A monte carlo pin cell spectral code for nuclear engineering applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Tally Class Referenceabstract

A Tally reprsents a set of bins for tallying some quantity. More...

#include "pinspec/src/Tally.h"

Inheritance diagram for Tally:
DerivedTally GeometryTally IsotopeTally MaterialTally RegionTally GeometryAbsorptionRateTally GeometryCaptureRateTally GeometryCollisionRateTally GeometryDiffusionRateTally GeometryElasticRateTally GeometryFissionRateTally GeometryFluxTally GeometryGroupRateTally GeometryInterCollisionTimeTally GeometryLeakageRateTally GeometryOutScatterRateTally GeometryTransportRateTally IsotopeAbsorptionRateTally IsotopeCaptureRateTally IsotopeCollisionRateTally IsotopeDiffusionRateTally IsotopeElasticRateTally IsotopeFissionRateTally IsotopeGroupRateTally IsotopeOutScatterRateTally IsotopeTransportRateTally MaterialAbsorptionRateTally MaterialCaptureRateTally MaterialCollisionRateTally MaterialDiffusionRateTally MaterialElasticRateTally MaterialFissionRateTally MaterialFluxTally MaterialGroupRateTally MaterialInterCollisionTimeTally MaterialLeakageRateTally MaterialOutScatterRateTally MaterialTransportRateTally RegionAbsorptionRateTally RegionCaptureRateTally RegionCollisionRateTally RegionDiffusionRateTally RegionElasticRateTally RegionFissionRateTally RegionFluxTally RegionGroupRateTally RegionInterCollisionTimeTally RegionLeakageRateTally RegionOutScatterRateTally RegionTransportRateTally

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...
 
Tallyclone ()
 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...
 
DerivedTallytile (const int num_tiles)
 Create a DerivedTally with this tally's data repetively "tiled". More...
 
DerivedTallyaddIntegers (const int *amt, const int length)
 Tally addition with an array of integers. More...
 
DerivedTallyaddFloats (const float *amt, const int length)
 Tally addition with an array of floats. More...
 
DerivedTallyaddDoubles (const double *amt, const int length)
 Tally addition with an array of doubles. More...
 
DerivedTallysubtractIntegers (const int *amt, const int length)
 Tally subtraction with an array of integers. More...
 
DerivedTallysubtractFloats (const float *amt, const int length)
 Tally subtraction with an array of floats. More...
 
DerivedTallysubtractDoubles (const double *amt, const int length)
 Tally subtraction with an array of doubles. More...
 
DerivedTallymultiplyIntegers (const int *amt, const int length)
 Tally multiplication with an array of integers. More...
 
DerivedTallymultiplyFloats (const float *amt, const int length)
 Tally multiplication with an array of floats. More...
 
DerivedTallymultiplyDoubles (const double *amt, const int length)
 Tally multiplication with an array of doubles. More...
 
DerivedTallydivideIntegers (const int *amt, const int length)
 Tally division with an array of integers. More...
 
DerivedTallydivideFloats (const float *amt, const int length)
 Tally division with an array of floats. More...
 
DerivedTallydivideDoubles (const double *amt, const int length)
 Tally division with an array of doubles. More...
 
DerivedTallyoperator+ (Tally *tally)
 Tally addition operator. More...
 
DerivedTallyoperator- (Tally *tally)
 Tally subtraction operator. More...
 
DerivedTallyoperator* (Tally *tally)
 Tally multiplication operator. More...
 
DerivedTallyoperator/ (Tally *tally)
 Tally division operator. More...
 
DerivedTallyoperator+ (const int amt)
 Tally addition with a constant operator. More...
 
DerivedTallyoperator- (const int amt)
 Tally subtraction with a constant operator. More...
 
DerivedTallyoperator* (const int amt)
 Tally multiplication with a constant operator. More...
 
DerivedTallyoperator/ (const int amt)
 Tally division with a constant operator. More...
 
DerivedTallyoperator+ (const float amt)
 Tally addition with a constant operator. More...
 
DerivedTallyoperator- (const float amt)
 Tally subtraction with a constant operator. More...
 
DerivedTallyoperator* (const float amt)
 Tally multiplication with a constant operator. More...
 
DerivedTallyoperator/ (const float amt)
 Tally division with a constant operator. More...
 
DerivedTallyoperator+ (const double amt)
 Tally addition with a constant operator. More...
 
DerivedTallyoperator- (const double amt)
 Tally subtraction with a constant operator. More...
 
DerivedTallyoperator* (const double amt)
 Tally multiplication with a constant operator. More...
 
DerivedTallyoperator/ (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
 

Detailed Description

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.

Constructor & Destructor Documentation

Tally::Tally ( char *  tally_name = (char*)"")

Tally constructor.

Assigns a default number of batches (0) and tally bins (0).

Member Function Documentation

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:

array = numpy.array([1.2, 3.5, 4.7, 8.2], numpy.dtype=float64)
new_tally = tally.addDoubles(array)
Parameters
amtthe right operand and the array to add to the tally
lengththe length of the array
Returns
a DERIVED type tally with the tally sum
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:

array = numpy.array([1.2, 3.5, 4.7, 8.2], numpy.dtype=float32)
new_tally = tally.addFloats(array)
Parameters
amtthe right operand and the array to add to the tally
lengththe length of the array
Returns
a DERIVED type tally with the tally sum
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:

array = numpy.array([1.2, 3.5, 4.7, 8.2])
new_tally = tally.addIntegers(array)
Parameters
amtthe right operand and the the array to add to the tally
lengththe length of the array
Returns
a DERIVED type tally with the tally sum
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.

Parameters
scale_factorthe 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:

array = numpy.array([1.2, 3.5, 4.7, 8.2], dtype=numpy.float64)
new_tally = tally.divideDoubles(array)
Parameters
amtthe right operand and the array to divide the tally by
lengththe length of the array
Returns
a DERIVED type tally with the tally dividend
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:

array = numpy.array([1.2, 3.5, 4.7, 8.2], dtype=numpy.float32)
new_tally = tally.divideFloats(array)
Parameters
amtthe right operand and the array to divide the tally by
lengththe length of the array
Returns
a DERIVED type tally with the tally dividend
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:

array = numpy.array([1.2, 3.5, 4.7, 8.2], dtype=numpy.int32)
new_tally = tally.divideIntegers(array)
Parameters
amtthe right operand and the array to divide the tally by
lengththe length of the array
Returns
a DERIVED type tally with the tally dividend
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.

Parameters
startfirst bin edge value
endlast bin edge value
num_binsthe number of bins to be created
typethe type of bins (EQUAL or LOGARITHMIC)
double * Tally::getBatchMu ( )

Returns a pointer to an array of tally batch averages if they have been computed.

Returns
a double array of batch averages for each bin
double * Tally::getBatchRelativeError ( )

Returns a pointer to an array of tally batch relative errors if they have been computed.

Returns
a double array of batch relative errors for each bin
double * Tally::getBatchStdDev ( )

Returns a pointer to an array of tally batch standard deviations if they have been computed.

Returns
a double array of batch standard deviations for each bin
double * Tally::getBatchVariance ( )

Returns a pointer to an array of tally batch variances if they have been computed.

Returns
a double array of batch variances for each bin
double * Tally::getBinCenters ( )

Returns a double array of bin center values.

Returns
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.

Returns
the spacing between bins
double Tally::getBinDelta ( double  sample)

Returns the delta spacing between the bin edges sandwiching a given sample value.

Parameters
samplethe value of interest
Returns
the spacing between bin edges
double * Tally::getBinEdges ( )

Returns a double array of bin edge values.

Returns
array of bin edge values
int Tally::getBinIndex ( double  sample)
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.

Parameters
samplethe sample value of interest
Returns
the bin index for the sample
binSpacingType Tally::getBinSpacingType ( )

Returns the bin spacing type (EQUAL, LOGARITHMIC, OTHER).

Returns
the bin spacing type
double Tally::getMaxMu ( )

Returns the maximum average tally over batches.

Returns
the maximum average tally
double Tally::getMaxRelErr ( )

Returns the maximum tally relative error.

Returns
the maximum relative error
double Tally::getMaxStdDev ( )

Returns the maximum tally standard deviatoin.

Returns
the maximum standard deviation
double Tally::getMaxTally ( )

Returns the maximum tally value among all bins and batches.

Returns
the maximum tally value
double Tally::getMaxVariance ( )

Returns the maximum tally variance over batches.

Returns
the maximum tally variance
double Tally::getMinTally ( )

Returns the maximum tally value among all bins and batches.

Returns
the maximum tally value
int Tally::getNumBatches ( )

Returns the number of batches for this tally.

Returns
the number of batches
int Tally::getNumBins ( )

Returns the number of tally bins.

Returns
the number of bins
int Tally::getNumEdges ( )

Returns the number of tally edges.

Returns
the number of edges
double ** Tally::getTallies ( )

Returns a double array of the tallies within each bin.

Returns
an array of
double Tally::getTally ( int  batch_num,
int  bin_index 
)

Returns a specific tally for a specific bin and batch.

Parameters
batch_numthe batch of interest
bin_indexthe index for the bin of interest
Returns
the tally within that bin
tallyDomainType Tally::getTallyDomainType ( )

Returns the type of tally for these bins (ISOTOPE, MATERIAL, REGION).

Returns
the tally type
char * Tally::getTallyName ( )

Returns the name of the tally.

Returns
the name of the tally
the Tally's name
tallyType Tally::getTallyType ( )

Returns the type of tally for these bins (FLUX, COLLISION_RATE, etc).

Returns
the tally type
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.

Returns
the trigger precision
triggerType Tally::getTriggerType ( )

Returns the precision trigger type (VARIANCE, STANDARD_DEVIATION, RELATIVE_ERROR, or NONE).

Returns
the trigger precision type.
bool Tally::hasComputedBatchStatistics ( )

Returns whether or not the tally has computed batch statistics.

Returns
true if the tally has computed batch statistics; otherwise false
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.

Returns
true if the tally has expanded group bins; otherwise false
void Tally::incrementNumBatches ( int  num_batches)

Increments the number of batches for this tally.

Parameters
num_batchesnumber 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.

Returns
true if the precision meets the threshold; otherwise false
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:

array = numpy.array([1.2, 3.5, 4.7, 8.2], dtype=numpy.float64)
new_tally = tally.multiplyDoubles(array)
Parameters
amtthe right operand and the array to multiply with the tally
lengththe length of the array
Returns
a DERIVED type tally with the tally product
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:

array = numpy.array([1.2, 3.5, 4.7, 8.2], dtype=numpy.float32)
new_tally = tally.multiplyFloats(array)
Parameters
amtthe right operand and the array to multiply with the tally
lengththe length of the array
Returns
a DERIVED type tally with the tally product
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:

array = numpy.array([1.2, 3.5, 4.7, 8.2], dtype=numpy.int32)
new_tally = tally.multiplyIntegers(array)
Parameters
amtthe right operand and the array to multiply with the tally
lengththe length of the array
Returns
a DERIVED type tally with the tally product
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.

new_tally = tally1 * tally2
Returns
a DERIVED type tally with the tally product
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.

new_tally = tally * int(3)
Parameters
amtthe right operand and the constant value to multiply the tally by
Returns
a DERIVED type tally with the tally product
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.

new_tally = tally * float(3.5)
Parameters
amtthe right operand and the constant value to multiply the tally by
Returns
a DERIVED type tally with the tally product
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.

new_tally = tally * double(3.5)
Parameters
amtthe right operand and the constant value to multiply the tally by
Returns
a DERIVED type tally with the tally product
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.

new_tally = tally1 + tally2
Parameters
tallythe right operand in the tally summation
Returns
a DERIVED type tally with the tally sum
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.

new_tally = tally + int(3)
Parameters
amtthe right operand and the constant value to add to the tally
Returns
a DERIVED type tally with the tally sum
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.

new_tally = tally + float(3.5)
Parameters
amtthe right operand and the constant value to add to the tally
Returns
a DERIVED type tally with the tally sum
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.

new_tally = tally + double(3.5)
Parameters
amtthe right operand and the constant value to add to the tally
Returns
a DERIVED type tally with the tally sum
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.

new_tally = tally1 - tally2
Parameters
tallythe right operand in the tally product
Returns
a DERIVED type tally with the tally difference
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.

new_tally = tally - int(3)
Parameters
amtthe right operand and the constant value to subtract from the tally
Returns
a DERIVED type tally with the tally difference
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.

new_tally = tally - float(3.5)
Parameters
amtthe right operand and the constant value to subtract from the tally
Returns
a DERIVED type tally with the tally difference
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.

new_tally = tally - double(3.5)
Parameters
amtthe right operand and the constant value to subtract from the tally
Returns
a DERIVED type tally with the tally difference
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.

new_tally = tally1 / tally2
Parameters
tallythe right operand in the tally division
Returns
a DERIVED type tally with 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.

new_tally = tally / int(3)
Parameters
amtthe right operand and the constant value to divide the tally by
Returns
a DERIVED type tally with the tally product
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.

new_tally = tally / float(3.5)
Parameters
amtthe right operand and the constant value to divide the tally by
Returns
a DERIVED type tally with the tally product
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.

new_tally = tally / double(3.5)
Parameters
amtthe right operand and the constant value to divide the tally by
Returns
a DERIVED type tally with the tally product
void Tally::outputBatchStatistics ( const char *  filename)

Outputs the batch statistics (if they have been computed) to an ASCII file.

Parameters
filenamethe 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.

Parameters
uncertaintiesa 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

  • the array to fill and the number of tally bins - but in Python the user must only supply the data array as follows:
num_bins = tally.getNumBins()
centers = tally.retrieveTallyCenters(num_bins)
Parameters
datathe data array to fill with bin center values
num_binsthe 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

  • the array to fill and the number of tally bins - but in Python the user must only supply the data array as follows:
num_bins = tally.getNumBins()
edges = tally.retrieveTallyEdges(num_bins+1)
Parameters
datathe data array to fill with bin edge values
num_binsthe 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

  • the array to fill and the number of tally bins - but in Python the user must only supply the data array as follows:
num_bins = tally.getNumBins()
mu = tally.retrieveTallyMu(num_bins)
Parameters
datathe data array to fill with tally average values
num_binsthe 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:

num_bins = tally.getNumBins()
rel_err = tally.retrieveTallyRelErr(num_bins)
Parameters
datathe data array to fill with tally relative errors
num_binsthe 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:

num_bins = tally.getNumBins()
std_dev = tally.retrieveTallyStdDev(num_bins)
Parameters
datathe data array to fill with tally standard deviations
num_binsthe 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

  • the array to fill and the number of tally bins - but in Python the user must only supply the data array as follows:
num_bins = tally.getNumBins()
variances = tally.retrieveTallyVariance(num_bins)
Parameters
datathe data array to fill with tally variances
num_binsthe 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 = numpy.array([0.1, 1., 5., 25., 100.])
tally.setBinEdges(edges)
Parameters
edgesthe array of bin edges
num_edgesthe number of bin edges
void Tally::setBinSpacingType ( binSpacingType  type)

Set the bin spacing type for this Tally (EQUAL, LOGARITHMIC, OTHER).

Parameters
typethe 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.

Parameters
truefor 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.

Parameters
num_batchesthe 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.

Parameters
trigger_typethe precision trigger type (VARIANCE, etc)
precisionthe threshold for the precision trigger
void Tally::setTallyDomainType ( tallyDomainType  type)

Set the tally domain type (MATERIAL, REGION, etc.).

Parameters
typethe tally domain type
void Tally::setTallyType ( tallyType  type)

Set the tally type (FLUX, CAPTURE_RATE, etc.).

Parameters
typethe 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:

array = numpy.array([1.2, 3.5, 4.7, 8.2], dtype=numpy.float64)
new_tally = tally.subtractIntegers(array)
Parameters
amtthe right operand and the array to subtract from the tally
lengththe length of the array
Returns
a DERIVED type tally with the tally difference
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:

array = numpy.array([1.2, 3.5, 4.7, 8.2], dtype=numpy.float32)
new_tally = tally.subtractFloats(array)
Parameters
amtthe right operand and the array to subtract from the tally
lengththe length of the array
Returns
a DERIVED type tally with the tally difference
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:

array = numpy.array([1.2, 3.5, 4.7, 8.2], dtype=numpy.integer)
new_tally = tally.subtractIntegers(array)
Parameters
amtthe right operand and the array to subtract from the tally
lengththe length of the array
Returns
a DERIVED type tally with the tally difference
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.

Parameters
neutronthe neutron we are tallying
weightthe weight to increment tally by
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.

Parameters
neutronthe neutron we are tallying
weightthe weight to increment tally by
DerivedTally * Tally::tile ( const int  num_tiles)

Create a DerivedTally with this tally's data repetively "tiled".

Parameters
num_tilesthe number of times to repeat ("tile") the tally's data.
Returns
a DERIVED type tally with the tiled tally data

Member Data Documentation

double* Tally::_batch_mu
protected

The batch average for each tally bin

double* Tally::_batch_rel_err
protected

The batch relative error for each tally bin

double* Tally::_batch_std_dev
protected

The batch standard deviation for each tally bin

double* Tally::_batch_variance
protected

The batch variance for each tally bin

double Tally::_bin_delta
protected

Equal / logarithmic spacing between bins if defined on a uniform grid

binSpacingType Tally::_bin_spacing
protected

The spacing type between bins

double* Tally::_centers
protected

The array of bin center values

bool Tally::_computed_statistics
protected

Whether or not batch statistics have been computed

double* Tally::_edges
protected

The array of bin edges between tally bins

bool Tally::_group_expand_bins
protected

Whether or not bin size has be squared for group-to-group xs

int Tally::_num_batches
protected

The number of batches in the PINSPEC simulation

int Tally::_num_bins
protected

The number of tally bins

int Tally::_num_edges
protected

The number of tally edges

double** Tally::_tallies
protected

A 2D array of tallies for each bin and each batch

tallyDomainType Tally::_tally_domain
protected

The domain in which this tally resides

char* Tally::_tally_name
protected

The user-specified name for the tally

tallyType Tally::_tally_type
protected

The type of tally

float Tally::_trigger_precision
protected

The trigger precision for this tally

triggerType Tally::_trigger_type
protected

The precision trigger for this tally


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