Peano
Loading...
Searching...
No Matches
tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid Class Reference

The visualiser is first and foremost a persistency layer around datasets. More...

Inheritance diagram for tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid:
Collaboration diagram for tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid:

Public Member Functions

 __init__ (self, file_name, output_directory=".", strip_relative_paths=True, start=0, end=0, verbose=False, split_unknowns=False)
 split_unknowns: Boolean Write one additional array per (named) variable.
 
 process_snapshot (self, snapshot, i)
 Helper function to process a single snapshot.
 
 display (self, max_workers=None)
 Should be called only once.
 
 display_single_file (self)
 If we are here we've supplied a single file which is itself a snapshot.
 
 write_vtu (self, unknown_name, grid_data, index=None)
 unknown_name should describe which unknown we are writing here.
 
 parse_and_render_snapshot (self, snapshot, index=0)
 We want to call the method in superclass, and then process this data into VTUUnstructuredGrid.
 
- Public Member Functions inherited from tarch.plotter.api.output.Visualiser.Visualiser
 read_metadata (self)
 Read the patch file metadata.
 
 append_filter (self, filter)
 
 remove_filters (self)
 
 parse_snapshot (self, snapshot)
 We rewrite "reload" from previous version of this file.
 

Data Fields

 split_unknowns
 
 output_directory
 
 display_as_tree
 
 pvd_file
 
 show_progress
 
 snapshots
 
 process_snapshot
 
- Data Fields inherited from tarch.plotter.api.output.Visualiser.Visualiser
 identifier
 
 verbose
 
 show_progress
 
 patch_filter
 
 snapshots
 
 meta_data_has_been_read
 

Protected Attributes

 _tp
 
 _grid
 
 _strip_relative_paths
 
 _file_name
 
- Protected Attributes inherited from tarch.plotter.api.output.Visualiser.Visualiser
 _file_name
 
 _start
 
 _end
 
 _filter
 
 _dimensions
 
 _description
 
 _is_data_associated_to_cell
 

Detailed Description

The visualiser is first and foremost a persistency layer around datasets.

It does not work on the command line.

Use this class by feeding the patch meta file you want to render into render.py, which will call this class.

Everything happens in either display() or display_single_file(). Please see documentation of these functions for more info.

Definition at line 411 of file VTUUnstructuredGrid.py.

Constructor & Destructor Documentation

◆ __init__()

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.__init__ (   self,
  file_name,
  output_directory = ".",
  strip_relative_paths = True,
  start = 0,
  end = 0,
  verbose = False,
  split_unknowns = False 
)

split_unknowns: Boolean Write one additional array per (named) variable.

See also
name_unknowns()

Reimplemented from tarch.plotter.api.output.Visualiser.Visualiser.

Definition at line 423 of file VTUUnstructuredGrid.py.

References tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.__init__().

Referenced by tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.__init__().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ display()

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.display (   self,
  max_workers = None 
)

Should be called only once.

How does this work?

  • First, hand over to the superclass display() function. This reads the metadata file, which should be available as self._file_name. This will populate self.snapshots with a list of the Snapshots helper classes. This helper class just contains timestamp plus a list of all patch files to parse for this timestamp
  • Once the list of snapshots has been populated, we loop over each snapshot, calling parse_and_render_snapshot()

For each unknown that we see on each cell/vertex, we produce an ordered list of VTUUnstructuredGrid files, and a PVD file to glue them together.

Reimplemented from tarch.plotter.api.output.Visualiser.Visualiser.

Definition at line 467 of file VTUUnstructuredGrid.py.

References tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.display().

Referenced by tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.display().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ display_single_file()

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.display_single_file (   self)

If we are here we've supplied a single file which is itself a snapshot.

Turn it into an instance of the snapshot helper class, set the timestamp to 0 and pass it back. We can just call parse_and_render_snapshot() on the result

Reimplemented from tarch.plotter.api.output.Visualiser.Visualiser.

Definition at line 634 of file VTUUnstructuredGrid.py.

References tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.display_single_file(), tarch.plotter.api.output.Visualiser.Visualiser.parse_and_render_snapshot(), and tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.parse_and_render_snapshot().

Referenced by tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.display_single_file().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_and_render_snapshot()

◆ process_snapshot()

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.process_snapshot (   self,
  snapshot,
  i 
)

Helper function to process a single snapshot.

Calls parse_and_render_snapshot and returns the snapshot timestamp and filenames.

Definition at line 455 of file VTUUnstructuredGrid.py.

References tarch.plotter.api.output.Visualiser.Visualiser.parse_and_render_snapshot(), tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.parse_and_render_snapshot(), TP::Parameters.verbose, tarch.plotter.api.filters.Filter.Filter.verbose, and tarch.plotter.api.output.Visualiser.Visualiser.verbose.

Here is the call graph for this function:

◆ write_vtu()

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.write_vtu (   self,
  unknown_name,
  grid_data,
  index = None 
)

Field Documentation

◆ _file_name

◆ _grid

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid._grid
protected

Definition at line 442 of file VTUUnstructuredGrid.py.

◆ _strip_relative_paths

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid._strip_relative_paths
protected

Definition at line 445 of file VTUUnstructuredGrid.py.

◆ _tp

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid._tp
protected

Definition at line 441 of file VTUUnstructuredGrid.py.

◆ display_as_tree

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.display_as_tree

◆ output_directory

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.output_directory

Definition at line 443 of file VTUUnstructuredGrid.py.

◆ process_snapshot

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.process_snapshot

Definition at line 556 of file VTUUnstructuredGrid.py.

◆ pvd_file

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.pvd_file

Definition at line 448 of file VTUUnstructuredGrid.py.

◆ show_progress

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.show_progress

◆ snapshots

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.snapshots

◆ split_unknowns

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.split_unknowns

The documentation for this class was generated from the following file: