An open source method of characteristics neutron transport code.
|
The arbitrary quadrature parent class. More...
#include "src/Quadrature.h"
Public Member Functions | |
Quadrature () | |
Dummy constructor sets the default number of angles to zero. | |
size_t | getNumPolarAngles () const |
Returns the number of polar angles. More... | |
size_t | getNumAzimAngles () const |
Returns the number of azimuthal angles. More... | |
double | getSinTheta (size_t azim, size_t polar) const |
Returns the value for a particular polar angle. More... | |
double | getSinThetaInline (size_t azim, size_t polar) const |
Returns the value for a particular polar angle. More... | |
double | getTheta (size_t azim, size_t polar) const |
Returns the polar angle in radians for a given azimuthal and polar angle index. More... | |
double | getPhi (size_t azim) const |
Returns the azimuthal angle value in radians. More... | |
double | getAzimWeight (size_t azim) const |
Returns the azimuthal angle weight value for a particular azimuthal angle. More... | |
double | getPolarWeight (size_t azim, size_t polar) const |
Returns the polar weight for a particular azimuthal and polar angle. More... | |
double | getWeight (size_t azim, size_t polar) const |
Returns the total weight for Tracks with the given azimuthal and polar indexes. More... | |
double | getWeightInline (size_t azim, size_t polar) const |
Returns the total weight for Tracks with the given azimuthal and polar indexes without error checking and inlined. More... | |
const std::vector< DoubleVec > & | getSinThetas () const |
Returns a pointer to the Quadrature's vector of polar angle sines . More... | |
const std::vector< DoubleVec > & | getThetas () const |
Returns a reference to the Quadrature's vector of polar angles . More... | |
const DoubleVec & | getPhis () const |
Returns a pointer to the Quadrature's vector of azimuthal angles . More... | |
const DoubleVec & | getAzimWeights () const |
Returns a pointer to the Quadrature's vector of azimuthal weights. More... | |
const std::vector< DoubleVec > & | getPolarWeights () const |
Returns a pointer to the Quadrature's vector of polar weights. More... | |
QuadratureType | getQuadratureType () const |
Returns the type of Quadrature created. More... | |
const DoubleVec & | getAzimSpacings () const |
Returns an vector of adjusted azimuthal spacings. More... | |
double | getAzimSpacing (size_t azim) const |
Returns the adjusted azimuthal spacing at the requested azimuthal angle index. More... | |
const std::vector< DoubleVec > & | getPolarSpacings () const |
Returns a 2D vector of adjusted polar spacings. More... | |
double | getPolarSpacing (size_t azim, size_t polar) const |
Returns the adjusted polar spacing at the requested azimuthal angle index and polar angle index. More... | |
virtual void | setNumAzimAngles (size_t num_azim) |
Set the number of azimuthal angles to initialize. More... | |
virtual void | setNumPolarAngles (size_t num_polar) |
Set the number of polar angles to initialize. More... | |
void | setThetas (const DoubleVec &thetas) |
Sets the Quadrature's vector of polar angles. More... | |
void | setPolarWeights (const DoubleVec &weights) |
Set the Quadrature's vector of polar weights. More... | |
void | setTheta (double theta, size_t azim, size_t polar) |
Sets the polar angle for the given indexes. More... | |
void | setPhi (double phi, size_t azim) |
Sets the azimuthal angle for the given index. More... | |
void | setAzimSpacing (double spacing, size_t azim) |
Sets the azimuthal spacing for the given index. More... | |
void | setPolarSpacing (double spacing, size_t azim, size_t polar) |
Sets the polar spacing for the given indexes. More... | |
void | setAzimWeight (double weight, size_t azim) |
Sets the azimuthal weight for the given index. More... | |
void | setPolarWeight (double weight, size_t azim, size_t polar) |
Sets the polar weight for the given indexes. More... | |
virtual void | initialize () |
Initialize the polar quadrature azimuthal angles. More... | |
virtual void | precomputeWeights (bool solve_3D) |
This private routine computes the product of the sine thetas and weights for each angle in the polar quadrature. More... | |
std::string | toString () const |
Converts this Quadrature to a character vector of its attributes. More... | |
Static Protected Member Functions | |
template<typename T > | |
static void | resize2D (std::vector< std::vector< T > > &vec, size_t dim1, size_t dim2) |
Protected Attributes | |
QuadratureType | _quad_type |
size_t | _num_azim |
size_t | _num_polar |
std::vector< DoubleVec > | _sin_thetas |
std::vector< DoubleVec > | _thetas |
DoubleVec | _phis |
DoubleVec | _azim_spacings |
DoubleVec | _azim_weights |
std::vector< DoubleVec > | _polar_spacings |
std::vector< DoubleVec > | _polar_weights |
std::vector< DoubleVec > | _total_weights |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Quadrature &quad) |
Prints to the provided output stream. More... | |
The arbitrary quadrature parent class.
double Quadrature::getAzimSpacing | ( | size_t | azim | ) | const |
Returns the adjusted azimuthal spacing at the requested azimuthal angle index.
The azimuthal spacing depends on the azimuthal angle. This function returns the azimuthal spacing used at the desired azimuthal angle index.
azim | the requested azimuthal angle index |
const DoubleVec & Quadrature::getAzimSpacings | ( | ) | const |
Returns an vector of adjusted azimuthal spacings.
An vector of azimuthal spacings after adjustment is returned, indexed by azimuthal angle
double Quadrature::getAzimWeight | ( | size_t | azim | ) | const |
Returns the azimuthal angle weight value for a particular azimuthal angle.
azim | index of the azimuthal angle of interest |
const DoubleVec & Quadrature::getAzimWeights | ( | ) | const |
Returns a pointer to the Quadrature's vector of azimuthal weights.
size_t Quadrature::getNumAzimAngles | ( | ) | const |
Returns the number of azimuthal angles.
size_t Quadrature::getNumPolarAngles | ( | ) | const |
Returns the number of polar angles.
double Quadrature::getPhi | ( | size_t | azim | ) | const |
Returns the azimuthal angle value in radians.
azim | index of the azimthal angle of interest |
const DoubleVec & Quadrature::getPhis | ( | ) | const |
Returns a pointer to the Quadrature's vector of azimuthal angles .
double Quadrature::getPolarSpacing | ( | size_t | azim, |
size_t | polar | ||
) | const |
Returns the adjusted polar spacing at the requested azimuthal angle index and polar angle index.
The polar spacing depends on the azimuthal angle and the polar angle. This function returns the azimuthal spacing used at the desired azimuthal angle and polar angle indexes.
azim | the requested azimuthal angle index |
polar | the requested polar angle index |
const std::vector< DoubleVec > & Quadrature::getPolarSpacings | ( | ) | const |
Returns a 2D vector of adjusted polar spacings.
An vector of polar spacings after adjustment is returned, indexed first by azimuthal angle and then by polar angle
double Quadrature::getPolarWeight | ( | size_t | azim, |
size_t | polar | ||
) | const |
Returns the polar weight for a particular azimuthal and polar angle.
azim | index of the azimthal angle of interest |
polar | index of the polar angle of interest |
const std::vector< DoubleVec > & Quadrature::getPolarWeights | ( | ) | const |
Returns a pointer to the Quadrature's vector of polar weights.
QuadratureType Quadrature::getQuadratureType | ( | ) | const |
Returns the type of Quadrature created.
double Quadrature::getSinTheta | ( | size_t | azim, |
size_t | polar | ||
) | const |
Returns the value for a particular polar angle.
azim | index of the azimthal angle of interest |
polar | index of the polar angle of interest |
|
inline |
Returns the value for a particular polar angle.
azim | index of the azimthal angle of interest |
polar | index of the polar angle of interest |
azim must be between 0 and _num_azim / 2
const std::vector< DoubleVec > & Quadrature::getSinThetas | ( | ) | const |
Returns a pointer to the Quadrature's vector of polar angle sines .
double Quadrature::getTheta | ( | size_t | azim, |
size_t | polar | ||
) | const |
Returns the polar angle in radians for a given azimuthal and polar angle index.
azim | index of the azimthal angle of interest |
polar | index of the polar angle of interest |
const std::vector< DoubleVec > & Quadrature::getThetas | ( | ) | const |
Returns a reference to the Quadrature's vector of polar angles .
double Quadrature::getWeight | ( | size_t | azim, |
size_t | polar | ||
) | const |
|
inline |
Returns the total weight for Tracks with the given azimuthal and polar indexes without error checking and inlined.
Angular weights are multiplied by Track spacings
azim | index of the azimuthal angle of interest |
polar | index of the polar angle of interest |
|
virtual |
Initialize the polar quadrature azimuthal angles.
The parent class routine simply checks that number of polar and azimuthal angles have been set by the user and generates the azimuthal angles if not already generated.
Reimplemented in EqualAnglePolarQuad, EqualWeightPolarQuad, GLPolarQuad, LeonardPolarQuad, and TYPolarQuad.
|
virtual |
This private routine computes the product of the sine thetas and weights for each angle in the polar quadrature.
Note that this routine must be called after populating the sine thetas and weights vectors.
Reimplemented in EqualAnglePolarQuad, EqualWeightPolarQuad, GLPolarQuad, LeonardPolarQuad, and TYPolarQuad.
void Quadrature::setAzimSpacing | ( | double | spacing, |
size_t | azim | ||
) |
Sets the azimuthal spacing for the given index.
spacing | the spacing (cm) in the azimuthal direction to be set |
azim | the azimuthal index |
void Quadrature::setAzimWeight | ( | double | weight, |
size_t | azim | ||
) |
Sets the azimuthal weight for the given index.
weight | the weight of the azimuthal angle |
azim | the azimuthal index |
|
virtual |
Set the number of azimuthal angles to initialize.
num_azim | the number of azimuthal angles |
|
virtual |
Set the number of polar angles to initialize.
num_polar | the number of polar angles |
Reimplemented in EqualAnglePolarQuad, EqualWeightPolarQuad, GLPolarQuad, LeonardPolarQuad, and TYPolarQuad.
void Quadrature::setPhi | ( | double | phi, |
size_t | azim | ||
) |
Sets the azimuthal angle for the given index.
phi | the value in radians of the azimuthal angle to be set |
azim | the azimuthal index |
void Quadrature::setPolarSpacing | ( | double | spacing, |
size_t | azim, | ||
size_t | polar | ||
) |
Sets the polar spacing for the given indexes.
spacing | the spacing in the polar direction to be set |
azim | the azimuthal index corresponding to the angle |
polar | the polar index corresponding to the angle |
void Quadrature::setPolarWeight | ( | double | weight, |
size_t | azim, | ||
size_t | polar | ||
) |
Sets the polar weight for the given indexes.
weight | the weight of the polar angle |
azim | the azimuthal index corresponding to the angle |
polar | the polar index corresponding to the angle |
void Quadrature::setPolarWeights | ( | const DoubleVec & | weights | ) |
Set the Quadrature's vector of polar weights.
This method is a helper function to allow OpenMOC users to assign the Quadrature's polar weights in Python. A user must initialize a NumPy array of the correct size (e.g., a float64 vector the length of the number of azimuthal times polar angles) as input to this function. This function then fills the Quadrature's polar weights with the given values. An example of how this function might be called in Python is as follows:
weights | The polar weights |
void Quadrature::setTheta | ( | double | theta, |
size_t | azim, | ||
size_t | polar | ||
) |
Sets the polar angle for the given indexes.
theta | the value in radians of the polar angle to be set |
azim | the azimuthal index of the angle of interest |
polar | the polar index of the angle of interest |
void Quadrature::setThetas | ( | const DoubleVec & | thetas | ) |
Sets the Quadrature's vector of polar angles.
This method is a helper function to allow OpenMOC users to assign the Quadrature's polar angles in Python. A user must initialize a NumPy array of the correct size (e.g., a float64 vector the length of the number of azimuthal times polar angles) as input to this function. This function then fills the Quadrature's polar angles with the given values. An example of how this function might be called in Python is as follows:
thetas | the vector of polar angle for each azimuthal/polar angle combination |
std::string Quadrature::toString | ( | ) | const |
Converts this Quadrature to a character vector of its attributes.
The character vector includes the number of polar angles, the the values of the sine and weight of each polar angle, and the product of the sine and weight of each polar angle.
|
friend |
Prints to the provided output stream.
Allows printing the Quadrature using <<
os | the provided stream to write to |
quad | the quadrature object which is printed |
|
protected |
The actual track azimuthal spacing (cm) by azimuthal angle
|
protected |
An array of the quadrature azimuthal weights
|
protected |
The number of azimuthal angles in (0, 2*PI)
|
protected |
The number of polar angles in (0, PI)
|
protected |
An array of the quadrature azimuthal angles
|
protected |
The actual track polar spacing (cm) by (azim, polar)
|
protected |
An array of the quadrature polar weights
|
protected |
The quadrature type being used
|
protected |
An array of the sines of quadrature polar angles
|
protected |
An array of the quadrature polar angles
|
protected |
An array of the total weights for each azimuthal/polar angle pair