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


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 |
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.
| 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.
Definition at line 423 of file VTUUnstructuredGrid.py.
References __init__().
Referenced by __init__().


| tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.display | ( | self, | |
| max_workers = None ) |
Should be called only once.
How does this work?
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().


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


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


| 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.
| tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.write_vtu | ( | self, | |
| unknown_name, | |||
| grid_data, | |||
| index = None ) |
unknown_name should describe which unknown we are writing here.
Add an index to be placed in the filename
Definition at line 638 of file VTUUnstructuredGrid.py.
References peano4.api.Logger.Logger._file_name, tarch.plotter.api.output.Visualiser.Visualiser._file_name, tarch.plotter.api.filters.AverageOverCell.AverageOverCell.verbose, tarch.plotter.api.filters.Calculator.Calculator.verbose, tarch.plotter.api.filters.ExtractFineGrid.ExtractFineGrid.verbose, tarch.plotter.api.filters.Filter.Filter.verbose, tarch.plotter.api.output.PointProbe.PointProbe.verbose, tarch.plotter.api.output.Visualiser.Visualiser.verbose, and TP::Parameters.verbose.
Referenced by parse_and_render_snapshot().

|
protected |
Definition at line 442 of file VTUUnstructuredGrid.py.
|
protected |
Definition at line 445 of file VTUUnstructuredGrid.py.
|
protected |
Definition at line 441 of file VTUUnstructuredGrid.py.
| 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().
| tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.output_directory = output_directory |
Definition at line 443 of file VTUUnstructuredGrid.py.
| str tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.pvd_file |
Definition at line 448 of file VTUUnstructuredGrid.py.
| tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.split_unknowns = split_unknowns |
Definition at line 440 of file VTUUnstructuredGrid.py.
Referenced by parse_and_render_snapshot().