ASPECT
Public Member Functions | List of all members
aspect::Postprocess::Interface< dim > Class Template Referenceabstract
Inheritance diagram for aspect::Postprocess::Interface< dim >:
Inheritance graph
[legend]

Public Member Functions

virtual std::pair< std::string, std::string > execute (TableHandler &statistics)=0
 
virtual std::list< std::string > required_other_postprocessors () const
 
virtual void save (std::map< std::string, std::string > &status_strings) const
 
virtual void load (const std::map< std::string, std::string > &status_strings)
 
- Public Member Functions inherited from aspect::Plugins::InterfaceBase
virtual ~InterfaceBase ()=default
 
virtual void initialize ()
 
virtual void update ()
 
virtual void parse_parameters (ParameterHandler &prm)
 

Additional Inherited Members

- Static Public Member Functions inherited from aspect::Plugins::InterfaceBase
static void declare_parameters (ParameterHandler &prm)
 

Detailed Description

template<int dim>
class aspect::Postprocess::Interface< dim >

This class declares the public interface of postprocessors. Postprocessors must implement a function that can be called at the end of each time step to evaluate the current solution, as well as functions that save the state of the object and restore it (for checkpoint/restart capabilities).

Access to the data of the simulator is granted by the protected member functions of the SimulatorAccess class, i.e., classes implementing this interface will in general want to derive from both this Interface class as well as from the SimulatorAccess class.

Definition at line 71 of file interface.h.

Member Function Documentation

§ execute()

template<int dim>
virtual std::pair<std::string,std::string> aspect::Postprocess::Interface< dim >::execute ( TableHandler &  statistics)
pure virtual

Execute this postprocessor. Derived classes will implement this function to do whatever they want to do to evaluate the solution at the current time step.

Parameters
[in,out]statisticsAn object that contains statistics that are collected throughout the simulation and that will be written to an output file at the end of each time step. Postprocessors may deposit data in these tables for later visualization or further processing.
Returns
A pair of strings that will be printed to the screen after running the postprocessor in two columns; typically the first column contains a description of what the data is and the second contains a numerical value of this data. If there is nothing to print, simply return two empty strings.

Implemented in aspect::Postprocess::Visualization< dim >, aspect::Postprocess::Particles< dim >, aspect::Postprocess::HeatFluxMap< dim >, aspect::Postprocess::GravityPointValues< dim >, aspect::Postprocess::CrystalPreferredOrientation< dim >, aspect::Postprocess::BoundaryVelocityResidualStatistics< dim >, aspect::Postprocess::BoundaryStrainRateResidualStatistics< dim >, aspect::Postprocess::GlobalStatistics< dim >, aspect::Postprocess::CoreStatistics< dim >, aspect::Postprocess::Command< dim >, aspect::Postprocess::LoadBalanceStatistics< dim >, aspect::Postprocess::StokesResidual< dim >, aspect::Postprocess::SeaLevel< dim >, aspect::Postprocess::BasicStatistics< dim >, aspect::Postprocess::PointValues< dim >, aspect::Postprocess::DepthAverage< dim >, aspect::Postprocess::ODEStatistics< dim >, aspect::Postprocess::MeltStatistics< dim >, aspect::Postprocess::HeatingStatistics< dim >, aspect::Postprocess::BoundaryDensities< dim >, aspect::Postprocess::BoundaryPressures< dim >, aspect::Postprocess::VelocityBoundaryStatistics< dim >, aspect::Postprocess::DomainVolume< dim >, aspect::Postprocess::HeatFluxDensities< dim >, aspect::Postprocess::MassFluxStatistics< dim >, aspect::Postprocess::MaterialStatistics< dim >, aspect::Postprocess::SphericalVelocityStatistics< dim >, aspect::Postprocess::ViscousDissipationStatistics< dim >, aspect::Postprocess::CompositionStatistics< dim >, aspect::Postprocess::CompositionVelocityStatistics< dim >, aspect::Postprocess::DynamicTopography< dim >, aspect::Postprocess::HeatFluxStatistics< dim >, aspect::Postprocess::ParticleCountStatistics< dim >, aspect::Postprocess::RotationStatistics< dim >, aspect::Postprocess::VolumeOfFluidStatistics< dim >, aspect::Postprocess::EntropyViscosityStatistics< dim >, aspect::Postprocess::Geoid< dim >, aspect::Postprocess::MatrixStatistics< dim >, aspect::Postprocess::MaxDepthField< dim >, aspect::Postprocess::MemoryStatistics< dim >, aspect::Postprocess::MobilityStatistics< dim >, aspect::Postprocess::PressureStatistics< dim >, aspect::Postprocess::TemperatureStatistics< dim >, aspect::Postprocess::Topography< dim >, and aspect::Postprocess::VelocityStatistics< dim >.

§ required_other_postprocessors()

template<int dim>
virtual std::list<std::string> aspect::Postprocess::Interface< dim >::required_other_postprocessors ( ) const
virtual

A function that is used to indicate to the postprocessor manager which other postprocessor(s) the current one depends upon. The returned list contains the names (as strings, as you would write them in the input file) of the postprocessors it requires. The manager will ensure that these postprocessors are indeed used, even if they were not explicitly listed in the input file, and are indeed run before this postprocessor every time they are executed.

The default implementation of this function returns an empty list.

Note
This mechanism is intended to support postprocessors that do not want to recompute information that other postprocessors already compute (or could compute, if they were run – which we can ensure using the current function). To do so, a postprocessor of course needs to be able to access these other postprocessors. This can be done by deriving your postprocessor from SimulatorAccess, and then using the SimulatorAccess::get_postprocess_manager() function, followed by asking the resulting object via get_matching_active_plugin() for a specific postprocessor object.

Reimplemented in aspect::Postprocess::Visualization< dim >, aspect::Postprocess::CrystalPreferredOrientation< dim >, aspect::Postprocess::SeaLevel< dim >, aspect::Postprocess::DynamicTopography< dim >, aspect::Postprocess::ParticleCountStatistics< dim >, and aspect::Postprocess::Geoid< dim >.

§ save()

template<int dim>
virtual void aspect::Postprocess::Interface< dim >::save ( std::map< std::string, std::string > &  status_strings) const
virtual

Save the state of this object to the argument given to this function. This function is in support of checkpoint/restart functionality.

Derived classes can implement this function and should store their state in a string that is deposited under a key in the map through which the respective class can later find the status again when the program is restarted. A legitimate key to store data under is typeid(*this).name(). It is up to derived classes to decide how they want to encode their state.

The default implementation of this function does nothing, i.e., it represents a stateless object for which nothing needs to be stored at checkpoint time and nothing needs to be restored at restart time.

Parameters
[in,out]status_stringsThe object into which implementations in derived classes can place their status under a key that they can use to retrieve the data.

Reimplemented in aspect::Postprocess::Visualization< dim >, aspect::Postprocess::Particles< dim >, aspect::Postprocess::GravityPointValues< dim >, aspect::Postprocess::SeaLevel< dim >, aspect::Postprocess::CoreStatistics< dim >, aspect::Postprocess::PointValues< dim >, aspect::Postprocess::DepthAverage< dim >, and aspect::Postprocess::StokesResidual< dim >.

§ load()

template<int dim>
virtual void aspect::Postprocess::Interface< dim >::load ( const std::map< std::string, std::string > &  status_strings)
virtual

Restore the state of the object by looking up a description of the state in the passed argument under the same key under which it was previously stored.

The default implementation does nothing.

Parameters
[in]status_stringsThe object from which the status will be restored by looking up the value for a key specific to this derived class.

Reimplemented in aspect::Postprocess::Visualization< dim >, aspect::Postprocess::Particles< dim >, aspect::Postprocess::GravityPointValues< dim >, aspect::Postprocess::SeaLevel< dim >, aspect::Postprocess::CoreStatistics< dim >, aspect::Postprocess::PointValues< dim >, aspect::Postprocess::DepthAverage< dim >, and aspect::Postprocess::StokesResidual< dim >.


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