13 #include <unordered_set> 25 std::unique_ptr<MeshBase>
generate()
override;
38 BoundaryName & boundary_name,
40 BoundaryInfo & boundary_info);
66 const std::unordered_map<
dof_id_type, std::vector<dof_id_type>> & node_to_elem_map,
67 const MeshBase & mesh);
90 std::unordered_set<std::pair<SubdomainID, SubdomainID>>
_block_pairs;
108 using ElemSide = std::tuple<const Elem *, unsigned int>;
118 std::unordered_map<std::pair<subdomain_id_type, subdomain_id_type>,
boundary_id_type>
std::unordered_set< std::pair< SubdomainID, SubdomainID > > _block_pairs
set of subdomain pairs between which interfaces will be generated.
static InputParameters validParams()
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.
const bool _surrounding_blocks_restricted
whether interfaces will be generated surrounding blocks
const bool _split_transition_interface
whether to split the transition boundary between the blocks and the rest of the mesh ...
const InputParameters & parameters() const
Get the parameters of the object.
std::pair< dof_id_type, std::vector< subdomain_id_type > > NodeConnectedBlocksPair
void addInterface(MeshBase &mesh)
generate the new boundary interface
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::set< std::pair< std::string, BoundaryID > > _bName_bID_set
A container holding (boundary name, boundary ID) associations.
const bool _block_pairs_restricted
whether interfaces will be generated between block pairs
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.
void mapBoundaryIdAndBoundaryName(boundary_id_type boundaryID, const std::string &boundaryName)
this method save the boundary name/id pair
std::unordered_map< SubdomainPair, std::set< ElemSide > > _subid_pairs_to_sides
Map from a pair of block ids to a set of ElemSide tuples.
const BoundaryName _interface_transition_name
the name of the transition interface
void checkInputParameter()
check that if split_interface==true interface_id and interface_name are not set by the user...
std::unique_ptr< MeshBase > & _input
the mesh to modify
BoundaryName generateBoundaryName(const MeshBase &mesh, subdomain_id_type primaryBlockID, subdomain_id_type secondaryBlockID)
this method generate the boundary name by assembling subdomain names
std::set< SubdomainPair > _neighboring_block_list
Set of pairs of block ids between which new boundary sides are created.
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.
subdomain_id_type blockRestrictedElementSubdomainID(const Elem *elem)
This is a helper method to avoid recoding the same if everywhere.
std::unordered_set< SubdomainID > _block_set
set of the blocks to split the mesh on
std::pair< subdomain_id_type, subdomain_id_type > SubdomainPair
const bool _add_transition_interface
whether to add a boundary when splitting the mesh
bool _split_interface
the flag to split the interface by block
BreakMeshByBlockGenerator(const InputParameters ¶meters)
const bool _add_interface_on_two_sides
whether to add two sides interface boundaries
std::string _interface_name
the name of the new interface
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
MeshGenerators are objects that can modify or add to an existing mesh.
std::tuple< const Elem *, unsigned int > ElemSide