|
criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
|
Class to hold and compute field quantities. More...
#include <FieldQty.H>
Public Member Functions | |
| FieldQty () | |
| Construct a field quantity filled with zeros. | |
| void | setZero () |
| Set all field quantities to zero. | |
| std::array< Real, nFieldQty > | getWgt (const CRPacket &pkt) const |
| Get weight with which packet contributes to field quantities. | |
| void | addPacket (const CRPacket &pkt, const RealVec &r, const RealTensor2 &h2Inv) |
| Add contribution of packet to field quantities at target point. | |
| Real & | operator[] (int i) |
| Return an element of the FieldQty. | |
| const Real & | operator[] (int i) const |
| Return an element of the FieldQty. | |
| FieldQty | operator+ (const FieldQty &a) const |
| Add two FieldQty objects. | |
| FieldQty | operator- (const FieldQty &a) const |
| Subtract two FieldQty objects. | |
| std::array< Real, nFieldQty > | operator/ (const FieldQty &a) const |
| Divide two FieldQty objects. | |
| FieldQty | operator* (const Real a) const |
| Multiply a FieldQty by a scalar. | |
| FieldQty | operator/ (const Real a) const |
| Divide a FieldQty by a scalar. | |
| FieldQty & | operator*= (const Real &a) |
| Multiply a FieldQty by a scalar. | |
| FieldQty & | operator/= (const Real &a) |
| Divide a FieldQty by a scalar. | |
| FieldQty & | operator+= (const FieldQty &a) |
| Add a FieldQty object to this one. | |
| FieldQty & | operator-= (const FieldQty &a) |
| Subtract a FieldQty object from this one. | |
Public Attributes | |
| std::array< Real, nFieldQty > | q |
Static Public Attributes | |
| static constexpr int | qtyNameLen = 8 |
| static constexpr std::array< char[qtyNameLen], nFieldQty > | qtyNames |
| static constexpr std::array< Real, nFieldQty > | qtyUnits |
Class to hold and compute field quantities.
In criptic, "field quantities" are quantities that can be computed from the CR field, for example the CR energy density or pressure. This class holds the field quantities and provides methods for computing them. Note that the algorithm used to compute field quantities assumes they are positive definite.
|
inline |
Construct a field quantity filled with zeros.
|
inline |
Add contribution of packet to field quantities at target point.
| pkt | Packet being added |
| r | Vector from packet to target point |
| h2Inv | Squared inverse of bandwidth matrix |
The addition done in this routine is non-normalized, so once all packets have been added, divide by (2 pi)^(3/2) det(h) to get properly normalized quantities.
Get weight with which packet contributes to field quantities.
| pkt | Packet whose weight is being computed |
The weights returned are the quantities that are multiplied by the kernel density weight to estimate the field quantities at a given point.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return an element of the FieldQty.
| i | The index of the quantity to return |
|
inline |
Return an element of the FieldQty.
| i | The index of the quantity to return |
|
inline |
Set all field quantities to zero.
|
staticconstexpr |
Maximum length of a quantity name
|
staticconstexpr |
Names of field quantities used in ASCII output
Unit conversions from internal to ASCII output units