12 #include "libmesh/elem.h" 23 "Converts one or more blocks (subdomains) from a mesh into a stand-alone mesh with a " 24 "single block in it.");
26 params.
addRequiredParam<MeshGeneratorName>(
"input",
"The mesh we want to modify");
29 "The (list of) blocks (or 'subdomains') we wish to have moved to a new mesh (by name, not " 37 _input(getMesh(
"input")),
38 _target_blocks(getParam<
std::vector<SubdomainName>>(
"target_blocks"))
42 std::unique_ptr<MeshBase>
45 std::unique_ptr<MeshBase>
mesh = std::move(
_input);
BlockToMeshConverterGenerator(const InputParameters ¶meters)
virtual const char * what() const
Get out the error message.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
These are reworked from https://stackoverflow.com/a/11003103.
std::unique_ptr< MeshBase > & _input
Mesh that comes from another generator.
Creates a new mesh out of one or more subdomains/blocks from another mesh.
const std::vector< SubdomainName > _target_blocks
Blocks to extract to form a mesh.
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
static InputParameters validParams()
registerMooseObject("MooseApp", BlockToMeshConverterGenerator)
Provides a way for users to bail out of the current solve.
static InputParameters validParams()
std::unique_ptr< MeshBase > buildMeshBaseObject(unsigned int dim=libMesh::invalid_uint)
Build a MeshBase object whose underlying type will be determined by the Mesh input file block...
void convertBlockToMesh(std::unique_ptr< MeshBase > &source_mesh, std::unique_ptr< MeshBase > &target_mesh, const std::vector< SubdomainName > &target_blocks)
Convert a list of blocks in a given mesh to a standalone new mesh.
MeshGenerators are objects that can modify or add to an existing mesh.