16 #include "libmesh/distributed_mesh.h" 17 #include "libmesh/elem.h" 18 #include "libmesh/parallel_elem.h" 19 #include "libmesh/parallel_node.h" 20 #include "libmesh/compare_elems_by_level.h" 21 #include "libmesh/mesh_communication.h" 35 params.
addRequiredParam<MeshGeneratorName>(
"input",
"The mesh we want to modify");
37 params.
addParam<SubdomainName>(
"new_block_name",
38 "The lower dimensional block name to create (optional)");
40 "sidesets",
"The sidesets from which to create the new block");
49 _input(getMesh(
"input")),
50 _sideset_names(getParam<
std::vector<BoundaryName>>(
"sidesets"))
54 std::unique_ptr<MeshBase>
57 std::unique_ptr<MeshBase>
mesh = std::move(
_input);
61 ? getParam<SubdomainID>(
"new_block_id")
69 ? getParam<SubdomainName>(
"new_block_name")
75 if (((std::string)e.
what()).compare(0, 12,
"The sideset ") == 0)
std::unique_ptr< MeshBase > & _input
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 ...
void createSubdomainFromSidesets(std::unique_ptr< MeshBase > &mesh, std::vector< BoundaryName > boundary_names, const SubdomainID new_subdomain_id, const SubdomainName new_subdomain_name, const std::string type_name)
Create a new subdomain by generating new side elements from a list of sidesets in a given mesh...
static InputParameters validParams()
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
registerMooseObject("MooseApp", LowerDBlockFromSidesetGenerator)
LowerDBlockFromSidesetGenerator(const InputParameters ¶meters)
const std::string & type() const
Get the type of this class.
static InputParameters validParams()
Provides a way for users to bail out of the current solve.
Creates lower-dimensional elements on the specified sidesets.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
SubdomainID getNextFreeSubdomainID(MeshBase &input_mesh)
Checks input mesh and returns max(block ID) + 1, which represents a block ID that is not currently in...
const std::vector< BoundaryName > _sideset_names
a vector of the names of the sidesets to add the lower-D elements to
MeshGenerators are objects that can modify or add to an existing mesh.