Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Enumerations | Functions
ReportingIDGeneratorUtils Namespace Reference

Enumerations

enum  AssignType { AssignType::cell, AssignType::pattern, AssignType::manual }
 Enum item for reporting id assign types. More...
 

Functions

std::vector< dof_id_typegetCellwiseIntegerIDs (const std::vector< std::unique_ptr< libMesh::ReplicatedMesh >> &meshes, const std::vector< std::vector< unsigned int >> &pattern, const bool use_exclude_id, const std::vector< bool > &exclude_ids)
 assign IDs for each component in pattern in sequential order More...
 
std::vector< dof_id_typegetPatternIntegerIDs (const std::vector< std::unique_ptr< libMesh::ReplicatedMesh >> &meshes, const std::vector< std::vector< unsigned int >> &pattern)
 assign IDs for each input component type More...
 
std::vector< dof_id_typegetManualIntegerIDs (const std::vector< std::unique_ptr< libMesh::ReplicatedMesh >> &meshes, const std::vector< std::vector< unsigned int >> &pattern, const std::vector< std::vector< dof_id_type >> &id_pattern)
 assign IDs based on user-defined mapping defined in id_pattern More...
 
std::set< SubdomainIDgetCellBlockIDs (const std::vector< std::unique_ptr< libMesh::ReplicatedMesh >> &meshes, const std::vector< std::vector< unsigned int >> &pattern)
 get list of block IDs in input mesh cells More...
 
std::map< SubdomainID, unsigned intgetDuckBlockIDs (const MeshBase &mesh, const bool has_assembly_boundary, const std::set< subdomain_id_type > background_blk_ids, const std::set< SubdomainID > &blks)
 get list of block IDs for the assembly duck regions More...
 
void assignReportingIDs (MeshBase &mesh, const unsigned int extra_id_index, const ReportingIDGeneratorUtils::AssignType assign_type, const bool use_exclude_id, const std::vector< bool > &exclude_ids, const bool has_assembly_boundary, const std::set< subdomain_id_type > background_block_ids, const std::vector< std::unique_ptr< libMesh::ReplicatedMesh >> &input_meshes, const std::vector< std::vector< unsigned int >> &pattern, const std::vector< std::vector< dof_id_type >> &id_pattern)
 assign the reporting IDs to the output mesh from the cartesian or hexagonal patterned mesh generator More...
 

Enumeration Type Documentation

◆ AssignType

Enum item for reporting id assign types.

Enumerator
cell 

assign unique IDs for each tile in the lattice in sequential order

pattern 

assign the same reporting IDs for all tiles in the pattern with same input

manual 

assign IDs based on user-defined mapping

Definition at line 22 of file ReportingIDGeneratorUtils.h.

23 {
25  cell,
27  pattern,
29  manual
30 };
assign IDs based on user-defined mapping
assign unique IDs for each tile in the lattice in sequential order
assign the same reporting IDs for all tiles in the pattern with same input

Function Documentation

◆ assignReportingIDs()

void ReportingIDGeneratorUtils::assignReportingIDs ( MeshBase &  mesh,
const unsigned int  extra_id_index,
const ReportingIDGeneratorUtils::AssignType  assign_type,
const bool  use_exclude_id,
const std::vector< bool > &  exclude_ids,
const bool  has_assembly_boundary,
const std::set< subdomain_id_type background_block_ids,
const std::vector< std::unique_ptr< libMesh::ReplicatedMesh >> &  input_meshes,
const std::vector< std::vector< unsigned int >> &  pattern,
const std::vector< std::vector< dof_id_type >> &  id_pattern 
)

assign the reporting IDs to the output mesh from the cartesian or hexagonal patterned mesh generator

Parameters
meshoutput mesh from the cartesian or hexagonal patterned mesh generator
extra_id_indexindex of extra integer id for assigning the reproting IDs
assign_typetype of integer ID assignment
use_exclude_idflag to indicate if exclude_id is defined
exclude_idsflag to indicate if exclude_id is used for each input mesh
has_assembly_boundaryflag to indicate if assembly boundary exists
background_block_idslist of block ID assigned to background regions
input_meshesinput meshes of the cartesian or hexagonal patterned mesh generator
pattern2D vector of the mesh pattern
id_patternuser-defined integer ID for each input pattern cell
Returns
output mesh file having reporting IDs

Referenced by PatternedCartesianMeshGenerator::addReportingIDs(), PatternedHexMeshGenerator::addReportingIDs(), and CartesianIDPatternedMeshGenerator::generate().

◆ getCellBlockIDs()

std::set< SubdomainID > ReportingIDGeneratorUtils::getCellBlockIDs ( const std::vector< std::unique_ptr< libMesh::ReplicatedMesh >> &  meshes,
const std::vector< std::vector< unsigned int >> &  pattern 
)

get list of block IDs in input mesh cells

Parameters
meshesinput meshes of the cartesian or hexagonal patterned mesh generator
pattern2D vector of the mesh pattern
Returns
list of block IDs in input meshes

Definition at line 74 of file ReportingIDGeneratorUtils.C.

77 {
78  std::set<SubdomainID> blks;
79  for (MooseIndex(pattern) i = 0; i < pattern.size(); ++i)
80  for (MooseIndex(pattern[i]) j = 0; j < pattern[i].size(); ++j)
81  {
82  std::set<SubdomainID> mesh_blks;
83  meshes[pattern[i][j]]->subdomain_ids(mesh_blks);
84  blks.insert(mesh_blks.begin(), mesh_blks.end());
85  }
86  return blks;
87 }
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
assign the same reporting IDs for all tiles in the pattern with same input

◆ getCellwiseIntegerIDs()

std::vector< dof_id_type > ReportingIDGeneratorUtils::getCellwiseIntegerIDs ( const std::vector< std::unique_ptr< libMesh::ReplicatedMesh >> &  meshes,
const std::vector< std::vector< unsigned int >> &  pattern,
const bool  use_exclude_id,
const std::vector< bool > &  exclude_ids 
)

assign IDs for each component in pattern in sequential order

Parameters
meshesinput meshes of the cartesian or hexagonal patterned mesh generator
pattern2D vector of the mesh pattern
use_exclude_idflag to indicate if exclude_id is defined
exclude_idsflag to indicate if exclude_id is used for each input mesh
Returns
list of reporting IDs for individual mesh elements

Definition at line 15 of file ReportingIDGeneratorUtils.C.

20 {
21  dof_id_type n = 0;
22  for (MooseIndex(pattern) i = 0; i < pattern.size(); ++i)
23  for (MooseIndex(pattern[i]) j = 0; j < pattern[i].size(); ++j)
24  n += meshes[pattern[i][j]]->n_elem();
25  std::vector<dof_id_type> integer_ids;
26  integer_ids.reserve(n);
27  dof_id_type id = 0;
28  for (MooseIndex(pattern) i = 0; i < pattern.size(); ++i)
29  for (MooseIndex(pattern[i]) j = 0; j < pattern[i].size(); ++j)
30  {
31  const auto value =
32  (use_exclude_id && exclude_ids[pattern[i][j]]) ? DofObject::invalid_id : id++;
33  integer_ids.insert(integer_ids.end(), meshes[pattern[i][j]]->n_elem(), value);
34  }
35  return integer_ids;
36 }
dof_id_type n_elem(const MeshBase::const_element_iterator &begin, const MeshBase::const_element_iterator &end)
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
assign the same reporting IDs for all tiles in the pattern with same input
uint8_t dof_id_type

◆ getDuckBlockIDs()

std::map<SubdomainID, unsigned int> ReportingIDGeneratorUtils::getDuckBlockIDs ( const MeshBase &  mesh,
const bool  has_assembly_boundary,
const std::set< subdomain_id_type background_blk_ids,
const std::set< SubdomainID > &  blks 
)

get list of block IDs for the assembly duck regions

Parameters
meshoutput mesh from the cartesian or hexagonal patterned mesh generator
has_assembly_boundaryflag to indicate if assembly boundary exists
background_blk_idslist of block ID assigned to background regions
blkslist of block defined in the input meshes of the cartesian or hexagonal patterned mesh generator
Returns
list of block ids in the assembly duct region

◆ getManualIntegerIDs()

std::vector< dof_id_type > ReportingIDGeneratorUtils::getManualIntegerIDs ( const std::vector< std::unique_ptr< libMesh::ReplicatedMesh >> &  meshes,
const std::vector< std::vector< unsigned int >> &  pattern,
const std::vector< std::vector< dof_id_type >> &  id_pattern 
)

assign IDs based on user-defined mapping defined in id_pattern

Parameters
meshesinput meshes of the cartesian or hexagonal patterned mesh generator
pattern2D vector of the mesh pattern
id_patternuser-defined integer ID for each input pattern cell
Returns
list of reporting IDs for individual mesh elements

Definition at line 56 of file ReportingIDGeneratorUtils.C.

60 {
61  dof_id_type n = 0;
62  for (MooseIndex(pattern) i = 0; i < pattern.size(); ++i)
63  for (MooseIndex(pattern[i]) j = 0; j < pattern[i].size(); ++j)
64  n += meshes[pattern[i][j]]->n_elem();
65  std::vector<dof_id_type> integer_ids;
66  integer_ids.reserve(n);
67  for (MooseIndex(pattern) i = 0; i < pattern.size(); ++i)
68  for (MooseIndex(pattern[i]) j = 0; j < pattern[i].size(); ++j)
69  integer_ids.insert(integer_ids.end(), meshes[pattern[i][j]]->n_elem(), id_pattern[i][j]);
70  return integer_ids;
71 }
dof_id_type n_elem(const MeshBase::const_element_iterator &begin, const MeshBase::const_element_iterator &end)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
assign the same reporting IDs for all tiles in the pattern with same input
uint8_t dof_id_type

◆ getPatternIntegerIDs()

std::vector< dof_id_type > ReportingIDGeneratorUtils::getPatternIntegerIDs ( const std::vector< std::unique_ptr< libMesh::ReplicatedMesh >> &  meshes,
const std::vector< std::vector< unsigned int >> &  pattern 
)

assign IDs for each input component type

Parameters
meshesinput meshes of the cartesian or hexagonal patterned mesh generator
pattern2D vector of the mesh pattern
Returns
list of reporting IDs for individual mesh elements

Definition at line 39 of file ReportingIDGeneratorUtils.C.

42 {
43  dof_id_type n = 0;
44  for (MooseIndex(pattern) i = 0; i < pattern.size(); ++i)
45  for (MooseIndex(pattern[i]) j = 0; j < pattern[i].size(); ++j)
46  n += meshes[pattern[i][j]]->n_elem();
47  std::vector<dof_id_type> integer_ids;
48  integer_ids.reserve(n);
49  for (MooseIndex(pattern) i = 0; i < pattern.size(); ++i)
50  for (MooseIndex(pattern[i]) j = 0; j < pattern[i].size(); ++j)
51  integer_ids.insert(integer_ids.end(), meshes[pattern[i][j]]->n_elem(), pattern[i][j]);
52  return integer_ids;
53 }
dof_id_type n_elem(const MeshBase::const_element_iterator &begin, const MeshBase::const_element_iterator &end)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
assign the same reporting IDs for all tiles in the pattern with same input
uint8_t dof_id_type