LevelRK4.H File Reference

Go to the source code of this file.

Functions

template<class TSoln, class TFR, class TOp>
void RK4LevelAdvance (TSoln &a_newSoln, TSoln &a_oldSoln, const TSoln &a_oldCrseSoln, Real a_oldCrseTime, const TSoln &a_newCrseSoln, Real a_newCrseTime, TFR &a_crseFRPtr, TFR &a_fineFRPtr, Real a_time, Real a_dt, TOp &a_op, const bool a_initializeNewSoln=true)
 Basic templated implementation of RK4 advance for a single AMRLevel.
template<class TSoln, class TInterp, class TFR, class TOp>
void RK4LevelAdvance (TSoln &a_newSoln, TSoln &a_oldSoln, TInterp &a_interpPtr, const TSoln &a_oldCrseSoln, Real a_oldCrseTime, const TSoln &a_newCrseSoln, Real a_newCrseTime, TFR &a_crseFRPtr, TFR &a_fineFRPtr, Real a_time, Real a_dt, TOp &a_op, const bool a_initializeNewSoln=true)
 Templated implementation of RK4 advance for a single AMRLevel, allowing interpolation in time.


Function Documentation

template<class TSoln, class TFR, class TOp>
void RK4LevelAdvance ( TSoln &  a_newSoln,
TSoln &  a_oldSoln,
const TSoln &  a_oldCrseSoln,
Real  a_oldCrseTime,
const TSoln &  a_newCrseSoln,
Real  a_newCrseTime,
TFR &  a_crseFRPtr,
TFR &  a_fineFRPtr,
Real  a_time,
Real  a_dt,
TOp &  a_op,
const bool  a_initializeNewSoln = true 
) [inline]

Basic templated implementation of RK4 advance for a single AMRLevel.

This implements fourth-order Runge-Kutta time advance of an ODE. ODE is d(Soln)/dt = RHS

Template types:

  • TSoln is the datatype for the solution
  • TFR is a flux-register datatype
  • TOp is an object encapsulating the actual ODE operations
TOp requirements: TOp must have the following functions:
        // evaluate d(soln)/dt at current time based on soln
        void evalRHS(TSoln& rhs, // d(soln)/dt based on soln
                     TSoln& soln, // soln at current time
                     TFR& fineFR,  // flux register w/ finer level
                     TFR& crseFR,  // flux register w/ crse level
                     const TSoln& oldCrseSoln, // old-time crse solution
                     Real oldCrseTime,    // old crse time
                     const TSoln& newCrseSoln,  // new-time crse solution
                     Real newCrseTime,   // new crse time
                     Real time,   // current time centering of soln
                     Real fluxWeight // weight to apply to fluxRegister updates
                    )

        // implements soln += dt*rhs
        void updateODE(TSoln& soln,
                       const TSoln& rhs,
                       Real dt)

        // define data holder newSoln based on existingSoln,
        // including ghost cell specification
        void defineSolnData(TSoln& newSoln,
                            const TSoln& existingSoln)

        // define data holder for RHS based on existingSoln
        // including ghost cell specification
        // (which in most cases is no ghost cells)
        void defineRHSData(TSoln& newRHS, const TSoln& existingSoln)

        /// copy data in src into dest
        void copySolnData(TSoln& dest, const TSoln& src)
Parameters:
a_newSoln  the cell-centered solution at the new time (a_time + a_dt)
a_oldSoln  the cell-centered solution at the old time (a_time)
a_oldCrseSoln  old-time coarse-level solution (if it exists)
a_oldCrseTime  time-centering of a_oldCrseSoln
a_newCrseSoln  new-time coarse-level solution (if it exists)
a_newCrseTime  time-centering of a_newCrseSoln
a_crseFRPtr  the pointer to the flux register between this level and the next coarser level
a_fineFRPtr  the pointer to the flux register between this level and the next finer level
a_time  time centering of a_oldSoln
a_dt  time step
a_op  object which encapsulates the ODE functionality (must meet the requirements detailed above)
a_initializeNewSoln  whether a_newSoln should be initialized with a_oldSoln (default true)

template<class TSoln, class TInterp, class TFR, class TOp>
void RK4LevelAdvance ( TSoln &  a_newSoln,
TSoln &  a_oldSoln,
TInterp &  a_interpPtr,
const TSoln &  a_oldCrseSoln,
Real  a_oldCrseTime,
const TSoln &  a_newCrseSoln,
Real  a_newCrseTime,
TFR &  a_crseFRPtr,
TFR &  a_fineFRPtr,
Real  a_time,
Real  a_dt,
TOp &  a_op,
const bool  a_initializeNewSoln = true 
) [inline]

Templated implementation of RK4 advance for a single AMRLevel, allowing interpolation in time.

This implements fourth-order Runge-Kutta time advance of an ODE, and saves intermediate results for use in interpolation in time. ODE is d(Soln)/dt = RHS

Template types:

  • TSoln is the datatype for the solution
  • TInterp is a storage class for intermediate values
  • TFR is a flux-register datatype
  • TOp is an object encapsulating the actual ODE operations
TInterp requirements: TInterp must have the following functions:
        // set time step
        void setDt(Real dt)

        // save initial solution
        void saveInitialSoln(TSoln& soln)

        // save this value of d(soln)/dt
        void saveRHS(TSoln& rhs)
TOp requirements: TOp must have the following functions:
        // evaluate d(soln)/dt at current time based on soln
        void evalRHS(TSoln& rhs, // d(soln)/dt based on soln
                     TSoln& soln, // soln at current time
                     TFR& fineFR,  // flux register w/ finer level
                     TFR& crseFR,  // flux register w/ crse level
                     const TSoln& oldCrseSoln, // old-time crse solution
                     Real oldCrseTime,    // old crse time
                     const TSoln& newCrseSoln,  // new-time crse solution
                     Real newCrseTime,   // new crse time
                     Real time,   // current time centering of soln
                     Real fluxWeight // weight to apply to fluxRegister updates
                    )

        // implements soln += dt*rhs
        void updateODE(TSoln& soln,
                       const TSoln& rhs,
                       Real dt)

        // define data holder newSoln based on existingSoln,
        // including ghost cell specification
        void defineSolnData(TSoln& newSoln,
                            const TSoln& existingSoln)

        // define data holder for RHS based on existingSoln
        // including ghost cell specification
        // (which in most cases is no ghost cells)
        void defineRHSData(TSoln& newRHS, const TSoln& existingSoln)

        /// copy data in src into dest
        void copySolnData(TSoln& dest, const TSoln& src)
Parameters:
a_newSoln  the cell-centered solution at the new time (a_time + a_dt)
a_oldSoln  the cell-centered solution at the old time (a_time)
a_interpPtr  object that encapsulates time interpolation
a_oldCrseSoln  old-time coarse-level solution (if it exists)
a_oldCrseTime  time-centering of a_oldCrseSoln
a_newCrseSoln  new-time coarse-level solution (if it exists)
a_newCrseTime  time-centering of a_newCrseSoln
a_crseFRPtr  the pointer to the flux register between this level and the next coarser level
a_fineFRPtr  the pointer to the flux register between this level and the next finer level
a_time  time centering of a_oldSoln
a_dt  time step
a_op  object which encapsulates the ODE functionality (must meet the requirements detailed above)
a_initializeNewSoln  whether a_newSoln is initialized with a_oldSoln (default true)


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