1 #include <lifev/core/fem/TimeAndExtrapolationHandler.hpp> 44 ASSERT( M_BDForder != 0,
"Order of the BDF scheme has not been set, please use TimeAndExtrapolationHandler::setBDForder(const UInt order)");
46 ASSERT( M_maximumExtrapolationOrder != 0,
"Maximum order for extrapolation has not been set, please use TimeAndExtrapolationHandler::setMaximumExtrapolationOrder(const UInt order)");
50 ASSERT( InitialData.size() == M_sizeStencil,
"Wrong initial data dimension, it has to be of size equal max(M_BDForder, M_maximumExtrapolationOrder)");
52 for (
int i = 0; i < M_sizeStencil; ++i )
53 M_states.push_back(InitialData[i]);
61 M_states[M_sizeStencil-1] = newVector;
64 M_states[M_sizeStencil-2] = M_states[M_sizeStencil-1];
65 M_states[M_sizeStencil-1] = newVector;
68 M_states[M_sizeStencil-3] = M_states[M_sizeStencil-2];
69 M_states[M_sizeStencil-2] = M_states[M_sizeStencil-1];
70 M_states[M_sizeStencil-1] = newVector;
80 ASSERT( order <= M_maximumExtrapolationOrder,
"Order of extrapolation is higher than the maximum order previously set");
83 extrapolation = M_states[M_sizeStencil-1];
86 extrapolation = 2*M_states[M_sizeStencil-1] - M_states[M_sizeStencil-2];
89 extrapolation = 3*M_states[M_sizeStencil-1] - 3*M_states[M_sizeStencil-2] + M_states[M_sizeStencil-3];
99 ASSERT( M_timeStep != 0,
"Timestep has not been set, please use TimeAndExtrapolationHandler::setTimeStep(const Real dt) ");
103 rhs_bdf = 1/M_timeStep*M_states[M_sizeStencil-1];
106 rhs_bdf = 1/M_timeStep*(2*M_states[M_sizeStencil-1] - (1.0/2.0)*M_states[M_sizeStencil-2]);
109 rhs_bdf = 1/M_timeStep*(3*M_states[M_sizeStencil-1] - (3.0/2.0)*M_states[M_sizeStencil-2] + (1.0/3.0)*M_states[M_sizeStencil-3]);
void extrapolate(const UInt order, vector_Type &extrapolation)
void initialize(const std::vector< vector_Type > InitialData)
TimeAndExtrapolationHandler()
void setTimeStep(const Real dt)
void shift(const vector_Type newVector)
void updateInverseJacobian(const UInt &iQuadPt)
void rhsContribution(vector_Type &rhs_bdf)
TimeAndExtrapolationHandler(const UInt orderBDF, const UInt maximumOrderExtrapolation)
UInt M_maximumExtrapolationOrder
double Real
Generic real data.
void setBDForder(const UInt order)
~TimeAndExtrapolationHandler()
uint32_type UInt
generic unsigned integer (used mainly for addressing)
void setMaximumExtrapolationOrder(const UInt order)