21 #include "MooseObject.h" 24 #include "openmc/tallies/tally.h" 25 #include "openmc/tensor.h" 30 class AuxiliarySystem;
33 typedef openmc::tensor::Tensor<double>
OMCTensor;
40 TallyBase(
const InputParameters & parameters);
48 virtual std::pair<unsigned int, openmc::Filter *>
spatialFilter() = 0;
69 Real
storeResults(
const std::vector<unsigned int> & var_numbers,
70 unsigned int local_score,
71 const std::string & output_type);
77 void addScore(
const std::string & score);
85 const Real & relaxation_factor);
161 int scoreIndex(
const std::string & score)
const;
203 std::vector<std::string>
getScoreVars(
const std::string & score)
const;
276 unsigned int local_score,
277 const std::vector<OMCTensor> & tally_vals,
278 bool norm_by_src_rate =
true) = 0;
287 const std::vector<unsigned int> & elem_ids,
const std::set< SubdomainID > & getBlocks() const
Definition: TallyBase.h:250
const std::vector< std::string > & getOutputs() const
Definition: TallyBase.h:176
Real tallyNormalization(unsigned int score) const
openmc::tensor::Tensor< double > OMCTensor
Definition: TallyBase.h:31
std::vector< OMCTensor > _current_raw_tally_rel_error
Current "raw" tally relative error.
Definition: TallyBase.h:417
void fillElementalAuxVariable(const unsigned int &var_num, const std::vector< unsigned int > &elem_ids, const Real &value)
virtual void initializeTally()
std::vector< OMCTensor > _previous_tally
Previous fixed point iteration tally result (after relaxation)
Definition: TallyBase.h:411
const Real & getMean(unsigned int local_score) const
Definition: TallyBase.h:189
virtual void setRelaxation(relaxation::RelaxationEnum relaxation_type, const Real &relaxation_factor)
std::vector< std::string > getScoreVars(const std::string &score) const
openmc::TallyEstimator _estimator
The OpenMC estimator to use with this tally.
Definition: TallyBase.h:330
void applyTriggersToLocalTally(openmc::Tally *tally)
relaxation::RelaxationEnum _relaxation_type
The type of relaxation this tally should employ.
Definition: TallyBase.h:489
static constexpr Real ZERO_TALLY_THRESHOLD
Tolerance for setting zero tally.
Definition: TallyBase.h:495
bool extBinSkipped(unsigned int ext_bin) const
Definition: TallyBase.h:210
const Real & _tally_sum_tol
Relative tolerance for erroring on local vs. global conservation of the tally.
Definition: TallyBase.h:459
std::vector< std::string > _tally_name
Auxiliary variable name(s) for this tally.
Definition: TallyBase.h:336
const bool _normalize_by_global
Definition: TallyBase.h:441
const MultiMooseEnum * _tally_trigger
Definition: TallyBase.h:386
Definition: OpenMCCellAverageProblem.h:66
const bool _check_tally_sum
Definition: TallyBase.h:456
virtual void resetTally()
std::vector< Real > _local_mean_tally
Definition: TallyBase.h:375
std::vector< Real > _tally_trigger_threshold
Definition: TallyBase.h:392
const bool _has_outputs
Whether this tally has additional outputs or not.
Definition: TallyBase.h:471
static InputParameters validParams()
std::vector< OMCTensor > _current_raw_tally_std_dev
Current "raw" tally standard deviation.
Definition: TallyBase.h:420
const std::vector< const TallyBase * > & linkedTallies() const
Definition: TallyBase.h:262
const openmc::Tally * getWrappedGlobalTally() const
unsigned int _num_ext_filter_bins
The number of non-spatial bins in this tally.
Definition: TallyBase.h:357
std::vector< std::string > _output_name
Suffixes to apply to 'tally_name' in order to name the fields in the 'output'.
Definition: TallyBase.h:474
Real _relaxation_factor
The relaxation factor this tally should use (for constant relaxation).
Definition: TallyBase.h:492
TallyBase(const InputParameters ¶meters)
std::vector< std::string > _tally_score
OpenMC tally score(s) to use with this tally.
Definition: TallyBase.h:333
unsigned int _filter_index
The index of the first filter added by this tally.
Definition: TallyBase.h:354
RelaxationEnum
Type of relaxation.
Definition: CardinalEnums.h:273
virtual void renormalizeLinkedTallies()
std::vector< Real > _linked_local_sum_tally
Linked sum value across all bins. Indexed by score.
Definition: TallyBase.h:378
OpenMCCellAverageProblem & _openmc_problem
The OpenMCCellAverageProblem using the tally system.
Definition: TallyBase.h:318
const bool _renames_tally_vars
Whether this tally stores results in variables names something other than '_tally_score'.
Definition: TallyBase.h:468
Definition: TallyBase.h:35
virtual bool addingGlobalTally() const
Definition: TallyBase.h:256
void addScore(const std::string &score)
std::vector< OMCTensor > _current_raw_tally
Current "raw" tally output from Monte Carlo solution.
Definition: TallyBase.h:414
openmc::Tally * _global_tally
Definition: TallyBase.h:348
void relaxAndNormalizeTally()
const Real & getSum(unsigned int local_score) const
Definition: TallyBase.h:196
virtual Real storeResultsInner(const std::vector< unsigned int > &var_numbers, unsigned int local_score, const std::vector< OMCTensor > &tally_vals, bool norm_by_src_rate=true)=0
MooseMesh & _mesh
The MooseMesh.
Definition: TallyBase.h:321
int scoreIndex(const std::string &score) const
unsigned int numExtFilterBins() const
Definition: TallyBase.h:244
void checkNormalization(const Real &sum, unsigned int score) const
bool renamesTallyVars() const
Definition: TallyBase.h:238
void addLinkedTally(const TallyBase *other)
const bool _needs_global_tally
Definition: TallyBase.h:465
Definition: FilterBase.h:40
int32_t getTallyID() const
std::vector< Real > _local_sum_tally
Sum value of this tally across all bins. Indexed by score.
Definition: TallyBase.h:360
unsigned int _global_tally_index
The index of the global OpenMC tally this object wraps.
Definition: TallyBase.h:351
const bool _is_adaptive
Whether the problem uses adaptive mesh refinement or not.
Definition: TallyBase.h:477
std::vector< OMCTensor > _current_tally
Definition: TallyBase.h:408
openmc::TallyEstimator getTallyEstimator() const
Definition: TallyBase.h:182
std::set< SubdomainID > _tally_blocks
Blocks for which to add tallies.
Definition: TallyBase.h:483
void checkTallySum(const unsigned int &score) const
const openmc::Tally * getWrappedTally() const
std::vector< Real > _global_sum_tally
Definition: TallyBase.h:367
virtual std::pair< unsigned int, openmc::Filter * > spatialFilter()=0
Real storeResults(const std::vector< unsigned int > &var_numbers, unsigned int local_score, const std::string &output_type)
int32_t getGlobalTallyID() const
openmc::Tally * _local_tally
The OpenMC tally object this class wraps.
Definition: TallyBase.h:339
bool hasOutputs() const
Definition: TallyBase.h:222
unsigned int _local_tally_index
The index of the OpenMC tally this object wraps.
Definition: TallyBase.h:342
Definition: CardinalEnums.h:157
std::vector< const TallyBase * > _linked_tallies
Other tallies linked for normalization.
Definition: TallyBase.h:486
bool hasTrigger() const
Definition: TallyBase.h:216
AuxiliarySystem & _aux
The aux system.
Definition: TallyBase.h:324
std::vector< bool > _trigger_ignore_zeros
Definition: TallyBase.h:398
const std::vector< std::string > & getScores() const
Definition: TallyBase.h:154
const std::vector< std::string > & getAuxVarNames() const
Definition: TallyBase.h:169
bool hasScore(const std::string &score) const
Definition: TallyBase.h:229
virtual void gatherLinkedSum()
std::vector< bool > _ext_bins_to_skip
External filter bins to skip while computing the tally sum and mean for normalization.
Definition: TallyBase.h:480
std::vector< std::shared_ptr< FilterBase > > _ext_filters
The external filters added in the [Problem/Filters] block.
Definition: TallyBase.h:327