TimeInterpolatorRK4 Class Reference

#include <TimeInterpolatorRK4.H>

List of all members.


Detailed Description

Time interpolator class using 4th-order Runge-Kutta.

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< FArrayBoxm_rhsCopy
 Copy of rhs on m_thisCoarsenedLayout, to be used within saveRHS.
LevelData< FArrayBoxm_taylorCoeffs
 coefficients of the third-degree Taylor polynomial on m_thisCoarsenedLayout with ghost vector m_ghostVect; m_numCoeffs*m_numStates components
LevelData< FArrayBoxm_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 &)

Constructor & Destructor Documentation

TimeInterpolatorRK4::TimeInterpolatorRK4 (  ) 

Default constructor.

Object requires define() to be called before all other functions.

TimeInterpolatorRK4::~TimeInterpolatorRK4 (  ) 

Destructor.

Destroys all objects created by define(). Passed in data references of define() are left alone.

TimeInterpolatorRK4::TimeInterpolatorRK4 ( const TimeInterpolatorRK4  )  [private]


Member Function Documentation

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.

Parameters:
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.

void TimeInterpolatorRK4::saveInitialSoln ( const LevelData< FArrayBox > &  a_soln  ) 

Update Taylor polynomial coefficients with the coarse solution.

Update Taylor polynomial coefficients with coarse solution a_soln. Ghost cells, too.

This function must be called after setDt() and before saveRHS().

void TimeInterpolatorRK4::saveRHS ( const LevelData< FArrayBox > &  a_rhs  ) 

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.

Parameters:
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.

Parameters:
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]


Member Data Documentation

layout for this level, coarsened by m_refToCoarse

layout for the coarse level

For copying from rhs on m_coarseLayout to m_rhsCopy on m_thisCoarsenedLayout.

layers of ghost cells around m_thisCoarsenedLayout for m_rhsCopy and m_taylorCoeffs

number of coefficients in Taylor polynomial: this is 4

ghost vector around m_thisCoarsenedLayout for m_rhsCopy and m_taylorCoeffs

coarse timestep

Copy of rhs on m_thisCoarsenedLayout, to be used within saveRHS.

coefficients of the third-degree Taylor polynomial on m_thisCoarsenedLayout with ghost vector m_ghostVect; m_numCoeffs*m_numStates components

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

whether initial solution has been saved

whether we have the full Taylor polynomial

number of times saveRHS function has been called

Problem domain - index space for next coarser level.

Refinement ratio between this level and the next coarser.

Number of variables.

define() has been called


The documentation for this class was generated from the following file:

Generated on Fri Apr 5 04:25:19 2019 for Chombo + EB by  doxygen 1.5.5