https://mooseframework.inl.gov
BreakMeshByBlockGenerator.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
13 #include <unordered_set>
14 
15 /*
16  * A mesh generator to split a mesh by a set of blocks
17  */
19 {
20 public:
22 
24 
25  std::unique_ptr<MeshBase> generate() override;
26 
27 protected:
38 
40  bool findBlockPairs(subdomain_id_type block_one, subdomain_id_type block_two);
41 
43  std::unique_ptr<MeshBase> & _input;
45  std::unordered_set<std::pair<SubdomainID, SubdomainID>> _block_pairs;
47  std::unordered_set<SubdomainID> _block_set;
57  const BoundaryName _interface_transition_name;
60 
61 private:
63  void addInterfaceBoundary(MeshBase & mesh);
64 
65  std::set<std::pair<subdomain_id_type, subdomain_id_type>> _neighboring_block_list;
66  std::map<std::pair<subdomain_id_type, subdomain_id_type>,
67  std::set<std::pair<dof_id_type, unsigned int>>>
69 };
void addInterfaceBoundary(MeshBase &mesh)
generate the new boundary interface
std::unordered_set< std::pair< SubdomainID, SubdomainID > > _block_pairs
set of subdomain pairs between which interfaces will be generated.
static InputParameters validParams()
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 ...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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&#39; provided block_pairs list.
const BoundaryName _interface_transition_name
the name of the transition interface
std::unique_ptr< MeshBase > & _input
the mesh to modify
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
const bool _add_transition_interface
whether to add a boundary when splitting the mesh
BreakMeshByBlockGenerator(const InputParameters &parameters)
const bool _add_interface_on_two_sides
whether to add two sides interface boundaries
std::set< std::pair< subdomain_id_type, subdomain_id_type > > _neighboring_block_list
const InputParameters & parameters() const
Get the parameters of the object.
std::map< std::pair< subdomain_id_type, subdomain_id_type >, std::set< std::pair< dof_id_type, unsigned int > > > _new_boundary_sides_map
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.