criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
Loading...
Searching...
No Matches
Public Member Functions | List of all members
criptic::gas::Gas Class Referenceabstract

Interface class to describe background gas. More...

#include <Gas.H>

Inheritance diagram for criptic::gas::Gas:
criptic::gas::CartesianGrid criptic::gas::CartesianTimeInterp criptic::gas::GizmoGas criptic::gas::SplitMonopole criptic::gas::TimeInterp< T > criptic::gas::UniformGas criptic::gas::CartesianTimeInterpFLASH

Public Member Functions

virtual ~Gas ()
 Empty virtual destructor.
 
virtual void frame (const RealVec &x, const Real t, RealVec &v, TNBBasis &tnb) const
 Compute the comoving TNB frame for the gas.
 
virtual GasData gasData (const RealVec &x, const Real t) const =0
 Return background gas state.
 
virtual Real dxGhost () const
 Size of the ghost region in the gas data.
 
virtual void updateState (const Real t, Real &tNext)
 Update the gas data.
 

Detailed Description

Interface class to describe background gas.

This is a virtual base class that defines an interface through which the user provides data on the background gas state to criptic. Users can describe arbitrary background gas distributions by deriving a specialized class from this interface.

Constructor & Destructor Documentation

◆ ~Gas()

virtual criptic::gas::Gas::~Gas ( )
inlinevirtual

Empty virtual destructor.

Member Function Documentation

◆ dxGhost()

virtual Real criptic::gas::Gas::dxGhost ( ) const
inlinevirtual

Size of the ghost region in the gas data.

Returns
Ghost region size

For some models of describing the gas (most prominently Cartesian boxes), the gas data are defined only over some finite volume. This volume must extend past the problem domain by at least a finite distance; for the example of a Cartesian grid, this area outside the problem domain corresponds to ghost zones whose values are set by the boundary conditions. The value returned by this function is the linear size of the ghost zone outside the problem domain where valid gas data exist. If valid gas data exist everywhere (for example because the background gas is specified by an analytic function), this function should return zero. The implementation in this base class returns zero, but derived classes that have ghost zones can override this.

Reimplemented in criptic::gas::CartesianGrid, criptic::gas::CartesianTimeInterp, and criptic::gas::TimeInterp< T >.

◆ frame()

virtual void criptic::gas::Gas::frame ( const RealVec x,
const Real  t,
RealVec v,
TNBBasis tnb 
) const
inlinevirtual

Compute the comoving TNB frame for the gas.

Parameters
xPosition
tTime
vComoving velocity at specified position and time
tnbThe TNBBasis at the specified position and time

This function computes the comoving TNB frame for the gas at a specified position and time. This class provides an implementation for convenience, but since this implementation involves computing the full gas state, it may be inefficient. Thus implementors of derived classes may wish to override this implementation and provide their own.

Reimplemented in criptic::gas::SplitMonopole, criptic::gas::CartesianGrid, criptic::gas::CartesianTimeInterp, and criptic::gas::UniformGas.

◆ gasData()

virtual GasData criptic::gas::Gas::gasData ( const RealVec x,
const Real  t 
) const
pure virtual

Return background gas state.

Parameters
xPosition
tTime
Returns
GasData at specified (x, t)

This is a pure virtual function, which must be implemented in a derived class. It must return the GasData describing the gas at the input (x, t).

Implemented in criptic::gas::SplitMonopole, criptic::gas::CartesianGrid, criptic::gas::CartesianTimeInterp, criptic::gas::GizmoGas, criptic::gas::TimeInterp< T >, and criptic::gas::UniformGas.

◆ updateState()

virtual void criptic::gas::Gas::updateState ( const Real  t,
Real tNext 
)
inlinevirtual

Update the gas data.

Parameters
tCurrent time
tNextNext time

This function is called at the start of every time step. By default it does nothing. However, it is declared as a virtual method and called from main to provide a hook for users to override and have their derived Gas class do something non-trivial to change the Gas object. This method is also allowed to modify the time step by changing the value of tNext, e.g., to ensure that some short-timescale behavior in the gas state is properly resolved. In principle the user can increase as well as decrease the time step; however, the former is discouraged, since it can cause issues with solution accuracy.

Reimplemented in criptic::gas::TimeInterp< T >, and criptic::gas::CartesianTimeInterp.


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