1 #ifndef TIMEHANDLERQUADPTS_H 2 #define TIMEHANDLERQUADPTS_H 1
14 #include <lifev/core/LifeV.hpp> 42 void initialize(
const std::vector<vector_Type> InitialData);
45 void shift(
const vector_Type newVector);
117 ASSERT( M_BDForder != 0,
"Order of the BDF scheme has not been set, please use TimeAndExtrapolationHandler::setBDForder(const UInt order)");
121 ASSERT( InitialData.size() == M_sizeStencil,
"Wrong initial data dimension, it has to be of size equal max(M_BDForder, M_maximumExtrapolationOrder)");
123 for (
int i = 0; i < M_sizeStencil; ++i )
124 M_states.push_back(InitialData[i]);
133 M_states[M_sizeStencil-1] = newVector;
136 M_states[M_sizeStencil-2] = M_states[M_sizeStencil-1];
137 M_states[M_sizeStencil-1] = newVector;
140 M_states[M_sizeStencil-3] = M_states[M_sizeStencil-2];
141 M_states[M_sizeStencil-2] = M_states[M_sizeStencil-1];
142 M_states[M_sizeStencil-1] = newVector;
153 ASSERT( M_timeStep != 0,
"Timestep has not been set, please use TimeAndExtrapolationHandler::setTimeStep(const Real dt) ");
162 for (
int i = 0 ; i < M_states[0].size() ; ++i )
164 for (
int j = 0 ; j < M_states[0][0].size(); ++j )
166 for (
int k = 0 ; k < DIM; ++k )
168 rhs_bdf[i][j](k) = 1/M_timeStep*M_states[M_sizeStencil-1][i][j](k);
174 for (
int i = 0 ; i < M_states[0].size() ; ++i )
176 for (
int j = 0 ; j < M_states[0][0].size(); ++j )
178 for (
int k = 0 ; k < DIM; ++k )
180 rhs_bdf[i][j](k) = 1/M_timeStep*(2*M_states[M_sizeStencil-1][i][j](k) - (1.0/2.0)*M_states[M_sizeStencil-2][i][j](k));
187 for (
int i = 0 ; i < M_states[0].size() ; ++i )
189 for (
int j = 0 ; j < M_states[0][0].size(); ++j )
191 for (
int k = 0 ; k < DIM; ++k )
193 rhs_bdf[i][j](k) = 1/M_timeStep*(3*M_states[M_sizeStencil-1][i][j](k) - (3.0/2.0)*M_states[M_sizeStencil-2][i][j](k) +
194 (1.0/3.0)*M_states[M_sizeStencil-3][i][j](k) );
209 ASSERT( M_timeStep != 0,
"Timestep has not been set, please use TimeAndExtrapolationHandler::setTimeStep(const Real dt) ");
213 for (
int i = 0 ; i < M_states[0].size() ; ++i )
215 for (
int j = 0 ; j < M_states[0][0].size(); ++j )
217 for (
int k = 0 ; k < DIM; ++k )
219 extrapolation[i][j](k) = M_states[M_sizeStencil-1][i][j](k);
225 for (
int i = 0 ; i < M_states[0].size() ; ++i )
227 for (
int j = 0 ; j < M_states[0][0].size(); ++j )
229 for (
int k = 0 ; k < DIM; ++k )
231 extrapolation[i][j](k) = 2*M_states[M_sizeStencil-1][i][j](k) - M_states[M_sizeStencil-2][i][j](k);
238 for (
int i = 0 ; i < M_states[0].size() ; ++i )
240 for (
int j = 0 ; j < M_states[0][0].size(); ++j )
242 for (
int k = 0 ; k < DIM; ++k )
244 extrapolation[i][j](k) = 3.0*M_states[M_sizeStencil-1][i][j](k) - 3.0*M_states[M_sizeStencil-2][i][j](k) +
245 M_states[M_sizeStencil-3][i][j](k);
std::shared_ptr< vector_Type > vectorPtr_Type
void setTimeStep(const Real dt)
std::vector< std::vector< VectorSmall< DIM > > > vector_Type
void setBDForder(const UInt order)
std::vector< vector_Type > state()
std::vector< vector_Type > M_states
double Real
Generic real data.
void rhsContribution(vector_Type &rhs_bdf)
void initialize(const std::vector< vector_Type > InitialData)
~TimeAndExtrapolationHandlerQuadPts()
void extrapolate(vector_Type &extrapolation)
void shift(const vector_Type newVector)
TimeAndExtrapolationHandlerQuadPts()
TimeAndExtrapolationHandlerQuadPts(const UInt orderBDF)
uint32_type UInt
generic unsigned integer (used mainly for addressing)