SpECTRE  v2024.03.19
StepChooser< StepChooserUse > Class Template Referenceabstract

StepChoosers suggest upper bounds on step sizes. 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...
 
template<typename StepChoosersToUse = AllStepChoosers, typename DbTags >
std::pair< double, bool > desired_step (const double last_step_magnitude, const db::DataBox< DbTags > &box) const
 The last_step_magnitude 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.

Concrete StepChoosers should define operator() returning the information described as the return type of desired_step and taking the last_step_magnitude 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. A class cannot inherit from both base classes simultaneously; if both uses are supported the use must be chosen using a template parameter.

Member Function Documentation

◆ desired_step()

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

The last_step_magnitude 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_magnitude 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_magnitude passed to the call operator is not considered local data.

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


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