35#ifndef NEKTAR_LIB_UTILITIES_TIME_INTEGRATION_IMEX_TIME_INTEGRATION_SCHEME_SDC
36#define NEKTAR_LIB_UTILITIES_TIME_INTEGRATION_IMEX_TIME_INTEGRATION_SCHEME_SDC
38#define LUE LIB_UTILITIES_EXPORT
50 std::vector<NekDouble> freeParams)
55 "Quadrature type that include the left end point (e.g. "
56 "GaussLobattoLegendre) should not be used for IMEXSDC");
59 <<
"WARNING: IMEX Spectral Deferred Correction method has been "
60 "implemented but its use is not recommended as the "
61 "approach is affected by order-reduction problems."
64 m_name =
"IMEXSpectralDeferredCorrection";
69 std::string variant,
size_t order, std::vector<NekDouble> freeParams)
73 variant, order, freeParams);
112 for (
size_t i = 0; i <
m_nvars; ++i)
128 for (
size_t i = 0; i <
m_nvars; ++i)
136 for (
size_t i = 0; i <
m_nvars; ++i)
147 [[maybe_unused]]
const NekDouble &delta_t, [[maybe_unused]]
const size_t n)
149 ASSERTL0(
false,
"v_ResidualEval not implemented for IMEX SDC");
178 for (
size_t i = 0; i <
m_nvars; ++i)
189 for (
size_t i = 0; i <
m_nvars; ++i)
223 for (
size_t i = 0; i <
m_nvars; ++i)
254 for (
size_t i = 0; i <
m_nvars; ++i)
274 for (
size_t i = 0; i <
m_nvars; ++i)
#define ASSERTL0(condition, msg)
LUE void v_ComputeInitialGuess(const NekDouble &delta_t) override
Worker method to compute the initial SDC guess.
LUE void v_SDCIterationLoop(const NekDouble &delta_t) override
Worker method to compute the SDC iteration.
static std::string className
LUE void v_InitializeScheme(const NekDouble deltaT, ConstDoubleArray &y_0, const NekDouble time, const TimeIntegrationSchemeOperators &op) override
Array for temporary storage.
DoubleArray m_tmp
Array corresponding to the stage derivatives.
static TimeIntegrationSchemeSharedPtr create(std::string variant, size_t order, std::vector< NekDouble > freeParams)
IMEXTimeIntegrationSchemeSDC(std::string variant, size_t order, std::vector< NekDouble > freeParams)
LUE void v_ResidualEval(const NekDouble &delta_t, const size_t n) override
Worker method to compute the residual.
TripleArray m_Fimp
Array corresponding to the stage derivatives.
void ComputeTotalResidual(const size_t n)
Worker method to compute the total residual.
Binds a set of functions for use by time integration schemes.
void DoImplicitSolve(InArrayType &inarray, OutArrayType &outarray, const NekDouble time, const NekDouble lambda) const
void DoProjection(InArrayType &inarray, OutArrayType &outarray, const NekDouble time) const
void DoOdeRhs(InArrayType &inarray, OutArrayType &outarray, const NekDouble time) const
Class for spectral deferred correction integration.
LUE void UpdateIntegratedResidualSFint(const NekDouble &delta_t)
Worker method that compute residual integral.
TripleArray m_Y
Array containing the last stage values.
TimeIntegrationSchemeOperators m_op
size_t m_nQuadPts
Order of the integration scheme.
LUE void AddFASCorrectionToSFint(void)
Worker method that add the FASCorrection.
bool m_first_quadrature
Number of points in the integration scheme.
size_t m_npoints
Number of variables in the integration scheme.
TripleArray m_SFint
Array containing the FAS correction term.
NekDouble m_theta
Array containing the interpolation coefficients.
TimeIntegrationSchemeType m_schemeType
SingleArray m_tau
Object containing quadrature data.
TripleArray m_F
Array containing the stage values.
LUE void v_InitializeScheme(const NekDouble deltaT, ConstDoubleArray &y_0, const NekDouble time, const TimeIntegrationSchemeOperators &op) override
Worker method to initialize the integration scheme.
size_t m_nvars
Number of quadrature points.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
AT< AT< NekDouble > > DoubleArray
AT< NekDouble > SingleArray
@ eIMEX
Implicit Explicit General Linear Method.
AT< AT< AT< NekDouble > > > TripleArray
std::shared_ptr< TimeIntegrationScheme > TimeIntegrationSchemeSharedPtr
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvp (scalar times vector plus vector): z = alpha*x + y.
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.