Loading [MathJax]/extensions/tex2jax.js
Cardinal
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
OpenMCCellAverageProblem.h
Go to the documentation of this file.
1/********************************************************************/
2/* SOFTWARE COPYRIGHT NOTIFICATION */
3/* Cardinal */
4/* */
5/* (c) 2021 UChicago Argonne, LLC */
6/* ALL RIGHTS RESERVED */
7/* */
8/* Prepared by UChicago Argonne, LLC */
9/* Under Contract No. DE-AC02-06CH11357 */
10/* With the U. S. Department of Energy */
11/* */
12/* Prepared by Battelle Energy Alliance, LLC */
13/* Under Contract No. DE-AC07-05ID14517 */
14/* With the U. S. Department of Energy */
15/* */
16/* See LICENSE for full restrictions */
17/********************************************************************/
18
19#pragma once
20
21#include "OpenMCProblemBase.h"
23
25#include "TallyBase.h"
26#include "FilterBase.h"
27
28#ifdef ENABLE_DAGMC
29#include "MoabSkinner.h"
30#include "DagMC.hpp"
31#endif
32
35
67{
68public:
69 OpenMCCellAverageProblem(const InputParameters & params);
70 static InputParameters validParams();
71
72 virtual void initialSetup() override;
73 virtual void externalSolve() override;
74 virtual void syncSolutions(ExternalProblem::Direction direction) override;
75 virtual bool converged(unsigned int) override { return true; }
76
84 void read2DBlockParameters(const std::string name,
85 std::vector<std::vector<SubdomainName>> & names,
86 std::vector<SubdomainID> & flattened_ids);
87
94 void checkBlocksInMesh(const std::string name,
95 const std::vector<SubdomainID> & ids,
96 const std::vector<SubdomainName> & names) const;
97
100
105 virtual void addExternalVariables() override;
106
112 virtual Real cellVolume(const cellInfo & cell_info) const;
113
118 virtual const OpenMCVolumeCalculation * volumeCalculation() const { return _volume_calc; }
119
124 virtual const std::map<cellInfo, std::vector<unsigned int>> & cellToElem() const
125 {
126 return _cell_to_elem;
127 }
128
134 virtual std::unordered_set<SubdomainID> getCellToElementSub(const cellInfo & info)
135 {
136 return _cell_to_elem_subdomain.at(info);
137 }
138
143 virtual bool hasPointTransformations() const { return _symmetry != nullptr; }
144
149 virtual const std::vector<std::string> & getTallyScores() const { return _all_tally_scores; }
150
156 bool hasScore(const std::string & score)
157 {
158 return std::find(_all_tally_scores.begin(), _all_tally_scores.end(), score) !=
159 _all_tally_scores.end();
160 }
161
167 std::vector<const TallyBase *> getTalliesByScore(const std::string & score);
168
174 std::vector<const MooseVariableFE<Real> *> getTallyScoreVariables(const std::string & score,
175 THREAD_ID tid);
176
182 std::vector<const VariableValue *> getTallyScoreVariableValues(const std::string & score,
183 THREAD_ID tid);
184
190 std::vector<const VariableValue *> getTallyScoreNeighborVariableValues(const std::string & score,
191 THREAD_ID tid);
192
198 virtual Point transformPoint(const Point & pt) const
199 {
200 return this->hasPointTransformations() ? _symmetry->transformPoint(pt) : pt;
201 }
202
224 virtual void createQRules(QuadratureType type,
225 Order order,
226 Order volume_order,
227 Order face_order,
228 SubdomainID block,
229 bool allow_negative_weights = true) override;
230
235 typedef std::unordered_map<int32_t, std::vector<int32_t>> containedCells;
236
242 int32_t elemToCellIndex(const int & elem_id) const { return elemToCellInfo(elem_id).first; }
243
250 int32_t elemToCellID(const int & elem_id) const { return cellID(elemToCellIndex(elem_id)); }
251
257 int32_t elemToCellInstance(const int & elem_id) const { return elemToCellInfo(elem_id).second; }
258
265 cellInfo elemToCellInfo(const int & elem_id) const { return _elem_to_cell[elem_id]; }
266
274 int32_t cellToMaterialIndex(const cellInfo & cell_info) const
275 {
276 return _cell_to_material.at(cell_info);
277 }
278
288
294 bool hasDensityFeedback(const cellInfo & cell_info) const
295 {
296 std::vector<coupling::CouplingFields> phase = {coupling::density,
298 return std::find(phase.begin(), phase.end(), cellFeedback(cell_info)) != phase.end();
299 }
300
306 bool hasTemperatureFeedback(const cellInfo & cell_info) const
307 {
308 std::vector<coupling::CouplingFields> phase = {coupling::temperature,
310 return std::find(phase.begin(), phase.end(), cellFeedback(cell_info)) != phase.end();
311 }
312
318 bool hasFilter(const std::string & filter_name) const { return _filters.count(filter_name) > 0; }
319
325 std::shared_ptr<FilterBase> & getFilter(const std::string & filter_name)
326 {
327 return _filters.at(filter_name);
328 }
329
334 const std::vector<std::shared_ptr<TallyBase>> & getLocalTally() const { return _local_tallies; }
335
341 double cellTemperature(const cellInfo & cell_info) const;
342
347 double cellMappedVolume(const cellInfo & cell_info) const;
348
351
358 void addFilter(const std::string & type,
359 const std::string & name,
360 InputParameters & moose_object_pars);
361
368 void
369 addTally(const std::string & type, const std::string & name, InputParameters & moose_object_pars);
370
379 Real tallyMultiplier(unsigned int global_score) const;
380
386 template <typename T>
387 void checkEmptyVector(const std::vector<T> & vector, const std::string & name) const
388 {
389 if (vector.empty())
390 mooseError(name + " cannot be empty!");
391 }
392
394
399 bool hasAdaptivity() const { return _has_adaptivity; }
400
402 static constexpr int32_t UNMAPPED{-1};
403
405 static constexpr int DIMENSION{3};
406
407protected:
413 unsigned int getCellLevel(const Point & c) const;
414
423 void
424 readBlockVariables(const std::string & param,
425 const std::string & default_name,
426 std::map<std::string, std::vector<SubdomainName>> & vars_to_specified_blocks,
427 std::vector<SubdomainID> & specified_blocks);
428
434 bool cellHasIdenticalFill(const cellInfo & cell_info) const;
435
443
450 bool cellMapsToSubdomain(const cellInfo & cell_info,
451 const std::unordered_set<SubdomainID> & id) const;
452
459
466
471
476 virtual void updateMaterials();
477
483 std::vector<std::string> getMaterialInEachSubdomain() const;
484
490 Point transformPointToOpenMC(const Point & pt) const;
491
498 void checkNormalization(const Real & sum, unsigned int global_score) const;
499
509 void
510 printTrisoHelp(const std::chrono::time_point<std::chrono::high_resolution_clock> & start) const;
511
519
525 std::vector<int32_t> materialsInCells(const containedCells & contained_cells) const;
526
529
534 std::set<SubdomainID> coupledSubdomains() const;
535
541 template <typename T>
542 void gatherCellSum(std::vector<T> & local, std::map<cellInfo, T> & global) const;
543
550 template <typename T>
551 void gatherCellVector(std::vector<T> & local, std::vector<unsigned int> & n_local, std::map<cellInfo, std::vector<T>> & global);
552
558 coupling::CouplingFields elemFeedback(const Elem * elem) const;
559
564 void getTallyTriggerParameters(const InputParameters & params);
565
571 void readBlockParameters(const std::string name, std::unordered_set<SubdomainID> & blocks);
572
579
586 void setContainedCells(const cellInfo & cell_info,
587 const Point & hint,
588 std::map<cellInfo, containedCells> & map);
589
599 containedCells & reference,
600 containedCells & compare) const;
601
607 void setMinimumVolumeQRules(Order & volume_order, const std::string & type);
608
610 std::string printNewline() const
611 {
612 if (_verbose)
613 return "\n";
614 else
615 return "";
616 }
617
620
642 void relaxAndNormalizeTally(unsigned int global_score,
643 unsigned int local_score,
644 std::shared_ptr<TallyBase> local_tally);
645
651
654
657
663
666
669
676
679
685
688
695
702 std::map<cellInfo, Real> computeVolumeWeightedCellInput(
703 const std::map<SubdomainID, std::pair<unsigned int, std::string>> & var_num,
704 const std::vector<coupling::CouplingFields> * phase) const;
705
711
717
723 Real tallyNormalization(unsigned int global_score) const;
724
729 void checkTallySum(const unsigned int & score) const;
730
736 void latticeOuterCheck(const Point & c, int level) const;
737
743 void latticeOuterError(const Point & c, int level) const;
744
750 bool findCell(const Point & point);
751
760 void compareContainedCells(std::map<cellInfo, containedCells> & reference,
761 std::map<cellInfo, containedCells> & compare) const;
762
763 NumericVector<Number> & _serialized_solution;
764
769 virtual std::vector<int32_t> getMappedTallyIDs() const override;
770
776
784
787
795
801 unsigned int _cell_level;
802
807 const bool & _export_properties;
808
829
831 const bool _using_skinner;
832
839
854
856 const Real & _relaxation_factor;
857
890
898
907
913
919
926
928 bool _has_cell_tallies = false;
929
932
938
943 std::map<std::string, std::shared_ptr<FilterBase>> _filters;
944
946 std::vector<std::shared_ptr<TallyBase>> _local_tallies;
947
949 std::vector<std::string> _all_tally_scores;
950
956 std::vector<std::map<std::string, int>> _local_tally_score_map;
957
959 std::vector<std::vector<unsigned int>> _tally_var_ids;
960
962 std::vector<std::vector<std::vector<unsigned int>>> _tally_ext_var_ids;
963
965 std::vector<SubdomainID> _density_blocks;
966
968 std::vector<SubdomainID> _temp_blocks;
969
971 std::unordered_set<SubdomainID> _identical_cell_fill_blocks;
972
974 std::vector<cellInfo> _elem_to_cell{};
975
977 std::map<cellInfo, coupling::CouplingFields> _cell_phase;
978
981
984
987
990
996
1002
1008
1011
1014
1017
1019 std::map<cellInfo, std::vector<unsigned int>> _cell_to_elem;
1020
1022 std::map<cellInfo, std::vector<unsigned int>> _local_cell_to_elem;
1023
1025 std::map<cellInfo, std::unordered_set<SubdomainID>> _cell_to_elem_subdomain;
1026
1028 std::map<SubdomainID, std::set<int32_t>> _subdomain_to_material;
1029
1034 std::map<cellInfo, Point> _cell_to_point;
1035
1040 std::map<cellInfo, Real> _cell_to_elem_volume;
1041
1046 std::map<cellInfo, Real> _cell_volume;
1047
1052 std::map<cellInfo, int32_t> _cell_to_material;
1053
1058 std::map<cellInfo, containedCells> _cell_to_contained_material_cells;
1059
1061 std::map<cellInfo, int32_t> _cell_to_n_contained;
1062
1067 std::vector<openmc::Tally *> _global_tallies;
1068
1070 std::vector<std::vector<std::string>> _global_tally_scores;
1071
1073 std::vector<openmc::TallyEstimator> _global_tally_estimators;
1074
1076 std::vector<Real> _global_sum_tally;
1077
1079 std::vector<Real> _local_sum_tally;
1080
1082 std::vector<Real> _local_mean_tally;
1083
1085 static bool _first_transfer;
1086
1088 static bool _printed_initial;
1089
1092
1094 openmc::Particle _particle;
1095
1097 unsigned int _n_particles_1;
1098
1100 std::map<std::string, std::vector<SubdomainName>> _temp_vars_to_blocks;
1101
1103 std::map<std::string, std::vector<SubdomainName>> _density_vars_to_blocks;
1104
1107
1110
1112 std::map<cellInfo, int> _n_temp;
1113
1115 std::map<cellInfo, int> _n_rho;
1116
1118 std::map<cellInfo, int> _n_temp_rho;
1119
1121 std::map<cellInfo, int> _n_none;
1122
1124 unsigned int _global_tally_index = 0;
1125
1128
1129#ifdef ENABLE_DAGMC
1131 MoabSkinner * _skinner = nullptr;
1132
1134 std::shared_ptr<moab::DagMC> _dagmc = nullptr;
1135#endif
1136
1138 long unsigned int _n_openmc_cells;
1139
1142
1145
1148
1152
1154 static constexpr Real EV_TO_JOULE = 1.6022e-19;
1155
1157 static constexpr Real ZERO_TALLY_THRESHOLD = 1e-12;
1158
1159private:
1163 void dufekGudowskiParticleUpdate();
1164
1166 std::vector<int32_t> _flattened_ids;
1167
1169 std::vector<int32_t> _flattened_instances;
1170
1172 containedCells _instance_offsets;
1173
1175 std::map<cellInfo, int32_t> _n_offset;
1176
1178 cellInfo _first_identical_cell;
1179
1181 std::vector<int32_t> _first_identical_cell_materials;
1182
1184 std::map<SubdomainID, std::pair<unsigned int, std::string>> _subdomain_to_temp_vars;
1185
1187 std::map<SubdomainID, std::pair<unsigned int, std::string>> _subdomain_to_density_vars;
1188};
Skins the [Mesh] according to individual bins for temperature, density, and subdomain ID.
Definition MoabSkinner.h:20
Definition OpenMCCellAverageProblem.h:67
const SymmetryPointGenerator * _symmetry
Userobject that maps from a partial-symmetry OpenMC model to a whole-domain [Mesh].
Definition OpenMCCellAverageProblem.h:1109
const bool _needs_global_tally
Definition OpenMCCellAverageProblem.h:937
const Real & _relaxation_factor
Constant relaxation factor.
Definition OpenMCCellAverageProblem.h:856
std::unordered_map< int32_t, std::vector< int32_t > > containedCells
Definition OpenMCCellAverageProblem.h:235
OpenMCCellAverageProblem(const InputParameters &params)
int32_t _dagmc_universe_id
ID of the OpenMC universe corresponding to the DAGMC universe.
Definition OpenMCCellAverageProblem.h:1141
double cellMappedVolume(const cellInfo &cell_info) const
std::vector< SubdomainID > _density_blocks
Blocks in MOOSE mesh that provide density feedback.
Definition OpenMCCellAverageProblem.h:965
int _n_moose_none_elems
Number of no-coupling elements in the MOOSE mesh.
Definition OpenMCCellAverageProblem.h:989
const bool _specified_density_feedback
Definition OpenMCCellAverageProblem.h:918
int _n_mapped_temp_elems
Definition OpenMCCellAverageProblem.h:995
const bool _specified_temperature_feedback
Definition OpenMCCellAverageProblem.h:925
std::map< cellInfo, Real > _cell_to_elem_volume
Definition OpenMCCellAverageProblem.h:1040
static constexpr Real ZERO_TALLY_THRESHOLD
Tolerance for setting zero tally.
Definition OpenMCCellAverageProblem.h:1157
void checkEmptyVector(const std::vector< T > &vector, const std::string &name) const
Definition OpenMCCellAverageProblem.h:387
NumericVector< Number > & _serialized_solution
Definition OpenMCCellAverageProblem.h:763
void readBlockVariables(const std::string &param, const std::string &default_name, std::map< std::string, std::vector< SubdomainName > > &vars_to_specified_blocks, std::vector< SubdomainID > &specified_blocks)
Real _uncoupled_volume
Total volume of uncoupled MOOSE mesh elements.
Definition OpenMCCellAverageProblem.h:1013
const bool & _check_identical_cell_fills
Definition OpenMCCellAverageProblem.h:897
void setContainedCells(const cellInfo &cell_info, const Point &hint, std::map< cellInfo, containedCells > &map)
std::vector< std::map< std::string, int > > _local_tally_score_map
Definition OpenMCCellAverageProblem.h:956
std::vector< SubdomainID > _temp_blocks
Blocks in MOOSE mesh that provide temperature feedback.
Definition OpenMCCellAverageProblem.h:968
int _n_moose_density_elems
Number of elements in the MOOSE mesh that exclusively provide density feedback.
Definition OpenMCCellAverageProblem.h:980
std::map< cellInfo, coupling::CouplingFields > _cell_phase
Phase of each cell.
Definition OpenMCCellAverageProblem.h:977
void sendTemperatureToOpenMC() const
const std::vector< std::shared_ptr< TallyBase > > & getLocalTally() const
Definition OpenMCCellAverageProblem.h:334
bool _map_density_by_cell
Definition OpenMCCellAverageProblem.h:912
std::vector< const MooseVariableFE< Real > * > getTallyScoreVariables(const std::string &score, THREAD_ID tid)
virtual bool converged(unsigned int) override
Definition OpenMCCellAverageProblem.h:75
std::vector< cellInfo > _elem_to_cell
Mapping of MOOSE elements to the OpenMC cell they map to (if any)
Definition OpenMCCellAverageProblem.h:974
bool hasFilter(const std::string &filter_name) const
Definition OpenMCCellAverageProblem.h:318
int32_t elemToCellID(const int &elem_id) const
Definition OpenMCCellAverageProblem.h:250
std::vector< openmc::TallyEstimator > _global_tally_estimators
Global tally estimators corresponding to '_global_tallies'.
Definition OpenMCCellAverageProblem.h:1073
int _n_moose_temp_density_elems
Number of elements in the MOOSE mesh which provide temperature+density feedback.
Definition OpenMCCellAverageProblem.h:986
unsigned int _global_tally_index
Index in OpenMC tallies corresponding to the first global tally added by Cardinal.
Definition OpenMCCellAverageProblem.h:1124
std::vector< std::vector< unsigned int > > _tally_var_ids
A vector of auxvariable ids added by the [Tallies] block.
Definition OpenMCCellAverageProblem.h:959
std::map< cellInfo, Real > computeVolumeWeightedCellInput(const std::map< SubdomainID, std::pair< unsigned int, std::string > > &var_num, const std::vector< coupling::CouplingFields > *phase) const
bool hasDensityFeedback(const cellInfo &cell_info) const
Definition OpenMCCellAverageProblem.h:294
bool hasScore(const std::string &score)
Definition OpenMCCellAverageProblem.h:156
virtual void initialSetup() override
std::map< cellInfo, std::unordered_set< SubdomainID > > _cell_to_elem_subdomain
Mapping of OpenMC cell indices to the subdomain IDs each maps to.
Definition OpenMCCellAverageProblem.h:1025
int _n_mapped_temp_density_elems
Definition OpenMCCellAverageProblem.h:1007
void checkCellMappedPhase()
This function is used to ensure that each OpenMC cell only maps to a single phase.
bool hasAdaptivity() const
Definition OpenMCCellAverageProblem.h:399
std::vector< int32_t > materialsInCells(const containedCells &contained_cells) const
void printTrisoHelp(const std::chrono::time_point< std::chrono::high_resolution_clock > &start) const
const trigger::TallyTriggerTypeEnum _k_trigger
Definition OpenMCCellAverageProblem.h:794
void setupProblem()
Initialize the mapping of OpenMC to the MooseMesh and perform additional setup actions.
virtual void createQRules(QuadratureType type, Order order, Order volume_order, Order face_order, SubdomainID block, bool allow_negative_weights=true) override
void latticeOuterCheck(const Point &c, int level) const
containedCells shiftCellInstances(const cellInfo &cell_info) const
Real tallyNormalization(unsigned int global_score) const
static constexpr int32_t UNMAPPED
Constant flag to indicate that a cell/element was unmapped.
Definition OpenMCCellAverageProblem.h:402
unsigned int _cell_level
Definition OpenMCCellAverageProblem.h:801
bool findCell(const Point &point)
std::map< cellInfo, int > _n_none
Number of none elements in each mapped OpenMC cell (global)
Definition OpenMCCellAverageProblem.h:1121
bool hasTemperatureFeedback(const cellInfo &cell_info) const
Definition OpenMCCellAverageProblem.h:306
int _n_mapped_none_elems
Number of no-coupling elements mapped to OpenMC cells.
Definition OpenMCCellAverageProblem.h:1010
void getCellMappedSubdomains()
Loop over all the OpenMC cells and get the element subdomain IDs that map to each cell.
std::map< cellInfo, int > _n_temp_rho
Number of temperature+density feedback elements in each mapped OpenMC cell (global)
Definition OpenMCCellAverageProblem.h:1118
std::set< SubdomainID > coupledSubdomains() const
void sendDensityToOpenMC() const
const relaxation::RelaxationEnum _relaxation
Type of relaxation to apply to the OpenMC tallies.
Definition OpenMCCellAverageProblem.h:786
void initializeElementToCellMapping()
Set up the mapping from MOOSE elements to OpenMC cells.
openmc::Particle _particle
Dummy particle to reduce number of allocations of particles for cell lookup routines.
Definition OpenMCCellAverageProblem.h:1094
const bool _has_identical_cell_fills
Definition OpenMCCellAverageProblem.h:889
virtual Real cellVolume(const cellInfo &cell_info) const
void relaxAndNormalizeTally(unsigned int global_score, unsigned int local_score, std::shared_ptr< TallyBase > local_tally)
static constexpr int DIMENSION
Spatial dimension of the Monte Carlo problem.
Definition OpenMCCellAverageProblem.h:405
virtual const OpenMCVolumeCalculation * volumeCalculation() const
Definition OpenMCCellAverageProblem.h:118
std::vector< std::vector< std::vector< unsigned int > > > _tally_ext_var_ids
A vector of external (output-based) auxvariable ids added by the [Tallies] block.
Definition OpenMCCellAverageProblem.h:962
unsigned int _source_rate_index
Index in tally_score pointing to the score used for normalizing flux tallies in eigenvalue mode.
Definition OpenMCCellAverageProblem.h:1127
bool _needs_to_map_cells
Whether any spatial mapping from OpenMC's cells to the mesh is needed.
Definition OpenMCCellAverageProblem.h:931
std::vector< std::string > getMaterialInEachSubdomain() const
static constexpr Real EV_TO_JOULE
Conversion rate from eV to Joule.
Definition OpenMCCellAverageProblem.h:1154
void reloadDAGMC()
Reconstruct the DAGMC geometry after skinning.
int32_t elemToCellIndex(const int &elem_id) const
Definition OpenMCCellAverageProblem.h:242
static bool _printed_triso_warning
Whether a warning has already been printed about very long setup times (for TRISOs)
Definition OpenMCCellAverageProblem.h:1091
bool _has_cell_tallies
Whether any cell tallies exist.
Definition OpenMCCellAverageProblem.h:928
std::map< std::string, std::vector< SubdomainName > > _density_vars_to_blocks
Mapping from density variable name to the subdomains on which to read it from.
Definition OpenMCCellAverageProblem.h:1103
coupling::CouplingFields cellFeedback(const cellInfo &cell_info) const
void mapElemsToCells()
Populate maps of MOOSE elements to OpenMC cells.
void addTally(const std::string &type, const std::string &name, InputParameters &moose_object_pars)
void checkContainedCellsStructure(const cellInfo &cell_info, containedCells &reference, containedCells &compare) const
std::string printNewline() const
For keeping the output neat when using verbose.
Definition OpenMCCellAverageProblem.h:610
std::vector< const VariableValue * > getTallyScoreVariableValues(const std::string &score, THREAD_ID tid)
int32_t _cell_using_dagmc_universe_id
ID of the OpenMC cell corresponding to the cell which uses the DAGMC universe as a fill.
Definition OpenMCCellAverageProblem.h:1147
unsigned int _n_particles_1
Number of particles simulated in the first iteration.
Definition OpenMCCellAverageProblem.h:1097
int _n_mapped_density_elems
Definition OpenMCCellAverageProblem.h:1001
std::vector< Real > _global_sum_tally
Sum value of the global tally(s), across all bins.
Definition OpenMCCellAverageProblem.h:1076
unsigned int getCellLevel(const Point &c) const
void addFilter(const std::string &type, const std::string &name, InputParameters &moose_object_pars)
virtual std::unordered_set< SubdomainID > getCellToElementSub(const cellInfo &info)
Definition OpenMCCellAverageProblem.h:134
static InputParameters validParams()
std::vector< Real > _local_mean_tally
Mean value of the local tally(s), across all bins; only used for fixed source mode.
Definition OpenMCCellAverageProblem.h:1082
std::map< SubdomainID, std::set< int32_t > > _subdomain_to_material
Mapping of elem subdomains to materials.
Definition OpenMCCellAverageProblem.h:1028
static bool _first_transfer
Whether the present transfer is the first transfer.
Definition OpenMCCellAverageProblem.h:1085
bool _dagmc_root_universe
Whether the DAGMC universe is the root universe or not.
Definition OpenMCCellAverageProblem.h:1144
std::map< cellInfo, containedCells > _cell_to_contained_material_cells
Definition OpenMCCellAverageProblem.h:1058
bool cellHasIdenticalFill(const cellInfo &cell_info) const
static bool _printed_initial
Whether the diagnostic tables on initialization have already been printed.
Definition OpenMCCellAverageProblem.h:1088
const bool & _export_properties
Definition OpenMCCellAverageProblem.h:807
bool _need_to_reinit_coupling
Definition OpenMCCellAverageProblem.h:838
int32_t cellToMaterialIndex(const cellInfo &cell_info) const
Definition OpenMCCellAverageProblem.h:274
std::map< cellInfo, int > _n_rho
Number of density-only feedback elements in each mapped OpenMC cell (global)
Definition OpenMCCellAverageProblem.h:1115
std::map< cellInfo, Point > _cell_to_point
Definition OpenMCCellAverageProblem.h:1034
std::map< std::string, std::vector< SubdomainName > > _temp_vars_to_blocks
Mapping from temperature variable name to the subdomains on which to read it from.
Definition OpenMCCellAverageProblem.h:1100
long unsigned int _n_openmc_cells
Total number of unique OpenMC cell IDs + instances combinations.
Definition OpenMCCellAverageProblem.h:1138
void subdomainsToMaterials()
Loop over the mapped cells, and build a map between subdomains to OpenMC materials.
void gatherCellSum(std::vector< T > &local, std::map< cellInfo, T > &global) const
int _n_moose_temp_elems
Number of elements in the MOOSE mesh that exclusively provide temperature feedback.
Definition OpenMCCellAverageProblem.h:983
void read2DBlockParameters(const std::string name, std::vector< std::vector< SubdomainName > > &names, std::vector< SubdomainID > &flattened_ids)
std::vector< std::vector< std::string > > _global_tally_scores
Global tally scores corresponding to '_global_tallies'.
Definition OpenMCCellAverageProblem.h:1070
void checkBlocksInMesh(const std::string name, const std::vector< SubdomainID > &ids, const std::vector< SubdomainName > &names) const
const coupling::OpenMCInitialCondition _initial_condition
Definition OpenMCCellAverageProblem.h:783
const bool _check_tally_sum
Definition OpenMCCellAverageProblem.h:853
std::map< cellInfo, int > _n_temp
Number of temperature-only feedback elements in each mapped OpenMC cell (global)
Definition OpenMCCellAverageProblem.h:1112
std::vector< std::shared_ptr< TallyBase > > _local_tallies
A vector of the tally objects created by the [Problem/Tallies] block.
Definition OpenMCCellAverageProblem.h:946
Point transformPointToOpenMC(const Point &pt) const
int32_t elemToCellInstance(const int &elem_id) const
Definition OpenMCCellAverageProblem.h:257
void checkTallySum(const unsigned int &score) const
virtual Point transformPoint(const Point &pt) const
Definition OpenMCCellAverageProblem.h:198
virtual void addExternalVariables() override
cellInfo firstContainedMaterialCell(const cellInfo &cell_info) const
Real tallyMultiplier(unsigned int global_score) const
std::vector< openmc::Tally * > _global_tallies
Definition OpenMCCellAverageProblem.h:1067
std::vector< std::string > _all_tally_scores
A list of all of the scores contained by the local tallies added in the [Tallies] block.
Definition OpenMCCellAverageProblem.h:949
std::unordered_set< SubdomainID > _identical_cell_fill_blocks
Blocks for which the cell fills are identical.
Definition OpenMCCellAverageProblem.h:971
void readBlockParameters(const std::string name, std::unordered_set< SubdomainID > &blocks)
containedCells containedMaterialCells(const cellInfo &cell_info) const
void setMinimumVolumeQRules(Order &volume_order, const std::string &type)
bool cellMapsToSubdomain(const cellInfo &cell_info, const std::unordered_set< SubdomainID > &id) const
std::map< cellInfo, std::vector< unsigned int > > _cell_to_elem
Mapping of OpenMC cell indices to a vector of MOOSE element IDs.
Definition OpenMCCellAverageProblem.h:1019
coupling::CouplingFields elemFeedback(const Elem *elem) const
std::map< cellInfo, int32_t > _cell_to_n_contained
Number of material-type cells contained within a cell.
Definition OpenMCCellAverageProblem.h:1061
virtual void syncSolutions(ExternalProblem::Direction direction) override
Set the 'mesh changed' adaptivity flag.
virtual void externalSolve() override
cellInfo elemToCellInfo(const int &elem_id) const
Definition OpenMCCellAverageProblem.h:265
double cellTemperature(const cellInfo &cell_info) const
virtual bool hasPointTransformations() const
Definition OpenMCCellAverageProblem.h:143
int fixedPointIteration() const
Definition OpenMCCellAverageProblem.h:393
const int32_t _initial_num_openmc_surfaces
Definition OpenMCCellAverageProblem.h:1151
void initializeTallies()
Add OpenMC tallies to facilitate the coupling.
const bool _normalize_by_global
Definition OpenMCCellAverageProblem.h:828
std::map< cellInfo, int32_t > _cell_to_material
Definition OpenMCCellAverageProblem.h:1052
virtual void updateMaterials()
std::map< cellInfo, Real > _cell_volume
Definition OpenMCCellAverageProblem.h:1046
std::vector< const TallyBase * > getTalliesByScore(const std::string &score)
std::map< cellInfo, std::vector< unsigned int > > _local_cell_to_elem
Mapping of OpenMC cell indices to a vector of MOOSE element IDs, on each local rank.
Definition OpenMCCellAverageProblem.h:1022
const bool & _output_cell_mapping
Definition OpenMCCellAverageProblem.h:775
const bool & _assume_separate_tallies
Definition OpenMCCellAverageProblem.h:906
virtual const std::map< cellInfo, std::vector< unsigned int > > & cellToElem() const
Definition OpenMCCellAverageProblem.h:124
virtual const std::vector< std::string > & getTallyScores() const
Definition OpenMCCellAverageProblem.h:149
OpenMCVolumeCalculation * _volume_calc
Optional volume calculation for cells which map to MOOSE.
Definition OpenMCCellAverageProblem.h:1106
std::shared_ptr< FilterBase > & getFilter(const std::string &filter_name)
Definition OpenMCCellAverageProblem.h:325
void getTallyTriggerParameters(const InputParameters &params)
std::map< std::string, std::shared_ptr< FilterBase > > _filters
Definition OpenMCCellAverageProblem.h:943
void getMaterialFills()
Find the material filling each cell which receives density feedback.
void latticeOuterError(const Point &c, int level) const
void compareContainedCells(std::map< cellInfo, containedCells > &reference, std::map< cellInfo, containedCells > &compare) const
bool _material_cells_only
Whether non-material cells are mapped.
Definition OpenMCCellAverageProblem.h:1016
const bool _using_skinner
Whether or not the problem uses a skinner to regenerate the OpenMC geometry.
Definition OpenMCCellAverageProblem.h:831
void storeElementPhase()
Loop over the elements in the MOOSE mesh and store the type of feedback applied by each.
std::vector< const VariableValue * > getTallyScoreNeighborVariableValues(const std::string &score, THREAD_ID tid)
void gatherCellVector(std::vector< T > &local, std::vector< unsigned int > &n_local, std::map< cellInfo, std::vector< T > > &global)
std::vector< Real > _local_sum_tally
Sum value of the local tally(s), across all bins.
Definition OpenMCCellAverageProblem.h:1079
void checkNormalization(const Real &sum, unsigned int global_score) const
virtual std::vector< int32_t > getMappedTallyIDs() const override
Definition OpenMCProblemBase.h:53
int _fixed_point_iteration
Definition OpenMCProblemBase.h:454
const bool & _verbose
Whether to print diagnostic information about model setup and the transfers.
Definition OpenMCProblemBase.h:404
int32_t cellID(const int32_t index) const
std::pair< int32_t, int32_t > cellInfo
Definition OpenMCProblemBase.h:197
const bool _has_adaptivity
Whether or not the problem contains mesh adaptivity.
Definition OpenMCProblemBase.h:486
Definition OpenMCVolumeCalculation.h:31
Definition SymmetryPointGenerator.h:29
Point transformPoint(const Point &p) const
Definition SymmetryPointGenerator.C:100
OpenMCInitialCondition
Where to get the initial temperature and density settings for OpenMC.
Definition CardinalEnums.h:221
CouplingFields
Type of feedback in Monte Carlo simulation.
Definition CardinalEnums.h:212
@ density
Definition CardinalEnums.h:214
@ density_and_temperature
Definition CardinalEnums.h:215
@ temperature
Definition CardinalEnums.h:213
Definition CardinalEnums.h:69
RelaxationEnum
Type of relaxation.
Definition CardinalEnums.h:244
TallyTriggerTypeEnum
Type of trigger to apply.
Definition CardinalEnums.h:172