SpECTRE  v2024.09.29
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
StepChooser< StepChooserUse > Class Template Referenceabstract

StepChoosers suggest upper bounds on step sizes. See TimeStepRequest for details on how the results are used. More...

#include <StepChooser.hpp>

Public Member Functions

 WRAPPED_PUPable_abstract (StepChooser)
 
virtual bool uses_local_data () const =0
 Whether the result can differ on different elements, so requiring communication to synchronize the result across the domain. This is ignored for LTS step changing. More...
 
virtual bool can_be_delayed () const =0
 Whether the result can be applied with a delay. More...
 
template<typename StepChoosersToUse = AllStepChoosers, typename DbTags >
std::pair< TimeStepRequest, bool > desired_step (const double last_step, const db::DataBox< DbTags > &box) const
 The last_step parameter describes the step size to be adjusted. It may be the step size or the slab size, or may be infinite if the appropriate size cannot be determined. More...
 

Detailed Description

template<typename StepChooserUse>
class StepChooser< StepChooserUse >

StepChoosers suggest upper bounds on step sizes. See TimeStepRequest for details on how the results are used.

Concrete StepChoosers should define operator() returning the information described as the return type of desired_step and taking the last_step and arguments specified by the class's argument_tags type alias.

Derived classes must indicate whether the chooser is usable as a step chooser, slab chooser, or both by inheriting from StepChooser with the appropriate StepChooserUse template argument.

Member Function Documentation

◆ can_be_delayed()

◆ desired_step()

template<typename StepChooserUse >
template<typename StepChoosersToUse = AllStepChoosers, typename DbTags >
std::pair< TimeStepRequest, bool > StepChooser< StepChooserUse >::desired_step ( const double  last_step,
const db::DataBox< DbTags > &  box 
) const
inline

The last_step parameter describes the step size to be adjusted. It may be the step size or the slab size, or may be infinite if the appropriate size cannot be determined.

The return value of this function contains the desired step size and a bool indicating whether the step should be accepted. When adjusting LTS step sizes, if the bool is false, the current time step will be recomputed with a step size informed by the desired step value returned by this function. We do not have the capability to reject a slab, so the bool is ignored for slab adjustment.

The implementations of the call operator in derived classes should always return a strictly smaller step than the last_step when they return false for the second member of the pair (indicating step rejection).

The optional template parameter StepChoosersToUse may be used to indicate a subset of the constructable step choosers to use for the current application of ChangeStepSize. Passing AllStepChoosers (default) indicates that any constructible step chooser may be used. This option is used when multiple components need to invoke ChangeStepSize with step choosers that may not be compatible with all components.

◆ uses_local_data()

template<typename StepChooserUse >
virtual bool StepChooser< StepChooserUse >::uses_local_data ( ) const
pure virtual

Whether the result can differ on different elements, so requiring communication to synchronize the result across the domain. This is ignored for LTS step changing.

Note
As this is only used for slab-size changing, the last_step passed to the call operator is not considered local data.

Implemented in StepChoosers::ByBlock< Dim >, StepChoosers::Cfl< Frame, System >, StepChoosers::Constant, StepChoosers::ElementSizeCfl< Dim, System >, StepChoosers::ErrorControl< StepChooserUse, EvolvedVariableTag, ErrorControlSelector >, StepChoosers::FixedLtsRatio, StepChoosers::LimitIncrease, StepChoosers::Maximum, StepChoosers::PreventRapidIncrease, StepChoosers::Random< VolumeDim >, and StepChoosers::StepToTimes.


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