criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes | List of all members
criptic::gas::TimeInterp< T > Class Template Reference

Gas model stored with snapshots. More...

#include <TimeInterp.H>

Inheritance diagram for criptic::gas::TimeInterp< T >:
criptic::gas::Gas

Public Member Functions

 TimeInterp (const ParmParser &pp, const Geometry &geom_, const IdxType nBB, const int nGhost, std::vector< Real > TBB_={}, std::vector< Real > WBB_={})
 Constructor.
 
virtual ~TimeInterp ()
 Destructor.
 
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 updateState (const Real t, Real &tNext)
 Update the gas data.
 
- Public Member Functions inherited from criptic::gas::Gas
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.
 

Static Public Member Functions

static std::vector< std::string > sortSnapFiles (std::vector< std::string > files, std::vector< Real > times)
 Sort snapshot files by their associated times.
 

Protected Attributes

std::vector< RealtSlice
 
std::vector< std::string > snapFiles
 
IdxType tPtr
 
Real hLim
 
int leafSize
 
bool uniformRadField
 
std::vector< RealTBB
 
std::vector< RealWBB
 

Private Attributes

int verbosity
 
T * gasOld
 
T * gasNew
 
bool dataLoaded
 

Detailed Description

template<typename T>
class criptic::gas::TimeInterp< T >

Gas model stored with snapshots.

Template Parameters
Tthe gas class which each snapshot is described as

This template class provides the ability to describe a gas whose properties are specified on a series of files that represent distinct snapshots in time. The snapshots are stored on disk, and read into memory only as necessary. This is a template class, so the user must implement a Gas class to describe a single snapshot file and define the necessary methods on the Gas class to use in TimeInterp.

Constructor & Destructor Documentation

◆ TimeInterp()

template<typename T >
criptic::gas::TimeInterp< T >::TimeInterp ( const ParmParser pp,
const Geometry geom_,
const IdxType  nBB,
const int  nGhost,
std::vector< Real TBB_ = {},
std::vector< Real WBB_ = {} 
)
inline

Constructor.

Parameters
ppcriptic::ParmParser object containing the input deck
geom_criptic::Geometry object describing problem geometry
nBBNumber of blackbody radiation components
nGhostNumber of ghost zones to add to grid
TBB_Temperature of uniform blackbody radiation field
WBB_Dilution factor of uniform blackbody radiation field

◆ ~TimeInterp()

template<typename T >
virtual criptic::gas::TimeInterp< T >::~TimeInterp ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ dxGhost()

template<typename T >
virtual Real criptic::gas::TimeInterp< T >::dxGhost ( ) const
inlineoverridevirtual

Size of the ghost region in the gas data.

Returns
Ghost region size

This returns the physical size of the ghost region.

Reimplemented from criptic::gas::Gas.

◆ gasData()

template<typename T >
virtual GasData criptic::gas::TimeInterp< T >::gasData ( const RealVec x,
const Real  t 
) const
inlineoverridevirtual

Return background gas state.

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

This method return the GasData describing the gas at the input (x, t).

Implements criptic::gas::Gas.

◆ sortSnapFiles()

template<typename T >
static std::vector< std::string > criptic::gas::TimeInterp< T >::sortSnapFiles ( std::vector< std::string >  files,
std::vector< Real times 
)
inlinestatic

Sort snapshot files by their associated times.

Parameters
filesvector<string> of filenames
timesvector<Real> of snapshot times

◆ updateState()

template<typename T >
void criptic::gas::TimeInterp< T >::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, and is responsible for loading new snapshots into memory when required. T::loadData must be defined for this to work.

Reimplemented from criptic::gas::Gas.

Member Data Documentation

◆ dataLoaded

template<typename T >
bool criptic::gas::TimeInterp< T >::dataLoaded
private

Have data been loaded yet?

◆ gasNew

template<typename T >
T* criptic::gas::TimeInterp< T >::gasNew
private

Pointer to new gas snapshot

◆ gasOld

template<typename T >
T* criptic::gas::TimeInterp< T >::gasOld
private

Pointer to old gas snapshot

◆ hLim

template<typename T >
Real criptic::gas::TimeInterp< T >::hLim
protected

Maximum smoothing length in particle trees

◆ leafSize

template<typename T >
int criptic::gas::TimeInterp< T >::leafSize
protected

Particle tree leaf size

◆ snapFiles

template<typename T >
std::vector<std::string> criptic::gas::TimeInterp< T >::snapFiles
protected

Snapshot filenames

◆ TBB

template<typename T >
std::vector<Real> criptic::gas::TimeInterp< T >::TBB
protected

Uniform blackbody tmperatures

◆ tPtr

template<typename T >
IdxType criptic::gas::TimeInterp< T >::tPtr
protected

Pointer to current snapshot

◆ tSlice

template<typename T >
std::vector<Real> criptic::gas::TimeInterp< T >::tSlice
protected

Times of snapshots

◆ uniformRadField

template<typename T >
bool criptic::gas::TimeInterp< T >::uniformRadField
protected

Check if radiation field info is supplied

◆ verbosity

template<typename T >
int criptic::gas::TimeInterp< T >::verbosity
private

Verbosity level

◆ WBB

template<typename T >
std::vector<Real> criptic::gas::TimeInterp< T >::WBB
protected

Uniform blackbody dilution factors


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