43 auto mesh = dynamic_pointer_cast<UnstructuredMesh>(std::move(*
_meshes[0]));
50 auto other_mesh = dynamic_pointer_cast<UnstructuredMesh>(std::move(*
_meshes[i]));
54 dof_id_type node_delta =
mesh->max_node_id();
55 dof_id_type elem_delta =
mesh->max_elem_id();
57 unique_id_type unique_delta =
58#ifdef LIBMESH_ENABLE_UNIQUE_ID
59 mesh->parallel_max_unique_id();
65 mesh->copy_nodes_and_elements(*other_mesh,
73 BoundaryInfo & boundary =
mesh->get_boundary_info();
74 const BoundaryInfo & other_boundary = other_mesh->get_boundary_info();
76 for (
const auto & t : other_boundary.build_node_list())
77 boundary.add_node(std::get<0>(t) + node_delta, std::get<1>(t));
79 for (
const auto & t : other_boundary.build_side_list())
80 boundary.add_side(std::get<0>(t) + elem_delta, std::get<1>(t), std::get<2>(t));
82 for (
const auto & t : other_boundary.build_edge_list())
83 boundary.add_edge(std::get<0>(t) + elem_delta, std::get<1>(t), std::get<2>(t));
85 for (
const auto & t : other_boundary.build_shellface_list())
86 boundary.add_shellface(std::get<0>(t) + elem_delta, std::get<1>(t), std::get<2>(t));
88 const auto & boundary_ids = boundary.get_boundary_ids();
89 const auto & other_boundary_ids = other_boundary.get_boundary_ids();
90 for (
auto id : other_boundary_ids)
93 if (boundary_ids.count(
id))
95 if (boundary.get_sideset_name(
id) !=
"" &&
96 boundary.get_sideset_name(
id) != other_boundary.get_sideset_name(
id))
99 " exists but has different names in the merged meshes ('",
100 boundary.get_sideset_name(
id),
102 other_boundary.get_sideset_name(
id),
105 boundary.sideset_name(
id) = other_boundary.get_sideset_name(
id);
107 if (boundary.get_nodeset_name(
id) !=
"" &&
108 boundary.get_nodeset_name(
id) != other_boundary.get_nodeset_name(
id))
111 " exists but has different names in the merged meshes ('",
112 boundary.get_nodeset_name(
id),
114 other_boundary.get_nodeset_name(
id),
117 boundary.nodeset_name(
id) = other_boundary.get_nodeset_name(
id);
122 mesh->unset_is_prepared();
123 return dynamic_pointer_cast<MeshBase>(
mesh);