|
criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
|
The primary namespace for criptic objects. More...
Namespaces | |
| namespace | constants |
| A namespace to hold physcial constants. | |
| namespace | gas |
| A namespace to hold quantities related to the background gas. | |
| namespace | MPIUtil |
| A namespace to hold variables and functions related to MPI. | |
| namespace | partTypes |
| A namespace to hold properties of elementary particles. | |
| namespace | propagation |
| A namespace to hold quantities related to CR propagation. | |
| namespace | rkf |
| A namespace to hold the Runge-Kutta-Fehlberg coefficients. | |
| namespace | sr |
| A namespace to hold special relativistic functions. | |
| namespace | units |
| A namespace to hold unit conversions. | |
Classes | |
| class | CheckpointManager |
| A class to write and read checkpoint files. More... | |
| class | CRPacket |
| A class that holds data to describe a CR packet. More... | |
| class | CRSource |
| A class to describe a source of CR packets. More... | |
| class | CRTree |
| A class to manage CR packets and sources. More... | |
| class | CRTreeCommunicator |
| Class to manage communications during tree walks. More... | |
| class | FieldQty |
| Class to hold and compute field quantities. More... | |
| class | FieldQtyGrad |
| Class to hold and compute gradients of field quantities. More... | |
| class | GasNode |
| A class to store information of nodes in a GasTree. More... | |
| class | GasTree |
| A class to manage Gas packets for Lagrangian gas descriptions. More... | |
| class | Geometry |
| A class that describes the geometry of a calculation. More... | |
| class | GizmoReader |
| A class to hold all relevant data from a GIZMO snapshot file. More... | |
| struct | GlobalNode |
| Struct representing a node of the global KD tree. More... | |
| class | Interp1D |
| A class to handle interpolation on 1D tables. More... | |
| class | Interp2D |
| A class to handle interpolation on 2D tables. More... | |
| struct | LocalNodeStruct_ |
| Struct representing a node of the local KD tree. More... | |
| class | ParmParser |
| Class to parse the criptic input deck. More... | |
| class | Prob |
| A class to manage user-defined problem setup and work. More... | |
| class | RealBox |
| Class that represents a 3D rectangular prism. More... | |
| class | RealTensor2 |
| Class that represents a rank 2 tensor. More... | |
| class | RngThread |
| Thread-safe random number generator. More... | |
| class | ThreadVec |
| A class to automate private thread copies of objects. More... | |
| struct | TNBBasis |
| Structure to hold TNB basis data. More... | |
| class | Vec3 |
| Class that represents a mathematical vector. More... | |
Typedefs | |
| typedef struct criptic::LocalNodeStruct_ | LocalNode |
| Struct representing a node of the local KD tree. | |
| using | Real = double |
| using | IdxType = std::vector< Real >::size_type |
| using | SignedIdxType = std::ptrdiff_t |
| typedef Vec3< Real > | RealVec |
| typedef Vec3< IdxType > | IdxVec |
| typedef Vec3< SignedIdxType > | SIdxVec |
| typedef Vec3< bool > | BoolVec |
Enumerations | |
| enum | FieldQtyType { ndenIdx = 0 , presIdx , edenIdx , nFieldQty } |
| Enum of field quantities. More... | |
| enum | FieldQtyNeedType { noFieldQty = 0 , needFieldQty , needFieldQtyGrad } |
| Enum of types of field quantities to be computed. More... | |
| enum | errCodes { errNoError , errBadCommandLine , errBadInputFile , errBadCheckpoint , errBadGridSpecification , errBadXLoExtrapolation , errBadXHiExtrapolation , errBadYLoExtrapolation , errBadYHiExtrapolation , errBadXYExtrapolation , errNotImplemented , errTimeStepTooSmall , errInvalidTimeStep , errUnspecified , nErrCodes } |
| List of error return codes. More... | |
| enum | extrapType { extrapError , extrapLinear , extrapConst , extrapFixedVal } |
| Enum describing different ways to handle extrapolation. More... | |
Functions | |
| criptic::Real | advancePacket (const criptic::Real tStart, const criptic::Real tStop, const criptic::Geometry &geom, const criptic::gas::Gas &gasBG, const criptic::propagation::Propagation &prop, const criptic::Losses &loss, const criptic::RngThread &rng, const criptic::FieldQty &qty, const criptic::FieldQtyGrad &qtyGrad, const criptic::Real cStep, const criptic::Real errTol, const criptic::Real wFracMin, const criptic::Real pMin, const criptic::Real TMin, const criptic::Real packetDtMin, const criptic::Real &h, criptic::RealVec &x, criptic::CRPacket &packet, criptic::Real &dt, std::vector< RealVec > &secondaryPositions, std::vector< CRPacket > &secondaryPackets) |
| Advance a packet by the specified time. | |
| criptic::FieldQty | operator* (const criptic::Real a, const criptic::FieldQty &fq) |
| Multiply a scalar by a FieldQty elementwise. | |
| criptic::FieldQty | min (const criptic::FieldQty &q1, const criptic::FieldQty &q2) |
| Take elementwise minimum of two FieldQty objects. | |
| criptic::FieldQty | max (const criptic::FieldQty &q1, const criptic::FieldQty &q2) |
| Take elementwise maximum of two FieldQty objects. | |
| criptic::FieldQtyGrad | operator* (const criptic::Real a, const criptic::FieldQtyGrad &fqg) |
| Multiply a scalar by a FieldQtyGrad elementwise. | |
| criptic::FieldQtyGrad | operator* (const criptic::RealVec &a, const criptic::FieldQtyGrad &fqg) |
| Multiply a RealVec by a FieldQtyGrad elementwise. | |
| criptic::FieldQtyGrad | min (const criptic::FieldQtyGrad &q1, const criptic::FieldQtyGrad &q2) |
| Take elementwise minimum of two FieldQtyGrad objects. | |
| criptic::FieldQtyGrad | max (const criptic::FieldQtyGrad &q1, const criptic::FieldQtyGrad &q2) |
| Take elementwise maximum of two FieldQtyGrad objects. | |
| Prob * | initProb (const criptic::ParmParser &pp, const criptic::Geometry &geom, criptic::RngThread &rng) |
| Function to return the Prob object. | |
| criptic::RealTensor2 | operator+ (const criptic::Real a, const criptic::RealTensor2 &t) |
| Add a scalar and a RealTensor2 elementwise. | |
| criptic::RealTensor2 | operator- (const criptic::Real a, const criptic::RealTensor2 &t) |
| Subtract a scalar from a RealTensor2 elementwise. | |
| criptic::RealTensor2 | operator* (const criptic::Real a, const criptic::RealTensor2 &t) |
| Multiply a scalar by a RealTensor2 elementwise. | |
| criptic::RealTensor2 | operator/ (const criptic::Real a, const criptic::RealTensor2 &t) |
| Divide a RealTensor2 by a scalar elementwise. | |
| criptic::RealTensor2 | outer (const criptic::RealVec &v1, const criptic::RealVec &v2) |
| Compute the outer product of two RealVec objects. | |
| TNBBasis | TNBVectors (const RealVec &v, const RealTensor2 &vGrad) |
| Compute tangent, normal, and binormal vectors. | |
| template<class T , class U , std::enable_if_t< std::is_arithmetic< T >::value, bool > = true> | |
| auto | operator+ (const T &a, const Vec3< U > &v) -> Vec3< decltype(a+v[0])> |
| Add a scalar and a Vec3 elementwise. | |
| template<class T , class U , std::enable_if_t< std::is_arithmetic< T >::value, bool > = true> | |
| auto | operator- (const T &a, const Vec3< U > &v) -> Vec3< decltype(a-v[0])> |
| Subtract a scalar from a Vec3 elementwise. | |
| template<class T , class U , std::enable_if_t< std::is_arithmetic< T >::value, bool > = true> | |
| auto | operator* (const T &a, const Vec3< U > &v) -> Vec3< decltype(a *v[0])> |
| Multiply a scalar by a Vec3 elementwise. | |
| template<class T , class U , std::enable_if_t< std::is_arithmetic< T >::value, bool > = true> | |
| auto | operator/ (const T &a, const Vec3< U > &v) -> Vec3< decltype(a/v[0])> |
| Divide a Vec3 by a scalar elementwise. | |
| template<class T , class U , std::enable_if_t< std::is_arithmetic< T >::value||std::is_enum< T >::value, bool > = true> | |
| Vec3< bool > | operator== (const T &a, const Vec3< U > &v) |
| Evaluate equality of a Vec3 with a scalar elementwise. | |
| template<class T , class U , std::enable_if_t< std::is_arithmetic< T >::value||std::is_enum< T >::value, bool > = true> | |
| Vec3< bool > | operator!= (const T &a, const Vec3< U > &v) |
| Evaluate inequality of a Vec3 with a scalar elementwise. | |
| template<class T , class U > | |
| auto | min (const criptic::Vec3< T > &v1, const criptic::Vec3< U > &v2) -> Vec3< decltype(v1[0]+v2[0])> |
| Return the elementwise minimum of two Vec3's. | |
| template<class T , class U > | |
| auto | max (const criptic::Vec3< T > &v1, const criptic::Vec3< U > &v2) -> Vec3< decltype(v1[0]+v2[0])> |
| Return the elementwise maximum of two Vec3's. | |
| template<class T > | |
| Vec3< T > | floor (const criptic::Vec3< T > &v) |
| Return the elementwise floor of a Vec3. | |
Variables | |
| constexpr IdxType | rootNode = 0 |
| constexpr IdxType | nullNode = maxIdx |
| constexpr IdxType | nullPacket = maxIdx |
| constexpr IdxType | extNode = ~(nullNode >> 1) |
| const std::array< const std::array< char, 80 >, nErrCodes > | errCodeStrings |
| static const criptic::RealTensor2 | zeroTensor (0, 0, 0, 0, 0, 0, 0, 0, 0) |
| static const criptic::RealTensor2 | identityTensor (1, 0, 0, 0, 1, 0, 0, 0, 1) |
| constexpr Real | maxReal |
| constexpr Real | eps |
| constexpr IdxType | maxInt |
| constexpr IdxType | maxIdx |
| constexpr IdxType | nullIdx = maxIdx |
| static const RealVec | zeroVec (0, 0, 0) |
| static const RealVec | identityVec (1, 1, 1) |
| static const RealVec | xHat (1, 0, 0) |
| static const RealVec | yHat (0, 1, 0) |
| static const RealVec | zHat (0, 0, 1) |
| static const IdxVec | zeroIdxVec (0, 0, 0) |
| static const SIdxVec | zeroSIdxVec (0, 0, 0) |
| static const BoolVec | trueVec (1, 1, 1) |
| static const BoolVec | falseVec (1, 1, 1) |
The primary namespace for criptic objects.
| typedef Vec3<bool> criptic::BoolVec |
Alias for a Vec3 of bool
| using criptic::IdxType = typedef std::vector<Real>::size_type |
Type for indices
| typedef Vec3<IdxType> criptic::IdxVec |
Alias for a Vec3 indices
| typedef struct criptic::LocalNodeStruct_ criptic::LocalNode |
Struct representing a node of the local KD tree.
This structure represents a node of the local KD tree, which organizes the data within a single MPI rank.
| using criptic::Real = typedef double |
Real number type
| typedef Vec3<Real> criptic::RealVec |
Alias for a Vec3 of Real
| typedef Vec3<SignedIdxType> criptic::SIdxVec |
Alias for a Vec3 of signed indices
| using criptic::SignedIdxType = typedef std::ptrdiff_t |
Signed type for indices
| enum criptic::errCodes |
List of error return codes.
| enum criptic::extrapType |
| criptic::Real criptic::advancePacket | ( | const criptic::Real | tStart, |
| const criptic::Real | tStop, | ||
| const criptic::Geometry & | geom, | ||
| const criptic::gas::Gas & | gasBG, | ||
| const criptic::propagation::Propagation & | prop, | ||
| const criptic::Losses & | loss, | ||
| const criptic::RngThread & | rng, | ||
| const criptic::FieldQty & | qty, | ||
| const criptic::FieldQtyGrad & | qtyGrad, | ||
| const criptic::Real | cStep, | ||
| const criptic::Real | errTol, | ||
| const criptic::Real | wFracMin, | ||
| const criptic::Real | pMin, | ||
| const criptic::Real | TMin, | ||
| const criptic::Real | packetDtMin, | ||
| const criptic::Real & | h, | ||
| criptic::RealVec & | x, | ||
| criptic::CRPacket & | packet, | ||
| criptic::Real & | dt, | ||
| std::vector< RealVec > & | secondaryPositions, | ||
| std::vector< CRPacket > & | secondaryPackets | ||
| ) |
Advance a packet by the specified time.
| tStart | Start time of advance |
| tStop | Stop time of advance |
| geom | Object describing problem geometry |
| gasBG | Object describing background gas |
| prop | Object describing propagation parameters |
| loss | Object that computes loss rates |
| rng | Random number generator |
| qty | Packet field quantities |
| qtyGrad | Gradients of packet field quantities |
| cStep | CFL-like parameter controlling step size |
| errTol | Tolerance in integration along field lines |
| wFracMin | Minimum statistical weight relative to starting |
| pMin | Minimum momentum |
| TMin | Minimum kinetic energy |
| packetDtMin | Minimum allowed time step for individual packet |
| h | Packet scale length |
| x | Packet position |
| packet | Packet properties |
| dt | Internal time step used to advance packet |
| secondaryPositions | Positions of any secondary packets created |
| secondaryPackets | Properties of any secondary packets created |
This routine advances a single packet through from tStart to tStop. On return, x and packet will have been updated to new values. The minimum internal time step required to advance the packet is stored as dt, and the time to which the packet was advanced is returned; this may be less than tStop if the packet left the computational domain or was destroyed by a loss mechanism. If the packet is to be deleted for this reason, packet.w will be set to a negative value.
|
inline |
| Prob * criptic::initProb | ( | const criptic::ParmParser & | pp, |
| const criptic::Geometry & | geom, | ||
| criptic::RngThread & | rng | ||
| ) |
Function to return the Prob object.
| pp | The criptic::ParmParser object containing the input deck |
| geom | The problem geometry object |
| rng | The random number generator |
In this routine it is the user's responsibility to allocate and return a pointer to an object of class criptic::Prob. This object allows the user to specify the background gas and cosmic ray propagation models, and to specify problem initialization and problem-specific work to be carried out at various poins during the simulation.
|
inline |
|
inline |
Take elementwise maximum of two FieldQtyGrad objects.
| q1 | The first FieldQtyGrad |
| q2 | The second FieldQtyGrad |
|
inline |
|
inline |
|
inline |
Take elementwise minimum of two FieldQtyGrad objects.
| q1 | The first FieldQtyGrad |
| q2 | The second FieldQtyGrad |
|
inline |
|
inline |
Evaluate inequality of a Vec3 with a scalar elementwise.
| a | The scalar |
| v | The Vec3 |
|
inline |
|
inline |
Multiply a scalar by a FieldQtyGrad elementwise.
| a | The scalar |
| fqg | The FieldQtyGrad |
|
inline |
Multiply a scalar by a RealTensor2 elementwise.
| a | The scalar |
| t | The RealTensor2 |
|
inline |
Multiply a RealVec by a FieldQtyGrad elementwise.
| a | The RealVec |
| fqg | The FieldQtyGrad |
|
inline |
Add a scalar and a RealTensor2 elementwise.
| a | The scalar |
| t | The RealTensor2 |
|
inline |
Subtract a scalar from a RealTensor2 elementwise.
| a | The scalar |
| t | The RealTensor2 |
|
inline |
Divide a RealTensor2 by a scalar elementwise.
| a | The scalar |
| t | The RealTensor2 |
|
inline |
Evaluate equality of a Vec3 with a scalar elementwise.
| a | The scalar |
| v | The Vec3 |
|
inline |
Compute the outer product of two RealVec objects.
| v1 | The first vector |
| v2 | The second vector |
|
inline |
Compute tangent, normal, and binormal vectors.
| v | The vector field |
| vGrad | The gradient of v |
This routine computes the tangent, normal, and binormal vectors of a vector field.
|
constexpr |
Precision of real numbers
| const std::array<const std::array<char, 80>, nErrCodes> criptic::errCodeStrings |
Descriptive strings for error codes
|
static |
Vector of all false
|
static |
The identity tensor
|
static |
The identity vector
|
constexpr |
Maximum index
|
constexpr |
Maximum integer
|
constexpr |
Maximum real number
|
constexpr |
Index of root node
|
static |
Vector of all true
|
static |
The x unit vector
|
static |
The y unit vector
|
static |
The zero index vector
|
static |
The signed zero index vector
|
static |
The zero tensor
|
static |
The zero vector
|
static |
The z unit vector