Chombo + EB  3.2
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
TimeInterpolatorRK4 Class Reference

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

#include <TimeInterpolatorRK4.H>

Public Member Functions

 TimeInterpolatorRK4 ()
 Default constructor. More...
 
 ~TimeInterpolatorRK4 ()
 Destructor. More...
 
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. More...
 
void setDt (const Real &a_dt)
 Set coarse timestep. More...
 
void saveInitialSoln (const LevelData< FArrayBox > &a_soln)
 Update Taylor polynomial coefficients with the coarse solution. More...
 
void saveRHS (const LevelData< FArrayBox > &a_rhs)
 Update Taylor polynomial coefficients with coarse right-hand side. More...
 
void interpolate (LevelData< FArrayBox > &a_U, const Real &a_timeInterpCoeff, const Interval &a_intvl)
 Interpolate in time using the Taylor polynomial. More...
 
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. More...
 

Protected Member Functions

void resetData ()
 Reset this object to use with new data. More...
 
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). More...
 

Protected Attributes

Vector< Vector< Real > > m_coeffs
 
DisjointBoxLayout m_thisCoarsenedLayout
 layout for this level, coarsened by m_refToCoarse More...
 
DisjointBoxLayout m_coarseLayout
 layout for the coarse level More...
 
Copier m_copier
 For copying from rhs on m_coarseLayout to m_rhsCopy on m_thisCoarsenedLayout. More...
 
int m_ghosts
 layers of ghost cells around m_thisCoarsenedLayout for m_rhsCopy and m_taylorCoeffs More...
 
int m_numCoeffs
 number of coefficients in Taylor polynomial: this is 4 More...
 
IntVect m_ghostVect
 ghost vector around m_thisCoarsenedLayout for m_rhsCopy and m_taylorCoeffs More...
 
Real m_dt
 coarse timestep More...
 
LevelData< FArrayBoxm_rhsCopy
 Copy of rhs on m_thisCoarsenedLayout, to be used within saveRHS. More...
 
LevelData< FArrayBoxm_taylorCoeffs
 coefficients of the third-degree Taylor polynomial on m_thisCoarsenedLayout with ghost vector m_ghostVect; m_numCoeffs*m_numStates components More...
 
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 More...
 
bool m_gotDt
 whether m_dt has been set More...
 
bool m_gotInitialSoln
 whether initial solution has been saved More...
 
bool m_gotFullTaylorPoly
 whether we have the full Taylor polynomial More...
 
int m_countRHS
 number of times saveRHS function has been called More...
 
ProblemDomain m_coarseDomain
 Problem domain - index space for next coarser level. More...
 
int m_refineCoarse
 Refinement ratio between this level and the next coarser. More...
 
int m_numStates
 Number of variables. More...
 
bool m_defined
 define() has been called More...
 

Private Member Functions

void operator= (const TimeInterpolatorRK4 &)
 
 TimeInterpolatorRK4 (const TimeInterpolatorRK4 &)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ TimeInterpolatorRK4() [1/2]

TimeInterpolatorRK4::TimeInterpolatorRK4 ( )

Default constructor.

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

◆ ~TimeInterpolatorRK4()

TimeInterpolatorRK4::~TimeInterpolatorRK4 ( )

Destructor.

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

◆ TimeInterpolatorRK4() [2/2]

TimeInterpolatorRK4::TimeInterpolatorRK4 ( const TimeInterpolatorRK4 )
private

Member Function Documentation

◆ define()

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_thisDisjointBoxLayoutlayout at this level
a_coarserDisjointBoxLayoutlayout at next coarser level
a_domainproblem domain on this level
a_refineCoarserefinement ratio between this level and next coarser level
a_numStatesnumber of variables
a_ghostslayers of ghost cells to be filled in on the coarsened layout at this level

◆ setDt()

void TimeInterpolatorRK4::setDt ( const Real a_dt)

Set coarse timestep.

◆ saveInitialSoln()

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().

◆ 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.

◆ interpolate()

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_Uinterpolated solution on this level coarsened
a_timeInterpCoefftime interpolation coefficient in range [0:1]
a_intvlinterval of a_U to fill in

◆ intermediate()

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_Uinterpolated solution on this level coarsened
a_timeInterpCoefftime interpolation coefficient in range [0:1]
a_stagewhich RK4 stage: 0, 1, 2, 3
a_intvlinterval of a_U to fill in

◆ resetData()

void TimeInterpolatorRK4::resetData ( )
protected

Reset this object to use with new data.

◆ setVectorDt()

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).

◆ operator=()

void TimeInterpolatorRK4::operator= ( const TimeInterpolatorRK4 )
private

Member Data Documentation

◆ m_coeffs

Vector< Vector<Real> > TimeInterpolatorRK4::m_coeffs
protected

◆ m_thisCoarsenedLayout

DisjointBoxLayout TimeInterpolatorRK4::m_thisCoarsenedLayout
protected

layout for this level, coarsened by m_refToCoarse

◆ m_coarseLayout

DisjointBoxLayout TimeInterpolatorRK4::m_coarseLayout
protected

layout for the coarse level

◆ m_copier

Copier TimeInterpolatorRK4::m_copier
protected

For copying from rhs on m_coarseLayout to m_rhsCopy on m_thisCoarsenedLayout.

◆ m_ghosts

int TimeInterpolatorRK4::m_ghosts
protected

layers of ghost cells around m_thisCoarsenedLayout for m_rhsCopy and m_taylorCoeffs

◆ m_numCoeffs

int TimeInterpolatorRK4::m_numCoeffs
protected

number of coefficients in Taylor polynomial: this is 4

◆ m_ghostVect

IntVect TimeInterpolatorRK4::m_ghostVect
protected

ghost vector around m_thisCoarsenedLayout for m_rhsCopy and m_taylorCoeffs

◆ m_dt

Real TimeInterpolatorRK4::m_dt
protected

coarse timestep

◆ m_rhsCopy

LevelData<FArrayBox> TimeInterpolatorRK4::m_rhsCopy
protected

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

◆ m_taylorCoeffs

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

◆ m_diff12

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

◆ m_gotDt

bool TimeInterpolatorRK4::m_gotDt
protected

whether m_dt has been set

◆ m_gotInitialSoln

bool TimeInterpolatorRK4::m_gotInitialSoln
protected

whether initial solution has been saved

◆ m_gotFullTaylorPoly

bool TimeInterpolatorRK4::m_gotFullTaylorPoly
protected

whether we have the full Taylor polynomial

◆ m_countRHS

int TimeInterpolatorRK4::m_countRHS
protected

number of times saveRHS function has been called

◆ m_coarseDomain

ProblemDomain TimeInterpolatorRK4::m_coarseDomain
protected

Problem domain - index space for next coarser level.

◆ m_refineCoarse

int TimeInterpolatorRK4::m_refineCoarse
protected

Refinement ratio between this level and the next coarser.

◆ m_numStates

int TimeInterpolatorRK4::m_numStates
protected

Number of variables.

◆ m_defined

bool TimeInterpolatorRK4::m_defined
protected

define() has been called


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