https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ReactorMeshParams Class Reference

A class to store mesh information that is globally applicable to a reactor. More...

#include <ReactorMeshParams.h>

Inheritance diagram for ReactorMeshParams:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 ReactorMeshParams (const InputParameters &parameters)
 
std::unique_ptr< MeshBase > generate () override
 
std::unique_ptr< CSG::CSGBasegenerateCSG () override
 
void generateData () override
 
std::unique_ptr< CSG::CSGBasegenerateInternalCSG ()
 
std::unique_ptr< MeshBase > generateInternal ()
 
const std::set< MeshGeneratorName > & getRequestedMeshGenerators () const
 
const std::set< MeshGeneratorName > & getRequestedMeshGeneratorsForSub () const
 
void addParentMeshGenerator (const MeshGenerator &mg, const AddParentChildKey)
 
void addChildMeshGenerator (const MeshGenerator &mg, const AddParentChildKey)
 
const std::set< const MeshGenerator *, Comparator > & getParentMeshGenerators () const
 
const std::set< const MeshGenerator *, Comparator > & getChildMeshGenerators () const
 
const std::set< const MeshGenerator *, Comparator > & getSubMeshGenerators () const
 
bool isParentMeshGenerator (const MeshGeneratorName &name, const bool direct=true) const
 
bool isChildMeshGenerator (const MeshGeneratorName &name, const bool direct=true) const
 
bool isNullMeshName (const MeshGeneratorName &name) const
 
bool hasSaveMesh () const
 
bool hasOutput () const
 
const std::string & getSavedMeshName () const
 
bool hasGenerateData () const
 
bool hasGenerateCSG () const
 
bool isDataOnly () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
bool isKokkosObject () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool haveParameter (const std::string &name) const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static bool hasGenerateData (const InputParameters &params)
 
static bool hasGenerateCSG (const InputParameters &params)
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 
static void setHasGenerateData (InputParameters &params)
 
static void setHasGenerateCSG (InputParameters &params)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string data_only_param
 
static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

TcopyMeshProperty (const std::string &target_data_name, const std::string &source_data_name, const std::string &source_mesh)
 
TcopyMeshProperty (const std::string &source_data_name, const std::string &source_mesh)
 
std::unique_ptr< MeshBase > & getMesh (const std::string &param_name, const bool allow_invalid=false)
 
std::vector< std::unique_ptr< MeshBase > *> getMeshes (const std::string &param_name)
 
std::unique_ptr< MeshBase > & getMeshByName (const MeshGeneratorName &mesh_generator_name)
 
std::vector< std::unique_ptr< MeshBase > *> getMeshesByName (const std::vector< MeshGeneratorName > &mesh_generator_names)
 
std::unique_ptr< CSG::CSGBase > & getCSGBase (const std::string &param_name)
 
std::unique_ptr< CSG::CSGBase > & getCSGBaseByName (const MeshGeneratorName &mesh_generator_name)
 
std::vector< std::unique_ptr< CSG::CSGBase > *> getCSGBases (const std::string &param_name)
 
std::vector< std::unique_ptr< CSG::CSGBase > *> getCSGBasesByName (const std::vector< MeshGeneratorName > &mesh_generator_names)
 
void declareMeshForSub (const std::string &param_name)
 
void declareMeshesForSub (const std::string &param_name)
 
void declareMeshForSubByName (const MeshGeneratorName &mesh_generator_name)
 
void declareMeshesForSubByName (const std::vector< MeshGeneratorName > &mesh_generator_names)
 
std::unique_ptr< MeshBase > buildMeshBaseObject (unsigned int dim=libMesh::invalid_uint)
 
std::unique_ptr< ReplicatedMesh > buildReplicatedMesh (unsigned int dim=libMesh::invalid_uint)
 
std::unique_ptr< DistributedMesh > buildDistributedMesh (unsigned int dim=libMesh::invalid_uint)
 
void addMeshSubgenerator (const std::string &type, const std::string &name, Ts... extra_input_parameters)
 
void addMeshSubgenerator (const std::string &type, const std::string &name, InputParameters params)
 
void declareNullMeshName (const MeshGeneratorName &name)
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
const TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
TdeclareMeshProperty (const std::string &data_name, Args &&... args)
 
TdeclareMeshProperty (const std::string &data_name, const T &data_value)
 
TdeclareMeshProperty (const std::string &data_name, Args &&... args)
 
TdeclareMeshProperty (const std::string &data_name, const T &data_value)
 
TsetMeshProperty (const std::string &data_name, Args &&... args)
 
TsetMeshProperty (const std::string &data_name, const T &data_value)
 
TsetMeshProperty (const std::string &data_name, Args &&... args)
 
TsetMeshProperty (const std::string &data_name, const T &data_value)
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

const MooseEnum _dim
 The number of dimension in the mesh. More...
 
const MooseEnum _geom
 The geometry type for the reactor. More...
 
const Real _assembly_pitch
 The the flat-to-flat size of assemblies in the reactor. More...
 
std::vector< Real_axial_regions
 The heights of the axial regions. More...
 
std::vector< unsigned int_axial_mesh_intervals
 The number of mesh divisions in each axial region. More...
 
boundary_id_type _top_boundary
 Boundary id assigned to top boundary of extruded mesh. More...
 
boundary_id_type _bottom_boundary
 Boundary id assigned to bottom boundary of extruded mesh. More...
 
boundary_id_type _radial_boundary
 Boundary id assigned to outer radial boundary of core mesh. More...
 
MooseMesh *const _mesh
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
const Parallel::Communicator & _communicator
 

Detailed Description

A class to store mesh information that is globally applicable to a reactor.

Definition at line 18 of file ReactorMeshParams.h.

Constructor & Destructor Documentation

◆ ReactorMeshParams()

ReactorMeshParams::ReactorMeshParams ( const InputParameters parameters)

Definition at line 67 of file ReactorMeshParams.C.

69  _dim(getParam<MooseEnum>("dim")),
70  _geom(getParam<MooseEnum>("geom")),
71  _assembly_pitch(getParam<Real>("assembly_pitch"))
72 {
73  if ((unsigned int)(_dim) == 2)
74  {
75  std::vector<std::string> invalid_params = {
76  "axial_regions", "axial_mesh_intervals", "top_boundary_id", "bottom_boundary_id"};
77  for (const auto & param : invalid_params)
78  if (isParamValid(param))
79  paramError(param, param + " should not be defined for 2-D meshes");
80  }
81  else
82  {
83  _axial_regions = getParam<std::vector<Real>>("axial_regions");
84  _axial_mesh_intervals = getParam<std::vector<unsigned int>>("axial_mesh_intervals");
85 
86  if (_axial_regions.size() != _axial_mesh_intervals.size())
87  mooseError(
88  "The number of axial regions is not consistent with the number of axial intervals.");
90  this->declareMeshProperty(RGMB::axial_mesh_intervals, _axial_mesh_intervals);
91  }
92 
93  this->declareMeshProperty(RGMB::mesh_dimensions, (unsigned int)std::stoul(_dim));
94  this->declareMeshProperty(RGMB::mesh_geometry, std::string(_geom));
97  getParam<bool>(RGMB::region_id_as_block_name));
98 
100  this->declareMeshProperty(RGMB::flexible_assembly_stitching, flexible_assembly_stitching);
103  getParam<unsigned int>("num_sectors_at_flexible_boundary"));
104  if (parameters.isParamSetByUser("num_sectors_at_flexible_boundary") &&
106  paramWarning(
107  "num_sectors_at_flexible_boundary",
108  "This parameter is only relevant when ReactorMeshParams/flexible_assembly_stitching is set "
109  "to true. This value will be ignored");
110 
111  // Option to bypass mesh generation depends on whether the current generator is in data only mode
112  bool bypass_meshgen = isDataOnly();
113  this->declareMeshProperty(RGMB::bypass_meshgen, bypass_meshgen);
114 
115  if (isParamValid("top_boundary_id"))
116  {
117  _top_boundary = getParam<boundary_id_type>("top_boundary_id");
119  }
120  if (isParamValid("bottom_boundary_id"))
121  {
122  _bottom_boundary = getParam<boundary_id_type>("bottom_boundary_id");
124  }
125  if (isParamValid("radial_boundary_id"))
126  {
127  _radial_boundary = getParam<boundary_id_type>("radial_boundary_id");
129  if (isParamValid("top_boundary_id") && _radial_boundary == _top_boundary)
130  mooseError("top_boundary_id and radial_boundary_id must be unique values");
131  if (isParamValid("bottom_boundary_id") && _radial_boundary == _bottom_boundary)
132  mooseError("bottom_boundary_id and radial_boundary_id must be unique values");
133  }
134  if (isParamValid("top_boundary_id") && isParamValid("bottom_boundary_id") &&
136  mooseError("top_boundary_id and bottom_boundary_id must be unique values");
137 }
void paramError(const std::string &param, Args... args) const
static const std::string region_id_as_block_name
const MooseEnum _geom
The geometry type for the reactor.
const InputParameters & parameters() const
static const std::string mesh_geometry
MeshGenerator(const InputParameters &parameters)
static const std::string axial_mesh_sizes
static const std::string assembly_pitch
static const std::string radial_boundary_id
boundary_id_type _bottom_boundary
Boundary id assigned to bottom boundary of extruded mesh.
static const std::string mesh_dimensions
boundary_id_type _radial_boundary
Boundary id assigned to outer radial boundary of core mesh.
const Real _assembly_pitch
The the flat-to-flat size of assemblies in the reactor.
static const std::string top_boundary_id
std::vector< unsigned int > _axial_mesh_intervals
The number of mesh divisions in each axial region.
bool isParamSetByUser(const std::string &name) const
const MooseEnum _dim
The number of dimension in the mesh.
static const std::string flexible_assembly_stitching
static const std::string axial_mesh_intervals
void mooseError(Args &&... args) const
boundary_id_type _top_boundary
Boundary id assigned to top boundary of extruded mesh.
T & declareMeshProperty(const std::string &data_name, Args &&... args)
bool isParamValid(const std::string &name) const
static const std::string bypass_meshgen
void paramWarning(const std::string &param, Args... args) const
bool isDataOnly() const
static const std::string num_sectors_flexible_stitching
static const std::string bottom_boundary_id
std::vector< Real > _axial_regions
The heights of the axial regions.

Member Function Documentation

◆ generate()

std::unique_ptr< MeshBase > ReactorMeshParams::generate ( )
overridevirtual

Implements MeshGenerator.

Definition at line 140 of file ReactorMeshParams.C.

141 {
142  // If mesh generation is requested and bypass_mesh is true, return a null mesh. generate()
143  // mesh should not be called with this option specified
144  if (getMeshProperty<bool>(RGMB::bypass_meshgen))
145  {
146  auto null_mesh = nullptr;
147  return null_mesh;
148  }
149  auto mesh = buildMeshBaseObject();
150  return dynamic_pointer_cast<MeshBase>(mesh);
151 }
MeshBase & mesh
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
static const std::string bypass_meshgen
std::unique_ptr< MeshBase > buildMeshBaseObject(unsigned int dim=libMesh::invalid_uint)

◆ generateCSG()

std::unique_ptr< CSG::CSGBase > ReactorMeshParams::generateCSG ( )
overridevirtual

Reimplemented from MeshGenerator.

Definition at line 154 of file ReactorMeshParams.C.

155 {
156  // This MeshGenerator does not produce a mesh, therefore return an empty CSGBase object
157  return std::make_unique<CSG::CSGBase>();
158 }

◆ generateData()

void ReactorMeshParams::generateData ( )
inlineoverridevirtual

Reimplemented from MeshGenerator.

Definition at line 29 of file ReactorMeshParams.h.

29 {};

◆ validParams()

InputParameters ReactorMeshParams::validParams ( )
static

Definition at line 25 of file ReactorMeshParams.C.

26 {
28  MooseEnum dims("2=2 3", "2");
29  params.addRequiredParam<MooseEnum>("dim", dims, "The dimension of the mesh to be generated");
30 
31  MooseEnum geoms("Square Hex", "Square");
32  params.addRequiredParam<MooseEnum>("geom", geoms, "The geometry type of the reactor mesh");
33 
34  params.addRequiredParam<Real>("assembly_pitch", "Center to center distance of assemblies");
35  params.addParam<boundary_id_type>("top_boundary_id",
36  "The boundary ID to set on top boundary of the extruded mesh");
37  params.addParam<boundary_id_type>(
38  "bottom_boundary_id", "The boundary ID to set on bottom boundary of the extruded mesh");
39  params.addParam<boundary_id_type>(
40  "radial_boundary_id",
41  "The boundary ID to set on the outer radial boundary of a CoreMeshGenerator object");
42  params.addParam<std::vector<Real>>("axial_regions", "Length of each axial region");
43  params.addParam<std::vector<unsigned int>>(
44  "axial_mesh_intervals",
45  "Number of elements in the Z direction for each axial region");
46  params.addParam<bool>("region_id_as_block_name", false, "Set block names based on region id");
47  params.addParam<bool>(
48  "flexible_assembly_stitching",
49  false,
50  "Use FlexiblePatternGenerator for stitching dissimilar assemblies together");
51  params.addRangeCheckedParam<unsigned int>(
52  "num_sectors_at_flexible_boundary",
53  6,
54  "num_sectors_at_flexible_boundary>2",
55  "Number of sectors to use at assembly boundary interface when flexible patterning is used "
56  "(Defaults to 6)");
57  params.addClassDescription("This ReactorMeshParams object acts as storage for persistent "
58  "information about the reactor geometry.");
59 
60  // Declare that this generator has a generateData method
62  // Declare that this generator has a generateCSG method
64  return params;
65 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
int8_t boundary_id_type
static InputParameters validParams()
static void setHasGenerateCSG(InputParameters &params)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static void setHasGenerateData(InputParameters &params)
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)

Member Data Documentation

◆ _assembly_pitch

const Real ReactorMeshParams::_assembly_pitch
protected

The the flat-to-flat size of assemblies in the reactor.

Definition at line 39 of file ReactorMeshParams.h.

Referenced by ReactorMeshParams().

◆ _axial_mesh_intervals

std::vector<unsigned int> ReactorMeshParams::_axial_mesh_intervals
protected

The number of mesh divisions in each axial region.

Definition at line 45 of file ReactorMeshParams.h.

Referenced by ReactorMeshParams().

◆ _axial_regions

std::vector<Real> ReactorMeshParams::_axial_regions
protected

The heights of the axial regions.

Definition at line 42 of file ReactorMeshParams.h.

Referenced by ReactorMeshParams().

◆ _bottom_boundary

boundary_id_type ReactorMeshParams::_bottom_boundary
protected

Boundary id assigned to bottom boundary of extruded mesh.

Definition at line 51 of file ReactorMeshParams.h.

Referenced by ReactorMeshParams().

◆ _dim

const MooseEnum ReactorMeshParams::_dim
protected

The number of dimension in the mesh.

Definition at line 29 of file ReactorMeshParams.h.

Referenced by ReactorMeshParams().

◆ _geom

const MooseEnum ReactorMeshParams::_geom
protected

The geometry type for the reactor.

Definition at line 36 of file ReactorMeshParams.h.

Referenced by ReactorMeshParams().

◆ _radial_boundary

boundary_id_type ReactorMeshParams::_radial_boundary
protected

Boundary id assigned to outer radial boundary of core mesh.

Definition at line 54 of file ReactorMeshParams.h.

Referenced by ReactorMeshParams().

◆ _top_boundary

boundary_id_type ReactorMeshParams::_top_boundary
protected

Boundary id assigned to top boundary of extruded mesh.

Definition at line 48 of file ReactorMeshParams.h.

Referenced by ReactorMeshParams().


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