A monte carlo pin cell spectral code for nuclear engineering applications.
|
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 TallyBank * | Get () |
Gets an instance pointer to this static class. More... | |
Private Member Functions | |
TallyBank () | |
TallyBank constructor. | |
TallyBank & | operator= (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 |
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.
|
inlineprivate |
void TallyBank::computeScaledBatchStatistics | ( | float | scale_factor | ) |
Compute scaled batch statistics for all registered tallies.
scale_factor | the value to scaled all of the batch statistics by |
void TallyBank::deregisterTally | ( | Tally * | tally | ) |
|
inlinestatic |
Gets an instance pointer to this static class.
void TallyBank::incrementNumBatches | ( | int | num_batches | ) |
Increment the total number of batches for batch-based statistics for each registered Tally object.
num_batches | the 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.
num_batches | the total number of batches |
bool TallyBank::isPrecisionTriggered | ( | ) |
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 geometry.
Registers a tally to be used whenever a collision occurs anywhere within the geometry.
tally | the tally to register |
geometry | a pointer to geometry object within which we should tally |
Register a Tally for a region.
Registers a tally to be used whenever a collision occurs anywhere within the user-specified region.
tally | the tally to register |
region | a pointer to the region within which we should tally |
Register a Tally for a material.
Registers a tally to be used whenever a collision occurs anywhere within the material.
tally | the tally to register |
material | a pointer to the material object within which we should tally |
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.
tally | the tally to register |
isotope | the isotope object within which we should tally |
void TallyBank::tally | ( | neutron * | neutron | ) |
Tallies a neutron in all appropriate Tally objects.
neutron | the neutron we wish to tally |
|
private |
Container of all registered tallies
Hash table of all tallies registered for the geometry
Hash map of all tallies registered for an isotope
Hash map of all tallies registered for a material
Hash table of all tallies registered for a region