|
criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
|
Interface class to describe background gas. More...
#include <Gas.H>
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. | |
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.
|
inlinevirtual |
Empty virtual destructor.
|
inlinevirtual |
Size of the ghost region in the gas data.
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 >.
|
inlinevirtual |
Compute the comoving TNB frame for the gas.
| x | Position |
| t | Time |
| v | Comoving velocity at specified position and time |
| tnb | The 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.
Return background gas state.
| x | Position |
| t | Time |
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.
Update the gas data.
| t | Current time |
| tNext | Next 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.