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

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, nFieldQtygetWgt (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.
 
Realoperator[] (int i)
 Return an element of the FieldQty.
 
const Realoperator[] (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, nFieldQtyoperator/ (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.
 
FieldQtyoperator*= (const Real &a)
 Multiply a FieldQty by a scalar.
 
FieldQtyoperator/= (const Real &a)
 Divide a FieldQty by a scalar.
 
FieldQtyoperator+= (const FieldQty &a)
 Add a FieldQty object to this one.
 
FieldQtyoperator-= (const FieldQty &a)
 Subtract a FieldQty object from this one.
 

Public Attributes

std::array< Real, nFieldQtyq
 

Static Public Attributes

static constexpr int qtyNameLen = 8
 
static constexpr std::array< char[qtyNameLen], nFieldQtyqtyNames
 
static constexpr std::array< Real, nFieldQtyqtyUnits
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FieldQty()

criptic::FieldQty::FieldQty ( )
inline

Construct a field quantity filled with zeros.

Member Function Documentation

◆ addPacket()

void criptic::FieldQty::addPacket ( const CRPacket pkt,
const RealVec r,
const RealTensor2 h2Inv 
)
inline

Add contribution of packet to field quantities at target point.

Parameters
pktPacket being added
rVector from packet to target point
h2InvSquared 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.

◆ getWgt()

std::array< Real, nFieldQty > criptic::FieldQty::getWgt ( const CRPacket pkt) const
inline

Get weight with which packet contributes to field quantities.

Parameters
pktPacket whose weight is being computed
Returns
Weight of the packet in all quantities

The weights returned are the quantities that are multiplied by the kernel density weight to estimate the field quantities at a given point.

◆ operator*()

criptic::FieldQty::operator* ( const Real  a) const
inline

Multiply a FieldQty by a scalar.

Parameters
aThe scalar by which to multiply
Returns
A FieldQty containing the elementwise product

◆ operator*=()

criptic::FieldQty::operator*= ( const Real a)
inline

Multiply a FieldQty by a scalar.

Parameters
aThe scalar by which to multiply
Returns
This FieldQty multiplied by a

◆ operator+()

criptic::FieldQty::operator+ ( const FieldQty a) const
inline

Add two FieldQty objects.

Parameters
aThe FieldQty to add
Returns
A FieldQty containing the elementwise sum

◆ operator+=()

criptic::FieldQty::operator+= ( const FieldQty a)
inline

Add a FieldQty object to this one.

Parameters
aThe FieldQty to add
Returns
This FieldQty

◆ operator-()

criptic::FieldQty::operator- ( const FieldQty a) const
inline

Subtract two FieldQty objects.

Parameters
aThe FieldQty to subtract
Returns
A FieldQty containing the elementwise difference

◆ operator-=()

criptic::FieldQty::operator-= ( const FieldQty a)
inline

Subtract a FieldQty object from this one.

Parameters
aThe FieldQty to subtract
Returns
This FieldQty

◆ operator/() [1/2]

criptic::FieldQty::operator/ ( const FieldQty a) const
inline

Divide two FieldQty objects.

Parameters
aThe FieldQty by which to divide
Returns
An array containing the elementwise division

◆ operator/() [2/2]

criptic::FieldQty::operator/ ( const Real  a) const
inline

Divide a FieldQty by a scalar.

Parameters
aThe scalar by which to divide
Returns
A FieldQty containing the elementwise dividend

◆ operator/=()

criptic::FieldQty::operator/= ( const Real a)
inline

Divide a FieldQty by a scalar.

Parameters
aThe scalar by which to divide
Returns
This FieldQty divided by a

◆ operator[]() [1/2]

criptic::FieldQty::operator[] ( int  i)
inline

Return an element of the FieldQty.

Parameters
iThe index of the quantity to return
Returns
The value of quantity t

◆ operator[]() [2/2]

criptic::FieldQty::operator[] ( int  i) const
inline

Return an element of the FieldQty.

Parameters
iThe index of the quantity to return
Returns
The value of quantity t

◆ setZero()

void criptic::FieldQty::setZero ( )
inline

Set all field quantities to zero.

Member Data Documentation

◆ q

std::array<Real,nFieldQty> criptic::FieldQty::q

Array of field quantities

◆ qtyNameLen

constexpr int criptic::FieldQty::qtyNameLen = 8
staticconstexpr

Maximum length of a quantity name

◆ qtyNames

constexpr std::array<char[qtyNameLen],nFieldQty> criptic::FieldQty::qtyNames
staticconstexpr
Initial value:
=
{{ "nden", "pres", "eden" }}

Names of field quantities used in ASCII output

◆ qtyUnits

constexpr std::array<Real,nFieldQty> criptic::FieldQty::qtyUnits
staticconstexpr
Initial value:
= {
}
static constexpr Real mp_c2
Definition Constants.H:118
static constexpr Real kB
Definition Constants.H:41
static constexpr Real eV
Definition Units.H:34

Unit conversions from internal to ASCII output units


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