https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SCMTriCoreMeshGenerator Class Reference

Places triangular-lattice SCM assembly meshes on a hexagonal core lattice and merges them into one mesh. More...

#include <SCMTriCoreMeshGenerator.h>

Inheritance diagram for SCMTriCoreMeshGenerator:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 SCMTriCoreMeshGenerator (const InputParameters &parameters)
 
std::unique_ptr< MeshBase > generate () override
 
std::unique_ptr< CSG::CSGBase > generateInternalCSG ()
 
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< MooseObject > getSharedPtr ()
 
std::shared_ptr< const MooseObject > getSharedPtr () const
 
bool isKokkosObject () const
 
MooseApp & getMooseApp () 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 InputParameters & parameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") 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

void readAssemblySizes () override
 Read the duct size metadata of every input.
 
bool overlap (unsigned int input_a, unsigned int input_b, const Point &offset) const override
 Whether the ducts of two inputs overlap when their centers are offset apart.
 
void addAssembly (int entry, const Point &center)
 Check that a pattern entry is -1 or a valid input index and, if it is an index, place that input at center.
 
virtual void generateData ()
 
virtual std::unique_ptr< CSG::CSGBase > generateCSG ()
 
T & copyMeshProperty (const std::string &target_data_name, const std::string &source_data_name, const std::string &source_mesh)
 
T & copyMeshProperty (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 T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (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
 
T & declareMeshProperty (const std::string &data_name, Args &&... args)
 
T & declareMeshProperty (const std::string &data_name, const T &data_value)
 
T & declareMeshProperty (const std::string &data_name, Args &&... args)
 
T & declareMeshProperty (const std::string &data_name, const T &data_value)
 
T & setMeshProperty (const std::string &data_name, Args &&... args)
 
T & setMeshProperty (const std::string &data_name, const T &data_value)
 
T & setMeshProperty (const std::string &data_name, Args &&... args)
 
T & setMeshProperty (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

std::vector< Real > _flat_to_flat
 Flat-to-flat duct size of each input [m].
 
const std::vector< MeshGeneratorName > & _input_names
 Names of the input SCM 1D assembly, duct, or 3D visualization assembly mesh generators.
 
const std::vector< std::unique_ptr< MeshBase > * > _meshes
 Input meshes.
 
const std::vector< std::vector< int > > & _pattern
 Core pattern of indices into the inputs; -1 marks an empty position.
 
const Real _assembly_pitch
 Center-to-center distance between neighboring assembly positions [m].
 
std::vector< std::pair< unsigned int, Point > > _assemblies
 Placed assemblies in pattern order: (index into the inputs, x-y center of the assembly)
 
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
 

Private Member Functions

virtual std::string meshPropertyPrefix (const std::string &) const override final
 
void checkGetMesh (const MeshGeneratorName &mesh_generator_name, const std::string &param_name) const
 
const MeshGeneratorName * getMeshGeneratorNameFromParam (const std::string &param_name, const bool allow_invalid) const
 
const std::vector< MeshGeneratorName > & getMeshGeneratorNamesFromParam (const std::string &param_name) const
 
RestartableDataValue & setMeshPropertyHelper (const std::string &data_name)
 
bool suppressInfo () const
 
const RestartableDataValue & getMeshPropertyInternal (const std::string &data_name, const std::string &prefix) const
 
void mooseErrorInternal (Args &&... args) const
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

std::set< MeshGeneratorName > _requested_mesh_generators
 
std::set< MeshGeneratorName > _requested_mesh_generators_for_sub
 
std::vector< std::pair< std::string, std::unique_ptr< MeshBase > * > > _requested_meshes
 
std::vector< std::pair< std::string, std::unique_ptr< CSG::CSGBase > * > > _requested_csg_bases
 
std::unique_ptr< MeshBase > _null_mesh
 
std::unique_ptr< CSG::CSGBase > _null_csg_base
 
std::set< const MeshGenerator *, Comparator > _parent_mesh_generators
 
std::set< const MeshGenerator *, Comparator > _child_mesh_generators
 
std::set< const MeshGenerator *, Comparator > _sub_mesh_generators
 
std::set< std::string > _null_mesh_names
 
const std::string & _save_with_name
 
const bool _data_only
 
const ParallelParamObject & _parent
 
const MooseBase & _si_moose_base
 
const FEProblemBase * _si_problem
 
MooseApp & _meta_data_app
 
const MooseObject *const _meta_data_object
 

Detailed Description

Places triangular-lattice SCM assembly meshes on a hexagonal core lattice and merges them into one mesh.

Each placed assembly keeps its own subdomains and boundaries, renamed with the assembly index, and is tagged with the "assembly_id" extra element integer. Assemblies are not connected to each other.

Definition at line 20 of file SCMTriCoreMeshGenerator.h.

Constructor & Destructor Documentation

◆ SCMTriCoreMeshGenerator()

SCMTriCoreMeshGenerator::SCMTriCoreMeshGenerator ( const InputParameters &  parameters)

Definition at line 37 of file SCMTriCoreMeshGenerator.C.

39{
40 const auto n_rows = _pattern.size();
41 if (n_rows == 0)
42 paramError("pattern", "The pattern must contain at least one row.");
43 if (n_rows % 2 == 0)
44 paramError("pattern", "A hexagonal pattern must have an odd number of rows.");
45
46 // Number of positions along each side of the hexagonal pattern
47 const auto n_side = (n_rows + 1) / 2;
48 for (const auto i : index_range(_pattern))
49 {
50 const auto row_length = n_side + std::min(i, n_rows - 1 - i);
51 if (_pattern[i].size() != row_length)
52 paramError("pattern",
53 "Row ",
54 i,
55 " has ",
56 _pattern[i].size(),
57 " entries; a hexagonal pattern with ",
58 n_rows,
59 " rows requires ",
60 row_length,
61 ".");
62
63 for (const auto j : index_range(_pattern[i]))
64 {
65 // The SCM assemblies have a duct corner on the +x axis, so their flat normals point at 30,
66 // 90 and 150 degrees. Placing rows as columns, with neighboring columns offset by half a
67 // pitch, puts every pair of neighboring positions along one of those normals.
68 const Real x = (Real(i) - Real(n_side - 1)) * _assembly_pitch * std::sqrt(3.0) / 2.0;
69 const Real y = (Real(j) - 0.5 * Real(row_length - 1)) * _assembly_pitch;
70 addAssembly(_pattern[i][j], Point(x, y, 0.0));
71 }
72 }
73
74 if (_assemblies.empty())
75 paramError("pattern", "The pattern must contain at least one assembly.");
76}
const std::vector< double > y
const std::vector< double > x
const InputParameters & parameters() const
void paramError(const std::string &param, Args... args) const
Base class for mesh generators that place SCM assembly meshes on a core lattice and merge them into o...
const Real _assembly_pitch
Center-to-center distance between neighboring assembly positions [m].
const std::vector< std::vector< int > > & _pattern
Core pattern of indices into the inputs; -1 marks an empty position.
std::vector< std::pair< unsigned int, Point > > _assemblies
Placed assemblies in pattern order: (index into the inputs, x-y center of the assembly)
void addAssembly(int entry, const Point &center)
Check that a pattern entry is -1 or a valid input index and, if it is an index, place that input at c...
auto index_range(const T &sizable)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Function Documentation

◆ addAssembly()

void SCMCoreMeshGeneratorBase::addAssembly ( int  entry,
const Point &  center 
)
protectedinherited

Check that a pattern entry is -1 or a valid input index and, if it is an index, place that input at center.

Definition at line 54 of file SCMCoreMeshGeneratorBase.C.

55{
56 if (entry == -1)
57 return;
58 if (entry < -1 || entry >= static_cast<int>(_input_names.size()))
59 paramError("pattern", "Entry ", entry, " is neither -1 nor a valid index into 'inputs'.");
60 _assemblies.emplace_back(entry, center);
61}
const std::vector< MeshGeneratorName > & _input_names
Names of the input SCM 1D assembly, duct, or 3D visualization assembly mesh generators.

Referenced by SCMQuadCoreMeshGenerator::SCMQuadCoreMeshGenerator(), and SCMTriCoreMeshGenerator().

◆ generate()

std::unique_ptr< MeshBase > SCMCoreMeshGeneratorBase::generate ( )
overridevirtualinherited

Implements MeshGenerator.

Definition at line 64 of file SCMCoreMeshGeneratorBase.C.

65{
66 std::vector<bool> used(_input_names.size(), false);
67 for (const auto & [input, _] : _assemblies)
68 used[input] = true;
69 for (const auto i : index_range(_input_names))
70 if (!used[i])
71 paramWarning("inputs", "Input '", _input_names[i], "' is not used in 'pattern'.");
72
74
75 // The edge and corner subchannels of a 1D assembly are bounded by a duct wall, which the overlap
76 // check below also uses, whether or not a duct mesh is generated. A 3D visualization core has no
77 // duct generator, so the warning applies to 1D cores only.
78 if (dynamic_cast<const SubChannelMesh *>(_mesh))
79 for (const auto i : index_range(_input_names))
80 if (used[i] && !hasMeshProperty<bool>("duct_mesh", _input_names[i]))
82 "inputs",
83 "Input '",
84 _input_names[i],
85 "' has no duct mesh. Its edge and corner subchannels are still bounded by a "
86 "duct wall, which the overlap check also uses, but the wall does not appear in "
87 "the mesh. Use a duct mesh generator to include it.");
88
89 // All pairs are checked, not only neighbors, because an assembly next to an empty position may
90 // extend past its lattice cell into a farther occupied one. Every overlapping pair is reported at
91 // once so the user does not have to fix and rerun one pair at a time.
92 std::string overlaps;
93 for (const auto a : index_range(_assemblies))
94 for (const auto b : make_range(a + 1, _assemblies.size()))
95 {
96 const auto & [input_a, center_a] = _assemblies[a];
97 const auto & [input_b, center_b] = _assemblies[b];
98 if (overlap(input_a, input_b, center_b - center_a))
99 overlaps += "\n Assembly " + std::to_string(a) + " ('" + _input_names[input_a] +
100 "') and assembly " + std::to_string(b) + " ('" + _input_names[input_b] + "')";
101 }
102 if (!overlaps.empty())
103 paramError("assembly_pitch",
104 "The following assemblies overlap. Increase 'assembly_pitch' or use smaller "
105 "assemblies.",
106 overlaps);
107
108 std::vector<std::unique_ptr<MeshBase>> inputs;
109 for (const auto i : index_range(_meshes))
110 {
111 inputs.push_back(std::move(*_meshes[i]));
112 if (!inputs.back()->is_replicated())
113 paramError("inputs",
114 "Input '",
115 _input_names[i],
116 "' is not a replicated mesh. SCM core meshes require a replicated mesh; run "
117 "without --distributed-mesh.");
118 }
119
120 auto mesh = dynamic_pointer_cast<UnstructuredMesh>(buildMeshBaseObject());
121 mesh->set_spatial_dimension(3);
122
123 // Every subdomain and boundary of every placed assembly gets a new id and its name gets the
124 // assembly index as a suffix, so each assembly can be addressed by block or boundary
125 subdomain_id_type next_subdomain_id = 0;
126 boundary_id_type next_boundary_id = 0;
127 for (const auto k : index_range(_assemblies))
128 {
129 const auto & [input, center] = _assemblies[k];
130 auto assembly = dynamic_pointer_cast<UnstructuredMesh>(inputs[input]->clone());
131 const std::string suffix = "_" + std::to_string(k);
132
133 std::set<subdomain_id_type> subdomain_ids;
134 for (const auto * const elem : assembly->element_ptr_range())
135 subdomain_ids.insert(elem->subdomain_id());
136 std::map<subdomain_id_type, subdomain_id_type> subdomain_map;
137 const auto & old_subdomain_names = assembly->get_subdomain_name_map();
138 std::map<subdomain_id_type, std::string> subdomain_names;
139 for (const auto old_id : subdomain_ids)
140 {
141 subdomain_map[old_id] = next_subdomain_id;
142 const auto it = old_subdomain_names.find(old_id);
143 subdomain_names[next_subdomain_id] =
144 (it == old_subdomain_names.end() ? std::to_string(old_id) : it->second) + suffix;
145 ++next_subdomain_id;
146 }
147 assembly->set_subdomain_name_map() = subdomain_names;
148
149 if (assembly->has_elem_integer("assembly_id"))
150 paramError("inputs",
151 "Input '",
152 _input_names[input],
153 "' already has an 'assembly_id' extra element integer, which this mesh "
154 "generator would overwrite.");
155 const auto assembly_id_index = assembly->add_elem_integer("assembly_id");
156 for (auto * const elem : assembly->element_ptr_range())
157 {
158 elem->subdomain_id() = libmesh_map_find(subdomain_map, elem->subdomain_id());
159 elem->set_extra_integer(assembly_id_index, k);
160 }
161
162 auto & boundary_info = assembly->get_boundary_info();
163 const auto side_list = boundary_info.build_side_list();
164 const auto node_list = boundary_info.build_node_list();
165 const auto sideset_names = boundary_info.get_sideset_name_map();
166 const auto nodeset_names = boundary_info.get_nodeset_name_map();
167 std::map<boundary_id_type, boundary_id_type> boundary_map;
168 const auto map_boundary = [&boundary_map, &next_boundary_id](const boundary_id_type old_id)
169 {
170 const auto [it, inserted] = boundary_map.try_emplace(old_id, next_boundary_id);
171 if (inserted)
172 ++next_boundary_id;
173 return it->second;
174 };
175 for (const auto old_id : boundary_info.get_boundary_ids())
176 map_boundary(old_id);
177 for (const auto & [old_id, _] : sideset_names)
178 map_boundary(old_id);
179 for (const auto & [old_id, _] : nodeset_names)
180 map_boundary(old_id);
181
182 // SCM 1D assembly, duct, and 3D visualization assembly meshes carry only side and node
183 // boundaries, so the edge and shellface boundaries that clear() also drops are not restored
184 boundary_info.clear();
185 for (const auto & [elem_id, side, old_id] : side_list)
186 boundary_info.add_side(elem_id, side, libmesh_map_find(boundary_map, old_id));
187 for (const auto & [node_id, old_id] : node_list)
188 boundary_info.add_node(node_id, libmesh_map_find(boundary_map, old_id));
189 for (const auto & [old_id, old_name] : sideset_names)
190 boundary_info.sideset_name(libmesh_map_find(boundary_map, old_id)) = old_name + suffix;
191 for (const auto & [old_id, old_name] : nodeset_names)
192 boundary_info.nodeset_name(libmesh_map_find(boundary_map, old_id)) = old_name + suffix;
193
194 MeshTools::Modification::translate(*assembly, center(0), center(1), 0.0);
196 *mesh,
197 *assembly,
198 /*avoid_merging_subdomains=*/false,
199 /*avoid_merging_boundaries=*/false,
201 /*skip_preparation=*/true);
202 }
203
204 mesh->unset_is_prepared();
205 return dynamic_pointer_cast<MeshBase>(mesh);
206}
Point center
for(PetscInt i=0;i< nvars;++i)
MooseMesh *const _mesh
std::unique_ptr< MeshBase > buildMeshBaseObject(unsigned int dim=libMesh::invalid_uint)
bool hasMeshProperty(const std::string &data_name, const std::string &prefix) const
void paramWarning(const std::string &param, Args... args) const
virtual bool overlap(unsigned int input_a, unsigned int input_b, const Point &offset) const =0
Whether the ducts of two inputs overlap when their centers are offset apart.
virtual void readAssemblySizes()=0
Read the duct size metadata of every input.
const std::vector< std::unique_ptr< MeshBase > * > _meshes
Input meshes.
Base class for subchannel meshes.
const Parallel::Communicator & _communicator
MeshBase & mesh
void copyIntoMesh(MeshGenerator &mg, UnstructuredMesh &destination, const UnstructuredMesh &source, const bool avoid_merging_subdomains, const bool avoid_merging_boundaries, const Parallel::Communicator &communicator, const bool skip_preparation=false)
int8_t boundary_id_type
if(subdm)
TestClass subdomain_id_type
IntRange< T > make_range(T beg, T end)

◆ overlap()

bool SCMTriCoreMeshGenerator::overlap ( unsigned int  input_a,
unsigned int  input_b,
const Point &  offset 
) const
overrideprotectedvirtual

Whether the ducts of two inputs overlap when their centers are offset apart.

Ducts that only touch do not overlap.

Implements SCMCoreMeshGeneratorBase.

Definition at line 95 of file SCMTriCoreMeshGenerator.C.

98{
99 // The ducts are hexagons with the same orientation, and the set of center offsets at which two
100 // of them overlap is a hexagon of that orientation whose apothem is the sum of their apothems.
101 // They therefore overlap if and only if the center offset projected on every flat normal is
102 // shorter than the sum of the apothems.
103 const std::array<Point, 3> flat_normals = {Point(std::sqrt(3.0) / 2.0, 0.5, 0.0),
104 Point(0.0, 1.0, 0.0),
105 Point(-std::sqrt(3.0) / 2.0, 0.5, 0.0)};
106 // Ducts that exactly touch (assembly_pitch equal to the flat-to-flat size) are allowed; the
107 // tolerance, relative to the pitch, absorbs roundoff in the lattice coordinates.
109 const Real sum_apothems = 0.5 * (_flat_to_flat[input_a] + _flat_to_flat[input_b]);
110 for (const auto & normal : flat_normals)
111 if (!MooseUtils::absoluteFuzzyLessThan(std::abs(offset * normal), sum_apothems, tol))
112 return false;
113 return true;
114}
const double tol
std::vector< Real > _flat_to_flat
Flat-to-flat duct size of each input [m].
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
static constexpr Real TOLERANCE

◆ readAssemblySizes()

void SCMTriCoreMeshGenerator::readAssemblySizes ( )
overrideprotectedvirtual

Read the duct size metadata of every input.

Called once before the overlap checks; derived classes store what overlap() needs.

Implements SCMCoreMeshGeneratorBase.

Definition at line 79 of file SCMTriCoreMeshGenerator.C.

80{
81 for (const auto & input_name : _input_names)
82 {
83 if (!hasMeshProperty<Real>("flat_to_flat", input_name))
84 paramError("inputs",
85 "Input '",
86 input_name,
87 "' does not provide 'flat_to_flat' metadata. Inputs must be "
88 "SCMTriAssemblyMeshGenerator, SCMTriDuctMeshGenerator, or "
89 "SCMTriVisualizationAssemblyMeshGenerator objects.");
90 _flat_to_flat.push_back(getMeshProperty<Real>("flat_to_flat", input_name));
91 }
92}

◆ validParams()

InputParameters SCMTriCoreMeshGenerator::validParams ( )
static

Definition at line 19 of file SCMTriCoreMeshGenerator.C.

20{
23 "Places triangular-lattice subchannel assembly meshes on a hexagonal core lattice. Each "
24 "assembly keeps its own subdomains and boundaries; assemblies are not connected.");
25 params.setDocString(
26 "inputs",
27 "The SCMTriAssemblyMeshGenerator, SCMTriDuctMeshGenerator, or "
28 "SCMTriVisualizationAssemblyMeshGenerator meshes that can be placed in the core");
29 params.setDocString(
30 "pattern",
31 "Hexagonal core pattern of indices into 'inputs', using the row syntax of "
32 "PatternedHexMeshGenerator; -1 marks an empty position. Row i is placed as the i-th column "
33 "from -x, and the entries of a row are placed from -y to +y.");
34 return params;
35}
void setDocString(const std::string &name, const std::string &doc)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()

Member Data Documentation

◆ _assemblies

std::vector<std::pair<unsigned int, Point> > SCMCoreMeshGeneratorBase::_assemblies
protectedinherited

Placed assemblies in pattern order: (index into the inputs, x-y center of the assembly)

Definition at line 51 of file SCMCoreMeshGeneratorBase.h.

Referenced by SCMCoreMeshGeneratorBase::addAssembly(), SCMCoreMeshGeneratorBase::generate(), SCMQuadCoreMeshGenerator::SCMQuadCoreMeshGenerator(), and SCMTriCoreMeshGenerator().

◆ _assembly_pitch

const Real SCMCoreMeshGeneratorBase::_assembly_pitch
protectedinherited

Center-to-center distance between neighboring assembly positions [m].

Definition at line 49 of file SCMCoreMeshGeneratorBase.h.

Referenced by SCMQuadCoreMeshGenerator::overlap(), overlap(), SCMQuadCoreMeshGenerator::SCMQuadCoreMeshGenerator(), and SCMTriCoreMeshGenerator().

◆ _flat_to_flat

std::vector<Real> SCMTriCoreMeshGenerator::_flat_to_flat
protected

Flat-to-flat duct size of each input [m].

Definition at line 32 of file SCMTriCoreMeshGenerator.h.

Referenced by overlap(), and readAssemblySizes().

◆ _input_names

const std::vector<MeshGeneratorName>& SCMCoreMeshGeneratorBase::_input_names
protectedinherited

Names of the input SCM 1D assembly, duct, or 3D visualization assembly mesh generators.

Definition at line 43 of file SCMCoreMeshGeneratorBase.h.

Referenced by SCMCoreMeshGeneratorBase::addAssembly(), SCMCoreMeshGeneratorBase::generate(), SCMQuadCoreMeshGenerator::readAssemblySizes(), and readAssemblySizes().

◆ _meshes

const std::vector<std::unique_ptr<MeshBase> *> SCMCoreMeshGeneratorBase::_meshes
protectedinherited

Input meshes.

Definition at line 45 of file SCMCoreMeshGeneratorBase.h.

Referenced by SCMCoreMeshGeneratorBase::generate().

◆ _pattern

const std::vector<std::vector<int> >& SCMCoreMeshGeneratorBase::_pattern
protectedinherited

Core pattern of indices into the inputs; -1 marks an empty position.

Definition at line 47 of file SCMCoreMeshGeneratorBase.h.

Referenced by SCMQuadCoreMeshGenerator::SCMQuadCoreMeshGenerator(), and SCMTriCoreMeshGenerator().


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