Peano
Loading...
Searching...
No Matches
tarch.plotter.api.output.PointProbe.PointProbe Class Reference

Probe the data within a Peano patch file at one point over time. More...

Inheritance diagram for tarch.plotter.api.output.PointProbe.PointProbe:
Collaboration diagram for tarch.plotter.api.output.PointProbe.PointProbe:

Public Member Functions

 __init__ (self, file_name, point, output_file, start, end, verbose=False)
 Abstract superclass of a visualiser.
 
 process_snapshot (self, snapshot, i)
 Return (timestamp, dict from unknown name onto (number of unknowns, description, values or None))
 
 display (self, max_workers=1)
 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.
 
- Public Member Functions inherited from tarch.plotter.api.output.Visualiser.Visualiser
 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

 patch_filter
 
 show_progress
 
 snapshots
 
 process_snapshot
 
- Data Fields inherited from tarch.plotter.api.output.Visualiser.Visualiser
 identifier
 
 verbose
 
 show_progress
 
 patch_filter
 
 snapshots
 
 meta_data_has_been_read
 

Static Public Attributes

int Tolerance = 1e-8
 

Protected Member Functions

 _probe_patch_data (self, patch_file_data, point)
 Return list of unknowns at point or None if point is not covered.
 
 _assert_default_cell_mapping (self, patch_file_data)
 Cell data with a user-defined (distorted) mapping is not supported.
 
 _run (self, max_workers)
 
 _column_names (self, columns, descriptions)
 One column name per unknown of each data set.
 
 _write_csv (self, results)
 

Protected Attributes

 _point
 
 _output_file
 
- Protected Attributes inherited from tarch.plotter.api.output.Visualiser.Visualiser
 _file_name
 
 _start
 
 _end
 
 _filter
 
 _dimensions
 
 _description
 
 _is_data_associated_to_cell
 

Detailed Description

Probe the data within a Peano patch file at one point over time.

This is not a visualiser but a postprocessing tool, but it reuses the whole meta file and snapshot logic of the Visualiser. Per snapshot, we parse only those patches which contain the probe point (

See also
PatchContainsPoint), pick the finest one of them, and take the value of the cell (for cell data) or of the nearest dof (for vertex data) which contains the point. There is no interpolation.

The result is a csv file with one row per snapshot. The first column is the snapshot's time stamp, followed by all unknowns of all data sets found in the file. If the point is not covered by any patch in a snapshot, we write NaNs.

If the point sits exactly on the face between two patches of the same size, we take the patch to the right/top/front, i.e. we use half-open intervals [offset,offset+size). Only if no such patch exists (domain boundary), we fall back to the patch to the left.

Definition at line 37 of file PointProbe.py.

Constructor & Destructor Documentation

◆ __init__()

tarch.plotter.api.output.PointProbe.PointProbe.__init__ (   self,
  file_name,
  start,
  end,
  verbose,
  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 from tarch.plotter.api.output.Visualiser.Visualiser.

Definition at line 61 of file PointProbe.py.

References tarch.plotter.api.output.PointProbe.PointProbe.__init__().

Referenced by tarch.plotter.api.output.PointProbe.PointProbe.__init__().

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

Member Function Documentation

◆ _assert_default_cell_mapping()

tarch.plotter.api.output.PointProbe.PointProbe._assert_default_cell_mapping (   self,
  patch_file_data 
)
protected

Cell data with a user-defined (distorted) mapping is not supported.

Definition at line 130 of file PointProbe.py.

Referenced by tarch.plotter.api.output.PointProbe.PointProbe._probe_patch_data().

Here is the caller graph for this function:

◆ _column_names()

tarch.plotter.api.output.PointProbe.PointProbe._column_names (   self,
  columns,
  descriptions 
)
protected

One column name per unknown of each data set.

If a data set names its unknowns (

See also
unknown_names_from_description()), we use these names, e.g. h, hu, hv, b. If two data sets use the same name, we prefix the names with the data set, e.g. SWEQ_h. Data sets without names yield SWEQ_0, SWEQ_1, ...

Definition at line 195 of file PointProbe.py.

Referenced by tarch.plotter.api.output.PointProbe.PointProbe._write_csv().

Here is the caller graph for this function:

◆ _probe_patch_data()

tarch.plotter.api.output.PointProbe.PointProbe._probe_patch_data (   self,
  patch_file_data,
  point 
)
protected

Return list of unknowns at point or None if point is not covered.

Definition at line 66 of file PointProbe.py.

References tarch.plotter.api.output.PointProbe.PointProbe._assert_default_cell_mapping(), and tarch.plotter.api.output.PointProbe.PointProbe.Tolerance.

Referenced by tarch.plotter.api.output.PointProbe.PointProbe.process_snapshot().

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

◆ _run()

tarch.plotter.api.output.PointProbe.PointProbe._run (   self,
  max_workers 
)
protected

Definition at line 172 of file PointProbe.py.

Referenced by tarch.plotter.api.output.PointProbe.PointProbe.display(), and tarch.plotter.api.output.PointProbe.PointProbe.display_single_file().

Here is the caller graph for this function:

◆ _write_csv()

tarch.plotter.api.output.PointProbe.PointProbe._write_csv (   self,
  results 
)
protected

Definition at line 224 of file PointProbe.py.

References tarch.plotter.api.output.PointProbe.PointProbe._column_names(), and tarch.plotter.api.output.PointProbe.PointProbe._output_file.

Here is the call graph for this function:

◆ display()

tarch.plotter.api.output.PointProbe.PointProbe.display (   self,
  max_workers = 1 
)

This is the one routine the visualisers typically do overwrite.

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

Definition at line 253 of file PointProbe.py.

References tarch.plotter.api.output.PointProbe.PointProbe._run(), and tarch.plotter.api.output.PointProbe.PointProbe.display().

Referenced by tarch.plotter.api.output.PointProbe.PointProbe.display().

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

◆ display_single_file()

tarch.plotter.api.output.PointProbe.PointProbe.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 257 of file PointProbe.py.

References tarch.plotter.api.output.PointProbe.PointProbe._run(), tarch.plotter.api.output.PointProbe.PointProbe.display_single_file(), tarch.plotter.api.output.PointProbe.PointProbe.snapshots, tarch.plotter.api.output.Visualiser.Visualiser.snapshots, and tarch.plotter.api.output.VTUUnstructuredGrid.VTUUnstructuredGrid.snapshots.

Referenced by tarch.plotter.api.output.PointProbe.PointProbe.display_single_file().

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

◆ process_snapshot()

tarch.plotter.api.output.PointProbe.PointProbe.process_snapshot (   self,
  snapshot,
  i 
)

Field Documentation

◆ _output_file

tarch.plotter.api.output.PointProbe.PointProbe._output_file
protected

◆ _point

tarch.plotter.api.output.PointProbe.PointProbe._point
protected

◆ patch_filter

tarch.plotter.api.output.PointProbe.PointProbe.patch_filter

◆ process_snapshot

tarch.plotter.api.output.PointProbe.PointProbe.process_snapshot

Definition at line 188 of file PointProbe.py.

◆ show_progress

tarch.plotter.api.output.PointProbe.PointProbe.show_progress

◆ snapshots

tarch.plotter.api.output.PointProbe.PointProbe.snapshots

◆ Tolerance

int tarch.plotter.api.output.PointProbe.PointProbe.Tolerance = 1e-8
static

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