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
 __init__ (self, file_name, start, end, verbose=False)
 Abstract superclass of a 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 = split_unknowns
 output_directory = output_directory
bool display_as_tree = False
str pvd_file
Data Fields inherited from tarch.plotter.api.output.Visualiser.Visualiser
tuple identifier
 verbose = verbose
bool show_progress = True
 patch_filter = None
list snapshots = []
bool meta_data_has_been_read = False

Protected Attributes

 _tp = None
 _grid = None
 _strip_relative_paths = strip_relative_paths
Protected Attributes inherited from tarch.plotter.api.output.Visualiser.Visualiser
 _file_name = file_name
 _start = start
 _end = end
list _filter = []
int _dimensions = 0
str _description = "" #
bool _is_data_associated_to_cell = False

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()

Definition at line 423 of file VTUUnstructuredGrid.py.

References __init__().

Referenced by __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 display().

Referenced by 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 display_single_file(), and tarch.plotter.api.output.Visualiser.Visualiser.parse_and_render_snapshot().

Referenced by display_single_file().

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

◆ parse_and_render_snapshot()

tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.parse_and_render_snapshot ( self,
snapshot,
index = 0 )

We want to call the method in superclass, and then process this data into VTUUnstructuredGrid.

Returns the filenames that we wrote, for each unknown. We combine these into vtk at the end.

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

Definition at line 672 of file VTUUnstructuredGrid.py.

References display_as_tree, tarch.plotter.api.output.VTUUnstructuredGrid.name_unknowns(), parse_and_render_snapshot(), tarch.plotter.api.output.VTUUnstructuredGrid.prepare_2D_patches_unstructured_grid(), tarch.plotter.api.output.VTUUnstructuredGrid.prepare_3D_patches_unstructured_grid(), split_unknowns, and write_vtu().

Referenced by parse_and_render_snapshot().

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

◆ 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.

◆ write_vtu()

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

Field Documentation

◆ _grid

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

Definition at line 442 of file VTUUnstructuredGrid.py.

◆ _strip_relative_paths

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

Definition at line 445 of file VTUUnstructuredGrid.py.

◆ _tp

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

Definition at line 441 of file VTUUnstructuredGrid.py.

◆ display_as_tree

bool tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.display_as_tree = False

Definition at line 444 of file VTUUnstructuredGrid.py.

Referenced by parse_and_render_snapshot().

◆ output_directory

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

Definition at line 443 of file VTUUnstructuredGrid.py.

◆ pvd_file

str tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.pvd_file
Initial value:
= """<?xml version="1.0"?>
<VTKFile type="Collection" version="0.1"
byte_order="LittleEndian"
compressor="vtkZLibDataCompressor">
<Collection>
"""

Definition at line 448 of file VTUUnstructuredGrid.py.

◆ split_unknowns

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

Definition at line 440 of file VTUUnstructuredGrid.py.

Referenced by parse_and_render_snapshot().


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