#include <TimeInterpolatorRK4.H>
Public Member Functions | |
TimeInterpolatorRK4 () | |
Default constructor. | |
~TimeInterpolatorRK4 () | |
Destructor. | |
void | define (const DisjointBoxLayout &a_thisDisjointBoxLayout, const DisjointBoxLayout &a_coarserDisjointBoxLayout, const ProblemDomain &a_domain, const int &a_refineCoarse, const int &a_numStates, const int &a_ghosts) |
Actual constructor. | |
void | setDt (const Real &a_dt) |
Set coarse timestep. | |
void | saveInitialSoln (const LevelData< FArrayBox > &a_soln) |
Update Taylor polynomial coefficients with the coarse solution. | |
void | saveRHS (const LevelData< FArrayBox > &a_rhs) |
Update Taylor polynomial coefficients with coarse right-hand side. | |
void | interpolate (LevelData< FArrayBox > &a_U, const Real &a_timeInterpCoeff, const Interval &a_intvl) |
Interpolate in time using the Taylor polynomial. | |
void | intermediate (LevelData< FArrayBox > &a_U, const Real &a_timeInterpCoeff, const int &a_stage, const Interval &a_intvl) const |
Set RK4 intermediate values in time using the Taylor polynomial. | |
Protected Member Functions | |
void | resetData () |
Reset this object to use with new data. | |
void | setVectorDt (Vector< Real > &a_vec, Real a_c0, Real a_c1, Real a_c2, Real a_c3) |
Set a_vec = m_dt * (a_c0, a_c1, a_c2, a_c3). | |
Protected Attributes | |
Vector< Vector< Real > > | m_coeffs |
DisjointBoxLayout | m_thisCoarsenedLayout |
layout for this level, coarsened by m_refToCoarse | |
DisjointBoxLayout | m_coarseLayout |
layout for the coarse level | |
Copier | m_copier |
For copying from rhs on m_coarseLayout to m_rhsCopy on m_thisCoarsenedLayout. | |
int | m_ghosts |
layers of ghost cells around m_thisCoarsenedLayout for m_rhsCopy and m_taylorCoeffs | |
int | m_numCoeffs |
number of coefficients in Taylor polynomial: this is 4 | |
IntVect | m_ghostVect |
ghost vector around m_thisCoarsenedLayout for m_rhsCopy and m_taylorCoeffs | |
Real | m_dt |
coarse timestep | |
LevelData< FArrayBox > | m_rhsCopy |
Copy of rhs on m_thisCoarsenedLayout, to be used within saveRHS. | |
LevelData< FArrayBox > | m_taylorCoeffs |
coefficients of the third-degree Taylor polynomial on m_thisCoarsenedLayout with ghost vector m_ghostVect; m_numCoeffs*m_numStates components | |
LevelData< FArrayBox > | m_diff12 |
difference between f(U1) and f(U2), used for intermediate-value calculations, on m_thisCoarsenedLayout with ghost vector m_ghostVect; m_numCoeffs*m_numStates components | |
bool | m_gotDt |
whether m_dt has been set | |
bool | m_gotInitialSoln |
whether initial solution has been saved | |
bool | m_gotFullTaylorPoly |
whether we have the full Taylor polynomial | |
int | m_countRHS |
number of times saveRHS function has been called | |
ProblemDomain | m_coarseDomain |
Problem domain - index space for next coarser level. | |
int | m_refineCoarse |
Refinement ratio between this level and the next coarser. | |
int | m_numStates |
Number of variables. | |
bool | m_defined |
define() has been called | |
Private Member Functions | |
void | operator= (const TimeInterpolatorRK4 &) |
TimeInterpolatorRK4 (const TimeInterpolatorRK4 &) |
TimeInterpolatorRK4::TimeInterpolatorRK4 | ( | ) |
Default constructor.
Object requires define() to be called before all other functions.
TimeInterpolatorRK4::~TimeInterpolatorRK4 | ( | ) |
TimeInterpolatorRK4::TimeInterpolatorRK4 | ( | const TimeInterpolatorRK4 & | ) | [private] |
void TimeInterpolatorRK4::define | ( | const DisjointBoxLayout & | a_thisDisjointBoxLayout, | |
const DisjointBoxLayout & | a_coarserDisjointBoxLayout, | |||
const ProblemDomain & | a_domain, | |||
const int & | a_refineCoarse, | |||
const int & | a_numStates, | |||
const int & | a_ghosts | |||
) |
Actual constructor.
Set up object.
a_thisDisjointBoxLayout | layout at this level |
a_coarserDisjointBoxLayout | layout at next coarser level |
a_domain | problem domain on this level |
a_refineCoarse | refinement ratio between this level and next coarser level |
a_numStates | number of variables |
a_ghosts | layers of ghost cells to be filled in on the coarsened layout at this level |
void TimeInterpolatorRK4::setDt | ( | const Real & | a_dt | ) |
Set coarse timestep.
Update Taylor polynomial coefficients with coarse right-hand side.
Update Taylor polynomial coefficients with coarse right-hand side. Ghost cells, too.
This function must be called exactly four times, after saveInitialSoln() and before any calls to interpolate().
The counter m_countRHS keeps track of how many times this is called.
void TimeInterpolatorRK4::interpolate | ( | LevelData< FArrayBox > & | a_U, | |
const Real & | a_timeInterpCoeff, | |||
const Interval & | a_intvl | |||
) |
Interpolate in time using the Taylor polynomial.
Interpolate in time to a_U on interval a_intvl using the Taylor polynomial. Ghost cells, too.
a_U | interpolated solution on this level coarsened |
a_timeInterpCoeff | time interpolation coefficient in range [0:1] |
a_intvl | interval of a_U to fill in |
void TimeInterpolatorRK4::intermediate | ( | LevelData< FArrayBox > & | a_U, | |
const Real & | a_timeInterpCoeff, | |||
const int & | a_stage, | |||
const Interval & | a_intvl | |||
) | const |
Set RK4 intermediate values in time using the Taylor polynomial.
Set RK4 intermediate values to a_U on interval a_intvl using the Taylor polynomial. Ghost cells, too.
a_U | interpolated solution on this level coarsened |
a_timeInterpCoeff | time interpolation coefficient in range [0:1] |
a_stage | which RK4 stage: 0, 1, 2, 3 |
a_intvl | interval of a_U to fill in |
void TimeInterpolatorRK4::resetData | ( | ) | [protected] |
Reset this object to use with new data.
void TimeInterpolatorRK4::setVectorDt | ( | Vector< Real > & | a_vec, | |
Real | a_c0, | |||
Real | a_c1, | |||
Real | a_c2, | |||
Real | a_c3 | |||
) | [protected] |
Set a_vec = m_dt * (a_c0, a_c1, a_c2, a_c3).
void TimeInterpolatorRK4::operator= | ( | const TimeInterpolatorRK4 & | ) | [private] |
Vector< Vector<Real> > TimeInterpolatorRK4::m_coeffs [protected] |
layout for this level, coarsened by m_refToCoarse
DisjointBoxLayout TimeInterpolatorRK4::m_coarseLayout [protected] |
layout for the coarse level
Copier TimeInterpolatorRK4::m_copier [protected] |
For copying from rhs on m_coarseLayout to m_rhsCopy on m_thisCoarsenedLayout.
int TimeInterpolatorRK4::m_ghosts [protected] |
layers of ghost cells around m_thisCoarsenedLayout for m_rhsCopy and m_taylorCoeffs
int TimeInterpolatorRK4::m_numCoeffs [protected] |
number of coefficients in Taylor polynomial: this is 4
IntVect TimeInterpolatorRK4::m_ghostVect [protected] |
ghost vector around m_thisCoarsenedLayout for m_rhsCopy and m_taylorCoeffs
Real TimeInterpolatorRK4::m_dt [protected] |
coarse timestep
LevelData<FArrayBox> TimeInterpolatorRK4::m_rhsCopy [protected] |
Copy of rhs on m_thisCoarsenedLayout, to be used within saveRHS.
LevelData<FArrayBox> TimeInterpolatorRK4::m_taylorCoeffs [protected] |
coefficients of the third-degree Taylor polynomial on m_thisCoarsenedLayout with ghost vector m_ghostVect; m_numCoeffs*m_numStates components
LevelData<FArrayBox> TimeInterpolatorRK4::m_diff12 [protected] |
difference between f(U1) and f(U2), used for intermediate-value calculations, on m_thisCoarsenedLayout with ghost vector m_ghostVect; m_numCoeffs*m_numStates components
bool TimeInterpolatorRK4::m_gotDt [protected] |
whether m_dt has been set
bool TimeInterpolatorRK4::m_gotInitialSoln [protected] |
whether initial solution has been saved
bool TimeInterpolatorRK4::m_gotFullTaylorPoly [protected] |
whether we have the full Taylor polynomial
int TimeInterpolatorRK4::m_countRHS [protected] |
number of times saveRHS function has been called
ProblemDomain TimeInterpolatorRK4::m_coarseDomain [protected] |
Problem domain - index space for next coarser level.
int TimeInterpolatorRK4::m_refineCoarse [protected] |
Refinement ratio between this level and the next coarser.
int TimeInterpolatorRK4::m_numStates [protected] |
Number of variables.
bool TimeInterpolatorRK4::m_defined [protected] |
define() has been called