Peano
Loading...
Searching...
No Matches
exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile Class Reference

Plotting counterpart to RusanovWithExplicitEuler: maps the patch data of a Finite Volume scheme with a Rusanov Riemann solver, realised over a block-structured mesh, onto a plot mesh and writes it out as a VTK file. More...

Inheritance diagram for exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile:
Collaboration diagram for exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile:

Public Member Functions

 __init__ (self, Solver solver, first_plot_time_stamp=0.0, time_in_between_plots=0.1, plotter_precision=5, output_path=".", filename="solution", str name=None, quantities=None, binary=True)
 output_file_prefix (self)
 Prefix of the files the plotter writes, including the path.
 add_plot_filter (self, offset, size, frequency=1)
 Add a new filter to Peano/ExaHyPE.
 construct_output (self, exahype2_project, peano_project, plot)
 Add one task to the plot graph which writes the solver's patches.
Public Member Functions inherited from exahype2.api.Solver.Solver.Plotter
 __init__ (self, "Solver" solver, str name=None)
str create_is_active_predicate (self)
 C++ predicate which holds if the plotter is active.
str create_finish_call (self)
 C++ statement which moves the plotter on to its next output.

Protected Member Functions

 _log_plot_graph (self, plot)
 _create_selected_entries (self)
 Indices of the entries of Q which are written, or None for all of them.
 _create_description (self)
 Comma-separated names of the entries which are written, or the solver's unknown identifier if its variables carry no names.
 _create_guard (self)
 Guard of the cells which are plotted.
Protected Member Functions inherited from exahype2.api.Solver.Solver.Plotter
 _add_time_interval_bookkeeping_to_solver (self, float first_time_stamp, float time_in_between)
 Make the plotter active in regular time intervals.

Protected Attributes

 _first_plot_time_stamp = first_plot_time_stamp
 _time_in_between_plots = time_in_between_plots
 _plotter_precision = plotter_precision
list _plot_filters = []
 _output_path = output_path
 _filename = filename
 _quantities = quantities
 _binary = binary
Protected Attributes inherited from exahype2.api.Solver.Solver.Plotter
 _solver = solver

Additional Inherited Members

Data Fields inherited from exahype2.api.Solver.Solver.Plotter
 name = name

Detailed Description

Plotting counterpart to RusanovWithExplicitEuler: maps the patch data of a Finite Volume scheme with a Rusanov Riemann solver, realised over a block-structured mesh, onto a plot mesh and writes it out as a VTK file.

The plotter is active in regular time intervals (exahype2.api.Solver.Solver.Plotter): It is active as soon as the solver's min time stamp has reached the time stamp of its next plot. After each plot, this time stamp is incremented by time_in_between_plots. A solver can have several plotters, e.g. two PlotAsVTKFile plotters with different plot intervals and filters, as long as they write into different files.

If the solver's variables carry names, the plotter writes them as comma-separated list into the description of the output files (exahype2.api.Solver.Solver.variable_names_per_entry()). Paraview then shows them in the name of the data array, and tarch.plotter.api.notebook.show_solution() uses them to label the unknowns. Otherwise, the description is the solver's unknown identifier.

Definition at line 47 of file PlotAsVTKFile.py.

Constructor & Destructor Documentation

◆ __init__()

exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile.__init__ ( self,
Solver solver,
first_plot_time_stamp = 0.0,
time_in_between_plots = 0.1,
plotter_precision = 5,
output_path = ".",
filename = "solution",
str name = None,
quantities = None,
binary = True )
Parameters
solverexahype2.api.Solver The solver whose solution is plotted.
first_plot_time_stampfloat Time stamp of the first plot.
time_in_between_plotsfloat Has to be positive. If you don't want to have any plots for a solver, don't give it a plotter.
plotter_precisionint Number of significant digits written per value. Has to be positive.
output_pathstr Directory the plot files are written into.
filenamestr The plot files are called filename-SolverName. Plotters of the same solver have to use different file names or output paths.
namestr or None Name of the plotter (exahype2.api.Solver.Solver.Plotter).
quantitiesList[str or int] or None The entries of Q which are written per volume. A string is the name of a variable as passed to the solver and selects all of its entries, an int is the index of one entry of Q. The auxiliary variables are written into files of their own (exahype2.api.Quantities.resolve_quantities()). None writes all entries.
binarybool Write the values as raw doubles instead of text (tarch.plotter.griddata.blockstructured.PeanoBinaryPatchFileWriter). The files are smaller and the values bit-exact, and the plotter's precision then only affects the patch offsets and sizes. The Python scripts of tarch.plotter.api read both formats. Pass False to get human-readable files.

Definition at line 71 of file PlotAsVTKFile.py.

References __init__().

Referenced by __init__().

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

Member Function Documentation

◆ _create_description()

◆ _create_guard()

exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._create_guard ( self)
protected

◆ _create_selected_entries()

◆ _log_plot_graph()

◆ add_plot_filter()

exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile.add_plot_filter ( self,
offset,
size,
frequency = 1 )

Add a new filter to Peano/ExaHyPE.

Restrict plotting to patches overlapping a given box. Filters are baked directly into the guard of the generated plot action set (see construct_output()), i.e. the generated C++ code evaluates the exact offset/size this filter was constructed with - it never consults any project-wide, separately configured filter object.

Parameters
offset(float,float,float)
size(float,float,float)
frequencyint A positive value. Peano makes snapshots every dt simulation units. This is something you specify once per simulation. But you might decide only to splot every k of these snapshots.

Definition at line 144 of file PlotAsVTKFile.py.

References _plot_filters.

◆ construct_output()

exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile.construct_output ( self,
exahype2_project,
peano_project,
plot )

Add one task to the plot graph which writes the solver's patches.

Reimplemented from exahype2.api.Solver.Solver.Plotter.

Definition at line 176 of file PlotAsVTKFile.py.

◆ output_file_prefix()

Field Documentation

◆ _binary

exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._binary = binary
protected

Definition at line 139 of file PlotAsVTKFile.py.

◆ _filename

◆ _first_plot_time_stamp

exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._first_plot_time_stamp = first_plot_time_stamp
protected

◆ _output_path

◆ _plot_filters

list exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._plot_filters = []
protected

◆ _plotter_precision

exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._plotter_precision = plotter_precision
protected

◆ _quantities

exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._quantities = quantities
protected

◆ _time_in_between_plots

exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._time_in_between_plots = time_in_between_plots
protected

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