criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
criptic::Prob Class Reference

A class to manage user-defined problem setup and work. More...

#include <Prob.H>

Public Member Functions

 Prob (const ParmParser &pp_, const Geometry &geom_, RngThread &rng_)
 Set up the problem class.
 
virtual gas::GasinitGas ()
 Set properties of background gas.
 
virtual propagation::PropagationinitProp ()
 Set up the CR propagation model.
 
virtual void initPackets (std::vector< RealVec > &x, std::vector< CRPacket > &packets)
 Set initial packet locations and properties.
 
virtual void initSources (std::vector< RealVec > &x, std::vector< CRSource > &sources)
 Set initial CR source locations and properties.
 
virtual void userSetup ()
 Perform arbitrary user-defined work at startup.
 
virtual void userWork (const Real t, Real &dt, gas::Gas &gasBG, propagation::Propagation &prop, CRTree &tree)
 Perform arbitrary user-defined work every time step.
 
virtual void userRead (const std::string &filename, const int step, Real &t, Real &dt, CRTree &tree)
 Perform arbitrary user-defined input after reading checkpoint.
 
virtual void userWrite (const int step, const Real t, const Real dt, const int chkNum, const std::string &baseChkName, const CRTree &tree)
 Perform arbitrary user-defined work after writing a checkpoint.
 
virtual void userFinalize (const Real t, gas::Gas &gasBG, propagation::Propagation &prop, CRTree &tree)
 Perform arbitrary user-defined work at the end of a run.
 

Protected Attributes

const ParmParserpp
 
const Geometrygeom
 
const RngThreadrng
 

Detailed Description

A class to manage user-defined problem setup and work.

This class defines methods that a user can use to initialize a problem and do user-defined work at various points in a calculation. The default version defined here provides no-op functions, which users can override to provide by defining a derived problem setup class.

Constructor & Destructor Documentation

◆ Prob()

criptic::Prob::Prob ( const ParmParser pp_,
const Geometry geom_,
RngThread rng_ 
)
inline

Set up the problem class.

Parameters
pp_The object containing the input deck
geom_The problem geometry object
rng_The random number generator

Member Function Documentation

◆ initGas()

virtual gas::Gas * criptic::Prob::initGas ( )
inlinevirtual

Set properties of background gas.

Returns
An object of class Gas describing the gas state

This routine is used to specify the background gas state. It defaults to setting up a simple uniform background gas state, but can be overridden by a derived class.

◆ initPackets()

virtual void criptic::Prob::initPackets ( std::vector< RealVec > &  x,
std::vector< CRPacket > &  packets 
)
inlinevirtual

Set initial packet locations and properties.

Parameters
xPositions of initial CR packets
packetsProperties of initial CR packets

This routine generates any initial packets that are present at time t = 0. The default implementation is empty, and creats no packets, but users can override this default.

◆ initProp()

virtual propagation::Propagation * criptic::Prob::initProp ( )
inlinevirtual

Set up the CR propagation model.

This routine is used to specify the CR propagation model. It defaults to setting up the ProbPowerlaw propagation model, but can be override by a derived class.

◆ initSources()

virtual void criptic::Prob::initSources ( std::vector< RealVec > &  x,
std::vector< CRSource > &  sources 
)
inlinevirtual

Set initial CR source locations and properties.

Parameters
xPositions of initial CR sources
sourcesProperties of initial CR sources

This routine generates any initial sources that are present at time t = 0. The default implementation is empty, and creats no packets, but users can override this default.

◆ userFinalize()

virtual void criptic::Prob::userFinalize ( const Real  t,
gas::Gas gasBG,
propagation::Propagation prop,
CRTree tree 
)
inlinevirtual

Perform arbitrary user-defined work at the end of a run.

Parameters
tCurrent time
gasBGGas object describing the background gas
propPropagation object describing the CR propagation model
treeThe tree containing the current CR packets and sources

This function is called at the end of a run, before the final checkpoint is output, and allows users to perform arbitrary calculations or modifications to the state of the simulation. The default implementation is empty, but this can be overriden by a derived class.

◆ userRead()

virtual void criptic::Prob::userRead ( const std::string &  filename,
const int  step,
Real t,
Real dt,
CRTree tree 
)
inlinevirtual

Perform arbitrary user-defined input after reading checkpoint.

Parameters
filenameName of checkpoint file to read
stepStep number stored in checkpoint
tTime stored in checkpoint
dtTime step stored in checkpoint
treeThe CRTree containing the checkpointed state

This function is called whenever a checkpoint is read, after the read has been completed. This routine allows the user to perform arbitrary additional work after reading the checkpoint, including modifyin the simulation state. The default implementation is empty, but this can be overridden by a derived class.

◆ userSetup()

virtual void criptic::Prob::userSetup ( )
inlinevirtual

Perform arbitrary user-defined work at startup.

This function is called immediately after construction of the Prob class, and allows users to to arbitrary setup work. The default implementation is empty, but this can be overridden by a derived class.

◆ userWork()

virtual void criptic::Prob::userWork ( const Real  t,
Real dt,
gas::Gas gasBG,
propagation::Propagation prop,
CRTree tree 
)
inlinevirtual

Perform arbitrary user-defined work every time step.

Parameters
tCurrent time
dtSize of next time step
gasBGGas object describing the background gas
propPropagation object describing the CR propagation model
treeThe tree containing the current CR packets and sources

This function is called at the end of every time step, and allows users to perform arbitrary calculations or modifications to the state of the simulation. The default implementation is empty, but this can be overriden by a derived class.

◆ userWrite()

virtual void criptic::Prob::userWrite ( const int  step,
const Real  t,
const Real  dt,
const int  chkNum,
const std::string &  baseChkName,
const CRTree tree 
)
inlinevirtual

Perform arbitrary user-defined work after writing a checkpoint.

Parameters
stepThe step number at which the checkpoint is written
tThe time at which the checkpoint is written
dtThe size of the next time step
chkNumThe checkpoint number that was just written
baseChkNameThe base name of the checkpoint file
treeThe CRTree containing the current state

This function is called whenever a checkpoint is written, and allows the user to perform arbitrary output, e.g., write out additional diagnostics. The default implementation is empty, but this can be overridden by a derived class.

Member Data Documentation

◆ geom

const Geometry& criptic::Prob::geom
protected

Problem geometry

◆ pp

const ParmParser& criptic::Prob::pp
protected

ParmParser object containing problem parameters

◆ rng

const RngThread& criptic::Prob::rng
protected

Random number generator


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