35 #ifndef NEKTAR_LIB_UTILITIES_TIME_INTEGRATION_TIME_INTEGRATION_SCHEME_SDC
36 #define NEKTAR_LIB_UTILITIES_TIME_INTEGRATION_TIME_INTEGRATION_SCHEME_SDC
38 #define LUE LIB_UTILITIES_EXPORT
47 namespace LibUtilities
56 std::vector<NekDouble> freeParams)
58 m_name(
"SpectralDeferredCorrection")
62 variant ==
"GaussLobattoLegendre" ||
63 variant ==
"GaussRadauLegendre" ||
64 variant ==
"GaussLobattoChebyshev" ||
65 variant ==
"GaussRadauChebyshev",
66 "unknow variant (quadrature) type");
68 ASSERTL0(1 <= order,
"Spectral Deferred Correction Time integration "
69 "scheme bad order numbers (>=1): " +
70 std::to_string(order));
72 "SDC Time integration scheme invalid number "
73 "of free parameters, expected two "
74 "<theta, number of quadrature>, received " +
75 std::to_string(freeParams.size()));
76 ASSERTL0(0.0 <= freeParams[0] && freeParams[0] <= 1.0,
77 "Spectral Deferred Correction Time integration "
78 "scheme bad parameter numbers (0.0 - 1.0): " +
79 std::to_string(freeParams[0]));
81 "Spectral Deferred Correction Time integration "
82 "scheme bad quadrature numbers (>=1): " +
83 std::to_string(
int(freeParams[1])));
91 if (variant ==
"Equidistant")
94 "Spectral Deferred Correction Time integration "
95 "Maximum order (<= n): " +
99 "Spectral Deferred Correction Time integration "
100 "scheme bad quadrature numbers (>=1): " +
101 std::to_string(freeParams[1]));
111 else if (variant ==
"GaussLobattoLegendre")
114 "Spectral Deferred Correction Time integration "
115 "Maximum order (<= 2 * n - 2): " +
125 else if (variant ==
"GaussRadauLegendre")
128 "Spectral Deferred Correction Time integration "
129 "Maximum order (<= 2 * n - 1): " +
146 else if (variant ==
"GaussLobattoChebyshev")
149 "Spectral Deferred Correction Time integration "
150 "Maximum order (<= 2 * n - 2): " +
160 else if (variant ==
"GaussRadauChebyshev")
163 "Spectral Deferred Correction Time integration "
164 "Maximum order (<= 2 * n - 2): " +
198 std::string variant,
unsigned int order,
199 std::vector<NekDouble> freeParams)
203 variant, order, freeParams);
211 const int option = 0);
260 const int timestep,
const NekDouble delta_t,
270 ASSERTL0(
false,
"Specific version of spectral deferred correction "
272 boost::ignore_unused(delta_t, n, op);
278 ASSERTL0(
false,
"Specific version of spectral deferred correction "
280 boost::ignore_unused(delta_t, op);
286 ASSERTL0(
false,
"Specific version of spectral deferred correction "
288 boost::ignore_unused(delta_t, op);
294 ASSERTL0(
false,
"Specific version of spectral deferred correction "
296 boost::ignore_unused(delta_t, op);
299 LUE virtual void v_print(std::ostream &os)
const override;
#define ASSERTL0(condition, msg)
Base class for time integration schemes.
Binds a set of functions for use by time integration schemes.
Class for spectral deferred correction integration.
LUE void SDCIterationLoop(const NekDouble &delta_t, const TimeIntegrationSchemeOperators &op)
std::vector< NekDouble > m_freeParams
virtual LUE unsigned int v_GetOrder() const override
virtual LUE void v_ResidualEval(const NekDouble &delta_t, const int n, const TimeIntegrationSchemeOperators &op)
LUE void ResidualEval(const NekDouble &delta_t, const TimeIntegrationSchemeOperators &op)
LUE void ResidualEval(const NekDouble &delta_t, const int n, const TimeIntegrationSchemeOperators &op)
LUE void UpdateIntegratedResidual(const NekDouble &delta_t, const int option=0)
Worker method that compute the integrated flux.
virtual LUE ConstDoubleArray & v_TimeIntegrate(const int timestep, const NekDouble delta_t, const TimeIntegrationSchemeOperators &op) override
Worker method that performs the time integration.
virtual LUE TimeIntegrationSchemeType v_GetIntegrationSchemeType() const override
virtual ~TimeIntegrationSchemeSDC()
Destructor.
virtual LUE void v_print(std::ostream &os) const override
Worker method to print details on the integration scheme.
virtual LUE std::string v_GetName() const override
static TimeIntegrationSchemeSharedPtr create(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
LUE void ComputeInitialGuess(const NekDouble &delta_t, const TimeIntegrationSchemeOperators &op)
virtual LUE void v_ResidualEval(const NekDouble &delta_t, const TimeIntegrationSchemeOperators &op)
TimeIntegrationSchemeSDC(std::string variant, unsigned int order, std::vector< NekDouble > freeParams)
virtual LUE void v_SetSolutionVector(const int Offset, const DoubleArray &y) override
Sets the solution vector of the ODE.
virtual LUE void v_printFull(std::ostream &os) const override
TripleArray m_Fint
Array corresponding to the stage Derivatives.
virtual LUE std::vector< NekDouble > v_GetFreeParams() const override
TimeIntegrationSchemeType m_schemeType
TripleArray m_F
Array containing the stage values.
virtual LUE void v_ComputeInitialGuess(const NekDouble &delta_t, const TimeIntegrationSchemeOperators &op)
virtual LUE unsigned int v_GetNumIntegrationPhases() const override
virtual LUE void v_InitializeScheme(const NekDouble deltaT, ConstDoubleArray &y_0, const NekDouble time, const TimeIntegrationSchemeOperators &op) override
Worker method to initialize the integration scheme.
virtual LUE void v_SDCIterationLoop(const NekDouble &delta_t, const TimeIntegrationSchemeOperators &op)
virtual LUE std::string v_GetVariant() const override
virtual LUE NekDouble v_GetTimeStability() const override
virtual LUE const TripleArray & v_GetSolutionVector() const override
Gets the solution vector of the ODE.
static std::string className
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
AT< NekDouble > SingleArray
TimeIntegrationSchemeType
@ eNoTimeIntegrationSchemeType
std::shared_ptr< TimeIntegrationScheme > TimeIntegrationSchemeSharedPtr
The above copyright notice and this permission notice shall be included.
void zwgrjp(double *z, double *w, const int np, const double alpha, const double beta)
Gauss-Radau-Jacobi zeros and weights with end point at z=1.
void zwglj(double *z, double *w, const int np, const double alpha, const double beta)
Gauss-Lobatto-Jacobi zeros and weights with end point at z=-1,1.