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

Public Member Functions | |
| __init__ (self, file_name, start, end, verbose=False) | |
| Abstract superclass of a visualiser. | |
| display (self) | |
| This is the one routine the visualisers typically do overwrite. | |
| display_single_file (self) | |
| If we are here we've supplied a single file which is itself a snapshot. | |
| read_metadata (self) | |
| Read the patch file metadata. | |
| append_filter (self, filter) | |
| remove_filters (self) | |
| parse_and_render_snapshot (self, snapshot) | |
| We pass in a snapshot object here, which should contain time stamp and filenames for everything we want to render here. | |
| parse_snapshot (self, snapshot) | |
| We rewrite "reload" from previous version of this file. | |
Data Fields | |
| tuple | identifier |
| verbose = verbose | |
| bool | show_progress = True |
| patch_filter = None | |
| list | snapshots = [] |
| bool | meta_data_has_been_read = False |
Protected Attributes | |
| _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 serves as abstract base class for real output formats, i.e. it can parse files and hold them, but it does not do anything with them.
The flow should work like this:
Currently, the only working child class is the VTU renderer.
Definition at line 197 of file Visualiser.py.
| tarch.plotter.api.output.Visualiser.Visualiser.__init__ | ( | self, | |
| file_name, | |||
| start, | |||
| end, | |||
| verbose = False ) |
Abstract superclass of a visualiser.
file_name: String Name of a Peano patch file. This does not need to be a meta file.
If we run render.py with the argument -s (to denote we are using single file), then we will use the file_name to create a member of the snapshot class (which captures the patch file to read, with default timestamp of 0). This is then parsed by parse_and_render, and handed back to child class.
If this is a meta file, then display() will be used.
verbose: Boolean Controls how much the class writes out.
self.identifier: String Pick one subidentifier from the input file. If this one is empty, we take every input data set. However, some output formats (such as ParaView) don't support multiple output data sets, so we might end up with either the first or last one from the file - depending on the implementations.
Definition at line 224 of file Visualiser.py.
| tarch.plotter.api.output.Visualiser.Visualiser.append_filter | ( | self, | |
| filter ) |
Definition at line 361 of file Visualiser.py.
References _filter.
| tarch.plotter.api.output.Visualiser.Visualiser.display | ( | self | ) |
This is the one routine the visualisers typically do overwrite.
Reimplemented in tarch.plotter.api.output.PointProbe.PointProbe, and tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.
Definition at line 289 of file Visualiser.py.
References read_metadata().

| tarch.plotter.api.output.Visualiser.Visualiser.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 in tarch.plotter.api.output.PointProbe.PointProbe, and tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.
Definition at line 297 of file Visualiser.py.
References peano4.api.Logger.Logger._file_name, and _file_name.
| tarch.plotter.api.output.Visualiser.Visualiser.parse_and_render_snapshot | ( | self, | |
| snapshot ) |
We pass in a snapshot object here, which should contain time stamp and filenames for everything we want to render here.
Behaviour is:
Reimplemented in tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.
Definition at line 369 of file Visualiser.py.
References parse_snapshot().
Referenced by tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.display_single_file().


| tarch.plotter.api.output.Visualiser.Visualiser.parse_snapshot | ( | self, | |
| snapshot ) |
We rewrite "reload" from previous version of this file.
We take in a argument of "snapshot", which is a helper class with two attributes: timestamp and a list of patch files to parse.
We need to ensure that self.identifier is set correctly so that the correct unknown is picked by the PatchFileParser. Remove this line of comment when this is done.
Also need to handle removal of relative file paths here
The reason we (possibly) apply filters on individual pieces of data, or once the patches have been concatenated is because we may have more than one file to parse per snapshot. The choice is is about whether we want to apply filters before combining all the patches into one list, or afterwards?
What does this function do?
Definition at line 385 of file Visualiser.py.
References _filter, identifier, tarch.plotter.api.input.PatchFileParser.PatchFileParser.patch_filter, tarch.plotter.api.output.PointProbe.PointProbe.patch_filter, patch_filter, tarch.plotter.api.input.PatchFileParser.PatchFileParser.show_progress, tarch.plotter.api.output.PointProbe.PointProbe.show_progress, show_progress, 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, verbose, and TP::Parameters.verbose.
Referenced by parse_and_render_snapshot().

| tarch.plotter.api.output.Visualiser.Visualiser.read_metadata | ( | self | ) |
Read the patch file metadata.
In this routine we should:
The meta file includes the snapshot files relative to its own location. We therefore prefix each included file with the directory of the meta file, so the visualiser works from any working directory.
Definition at line 310 of file Visualiser.py.
References _end, peano4.api.Logger.Logger._file_name, _file_name, _start, meta_data_has_been_read, tarch.plotter.api.output.PointProbe.PointProbe.snapshots, and snapshots.
Referenced by display().

| tarch.plotter.api.output.Visualiser.Visualiser.remove_filters | ( | self | ) |
Definition at line 365 of file Visualiser.py.
References _filter.
|
protected |
Definition at line 279 of file Visualiser.py.
|
protected |
|
protected |
Definition at line 253 of file Visualiser.py.
Referenced by read_metadata().
|
protected |
Definition at line 251 of file Visualiser.py.
Referenced by display_single_file(), OutputFile.OutputFile.parse(), postprocessing.PerformanceData.PerformanceData.parse(), read_metadata(), and tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.write_vtu().
|
protected |
Definition at line 254 of file Visualiser.py.
Referenced by append_filter(), parse_snapshot(), and remove_filters().
|
protected |
Definition at line 280 of file Visualiser.py.
|
protected |
Definition at line 252 of file Visualiser.py.
Referenced by read_metadata().
| tuple tarch.plotter.api.output.Visualiser.Visualiser.identifier |
Definition at line 257 of file Visualiser.py.
Referenced by parse_snapshot().
| bool tarch.plotter.api.output.Visualiser.Visualiser.meta_data_has_been_read = False |
Definition at line 287 of file Visualiser.py.
Referenced by read_metadata().
| tarch.plotter.api.output.Visualiser.Visualiser.patch_filter = None |
Definition at line 276 of file Visualiser.py.
Referenced by parse_snapshot().
| bool tarch.plotter.api.output.Visualiser.Visualiser.show_progress = True |
Definition at line 271 of file Visualiser.py.
Referenced by parse_snapshot().
| list tarch.plotter.api.output.Visualiser.Visualiser.snapshots = [] |
Definition at line 284 of file Visualiser.py.
Referenced by read_metadata().
| tarch.plotter.api.output.Visualiser.Visualiser.verbose = verbose |
Definition at line 260 of file Visualiser.py.
Referenced by parse_snapshot(), and tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.write_vtu().