Chombo + EB + MF  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() [1/2]

LevelGodunov::LevelGodunov ( )

Default constructor.

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

◆ ~LevelGodunov()

LevelGodunov::~LevelGodunov ( )

Destructor.

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

◆ LevelGodunov() [2/2]

LevelGodunov::LevelGodunov ( const LevelGodunov )
private

Member Function Documentation

◆ define()

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

◆ step()

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

◆ computeWHalf()

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

◆ computeUpdate()

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

◆ getMaxWaveSpeed()

Real LevelGodunov::getMaxWaveSpeed ( const LevelData< FArrayBox > &  a_U)

Return maximum wave speed.

◆ getGodunovPhysicsPtr()

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.

◆ getGodunovPhysicsPtrConst()

const GodunovPhysics* LevelGodunov::getGodunovPhysicsPtrConst ( ) const

◆ highOrderLimiter()

void LevelGodunov::highOrderLimiter ( bool  a_highOrderLimiter)

Set whether to use high-order limiter.

◆ operator=()

void LevelGodunov::operator= ( const LevelGodunov )
private

Member Data Documentation

◆ m_grids

DisjointBoxLayout LevelGodunov::m_grids
protected

◆ m_patchGodunov

LayoutData<PatchGodunov> LevelGodunov::m_patchGodunov
protected

◆ m_patchGodunovNoBox

PatchGodunov LevelGodunov::m_patchGodunovNoBox
protected

just for global calls

◆ m_numGhost

int LevelGodunov::m_numGhost
protected

◆ m_exchangeCopier

Copier LevelGodunov::m_exchangeCopier
protected

◆ m_U

LevelData<FArrayBox> LevelGodunov::m_U
protected

◆ m_patcher

PiecewiseLinearFillPatch LevelGodunov::m_patcher
protected

◆ m_dx

Real LevelGodunov::m_dx
protected

◆ m_domain

ProblemDomain LevelGodunov::m_domain
protected

◆ m_refineCoarse

int LevelGodunov::m_refineCoarse
protected

◆ m_numCons

int LevelGodunov::m_numCons
protected

◆ m_numFluxes

int LevelGodunov::m_numFluxes
protected

◆ m_hasCoarser

bool LevelGodunov::m_hasCoarser
protected

◆ m_hasFiner

bool LevelGodunov::m_hasFiner
protected

◆ m_normalPredOrder

int LevelGodunov::m_normalPredOrder
protected

◆ m_useFourthOrderSlopes

bool LevelGodunov::m_useFourthOrderSlopes
protected

◆ m_usePrimLimiting

bool LevelGodunov::m_usePrimLimiting
protected

◆ m_useCharLimiting

bool LevelGodunov::m_useCharLimiting
protected

◆ m_useFlattening

bool LevelGodunov::m_useFlattening
protected

◆ m_useArtificialViscosity

bool LevelGodunov::m_useArtificialViscosity
protected

◆ m_artificialViscosity

Real LevelGodunov::m_artificialViscosity
protected

◆ m_isDefined

bool LevelGodunov::m_isDefined
protected

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