File rkscheme.hxx

Typedefs

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

RKScheme(Options *opts = nullptr)
virtual ~RKScheme() = default
void init(int nlocalIn, int neqIn, bool adaptiveIn, BoutReal atolIn, BoutReal rtolIn, Options *options = nullptr)
BoutReal setCurTime(BoutReal timeIn, BoutReal dt, int curStage)
virtual void setCurState(const Array<BoutReal> &start, Array<BoutReal> &out, int curStage, BoutReal dt)
virtual BoutReal setOutputStates(const Array<BoutReal> &start, BoutReal dt, Array<BoutReal> &resultFollow)
virtual BoutReal updateTimestep(BoutReal dt, BoutReal err)
inline virtual std::string getType()
inline int getStageCount()
inline int getNumOrders()

Public Members

Matrix<BoutReal> steps

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
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
BoutReal dtfac

Private Functions

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