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

The TallyBank contains all tallies for a simulation. More...

#include "pinspec/src/TallyBank.h"

Public Member Functions

 ~TallyBank ()
 TallyBank destructor.
 
void registerTally (Tally *tally)
 Register a Tally for the Tally's domain. More...
 
void registerTally (Tally *tally, Geometry *geometry)
 Register a Tally for the geometry. More...
 
void registerTally (Tally *tally, Region *region)
 Register a Tally for a region. More...
 
void registerTally (Tally *tally, Material *material)
 Register a Tally for a material. More...
 
void registerTally (Tally *tally, Isotope *isotope)
 Register a Tally for an isotope. More...
 
void deregisterTally (Tally *tally)
 Un-registers a Tally from the TallyBank. More...
 
void initializeBatchTallies (int num_batches)
 Initializes each registered tally with some number of batches for batch-based statistics. More...
 
bool isPrecisionTriggered ()
 Checks whether a tally in the TallyBank contains a precision trigger * *. More...
 
void incrementNumBatches (int num_batches)
 Increment the total number of batches for batch-based statistics for each registered Tally object. More...
 
void computeBatchStatistics ()
 Compute batch statistics for all registered tallies.
 
void computeScaledBatchStatistics (float scale_factor)
 Compute scaled batch statistics for all registered tallies. More...
 
void outputBatchStatistics ()
 Calls each of the Tally class objects in the simulation to output their tallies and statistics to output files. More...
 
void tally (neutron *neutron)
 Tallies a neutron in all appropriate Tally objects. More...
 
void clearTallies ()
 Delete all containers (vectors and maps) of Tally objects.
 

Static Public Member Functions

static TallyBankGet ()
 Gets an instance pointer to this static class. More...
 

Private Member Functions

 TallyBank ()
 TallyBank constructor.
 
TallyBankoperator= (const TallyBank &)
 An overloaded assignment function to allow for static referencing of the TallyBank class. More...
 
 TallyBank (const TallyBank &)
 TallyBank constructor. More...
 

Private Attributes

std::set< Tally * > _all_tallies
 
std::map< Geometry *, std::set
< Tally * > * > 
_geometry_tallies
 
std::map< Region *, std::set
< Tally * > * > 
_region_tallies
 
std::map< Material *, std::set
< Tally * > * > 
_material_tallies
 
std::map< Isotope *, std::set
< Tally * > * > 
_isotope_tallies
 

Detailed Description

The TallyBank contains all tallies for a simulation.

The TallyBank ensures accurate error checking for tallies used in a simulation. The TallyBank stores tallies in the appropriate hash table with keys corresponding to the isotope, material, region and/or geometry in which a tally is to be applied. The TallyBank can iterate through all of the approrpirate tallies for a neutron and make a tally in each one, in addition to providing other functionality to the main Monte Carlo kernel.

Constructor & Destructor Documentation

TallyBank::TallyBank ( const TallyBank )
inlineprivate

TallyBank constructor.

Parameters
&The TallyBank static reference pointer.

Member Function Documentation

void TallyBank::computeScaledBatchStatistics ( float  scale_factor)

Compute scaled batch statistics for all registered tallies.

Parameters
scale_factorthe value to scaled all of the batch statistics by
void TallyBank::deregisterTally ( Tally tally)

Un-registers a Tally from the TallyBank.

Deregisters a tally to be used whenever a collision occurs anywhere within the tally's domain of geometry, region, material or isotope.

Parameters
tallythe tally to deregister
static TallyBank* TallyBank::Get ( )
inlinestatic

Gets an instance pointer to this static class.

Returns
Returns a pointer to the static TallyBank class object.
void TallyBank::incrementNumBatches ( int  num_batches)

Increment the total number of batches for batch-based statistics for each registered Tally object.

Parameters
num_batchesthe number of batches we wish to increment by
void TallyBank::initializeBatchTallies ( int  num_batches)

Initializes each registered tally with some number of batches for batch-based statistics.

Parameters
num_batchesthe total number of batches
bool TallyBank::isPrecisionTriggered ( )

Checks whether a tally in the TallyBank contains a precision trigger * *.

This method iterates over all tallies which are registered with the TallyBank to see if any precision triggers remain.

Returns
Returns true if an active presicion trigger remains
TallyBank& TallyBank::operator= ( const TallyBank )
inlineprivate

An overloaded assignment function to allow for static referencing of the TallyBank class.

Returns
a pointer to the static TallyBank class
void TallyBank::outputBatchStatistics ( )

Calls each of the Tally class objects in the simulation to output their tallies and statistics to output files.

If a user asks to output the files to a directory which does not exist, this method will create the directory.

void TallyBank::registerTally ( Tally tally)

Register a Tally for the Tally's domain.

Registers a tally to be used for any collision within the Tally's domain (ie, ISOTOPE, MATERIAL, REGION, GEOMETRY).

Parameters
tallythe tally to register
void TallyBank::registerTally ( Tally tally,
Geometry geometry 
)

Register a Tally for the geometry.

Registers a tally to be used whenever a collision occurs anywhere within the geometry.

Parameters
tallythe tally to register
geometrya pointer to geometry object within which we should tally
void TallyBank::registerTally ( Tally tally,
Region region 
)

Register a Tally for a region.

Registers a tally to be used whenever a collision occurs anywhere within the user-specified region.

Parameters
tallythe tally to register
regiona pointer to the region within which we should tally
void TallyBank::registerTally ( Tally tally,
Material material 
)

Register a Tally for a material.

Registers a tally to be used whenever a collision occurs anywhere within the material.

Parameters
tallythe tally to register
materiala pointer to the material object within which we should tally
void TallyBank::registerTally ( Tally tally,
Isotope isotope 
)

Register a Tally for an isotope.

Registers a tally to be used whenever a collision occurs anywhere within the geometry but using only the isotope's microscopic cross-section data.

Parameters
tallythe tally to register
isotopethe isotope object within which we should tally
void TallyBank::tally ( neutron neutron)

Tallies a neutron in all appropriate Tally objects.

Parameters
neutronthe neutron we wish to tally

Member Data Documentation

std::set<Tally*> TallyBank::_all_tallies
private

Container of all registered tallies

std::map< Geometry*, std::set<Tally*>* > TallyBank::_geometry_tallies
private

Hash table of all tallies registered for the geometry

std::map< Isotope*, std::set<Tally*>* > TallyBank::_isotope_tallies
private

Hash map of all tallies registered for an isotope

std::map< Material*, std::set<Tally*>* > TallyBank::_material_tallies
private

Hash map of all tallies registered for a material

std::map< Region*, std::set<Tally*>* > TallyBank::_region_tallies
private

Hash table of all tallies registered for a region


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