Nektar++
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
StartupRecorder Struct Reference

Solves of the test problem, with alpha = 1 and beta = -10, that record what a solver can observe of the start-up of a multistep scheme in each implicit solve. More...

Public Member Functions

void DoExplicitRhs (Field< double, FieldState::Phys > &in, Field< double, FieldState::Phys > &out, const double &time, const double &factor)
 
void DoImplicit (Field< double, FieldState::Phys > &in, Field< double, FieldState::Phys > &out, const double &time, const double &lambda, const IMEXBaseOp< double >::ExplicitWeights &weights)
 

Public Attributes

TimeOp< double > * op = nullptr
 
Math::MathHelper math
 
Field< double, FieldState::Phys > * stepStart = nullptr
 
Field< double, FieldState::Phys > * previousResult = nullptr
 
Field< double, FieldState::Phys > * explicitInput = nullptr
 
Field< double, FieldState::Phys > * wsp = nullptr
 
unsigned int stageInStep = 0
 
std::vector< unsigned int > steps
 
std::vector< double > implicitCoefficients
 
std::vector< double > explicitInputErrors
 
std::vector< IMEXBaseOp< double >::ExplicitWeights > recordedWeights
 

Detailed Description

Solves of the test problem, with alpha = 1 and beta = -10, that record what a solver can observe of the start-up of a multistep scheme in each implicit solve.

Definition at line 53 of file TestIMEX.cpp.

Member Function Documentation

◆ DoExplicitRhs()

void StartupRecorder::DoExplicitRhs ( Field< double, FieldState::Phys > &  in,
Field< double, FieldState::Phys > &  out,
const double &  time,
const double &  factor 
)
inline

Definition at line 71 of file TestIMEX.cpp.

75 {
76 explicitInput->template Copy<NektarSpaces::HostSpace>(in);
77 math.mul(factor, in, out);
78 }
LIB_MATH_EXPORT void mul(const typename T::value_type alpha, T &x, T &y, const std::string &execSpace="")
Math::MathHelper math
Definition TestIMEX.cpp:56
Field< double, FieldState::Phys > * explicitInput
Definition TestIMEX.cpp:61

References explicitInput, math, and Nektar::Math::MathHelper::mul().

Referenced by CheckStartup().

◆ DoImplicit()

void StartupRecorder::DoImplicit ( Field< double, FieldState::Phys > &  in,
Field< double, FieldState::Phys > &  out,
const double &  time,
const double &  lambda,
const IMEXBaseOp< double >::ExplicitWeights &  weights 
)
inline

Definition at line 80 of file TestIMEX.cpp.

84 {
85 steps.push_back(op->GetStep());
86 recordedWeights.push_back(weights);
87 implicitCoefficients.push_back(lambda / op->GetTimeStep());
88 // The first stage starts from the solution at the start of the step,
89 // a later one from the result of the previous stage.
90 auto &expected = stageInStep == 0 ? *stepStart : *previousResult;
91 math.sub(*explicitInput, expected, *wsp);
93
94 math.mul(1.0 / (1.0 + 10.0 * lambda), in, out);
95 previousResult->template Copy<NektarSpaces::HostSpace>(out);
97 }
LIB_MATH_EXPORT T::value_type l2norm(T &, const std::string &execSpace="")
LIB_MATH_EXPORT void sub(T &x, T &y, T &z, const std::string &execSpace="")
std::vector< IMEXBaseOp< double >::ExplicitWeights > recordedWeights
Definition TestIMEX.cpp:69
unsigned int stageInStep
Definition TestIMEX.cpp:64
std::vector< double > explicitInputErrors
Definition TestIMEX.cpp:68
std::vector< double > implicitCoefficients
Definition TestIMEX.cpp:67
Field< double, FieldState::Phys > * previousResult
Definition TestIMEX.cpp:60
Field< double, FieldState::Phys > * stepStart
Definition TestIMEX.cpp:59
Field< double, FieldState::Phys > * wsp
Definition TestIMEX.cpp:62
TimeOp< double > * op
Definition TestIMEX.cpp:55
std::vector< unsigned int > steps
Definition TestIMEX.cpp:66

References explicitInput, explicitInputErrors, implicitCoefficients, Nektar::Math::MathHelper::l2norm(), math, Nektar::Math::MathHelper::mul(), op, previousResult, recordedWeights, stageInStep, steps, stepStart, Nektar::Math::MathHelper::sub(), and wsp.

Referenced by CheckStartup().

Member Data Documentation

◆ explicitInput

Field<double, FieldState::Phys>* StartupRecorder::explicitInput = nullptr

Definition at line 61 of file TestIMEX.cpp.

Referenced by CheckStartup(), DoExplicitRhs(), and DoImplicit().

◆ explicitInputErrors

std::vector<double> StartupRecorder::explicitInputErrors

Definition at line 68 of file TestIMEX.cpp.

Referenced by CheckStartup(), and DoImplicit().

◆ implicitCoefficients

std::vector<double> StartupRecorder::implicitCoefficients

Definition at line 67 of file TestIMEX.cpp.

Referenced by CheckStartup(), and DoImplicit().

◆ math

Math::MathHelper StartupRecorder::math

Definition at line 56 of file TestIMEX.cpp.

Referenced by CheckStartup(), DoExplicitRhs(), and DoImplicit().

◆ op

TimeOp<double>* StartupRecorder::op = nullptr

Definition at line 55 of file TestIMEX.cpp.

Referenced by CheckStartup(), and DoImplicit().

◆ previousResult

Field<double, FieldState::Phys>* StartupRecorder::previousResult = nullptr

Definition at line 60 of file TestIMEX.cpp.

Referenced by CheckStartup(), and DoImplicit().

◆ recordedWeights

std::vector<IMEXBaseOp<double>::ExplicitWeights> StartupRecorder::recordedWeights

Definition at line 69 of file TestIMEX.cpp.

Referenced by CheckStartup(), and DoImplicit().

◆ stageInStep

unsigned int StartupRecorder::stageInStep = 0

Definition at line 64 of file TestIMEX.cpp.

Referenced by CheckStartup(), and DoImplicit().

◆ steps

std::vector<unsigned int> StartupRecorder::steps

Definition at line 66 of file TestIMEX.cpp.

Referenced by CheckStartup(), and DoImplicit().

◆ stepStart

Field<double, FieldState::Phys>* StartupRecorder::stepStart = nullptr

Definition at line 59 of file TestIMEX.cpp.

Referenced by CheckStartup(), and DoImplicit().

◆ wsp

Field<double, FieldState::Phys>* StartupRecorder::wsp = nullptr

Definition at line 62 of file TestIMEX.cpp.

Referenced by CheckStartup(), and DoImplicit().