ASPECT
Public Member Functions | Static 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 ~Interface ()
 
virtual void initialize ()
 
virtual bool execute ()=0
 
virtual double check_for_last_time_step (const double time_step) const
 
virtual void parse_parameters (ParameterHandler &prm)
 

Static Public Member Functions

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.

Constructor & Destructor Documentation

§ ~Interface()

template<int dim>
virtual aspect::TerminationCriteria::Interface< dim >::~Interface ( )
virtual

Destructor. Does nothing but is virtual so that derived classes' destructors are also virtual.

Member Function Documentation

§ initialize()

template<int dim>
virtual void aspect::TerminationCriteria::Interface< dim >::initialize ( )
virtual

Initialization function. This function is called once at the beginning of the program after parse_parameters is run and after the SimulatorAccess (if applicable) is initialized.

§ 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::SteadyRMSVelocity< dim >, and aspect::TerminationCriteria::EndStep< 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 >.

§ declare_parameters()

template<int dim>
static void aspect::TerminationCriteria::Interface< dim >::declare_parameters ( ParameterHandler prm)
static

Declare the parameters this class takes through input files. Derived classes should overload this function if they actually do take parameters; this class declares a fall-back function that does nothing, so that classes that do not take any parameters do not have to do anything at all.

This function is static (and needs to be static in derived classes) so that it can be called without creating actual objects (because declaring parameters happens before we read the input file and thus at a time when we don't even know yet which plugin objects we need).

§ parse_parameters()

template<int dim>
virtual void aspect::TerminationCriteria::Interface< dim >::parse_parameters ( ParameterHandler prm)
virtual

Read the parameters this class declares from the parameter file. The default implementation in this class does nothing, so that derived classes that do not need any parameters do not need to implement it.

Reimplemented in aspect::TerminationCriteria::EndTime< dim >, aspect::TerminationCriteria::EndWalltime< dim >, aspect::TerminationCriteria::UserRequest< dim >, aspect::TerminationCriteria::SteadyRMSVelocity< dim >, and aspect::TerminationCriteria::EndStep< dim >.


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