13#include <unordered_set>
25 std::unique_ptr<MeshBase>
generate()
override;
31 subdomain_id_type primaryBlockID,
32 subdomain_id_type secondaryBlockID,
33 BoundaryName & boundary_name,
34 boundary_id_type boundaryID,
35 BoundaryInfo & boundary_info);
42 subdomain_id_type primaryBlockID,
43 subdomain_id_type secondaryBlockID);
61 const std::unordered_map<dof_id_type, std::vector<dof_id_type>> & node_to_elem_map,
62 const MeshBase & mesh);
76 bool findBlockPairs(subdomain_id_type block_one, subdomain_id_type block_two);
81 std::unordered_set<std::pair<SubdomainID, SubdomainID>>
_block_pairs;
91 using ElemSide = std::tuple<const Elem *, unsigned int>;
101 std::unordered_map<std::pair<subdomain_id_type, subdomain_id_type>, boundary_id_type>
std::unordered_set< SubdomainID > _block_set
set of the blocks to split the mesh on
std::set< std::pair< std::string, BoundaryID > > _bName_bID_set
A container holding (boundary name, boundary ID) associations.
std::unordered_map< dof_id_type, std::set< subdomain_id_type > > syncConnectedBlocks(const std::unordered_map< dof_id_type, std::vector< dof_id_type > > &node_to_elem_map, const MeshBase &mesh)
Synchronizes connected blocks across all MPI ranks.
std::unique_ptr< MeshBase > & _input
the mesh to modify
const bool _surrounding_blocks_restricted
whether interfaces will be generated surrounding blocks
subdomain_id_type blockRestrictedElementSubdomainID(const Elem *elem)
This is a helper method to avoid recoding the same if everywhere.
BoundaryName generateBoundaryName(const MeshBase &mesh, subdomain_id_type primaryBlockID, subdomain_id_type secondaryBlockID)
this method generate the boundary name by assembling subdomain names
std::unordered_map< SubdomainPair, std::set< ElemSide > > _subid_pairs_to_sides
Map from a pair of block ids to a set of ElemSide tuples.
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
std::pair< dof_id_type, std::vector< subdomain_id_type > > NodeConnectedBlocksPair
void findBoundaryName(const MeshBase &mesh, subdomain_id_type primaryBlockID, subdomain_id_type secondaryBlockID, BoundaryName &boundary_name, boundary_id_type boundaryID, BoundaryInfo &boundary_info)
given the primary and secondary blocks this method return the appropriate boundary id and name
std::tuple< const Elem *, unsigned int > ElemSide
static InputParameters validParams()
std::pair< subdomain_id_type, subdomain_id_type > SubdomainPair
std::unordered_set< std::pair< SubdomainID, SubdomainID > > _block_pairs
set of subdomain pairs between which interfaces will be generated.
void addInterface(MeshBase &mesh)
generate the new boundary interface
bool findBlockPairs(subdomain_id_type block_one, subdomain_id_type block_two)
Return true if block_one and block_two are found in users' provided block_pairs list.
std::set< SubdomainPair > _neighboring_block_list
Set of pairs of block ids between which new boundary sides are created.
const bool _block_pairs_restricted
whether interfaces will be generated between block pairs
std::unordered_map< std::pair< subdomain_id_type, subdomain_id_type >, boundary_id_type > _subid_pairs_to_boundary_id
Map from a pair of block ids to the corresponding boundary id.
void mapBoundaryIdAndBoundaryName(boundary_id_type boundaryID, const std::string &boundaryName)
this method save the boundary name/id pair
MeshGenerators are objects that can modify or add to an existing mesh.
const InputParameters & parameters() const
Get the parameters of the object.