File rkscheme.hxx#

Typedefs

template<typename DerivedType>
using RegisterRKScheme = RKSchemeFactory::RegisterInFactory<DerivedType>#

Simpler name for Factory registration helper class

Usage:

#include <bout/rkschemefactory.hxx>
namespace {
RegisterRKScheme<MyRKScheme> registerrkschememine("myrkscheme");
}

Variables

constexpr auto RKSCHEME_RKF45 = "rkf45"#
constexpr auto RKSCHEME_CASHKARP = "cashkarp"#
constexpr auto RKSCHEME_RK4 = "rk4"#
constexpr auto RKSCHEME_RKF34 = "rkf34"#
class RKSchemeFactory : public Factory<RKScheme, RKSchemeFactory, Options*>#

Public Static Attributes

static constexpr auto type_name = "RKScheme"#
static constexpr auto section_name = "solver"#
static constexpr auto option_name = "scheme"#
static constexpr auto default_type = RKSCHEME_RKF45#
class RKScheme#

Subclassed by CASHKARPScheme, RK4SIMPLEScheme, RKF34Scheme, RKF45Scheme

Public Functions

explicit RKScheme(Options *options, bool default_follow_high_order = false)#
virtual ~RKScheme() = default#
void init(int nlocalIn, int neqIn, bool adaptiveIn, BoutReal atolIn, BoutReal rtolIn)#

Finish generic initialisation.

BoutReal setCurTime(BoutReal timeIn, BoutReal dt, int curStage)#

Get the time at given stage.

virtual void setCurState(const Array<BoutReal> &start, Array<BoutReal> &out, int curStage, BoutReal dt)#

Get the state vector at given stage.

virtual BoutReal setOutputStates(const Array<BoutReal> &start, BoutReal dt, Array<BoutReal> &resultFollow)#

Calculate the output state and return the error estimate (if adaptive)

virtual BoutReal updateTimestep(BoutReal dt, BoutReal err)#

Update the timestep.

inline virtual std::string getType()#

Returns the string name for the given scheme.

inline int getStageCount()#

Returns the number of stages for the current scheme.

inline int getNumOrders()#

Returns the number of orders for the current scheme.

Public Members

Matrix<BoutReal> steps#

The intermediate stages.

Protected Functions

virtual BoutReal getErr(Array<BoutReal> &solA, Array<BoutReal> &solB)#
virtual void constructOutput(const Array<BoutReal> &start, BoutReal dt, int index, Array<BoutReal> &sol)#
virtual void constructOutputs(const Array<BoutReal> &start, BoutReal dt, int indexFollow, int indexAlt, Array<BoutReal> &solFollow, Array<BoutReal> &solAlt)#

Protected Attributes

bool followHighOrder#

If true the recommended solution is the higher order one.

std::string label#
int numStages#
int numOrders#
int order#
Matrix<BoutReal> stageCoeffs#
Matrix<BoutReal> resultCoeffs#
Array<BoutReal> timeCoeffs#
Array<BoutReal> resultAlt#
int nlocal#
int neq#
BoutReal atol#
BoutReal rtol#
bool adaptive#
bool diagnose#
BoutReal dtfac = {1.0}#

Private Functions

void verifyCoeffs()#
void printButcherTableau()#
void zeroSteps()#