|
criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
|
Describe a gas with properties stored on a Cartesian grid. More...
#include <CartesianGrid.H>
Public Types | |
| enum | gasIdxType { denIdx = 0 , ionDenIdx , vxIdx , vyIdx , vzIdx , BxIdx , ByIdx , BzIdx , xH0Idx , xHpIdx , xHe0Idx , xHepIdx , xHep2Idx , xeIdx , ZIdx , nf } |
| Convenience enum to give specify indices in gas array. More... | |
Public Member Functions | |
| CartesianGrid (const ParmParser &pp, const Geometry &geom_, const IdxType nBB_, const int nGhost_=1) | |
| Constructor. | |
| CartesianGrid (const IdxVec &nGrid_, const Geometry &geom_, const IdxType nBB_, const int nGhost_=1) | |
| Constructor with manually-specified grid size. | |
| virtual void | frame (const RealVec &x, const Real t, RealVec &v, TNBBasis &tnb) const override |
| Compute the comoving TNB frame for the gas. | |
| virtual GasData | gasData (const RealVec &x, const Real t) const override |
| Return background gas state. | |
| virtual Real | dxGhost () const override |
| Size of the ghost region in the gas data. | |
| void | applyBC () |
| Fill the ghost cells using the specified boundary condition. | |
| const IdxVec & | gridSize () const |
| Return the grid size. | |
| IdxType | nComponents () const |
| Return the number of components. | |
| const RealBox & | xBox () const |
| Return the domain bounding box. | |
| const RealVec & | xLo () const |
| Return low boundary of computational domain. | |
| const RealVec & | xHi () const |
| Return high boundary of computational domain. | |
| const RealVec & | xSize () const |
| Return size of computational domain. | |
| template<class T , std::enable_if_t< std::is_integral< T >::value, bool > = true> | |
| IdxType | idx (const Vec3< T > &iv, IdxType n) const |
| Convert an ((i,j,k),n) index to a memory location. | |
| void | posToIdx (const RealVec &x, SIdxVec &iv, RealVec &f) const |
| Convert a physical position to cell coordinates. | |
| template<class T , std::enable_if_t< std::is_integral< T >::value, bool > = true> | |
| RealVec | idxToPos (const Vec3< T > &iv, const RealVec &f=zeroIdxVec) const |
| Convert a position in cell coordinates to a physical position. | |
| template<class T , std::enable_if_t< std::is_integral< T >::value, bool > = true> | |
| Real & | operator() (const Vec3< T > &iv, const IdxType n) |
| Access data by index. | |
| template<class T , std::enable_if_t< std::is_integral< T >::value, bool > = true> | |
| const Real & | operator() (const Vec3< T > &iv, const IdxType n) const |
| Access data by index. | |
| Real & | operator() (const SignedIdxType i, const SignedIdxType j, const SignedIdxType k, const IdxType n) |
| Access data by index. | |
| const Real & | operator() (const SignedIdxType i, const SignedIdxType j, const SignedIdxType k, const IdxType n) const |
| Access data by index. | |
| template<class T , std::enable_if_t< std::is_integral< T >::value, bool > = true> | |
| std::vector< Real > | interp (const Vec3< T > &iv, const RealVec &f, const IdxType sComp=0, const IdxType eComp=maxIdx) const |
| Linearly interpolate grid data to specified point. | |
| template<class T , std::enable_if_t< std::is_integral< T >::value, bool > = true> | |
| RealVec | interpVec (const Vec3< T > &iv, const RealVec &f, const IdxType c) const |
| Linearly interpolate one vector component to a given point. | |
| template<class T , std::enable_if_t< std::is_integral< T >::value, bool > = true> | |
| RealVec | interpGradScalar (const Vec3< T > &iv, const RealVec &f, const IdxType c) const |
| Compute gradient of a scalar quantity by linear interpolation. | |
| template<class T , std::enable_if_t< std::is_integral< T >::value, bool > = true> | |
| RealTensor2 | interpGradVector (const Vec3< T > &iv, const RealVec &f, const IdxType c) const |
| Compute gradient of a vector quantity by linear interpolation. | |
Public Member Functions inherited from criptic::gas::Gas | |
| virtual | ~Gas () |
| Empty virtual destructor. | |
| virtual void | updateState (const Real t, Real &tNext) |
| Update the gas data. | |
Private Attributes | |
| const Geometry & | geom |
| IdxVec | nGrid |
| IdxType | nComp |
| IdxType | nBB |
| IdxType | nGhost |
| RealVec | dx |
| std::vector< Real > | data |
Describe a gas with properties stored on a Cartesian grid.
This class provides the ability to describe a gas whose properties are specified on a time-independent, cell-centered Cartesian grid. Many of the routines in this class make use of the idea of cell coordinates, defined as coordinate system with an integer part iv that specifies which cell the position is in, and a real part f that specifies where within the cell the point is located, with f going from -0.5 to +0.5; f = 0 corresponds to the cell center.
| CartesianGrid::CartesianGrid | ( | const ParmParser & | pp, |
| const Geometry & | geom_, | ||
| const IdxType | nBB_, | ||
| const int | nGhost_ = 1 |
||
| ) |
Constructor.
| pp | criptic::ParmParser object containing the input deck |
| geom_ | criptic::Geometry object describing problem geometry |
| nBB_ | Number of blackbody radiation components |
| nGhost_ | Number of ghost zones to add to grid |
| CartesianGrid::CartesianGrid | ( | const IdxVec & | nGrid_, |
| const Geometry & | geom_, | ||
| const IdxType | nBB_, | ||
| const int | nGhost_ = 1 |
||
| ) |
Constructor with manually-specified grid size.
| nGrid_ | Grid size |
| geom_ | criptic::Geometry object describing problem geometry |
| nBB_ | Number of blackbody radiation components |
| nGhost_ | Number of ghost zones to add to grid |
| void CartesianGrid::applyBC | ( | ) |
Fill the ghost cells using the specified boundary condition.
|
inlineoverridevirtual |
Size of the ghost region in the gas data.
This returns the physical size of the ghost region.
Reimplemented from criptic::gas::Gas.
|
inlineoverridevirtual |
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.
Reimplemented from criptic::gas::Gas.
Return background gas state.
| x | Position |
| t | Time |
This method return the GasData describing the gas at the input (x, t).
Implements criptic::gas::Gas.
|
inline |
Return the grid size.
|
inline |
Convert an ((i,j,k),n) index to a memory location.
| iv | Position index (i,j,k) |
| n | Field index n |
|
inline |
Convert a position in cell coordinates to a physical position.
| iv | Index of cell |
| f | Cell position |
|
inline |
Linearly interpolate grid data to specified point.
| iv | Cell within which target point lies |
| f | Position within cell in cell coordinates |
| sComp | Starting component |
| eComp | Ending component |
The components returned are [sComp, eComp), so for example if sComp = 2 and eComp = 5, the routine will interpolate components 2, 3, and 4, but not 5.
|
inline |
Compute gradient of a scalar quantity by linear interpolation.
| iv | Cell within which target point lies |
| f | Position within cell in cell coordinates |
| c | Component whose gradient should be computed |
|
inline |
Compute gradient of a vector quantity by linear interpolation.
| iv | Cell within which target point lies |
| f | Position within cell in cell coordinates |
| c | Starting component of vector quantity |
|
inline |
Linearly interpolate one vector component to a given point.
| iv | Cell within which target point lies |
| f | Position within cell in cell coordinates |
| c | Starting component of vector |
The components returned are [sComp, eComp), so for example if sComp = 2 and eComp = 5, the routine will interpolate components 2, 3, and 4, but not 5.
|
inline |
Return the number of components.
|
inline |
Access data by index.
| i | First index |
| j | Second index |
| k | Third index |
| n | Component |
|
inline |
Access data by index.
| i | First index |
| j | Second index |
| k | Third index |
| n | Component |
|
inline |
Access data by index.
| iv | Spatial index |
| n | Component |
|
inline |
Access data by index.
| iv | Spatial index |
| n | Component |
|
inline |
Convert a physical position to cell coordinates.
| x | Physical position |
| iv | Index of cell containing that position |
| f | Fractional position within the cell |
|
inline |
Return the domain bounding box.
|
inline |
Return high boundary of computational domain.
|
inline |
Return low boundary of computational domain.
|
inline |
Return size of computational domain.
|
private |
Data holder
|
private |
Grid spacing
|
private |
Problem geometry
|
private |
Number of blackbody fields
|
private |
Number of components
|
private |
Number of ghost zones
|
private |
Size of grid (real cells only)