13 #include "libmesh/elem.h" 14 #include "libmesh/boundary_info.h" 15 #include "libmesh/mesh_base.h" 16 #include "libmesh/parallel.h" 17 #include "libmesh/parallel_algebra.h" 18 #include "libmesh/cell_tet4.h" 19 #include "libmesh/face_tri3.h" 32 "input",
"The input mesh that needs to be converted to tetrahedral elements.");
35 "This ElementsToTetrahedronsConverter object is designed to convert all the elements in a 3D " 36 "mesh consisting only linear elements into TET4 elements.");
43 _input_name(getParam<MeshGeneratorName>(
"input")),
44 _input(getMeshByName(_input_name))
48 std::unique_ptr<MeshBase>
51 auto replicated_mesh_ptr =
dynamic_cast<ReplicatedMesh *
>(
_input.get());
52 if (!replicated_mesh_ptr)
53 paramError(
"input",
"Input is not a replicated mesh, which is required");
54 if (*(replicated_mesh_ptr->elem_dimensions().begin()) != 3 ||
55 *(replicated_mesh_ptr->elem_dimensions().rbegin()) != 3)
56 paramError(
"input",
"Only 3D meshes are supported.");
58 ReplicatedMesh &
mesh = *replicated_mesh_ptr;
static InputParameters validParams()
std::unique_ptr< MeshBase > & _input
Reference to input mesh pointer.
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 ...
static InputParameters validParams()
void convert3DMeshToAllTet4(ReplicatedMesh &mesh, const std::vector< std::pair< dof_id_type, bool >> &elems_to_process, std::vector< dof_id_type > &converted_elems_ids_to_track, const subdomain_id_type block_id_to_remove, const bool delete_block_to_remove)
Convert all the elements in a 3D mesh, consisting of only linear elements, into TET4 elements...
registerMooseObject("MooseApp", ElementsToTetrahedronsConverter)
ElementsToTetrahedronsConverter(const InputParameters ¶meters)
This ElementsToTetrahedronsConverter object is designed to convert all the elements in a 3D mesh cons...
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
MeshGenerators are objects that can modify or add to an existing mesh.