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

Level Godunov - really a hyperbolic level integrator. More...

#include <LevelGodunov.H>

Public Member Functions

 LevelGodunov ()
 Default constructor. More...
 
 ~LevelGodunov ()
 Destructor. More...
 
void define (const DisjointBoxLayout &a_thisDisjointBoxLayout, const DisjointBoxLayout &a_coarserDisjointBoxLayout, const ProblemDomain &a_domain, const int &a_refineCoarse, const Real &a_dx, const GodunovPhysics *const a_godunovFactory, const int &a_normalPredOrder, const bool &a_useFourthOrderSlopes, const bool &a_usePrimLimiting, const bool &a_useCharLimiting, const bool &a_useFlattening, const bool &a_useArtificialViscosity, const Real &a_artificialViscosity, const bool &a_hasCoarser, const bool &a_hasFiner)
 Actual constructor. More...
 
Real step (LevelData< FArrayBox > &a_U, LevelData< FArrayBox > a_flux[CH_SPACEDIM], LevelFluxRegister &a_finerFluxRegister, LevelFluxRegister &a_coarserFluxRegister, const LevelData< FArrayBox > &a_S, const LevelData< FArrayBox > &a_UCoarseOld, const Real &a_TCoarseOld, const LevelData< FArrayBox > &a_UCoarseNew, const Real &a_TCoarseNew, const Real &a_time, const Real &a_dt)
 Take one timestep for this grid level. More...
 
void computeWHalf (LayoutData< FluxBox > &a_WHalf, LevelData< FArrayBox > &a_U, const LevelData< FArrayBox > &a_S, const LevelData< FArrayBox > &a_UCoarseOld, const Real &a_TCoarseOld, const LevelData< FArrayBox > &a_UCoarseNew, const Real &a_TCoarseNew, const Real &a_time, const Real &a_dt)
 Compute the time-centered values of the primitive variables on cell faces. More...
 
Real computeUpdate (LevelData< FArrayBox > &a_dU, LevelFluxRegister &a_finerFluxRegister, LevelFluxRegister &a_coarserFluxRegister, const LevelData< FArrayBox > &a_U, const LayoutData< FluxBox > &a_WHalf, const Real &a_time, const Real &a_dt)
 Compute the increment in the conserved variables from face variables. More...
 
Real getMaxWaveSpeed (const LevelData< FArrayBox > &a_U)
 Return maximum wave speed. More...
 
GodunovPhysicsgetGodunovPhysicsPtr ()
 Get the GodunovPhysics pointer from the PatchGodunov member. More...
 
const GodunovPhysicsgetGodunovPhysicsPtrConst () const
 
void highOrderLimiter (bool a_highOrderLimiter)
 Set whether to use high-order limiter. More...
 

Protected Attributes

DisjointBoxLayout m_grids
 
LayoutData< PatchGodunovm_patchGodunov
 
PatchGodunov m_patchGodunovNoBox
 just for global calls More...
 
int m_numGhost
 
Copier m_exchangeCopier
 
LevelData< FArrayBoxm_U
 
PiecewiseLinearFillPatch m_patcher
 
Real m_dx
 
ProblemDomain m_domain
 
int m_refineCoarse
 
int m_numCons
 
int m_numFluxes
 
bool m_hasCoarser
 
bool m_hasFiner
 
int m_normalPredOrder
 
bool m_useFourthOrderSlopes
 
bool m_usePrimLimiting
 
bool m_useCharLimiting
 
bool m_useFlattening
 
bool m_useArtificialViscosity
 
Real m_artificialViscosity
 
bool m_isDefined
 

Private Member Functions

void operator= (const LevelGodunov &)
 
 LevelGodunov (const LevelGodunov &)
 

Detailed Description

Level Godunov - really a hyperbolic level integrator.

Constructor & Destructor Documentation

LevelGodunov::LevelGodunov ( )

Default constructor.

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

LevelGodunov::~LevelGodunov ( )

Destructor.

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

LevelGodunov::LevelGodunov ( const LevelGodunov )
private

Member Function Documentation

void LevelGodunov::define ( const DisjointBoxLayout a_thisDisjointBoxLayout,
const DisjointBoxLayout a_coarserDisjointBoxLayout,
const ProblemDomain a_domain,
const int &  a_refineCoarse,
const Real a_dx,
const GodunovPhysics *const  a_godunovFactory,
const int &  a_normalPredOrder,
const bool &  a_useFourthOrderSlopes,
const bool &  a_usePrimLimiting,
const bool &  a_useCharLimiting,
const bool &  a_useFlattening,
const bool &  a_useArtificialViscosity,
const Real a_artificialViscosity,
const bool &  a_hasCoarser,
const bool &  a_hasFiner 
)

Actual constructor.

Inside the routine, we cast away const-ness on the data members for the assignment. The arguments passed in are maintained const (coding standards).

Parameters
a_thisDisjointBoxLayoutbox layout at this level
a_coarserDisjointBoxLayoutbox layout at next coarser level (or empty if this is coarsest level)
a_domainproblem domain at this level
a_refineCoarserefinement ratio between this level and next coarser level
a_dxgrid spacing at this level
a_godunovFactorypointer to GodunovPhysics class
a_normalPredOrderorder of the normal predictor: 1 for PLM, 2 for PPM
a_useFourthOrderSlopeswhether to use 4th-order slopes
a_usePrimLimitingwhether to apply slope limiting to primitive variables
a_useCharLimitingwhether to apply slope limiting to characteristic variables
a_useFlatteningwhether to apply slope flattening
a_useArtificialViscositywhether to apply artificial viscosity
a_artificialViscosityartificial viscosity coefficient
a_hasCoarserwhether there is a coarser level
a_hasFinerwhether there is a finer level
Real LevelGodunov::step ( LevelData< FArrayBox > &  a_U,
LevelData< FArrayBox a_flux[CH_SPACEDIM],
LevelFluxRegister a_finerFluxRegister,
LevelFluxRegister a_coarserFluxRegister,
const LevelData< FArrayBox > &  a_S,
const LevelData< FArrayBox > &  a_UCoarseOld,
const Real a_TCoarseOld,
const LevelData< FArrayBox > &  a_UCoarseNew,
const Real a_TCoarseNew,
const Real a_time,
const Real a_dt 
)

Take one timestep for this grid level.

Parameters
a_Uconserved variables at this level, defined on a_thisDisjointBoxLayout in define()
a_fluxflux, for passing face-centered data in and out of the function
a_finerFluxRegisterflux register with next finer level
a_coarserFluxRegisterflux register with next coarser level
a_Ssource term, or if no source term then this is null constructed and not defined
a_UCoarseOldconserved variables at coarser level at time of last coarser-level update, or empty if no coarser level; may be empty if interpolation not required
a_TCoarseOldtime of last update at coarser level
a_UCoarseNewconserved variables at coarser level at time of next coarser-level update, or empty if no coarser level; may be empty if interpolation not required
a_TCoarseNewtime of next update at coarser level
a_timecurrent time
a_dttime step
void LevelGodunov::computeWHalf ( LayoutData< FluxBox > &  a_WHalf,
LevelData< FArrayBox > &  a_U,
const LevelData< FArrayBox > &  a_S,
const LevelData< FArrayBox > &  a_UCoarseOld,
const Real a_TCoarseOld,
const LevelData< FArrayBox > &  a_UCoarseNew,
const Real a_TCoarseNew,
const Real a_time,
const Real a_dt 
)

Compute the time-centered values of the primitive variables on cell faces.

This API is used in cases where some operation over the whole level must be performed on the face-centered variables prior to the final difference update. Examples include incompressible flow and MHD, in which it is necessary to compute the projection of a face-centered vector field on its divergence-free part. To complete the differencing, it is necessary to call the member function computeUpdate().

Parameters
a_WHalfprimitive variables extrapolated to cell faces and a half time step
a_Uconserved variables on current grids
a_Ssource term on current grid
a_UCoarseOldconserved variables at coarser level at time of last coarser-level update, or empty if no coarser level; may be empty if interpolation not required
a_TCoarseOldtime of last update at coarser level
a_UCoarseNewconserved variables at coarser level at time of next coarser-level update, or empty if no coarser level; may be empty if interpolation not required
a_TCoarseNewtime of next update at coarser level
a_timecurrent time
a_dttime step
Real LevelGodunov::computeUpdate ( LevelData< FArrayBox > &  a_dU,
LevelFluxRegister a_finerFluxRegister,
LevelFluxRegister a_coarserFluxRegister,
const LevelData< FArrayBox > &  a_U,
const LayoutData< FluxBox > &  a_WHalf,
const Real a_time,
const Real a_dt 
)

Compute the increment in the conserved variables from face variables.

Compute dU = dt*dU/dt, the change in the conserved variables over the time step. Function returns the maximum stable time step.

Parameters
a_dUchange in conserved variables over the time step
a_finerFluxRegisterflux register with next finer level
a_coarserFluxRegisterflux register with next coarser level
a_Uconserved variables at beginning of time step
a_WHalfprimitive variables extrapolated to cell faces and a half time step
a_timecurrent time
a_dttime step
Real LevelGodunov::getMaxWaveSpeed ( const LevelData< FArrayBox > &  a_U)

Return maximum wave speed.

GodunovPhysics* LevelGodunov::getGodunovPhysicsPtr ( )

Get the GodunovPhysics pointer from the PatchGodunov member.

Returns the pointer to the GodunovPhysics object that is used in the PatchGodunov class.

const GodunovPhysics* LevelGodunov::getGodunovPhysicsPtrConst ( ) const
void LevelGodunov::highOrderLimiter ( bool  a_highOrderLimiter)

Set whether to use high-order limiter.

void LevelGodunov::operator= ( const LevelGodunov )
private

Member Data Documentation

DisjointBoxLayout LevelGodunov::m_grids
protected
LayoutData<PatchGodunov> LevelGodunov::m_patchGodunov
protected
PatchGodunov LevelGodunov::m_patchGodunovNoBox
protected

just for global calls

int LevelGodunov::m_numGhost
protected
Copier LevelGodunov::m_exchangeCopier
protected
LevelData<FArrayBox> LevelGodunov::m_U
protected
PiecewiseLinearFillPatch LevelGodunov::m_patcher
protected
Real LevelGodunov::m_dx
protected
ProblemDomain LevelGodunov::m_domain
protected
int LevelGodunov::m_refineCoarse
protected
int LevelGodunov::m_numCons
protected
int LevelGodunov::m_numFluxes
protected
bool LevelGodunov::m_hasCoarser
protected
bool LevelGodunov::m_hasFiner
protected
int LevelGodunov::m_normalPredOrder
protected
bool LevelGodunov::m_useFourthOrderSlopes
protected
bool LevelGodunov::m_usePrimLimiting
protected
bool LevelGodunov::m_useCharLimiting
protected
bool LevelGodunov::m_useFlattening
protected
bool LevelGodunov::m_useArtificialViscosity
protected
Real LevelGodunov::m_artificialViscosity
protected
bool LevelGodunov::m_isDefined
protected

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