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

Public Member Functions

virtual bool execute ()=0
 
virtual double check_for_last_time_step (const double time_step) const
 
- 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::TerminationCriteria::Interface< dim >

This class declares the public interface of termination criteria plugins. These plugins must implement a function that can be called each time step to determine if specific criteria have been met that mean the simulation should be ended gracefully.

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 if they need to find out about the state of the simulation.

Definition at line 65 of file interface.h.

Member Function Documentation

§ execute()

template<int dim>
virtual bool aspect::TerminationCriteria::Interface< dim >::execute ( )
pure virtual

Execute evaluation of the termination criterion.

Returns
Whether to terminate the simulation (true) or continue (false).
Note
For some kinds of termination plugins, it may be difficult to ensure that all processors come to the same conclusion. An example is one that terminates the simulation after a certain amount of CPU time has expired, and this may be different from MPI process to MPI process. To avoid difficult to deal with situations, the plugin manager only requires that a single processor returns true for a given plugin to record that the plugin wants to terminate the simulation, even if the other processors return false.

Implemented in aspect::TerminationCriteria::EndTime< dim >, aspect::TerminationCriteria::EndWalltime< dim >, aspect::TerminationCriteria::UserRequest< dim >, aspect::TerminationCriteria::SteadyHeatFlux< dim >, aspect::TerminationCriteria::SteadyRMSVelocity< dim >, aspect::TerminationCriteria::EndStep< dim >, and aspect::TerminationCriteria::SteadyTemperature< dim >.

§ check_for_last_time_step()

template<int dim>
virtual double aspect::TerminationCriteria::Interface< dim >::check_for_last_time_step ( const double  time_step) const
virtual

Check for last time step and if so reduce the time step to user specified end time

Returns
Reduced or current time step size
Note
A reduced time step size may be returned for the last time step. For all other time steps, the current time step size (provided as argument) will be returned. The returned time step size will be greater than zero, and less than or equal to the given argument put into this function.

Reimplemented in aspect::TerminationCriteria::EndTime< dim >.


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