Peano
Loading...
Searching...
No Matches
peano4.visualisation.output.Visualiser.Visualiser Class Reference

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

Inheritance diagram for peano4.visualisation.output.Visualiser.Visualiser:

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
 

Detailed Description

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:

  • Pass the file name of the patch file meta data to this class. We then use read_metadata() to read this file, and gather, for each timestamp, the list of patch files that we need to read. For each timestamp, we create an instance of the Snapshot helper class, which captures the timestamp, plus a list of patch files to parse
  • We then pass back to display(). Then, for each snapshot, we do the following:
    • Create a PatchFileParser object for each patch file within this timestamp
    • Read all the patch file data and combine it into the PatchFileData class in this file.
    • Return this data to child class, so that it can be rendered by display()

Currently, the only working child class is the VTU renderer.

Definition at line 195 of file Visualiser.py.

Constructor & Destructor Documentation

◆ __init__()

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.

Attributes

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.

Member Function Documentation

◆ append_filter()

peano4.visualisation.output.Visualiser.Visualiser.append_filter ( self,
filter )

◆ display()

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

Here is the call graph for this function:

◆ display_single_file()

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.

◆ parse_and_render_snapshot()

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:

  • parse all the files listed in snapshot (use the method we wrote)
  • return a dict, where the keys are unknown names, and the values are cell data to be rendered
  • child class should handle the rest.

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

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

◆ parse_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?

  • Get filename for each patch file in this timestamp
  • Produce a PatchFileParser object for each
  • Parse each file in parallel
  • Apply all the filters specified in render.py
  • Amalgamate data as in original reload() method
  • Returns a dict, where the keys are unknown names, and the values are patches that can be placed into individual patch files

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

Here is the caller graph for this function:

◆ read_metadata()

◆ remove_filters()

peano4.visualisation.output.Visualiser.Visualiser.remove_filters ( self)

Field Documentation

◆ _description

peano4.visualisation.output.Visualiser.Visualiser._description
protected

◆ _dimensions

◆ _end

peano4.visualisation.output.Visualiser.Visualiser._end
protected

◆ _file_name

◆ _filter

◆ _is_data_associated_to_cell

peano4.visualisation.output.Visualiser.Visualiser._is_data_associated_to_cell
protected

◆ _start

peano4.visualisation.output.Visualiser.Visualiser._start
protected

◆ identifier

peano4.visualisation.output.Visualiser.Visualiser.identifier

◆ meta_data_has_been_read

peano4.visualisation.output.Visualiser.Visualiser.meta_data_has_been_read

◆ snapshots

peano4.visualisation.output.Visualiser.Visualiser.snapshots

◆ verbose


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