![]() |
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 | |
identifier | |
verbose | |
snapshots | |
meta_data_has_been_read | |
Protected Attributes | |
_file_name | |
_start | |
_end | |
_filter | |
_dimensions | |
_description | |
_is_data_associated_to_cell | |
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 195 of file Visualiser.py.
peano4.visualisation.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.
Reimplemented in peano4.visualisation.output.VTUUnstructuredGrid.VTUUnstructuredGrid.
Definition at line 222 of file Visualiser.py.
peano4.visualisation.output.Visualiser.Visualiser.append_filter | ( | self, | |
filter ) |
Definition at line 337 of file Visualiser.py.
References peano4.visualisation.output.Visualiser.Visualiser._filter.
peano4.visualisation.output.Visualiser.Visualiser.display | ( | self | ) |
This is the one routine the visualisers typically do overwrite.
Reimplemented in peano4.visualisation.output.VTUUnstructuredGrid.VTUUnstructuredGrid.
Definition at line 271 of file Visualiser.py.
References peano4.visualisation.output.Visualiser.Visualiser.read_metadata().
peano4.visualisation.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 peano4.visualisation.output.VTUUnstructuredGrid.VTUUnstructuredGrid.
Definition at line 279 of file Visualiser.py.
References exahype2.postprocessing.PerformanceData.PerformanceData._file_name, peano4.visualisation.output.Visualiser.Visualiser._file_name, and peano4.visualisation.output.VTUUnstructuredGrid.VTUUnstructuredGrid._file_name.
peano4.visualisation.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 peano4.visualisation.output.VTUUnstructuredGrid.VTUUnstructuredGrid.
Definition at line 345 of file Visualiser.py.
References peano4.visualisation.output.Visualiser.Visualiser.parse_snapshot().
Referenced by peano4.visualisation.output.VTUUnstructuredGrid.VTUUnstructuredGrid.display_single_file(), and peano4.visualisation.output.VTUUnstructuredGrid.VTUUnstructuredGrid.process_snapshot().
peano4.visualisation.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 361 of file Visualiser.py.
References peano4.visualisation.output.Visualiser.Visualiser._filter, peano4.visualisation.output.Visualiser.Visualiser.identifier, TP::Parameters.verbose, peano4.visualisation.filters.Filter.Filter.verbose, and peano4.visualisation.output.Visualiser.Visualiser.verbose.
Referenced by peano4.visualisation.output.Visualiser.Visualiser.parse_and_render_snapshot().
peano4.visualisation.output.Visualiser.Visualiser.read_metadata | ( | self | ) |
Read the patch file metadata.
In this routine we should:
Definition at line 292 of file Visualiser.py.
References peano4.visualisation.output.Visualiser.Visualiser._end, exahype2.postprocessing.PerformanceData.PerformanceData._file_name, peano4.visualisation.output.Visualiser.Visualiser._file_name, peano4.visualisation.output.VTUUnstructuredGrid.VTUUnstructuredGrid._file_name, peano4.visualisation.output.Visualiser.Visualiser._start, peano4.visualisation.output.Visualiser.Visualiser.meta_data_has_been_read, peano4.visualisation.output.Visualiser.Visualiser.snapshots, and peano4.visualisation.output.VTUUnstructuredGrid.VTUUnstructuredGrid.snapshots.
Referenced by peano4.visualisation.output.Visualiser.Visualiser.display().
peano4.visualisation.output.Visualiser.Visualiser.remove_filters | ( | self | ) |
Definition at line 341 of file Visualiser.py.
References peano4.visualisation.output.Visualiser.Visualiser._filter.
|
protected |
Definition at line 261 of file Visualiser.py.
Referenced by peano4.visualisation.output.Visualiser.PatchFileData.apply_renderer_to_data(), and peano4.visualisation.output.Visualiser.PatchFileData.copy_data_from_parser_object().
|
protected |
Definition at line 260 of file Visualiser.py.
Referenced by exahype2.Project.Project.__configure_makefile(), swift2.Project.Project.__configure_makefile(), api.Project.Project.__configure_makefile(), exahype2.Project.Project.__export_constants(), swift2.Project.Project.__export_constants(), api.Project.Project.__export_constants(), api.Project.Project.__init__(), solvers.api.ContinuousGalerkinDiscretisationGaussLobattoWithBlockJacobi.ContinuousGalerkinDiscretisationGaussLobattoWithBlockJacobi._construct_narrow_to_interior_matrix(), scenarios.elastic_planar_waves.ElasticPlanarWaves.analytical_solution(), peano4.visualisation.output.Visualiser.PatchFileData.apply_renderer_to_data(), exahype2.Project.Project.generate_Peano4_project(), scenarios.elastic_planar_waves.ElasticPlanarWaves.initial_conditions(), swift2.Project.Project.set_global_simulation_parameters(), api.Project.Project.set_global_simulation_parameters(), api.Project.Project.set_global_simulation_parameters(), exahype2.Project.Project.set_global_simulation_parameters(), and scenarios.scenario.Scenario.set_global_simulation_parameters().
|
protected |
Definition at line 251 of file Visualiser.py.
Referenced by peano4.visualisation.output.Visualiser.Visualiser.read_metadata().
|
protected |
Definition at line 249 of file Visualiser.py.
Referenced by peano4.visualisation.output.Visualiser.Visualiser.display_single_file(), exahype2.postprocessing.PerformanceData.PerformanceData.parse(), peano4.visualisation.output.Visualiser.Visualiser.read_metadata(), and peano4.visualisation.output.VTUUnstructuredGrid.VTUUnstructuredGrid.write_vtu().
|
protected |
|
protected |
Definition at line 262 of file Visualiser.py.
Referenced by peano4.visualisation.output.Visualiser.PatchFileData.apply_renderer_to_data(), and peano4.visualisation.output.Visualiser.PatchFileData.copy_data_from_parser_object().
|
protected |
Definition at line 250 of file Visualiser.py.
Referenced by peano4.visualisation.output.Visualiser.Visualiser.read_metadata().
peano4.visualisation.output.Visualiser.Visualiser.identifier |
Definition at line 255 of file Visualiser.py.
Referenced by peano4.visualisation.output.Visualiser.Visualiser.parse_snapshot().
peano4.visualisation.output.Visualiser.Visualiser.meta_data_has_been_read |
Definition at line 269 of file Visualiser.py.
Referenced by peano4.visualisation.output.Visualiser.Visualiser.read_metadata().
peano4.visualisation.output.Visualiser.Visualiser.snapshots |
Definition at line 266 of file Visualiser.py.
Referenced by peano4.visualisation.output.Visualiser.Visualiser.read_metadata().
peano4.visualisation.output.Visualiser.Visualiser.verbose |
Definition at line 258 of file Visualiser.py.
Referenced by peano4.visualisation.filters.Filter.Filter.__str__(), peano4.visualisation.output.Visualiser.Visualiser.parse_snapshot(), peano4.visualisation.output.VTUUnstructuredGrid.VTUUnstructuredGrid.process_snapshot(), peano4.visualisation.filters.AverageOverCell.AverageOverCell.render(), peano4.visualisation.filters.Calculator.Calculator.render(), peano4.visualisation.filters.ExtractFineGrid.ExtractFineGrid.render(), and peano4.visualisation.output.VTUUnstructuredGrid.VTUUnstructuredGrid.write_vtu().