A monte carlo pin cell spectral code for nuclear engineering applications.
|
A Tally reprsents a set of bins for tallying some quantity. More...
#include "pinspec/src/Tally.h"
Public Member Functions | |
Tally (char *tally_name=(char *)"") | |
Tally constructor. More... | |
virtual | ~Tally () |
Tally destructor deletes memory for tallies, number of tallies, bin centers and bin edges (if they have been created). | |
char * | getTallyName () |
Returns the name of the tally. More... | |
int | getNumBins () |
Returns the number of tally bins. More... | |
int | getNumEdges () |
Returns the number of tally edges. More... | |
double * | getBinEdges () |
Returns a double array of bin edge values. More... | |
double * | getBinCenters () |
Returns a double array of bin center values. More... | |
double | getBinDelta () |
Returns the delta spacing between bins. NOTE: this value is only non-zero for EQUAL and LOGARITHMIC bin types. More... | |
double | getBinDelta (double sample) |
Returns the delta spacing between the bin edges sandwiching a given sample value. More... | |
binSpacingType | getBinSpacingType () |
Returns the bin spacing type (EQUAL, LOGARITHMIC, OTHER). More... | |
tallyDomainType | getTallyDomainType () |
Returns the type of tally for these bins (ISOTOPE, MATERIAL, REGION). More... | |
tallyType | getTallyType () |
Returns the type of tally for these bins (FLUX, COLLISION_RATE, etc). More... | |
double ** | getTallies () |
Returns a double array of the tallies within each bin. More... | |
double | getTally (int bin_index, int batch_num) |
Returns a specific tally for a specific bin and batch. More... | |
double | getMaxTally () |
Returns the maximum tally value among all bins and batches. More... | |
double | getMinTally () |
Returns the maximum tally value among all bins and batches. More... | |
int | getBinIndex (double sample) |
Finds the bin index for a sample in a set of bins. If the samples is outside the bounds of all bins, it returns infinity. More... | |
double | getMaxMu () |
Returns the maximum average tally over batches. More... | |
double | getMaxVariance () |
Returns the maximum tally variance over batches. More... | |
double | getMaxStdDev () |
Returns the maximum tally standard deviatoin. More... | |
double | getMaxRelErr () |
Returns the maximum tally relative error. More... | |
float | getTriggerPrecision () |
Returns the trigger precision for this tally. More... | |
triggerType | getTriggerType () |
Returns the precision trigger type (VARIANCE, STANDARD_DEVIATION, RELATIVE_ERROR, or NONE). More... | |
bool | hasComputedBatchStatistics () |
Returns whether or not the tally has computed batch statistics. More... | |
bool | hasExpandedGroupBins () |
Returns whether or not the tally has expanded it's group bins. More... | |
void | retrieveTallyEdges (double *data, int num_bins) |
This method fills an array with the tally bin edges. More... | |
void | retrieveTallyCenters (double *data, int num_bins) |
This method fills an array with the tally bin centers. More... | |
void | retrieveTallyMu (double *data, int num_bins) |
This method fills an array with the average tally values. More... | |
void | retrieveTallyVariance (double *data, int num_bins) |
This method fills an array with the tally variances. More... | |
void | retrieveTallyStdDev (double *data, int num_bins) |
This method fills an array with the tally standard deviations. More... | |
void | retrieveTallyRelErr (double *data, int num_bins) |
This method fills an array with the tally relative errors. More... | |
int | getNumBatches () |
Returns the number of batches for this tally. More... | |
double * | getBatchMu () |
Returns a pointer to an array of tally batch averages if they have been computed. More... | |
double * | getBatchVariance () |
Returns a pointer to an array of tally batch variances if they have been computed. More... | |
double * | getBatchStdDev () |
Returns a pointer to an array of tally batch standard deviations if they have been computed. More... | |
double * | getBatchRelativeError () |
Returns a pointer to an array of tally batch relative errors if they have been computed. More... | |
void | setTallyDomainType (tallyDomainType type) |
Set the tally domain type (MATERIAL, REGION, etc.). More... | |
void | setTallyType (tallyType type) |
Set the tally type (FLUX, CAPTURE_RATE, etc.). More... | |
void | setBinSpacingType (binSpacingType type) |
Set the bin spacing type for this Tally (EQUAL, LOGARITHMIC, OTHER). More... | |
void | setBinEdges (double *edges, int num_edges) |
Set a user-defined double array of bin edge values. More... | |
void | setGroupExpandBins (bool expand_bins) |
Informs the tally whether or not to expand its group bins. More... | |
void | setPrecisionTrigger (triggerType trigger_type, float precision) |
Sets a precision trigger for this tally. More... | |
void | generateBinEdges (double start, double end, int num_bins, binSpacingType type) |
Generate edges between bins defined by a start and end point. More... | |
void | generateBinCenters () |
Compute the center points between bin edges for this Tally's bins. More... | |
void | setNumBatches (int num_batches) |
Set the number of batches for this Tally. More... | |
void | incrementNumBatches (int num_batches) |
Increments the number of batches for this tally. More... | |
bool | isPrecisionTriggered () |
Returns whether or not the tally precision meets the precision trigger threshold, if a trigger exists. More... | |
void | computeBatchStatistics () |
Computes average, variance, standard deviation and relative error for each bin over the set of batches. More... | |
void | computeScaledBatchStatistics (double scale_factor) |
Computes average, variance, standard deviation and relative error for each bin over the set of batches. More... | |
void | normalizeBatchMu () |
Divide each tally by the maximum tally value. | |
void | outputBatchStatistics (const char *filename) |
Outputs the batch statistics (if they have been computed) to an ASCII file. More... | |
void | printTallies (bool uncertainties=false) |
Print the tally values to the screen. More... | |
Tally * | clone () |
Creates a new version of this tally with identical data. More... | |
void | tally (neutron *neutron, double weight) |
This method tallies a particular weight for a neutron. More... | |
void | tallyGroup (neutron *neutron, double weight) |
This method tallies a particular weight for a neutron for group-to group scattering. More... | |
virtual void | tally (neutron *neutron)=0 |
A virtual method to tally a neutron which must be implemented by Tally subclasses. More... | |
DerivedTally * | tile (const int num_tiles) |
Create a DerivedTally with this tally's data repetively "tiled". More... | |
DerivedTally * | addIntegers (const int *amt, const int length) |
Tally addition with an array of integers. More... | |
DerivedTally * | addFloats (const float *amt, const int length) |
Tally addition with an array of floats. More... | |
DerivedTally * | addDoubles (const double *amt, const int length) |
Tally addition with an array of doubles. More... | |
DerivedTally * | subtractIntegers (const int *amt, const int length) |
Tally subtraction with an array of integers. More... | |
DerivedTally * | subtractFloats (const float *amt, const int length) |
Tally subtraction with an array of floats. More... | |
DerivedTally * | subtractDoubles (const double *amt, const int length) |
Tally subtraction with an array of doubles. More... | |
DerivedTally * | multiplyIntegers (const int *amt, const int length) |
Tally multiplication with an array of integers. More... | |
DerivedTally * | multiplyFloats (const float *amt, const int length) |
Tally multiplication with an array of floats. More... | |
DerivedTally * | multiplyDoubles (const double *amt, const int length) |
Tally multiplication with an array of doubles. More... | |
DerivedTally * | divideIntegers (const int *amt, const int length) |
Tally division with an array of integers. More... | |
DerivedTally * | divideFloats (const float *amt, const int length) |
Tally division with an array of floats. More... | |
DerivedTally * | divideDoubles (const double *amt, const int length) |
Tally division with an array of doubles. More... | |
DerivedTally * | operator+ (Tally *tally) |
Tally addition operator. More... | |
DerivedTally * | operator- (Tally *tally) |
Tally subtraction operator. More... | |
DerivedTally * | operator* (Tally *tally) |
Tally multiplication operator. More... | |
DerivedTally * | operator/ (Tally *tally) |
Tally division operator. More... | |
DerivedTally * | operator+ (const int amt) |
Tally addition with a constant operator. More... | |
DerivedTally * | operator- (const int amt) |
Tally subtraction with a constant operator. More... | |
DerivedTally * | operator* (const int amt) |
Tally multiplication with a constant operator. More... | |
DerivedTally * | operator/ (const int amt) |
Tally division with a constant operator. More... | |
DerivedTally * | operator+ (const float amt) |
Tally addition with a constant operator. More... | |
DerivedTally * | operator- (const float amt) |
Tally subtraction with a constant operator. More... | |
DerivedTally * | operator* (const float amt) |
Tally multiplication with a constant operator. More... | |
DerivedTally * | operator/ (const float amt) |
Tally division with a constant operator. More... | |
DerivedTally * | operator+ (const double amt) |
Tally addition with a constant operator. More... | |
DerivedTally * | operator- (const double amt) |
Tally subtraction with a constant operator. More... | |
DerivedTally * | operator* (const double amt) |
Tally multiplication with a constant operator. More... | |
DerivedTally * | operator/ (const double amt) |
Tally division with a constant operator. More... | |
Protected Attributes | |
char * | _tally_name |
int | _num_bins |
int | _num_edges |
double * | _edges |
double * | _centers |
double ** | _tallies |
double | _bin_delta |
binSpacingType | _bin_spacing |
tallyDomainType | _tally_domain |
tallyType | _tally_type |
triggerType | _trigger_type |
float | _trigger_precision |
int | _num_batches |
double * | _batch_mu |
double * | _batch_variance |
double * | _batch_std_dev |
double * | _batch_rel_err |
bool | _computed_statistics |
bool | _group_expand_bins |
A Tally reprsents a set of bins for tallying some quantity.
This class represents a set of tallies. A set of values define the edges between bins for each tally. This class holds the edges, the centers between bins. It also allows for tallies to be made within each bin.
A set of values define the edges between bins for each tally. This class holds the edges, the centers between bins and the tallies within each bin. The Tally class knows how to compute batch-based statistics for each tally bin. The Tally class is an abstract class and must be implemented for each specific type of Tally the developer might wish to define.
Tally::Tally | ( | char * | tally_name = (char*)"" | ) |
Tally constructor.
Assigns a default number of batches (0) and tally bins (0).
DerivedTally * Tally::addDoubles | ( | const double * | amt, |
const int | length | ||
) |
Tally addition with an array of doubles.
This overloaded division operator allows the user to add a tally to an array of doubles, if the number of values equals the number of tally bins. This creates a new DERIVED type tally, loads it with the sum of the tally bin averages and the array, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python. This method prototype appears to require two operands - the double array and the length of the array - but in Python it only requires the double array as follows:
amt | the right operand and the array to add to the tally |
length | the length of the array |
DerivedTally * Tally::addFloats | ( | const float * | amt, |
const int | length | ||
) |
Tally addition with an array of floats.
This overloaded division operator allows the user to add a tally by an array of floats, if the number of values equals the number of tally bins. This creates a new DERIVED type tally, loads it with the sum of the tally bin averages and the array, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python. This method prototype appears to require two operands - the float array and the length of the array - but in Python it only requires the integer array as follows:
amt | the right operand and the array to add to the tally |
length | the length of the array |
DerivedTally * Tally::addIntegers | ( | const int * | amt, |
const int | length | ||
) |
Tally addition with an array of integers.
This overloaded division operator allows the user to ad a tally by an array of integers, if the number of values equals the number of tally bins. This creates a new DERIVED type tally, loads it with the sum of the tally bin averages and the array, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python. This method prototype appears to require two operands - the integer array and the length of the array - but in Python it only requires the integer array as follows:
amt | the right operand and the the array to add to the tally |
length | the length of the array |
Tally * Tally::clone | ( | ) |
Creates a new version of this tally with identical data.
The clone method makes a deep copy of all of this tally's data and loads it into a new tally class object.
void Tally::computeBatchStatistics | ( | ) |
Computes average, variance, standard deviation and relative error for each bin over the set of batches.
This method populates private class attribute arrays with the batch statistics.
void Tally::computeScaledBatchStatistics | ( | double | scale_factor | ) |
Computes average, variance, standard deviation and relative error for each bin over the set of batches.
This method scales each bin value by a scaling factor.
scale_factor | the factor to scale each bin value by |
DerivedTally * Tally::divideDoubles | ( | const double * | amt, |
const int | length | ||
) |
Tally division with an array of doubles.
This overloaded multiplication operator allows the user to divide a tally by an array of doubles, if the number of values equals the number of tally bins. This creates a new DERIVED type tally, loads it with the product of the tally bin averages and the array, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python. This method prototype appears to require two operands - the double array and the length of the array - but in Python it only requires the double array as follows:
amt | the right operand and the array to divide the tally by |
length | the length of the array |
DerivedTally * Tally::divideFloats | ( | const float * | amt, |
const int | length | ||
) |
Tally division with an array of floats.
This overloaded multiplication operator allows the user to divide a tally by an array of floats, if the number of values equals the number of tally bins. This creates a new DERIVED type tally, loads it with the product of the tally bin averages and the array, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python. This method prototype appears to require two operands - the float array and the length of the array - but in Python it only requires the float array as follows:
amt | the right operand and the array to divide the tally by |
length | the length of the array |
DerivedTally * Tally::divideIntegers | ( | const int * | amt, |
const int | length | ||
) |
Tally division with an array of integers.
This overloaded multiplication operator allows the user to divide a tally by an array of integers, if the number of values equals the number of tally bins. This creates a new DERIVED type tally, loads it with the product of the tally bin averages and the array, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python. This method prototype appears to require two operands - the integer array and the length of the array - but in Python it only requires the integer array as follows:
amt | the right operand and the array to divide the tally by |
length | the length of the array |
void Tally::generateBinCenters | ( | ) |
Compute the center points between bin edges for this Tally's bins.
This method populates a private class attribute array with the bin center values.
void Tally::generateBinEdges | ( | double | start, |
double | end, | ||
int | num_bins, | ||
binSpacingType | type | ||
) |
Generate edges between bins defined by a start and end point.
start | first bin edge value |
end | last bin edge value |
num_bins | the number of bins to be created |
type | the type of bins (EQUAL or LOGARITHMIC) |
double * Tally::getBatchMu | ( | ) |
Returns a pointer to an array of tally batch averages if they have been computed.
double * Tally::getBatchRelativeError | ( | ) |
Returns a pointer to an array of tally batch relative errors if they have been computed.
double * Tally::getBatchStdDev | ( | ) |
Returns a pointer to an array of tally batch standard deviations if they have been computed.
double * Tally::getBatchVariance | ( | ) |
Returns a pointer to an array of tally batch variances if they have been computed.
double * Tally::getBinCenters | ( | ) |
Returns a double array of bin center values.
double Tally::getBinDelta | ( | ) |
Returns the delta spacing between bins. NOTE: this value is only non-zero for EQUAL and LOGARITHMIC bin types.
double Tally::getBinDelta | ( | double | sample | ) |
Returns the delta spacing between the bin edges sandwiching a given sample value.
sample | the value of interest |
double * Tally::getBinEdges | ( | ) |
Returns a double array of bin edge values.
|
inline |
Finds the bin index for a sample in a set of bins. If the samples is outside the bounds of all bins, it returns infinity.
sample | the sample value of interest |
binSpacingType Tally::getBinSpacingType | ( | ) |
Returns the bin spacing type (EQUAL, LOGARITHMIC, OTHER).
double Tally::getMaxMu | ( | ) |
Returns the maximum average tally over batches.
double Tally::getMaxRelErr | ( | ) |
Returns the maximum tally relative error.
double Tally::getMaxStdDev | ( | ) |
Returns the maximum tally standard deviatoin.
double Tally::getMaxTally | ( | ) |
Returns the maximum tally value among all bins and batches.
double Tally::getMaxVariance | ( | ) |
Returns the maximum tally variance over batches.
double Tally::getMinTally | ( | ) |
Returns the maximum tally value among all bins and batches.
int Tally::getNumBatches | ( | ) |
Returns the number of batches for this tally.
int Tally::getNumBins | ( | ) |
Returns the number of tally bins.
int Tally::getNumEdges | ( | ) |
Returns the number of tally edges.
double ** Tally::getTallies | ( | ) |
Returns a double array of the tallies within each bin.
double Tally::getTally | ( | int | batch_num, |
int | bin_index | ||
) |
Returns a specific tally for a specific bin and batch.
batch_num | the batch of interest |
bin_index | the index for the bin of interest |
tallyDomainType Tally::getTallyDomainType | ( | ) |
Returns the type of tally for these bins (ISOTOPE, MATERIAL, REGION).
char * Tally::getTallyName | ( | ) |
Returns the name of the tally.
tallyType Tally::getTallyType | ( | ) |
Returns the type of tally for these bins (FLUX, COLLISION_RATE, etc).
float Tally::getTriggerPrecision | ( | ) |
Returns the trigger precision for this tally.
The trigger precision is the threshold value which must be met for all of this tally's values before the PINSPEC simulation will complete.
triggerType Tally::getTriggerType | ( | ) |
Returns the precision trigger type (VARIANCE, STANDARD_DEVIATION, RELATIVE_ERROR, or NONE).
bool Tally::hasComputedBatchStatistics | ( | ) |
Returns whether or not the tally has computed batch statistics.
bool Tally::hasExpandedGroupBins | ( | ) |
Returns whether or not the tally has expanded it's group bins.
NOTE: The group bins are only expanded for matrix scattering GROUP_TO_GROUP_RATE tallies.
void Tally::incrementNumBatches | ( | int | num_batches | ) |
Increments the number of batches for this tally.
num_batches | number of batches to add to the total number of batches. |
bool Tally::isPrecisionTriggered | ( | ) |
Returns whether or not the tally precision meets the precision trigger threshold, if a trigger exists.
DerivedTally * Tally::multiplyDoubles | ( | const double * | amt, |
const int | length | ||
) |
Tally multiplication with an array of doubles.
This overloaded multiplication operator allows the user to multiply an array of doubles with a tally, if the number of values equals the number of tally bins. This creates a new DERIVED type tally, loads it with the product of the tally bin averages and the array, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python. This method prototype appears to require two operands - the double array and the length of the array - but in Python it only requires the double array as follows:
amt | the right operand and the array to multiply with the tally |
length | the length of the array |
DerivedTally * Tally::multiplyFloats | ( | const float * | amt, |
const int | length | ||
) |
Tally multiplication with an array of floats.
This overloaded multiplication operator allows the user to multiply an array of floats with a tally, if the number of values equals the number of tally bins. This creates a new DERIVED type tally, loads it with the product of the tally bin averages and the array, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python. This method prototype appears to require two operands - the float array and the length of the array - but in Python it only requires the float array as follows:
amt | the right operand and the array to multiply with the tally |
length | the length of the array |
DerivedTally * Tally::multiplyIntegers | ( | const int * | amt, |
const int | length | ||
) |
Tally multiplication with an array of integers.
This overloaded multiplication operator allows the user to multiply an array of integers with a tally, if the number of values equals the number of tally bins. This creates a new DERIVED type tally, loads it with the product of the tally bin averages and the array, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python. This method prototype appears to require two operands - the integer array and the length of the array - but in Python it only requires the integer array as follows:
amt | the right operand and the array to multiply with the tally |
length | the length of the array |
DerivedTally * Tally::operator* | ( | Tally * | tally | ) |
Tally multiplication operator.
This overloaded multiplication operator allows the user to multiply two tallies with each other, if they have the same number of tallies. The creates a new DERIVED type tally, loads it with the product of the tally bin averages for the two tally operands, and computes its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
DerivedTally * Tally::operator* | ( | const int | amt | ) |
Tally multiplication with a constant operator.
This overloaded subtraction operator allows the user to multiply a constant with a tally. The creates a new DERIVED type tally, loads it with the product of the tally bin averages and the constant, and updates its batch statistics appropriately. constant, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
amt | the right operand and the constant value to multiply the tally by |
DerivedTally * Tally::operator* | ( | const float | amt | ) |
Tally multiplication with a constant operator.
This overloaded subtraction operator allows the user to multiply a constant with a tally. The creates a new DERIVED type tally, loads it with the product of the tally bin averages and the constant, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
amt | the right operand and the constant value to multiply the tally by |
DerivedTally * Tally::operator* | ( | const double | amt | ) |
Tally multiplication with a constant operator.
This overloaded subtraction operator allows the user to multiply a constant with a tally. The creates a new DERIVED type tally, loads it with the product of the tally bin averages and the constant, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
amt | the right operand and the constant value to multiply the tally by |
DerivedTally * Tally::operator+ | ( | Tally * | tally | ) |
Tally addition operator.
This overloaded addition operator allows the user to add two tallies with each other, if they have the same number of tallies. The creates a new DERIVED type tally, loads it with the sum of the tally bin averages for the two tally operands, and computes its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
tally | the right operand in the tally summation |
DerivedTally * Tally::operator+ | ( | const int | amt | ) |
Tally addition with a constant operator.
This overloaded addition operator allows the user to add a constant to a tally. The creates a new DERIVED type tally, loads it with the sum of the tally bin averages and the constant, and updates its batch statistics appropriately. constant, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
amt | the right operand and the constant value to add to the tally |
DerivedTally * Tally::operator+ | ( | const float | amt | ) |
Tally addition with a constant operator.
This overloaded addition operator allows the user to add a constant to a tally. The creates a new DERIVED type tally, loads it with the sum of the tally bin averages and the constant, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
amt | the right operand and the constant value to add to the tally |
DerivedTally * Tally::operator+ | ( | const double | amt | ) |
Tally addition with a constant operator.
This overloaded addition operator allows the user to add a constant to a tally. The creates a new DERIVED type tally, loads it with the sum of the tally bin averages and the constant, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
amt | the right operand and the constant value to add to the tally |
DerivedTally * Tally::operator- | ( | Tally * | tally | ) |
Tally subtraction operator.
This overloaded subtraction operator allows the user to subtract two tallies with each other, if they have the same number of tallies. The creates a new DERIVED type tally, loads it with the difference of the tally bin averages for the two tally operands and computes its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
tally | the right operand in the tally product |
DerivedTally * Tally::operator- | ( | const int | amt | ) |
Tally subtraction with a constant operator.
This overloaded subtraction operator allows the user to subtract a constant from a tally. The creates a new DERIVED type tally, loads it with the difference of the tally bin averages and the constant, and updates its batch statistics appropriately. constant, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
amt | the right operand and the constant value to subtract from the tally |
DerivedTally * Tally::operator- | ( | const float | amt | ) |
Tally subtraction with a constant operator.
This overloaded subtraction operator allows the user to subtract a constant from a tally. The creates a new DERIVED type tally, loads it with the difference of the tally bin averages and the constant, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
amt | the right operand and the constant value to subtract from the tally |
DerivedTally * Tally::operator- | ( | const double | amt | ) |
Tally subtraction with a constant operator.
This overloaded subtraction operator allows the user to subtract a constant from a tally. The creates a new DERIVED type tally, loads it with the difference of the tally bin averages and the constant, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
amt | the right operand and the constant value to subtract from the tally |
DerivedTally * Tally::operator/ | ( | Tally * | tally | ) |
Tally division operator.
This overloaded division operator allows the user to divide two tallies with each other, if they have the same number of tallies. The creates a new DERIVED type tally, loads it with the dividend of the tally bin averages for the two tally operands, and computes its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
tally | the right operand in the tally division |
DerivedTally * Tally::operator/ | ( | const int | amt | ) |
Tally division with a constant operator.
This overloaded division operator allows the user to divide a tally by a constant. The creates a new DERIVED type tally, loads it with the dividend of the tally bin averages and the constant, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
amt | the right operand and the constant value to divide the tally by |
DerivedTally * Tally::operator/ | ( | const float | amt | ) |
Tally division with a constant operator.
This overloaded division operator allows the user to divide a tally by a constant. The creates a new DERIVED type tally, loads it with the dividend of the tally bin averages and the constant, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
amt | the right operand and the constant value to divide the tally by |
DerivedTally * Tally::operator/ | ( | const double | amt | ) |
Tally division with a constant operator.
This overloaded division operator allows the user to divide a tally by a constant. The creates a new DERIVED type tally, loads it with the dividend of the tally bin averages and the constant, and updates its batch statistics appropriately. array, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python.
amt | the right operand and the constant value to divide the tally by |
void Tally::outputBatchStatistics | ( | const char * | filename | ) |
Outputs the batch statistics (if they have been computed) to an ASCII file.
filename | the output filename (optional) |
void Tally::printTallies | ( | bool | uncertainties = false | ) |
Print the tally values to the screen.
This method will print the tally results, including bin edges tally averages, and if a user requests, even tally batch statistics.
uncertainties | a boolean representing whether or not to print tally statistics |
void Tally::retrieveTallyCenters | ( | double * | data, |
int | num_bins | ||
) |
This method fills an array with the tally bin centers.
This method is a utility function for users to access PINSPEC data in Python. The method prototype may seem to require two arguments
data | the data array to fill with bin center values |
num_bins | the number of tally bins |
void Tally::retrieveTallyEdges | ( | double * | data, |
int | num_edges | ||
) |
This method fills an array with the tally bin edges.
This method is a utility function for users to access PINSPEC data in Python. The method prototype may seem to require two arguments
data | the data array to fill with bin edge values |
num_bins | the number of tally bins |
void Tally::retrieveTallyMu | ( | double * | data, |
int | num_bins | ||
) |
This method fills an array with the average tally values.
This method is a utility function for users to access PINSPEC data in Python. The method prototype may seem to require two arguments
data | the data array to fill with tally average values |
num_bins | the number of tally bins |
void Tally::retrieveTallyRelErr | ( | double * | data, |
int | num_bins | ||
) |
This method fills an array with the tally relative errors.
This method is a utility function for users to access PINSPEC data in Python. The method prototype may seem to require two arguments - the array to fill and the number of tally bins - but in Python the user must only supply the data array as follows:
data | the data array to fill with tally relative errors |
num_bins | the number of tally bins |
void Tally::retrieveTallyStdDev | ( | double * | data, |
int | num_bins | ||
) |
This method fills an array with the tally standard deviations.
This method is a utility function for users to access PINSPEC data in Python. The method prototype may seem to require two arguments - the array to fill and the number of tally bins - but in Python the user must only supply the data array as follows:
data | the data array to fill with tally standard deviations |
num_bins | the number of tally bins |
void Tally::retrieveTallyVariance | ( | double * | data, |
int | num_bins | ||
) |
This method fills an array with the tally variances.
This method is a utility function for users to access PINSPEC data in Python. The method prototype may seem to require two arguments
data | the data array to fill with tally variances |
num_bins | the number of tally bins |
void Tally::setBinEdges | ( | double * | edges, |
int | num_edges | ||
) |
Set a user-defined double array of bin edge values.
This method is intended to allow PINSPEC users to set tally bin edges through Python. Although this method prototype seems to require two arguments - an array of bin edges and the number of edges - in Python the user only needs to provide the edges array as follows:
edges | the array of bin edges |
num_edges | the number of bin edges |
void Tally::setBinSpacingType | ( | binSpacingType | type | ) |
Set the bin spacing type for this Tally (EQUAL, LOGARITHMIC, OTHER).
type | the bin spacing type |
void Tally::setGroupExpandBins | ( | bool | expand_bins | ) |
Informs the tally whether or not to expand its group bins.
NOTE: The group bins are only expanded for matrix scattering GROUP_TO_GROUP_RATE tallies.
true | for the tally to expand its group bins; otherwise false |
void Tally::setNumBatches | ( | int | num_batches | ) |
Set the number of batches for this Tally.
This method also allocates memory for the tallies and batch statistics arrays.
num_batches | the number of batches |
void Tally::setPrecisionTrigger | ( | triggerType | trigger_type, |
float | precision | ||
) |
Sets a precision trigger for this tally.
By setting a precision trigger, the user instructs a PINSEPC simulation to continue running until all tallies meet the precision trigger threshold.
trigger_type | the precision trigger type (VARIANCE, etc) |
precision | the threshold for the precision trigger |
void Tally::setTallyDomainType | ( | tallyDomainType | type | ) |
Set the tally domain type (MATERIAL, REGION, etc.).
type | the tally domain type |
void Tally::setTallyType | ( | tallyType | type | ) |
Set the tally type (FLUX, CAPTURE_RATE, etc.).
type | the tally type |
DerivedTally * Tally::subtractDoubles | ( | const double * | amt, |
const int | length | ||
) |
Tally subtraction with an array of doubles.
This overloaded subtraction operator allows the user to subtract an array of doubles from a tally, if the number of values equals the number of tally bins. This creates a new DERIVED type tally, loads it with the difference of the tally bin averages and the array, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python. This method prototype appears to require two operands - the double array and the length of the array - but in Python it only requires the double array as follows:
amt | the right operand and the array to subtract from the tally |
length | the length of the array |
DerivedTally * Tally::subtractFloats | ( | const float * | amt, |
const int | length | ||
) |
Tally subtraction with an array of floats.
This overloaded subtraction operator allows the user to subtract an array of floats from a tally, if the number of values equals the number of tally bins. This creates a new DERIVED type tally, loads it with the difference of the tally bin averages and the array, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python. This method prototype appears to require two operands - the float array and the length of the array - but in Python it only requires the float array as follows:
amt | the right operand and the array to subtract from the tally |
length | the length of the array |
DerivedTally * Tally::subtractIntegers | ( | const int * | amt, |
const int | length | ||
) |
Tally subtraction with an array of integers.
This overloaded subtraction operator allows the user to subtract an array of integers from a tally, if the number of values equals the number of tally bins. This creates a new DERIVED type tally, loads it with the difference of the tally bin averages and the array, and updates its batch statistics appropriately. This method is intended to allow for simple tally arithmetic in Python. This method prototype appears to require two operands - the integer array and the length of the array - but in Python it only requires the integer array as follows:
amt | the right operand and the array to subtract from the tally |
length | the length of the array |
void Tally::tally | ( | neutron * | neutron, |
double | weight | ||
) |
This method tallies a particular weight for a neutron.
The method determines which tally bin to use based on the neutron's energy.
neutron | the neutron we are tallying |
weight | the weight to increment tally by |
|
pure virtual |
A virtual method to tally a neutron which must be implemented by Tally subclasses.
neutron | the neutron of interest |
Implemented in DerivedTally, GeometryInterCollisionTimeTally, RegionInterCollisionTimeTally, MaterialInterCollisionTimeTally, GeometryFluxTally, RegionFluxTally, MaterialFluxTally, GeometryLeakageRateTally, RegionLeakageRateTally, MaterialLeakageRateTally, GeometryDiffusionRateTally, RegionDiffusionRateTally, MaterialDiffusionRateTally, IsotopeDiffusionRateTally, GeometryTransportRateTally, RegionTransportRateTally, MaterialTransportRateTally, IsotopeTransportRateTally, GeometryFissionRateTally, RegionFissionRateTally, MaterialFissionRateTally, IsotopeFissionRateTally, GeometryCaptureRateTally, RegionCaptureRateTally, MaterialCaptureRateTally, IsotopeCaptureRateTally, GeometryAbsorptionRateTally, RegionAbsorptionRateTally, MaterialAbsorptionRateTally, IsotopeAbsorptionRateTally, GeometryOutScatterRateTally, RegionOutScatterRateTally, MaterialOutScatterRateTally, IsotopeOutScatterRateTally, GeometryGroupRateTally, RegionGroupRateTally, MaterialGroupRateTally, IsotopeGroupRateTally, GeometryElasticRateTally, RegionElasticRateTally, MaterialElasticRateTally, IsotopeElasticRateTally, GeometryCollisionRateTally, RegionCollisionRateTally, MaterialCollisionRateTally, IsotopeCollisionRateTally, GeometryTally, RegionTally, MaterialTally, and IsotopeTally.
void Tally::tallyGroup | ( | neutron * | neutron, |
double | weight | ||
) |
This method tallies a particular weight for a neutron for group-to group scattering.
The method determines which tally bin to use based on the neutron's old energy and new energy.
neutron | the neutron we are tallying |
weight | the weight to increment tally by |
DerivedTally * Tally::tile | ( | const int | num_tiles | ) |
Create a DerivedTally with this tally's data repetively "tiled".
num_tiles | the number of times to repeat ("tile") the tally's data. |
|
protected |
The batch average for each tally bin
|
protected |
The batch relative error for each tally bin
|
protected |
The batch standard deviation for each tally bin
|
protected |
The batch variance for each tally bin
|
protected |
Equal / logarithmic spacing between bins if defined on a uniform grid
|
protected |
The spacing type between bins
|
protected |
The array of bin center values
|
protected |
Whether or not batch statistics have been computed
|
protected |
The array of bin edges between tally bins
|
protected |
Whether or not bin size has be squared for group-to-group xs
|
protected |
The number of batches in the PINSPEC simulation
|
protected |
The number of tally bins
|
protected |
The number of tally edges
|
protected |
A 2D array of tallies for each bin and each batch
|
protected |
The domain in which this tally resides
|
protected |
The user-specified name for the tally
|
protected |
The type of tally
|
protected |
The trigger precision for this tally
|
protected |
The precision trigger for this tally