// Collect into a sortable data structure:
std::vector<std::pair<std::size_t, std::vector<int>>>
face_id_to_side_sets;
+ face_id_to_side_sets.reserve(face_side_sets.size());
for (auto &pair : face_side_sets)
{
Assert(pair.second.size() > 0, ExcInternalError());
b.second.end());
});
+ if (dim == 2)
+ subcelldata.boundary_lines.reserve(face_id_to_side_sets.size());
+ else if (dim == 3)
+ subcelldata.boundary_quads.reserve(face_id_to_side_sets.size());
types::boundary_id current_b_or_m_id = 0;
for (const auto &pair : face_id_to_side_sets)
{
AssertDimension(mesh_dimension, spacedim);
// Read nodes:
- std::vector<double> xs(n_nodes);
- std::vector<double> ys(n_nodes);
- std::vector<double> zs(n_nodes);
-
- ierr = ex_get_coord(ex_id, xs.data(), ys.data(), zs.data());
- AssertThrowExodusII(ierr);
-
+ //
// Even if there is a node numbering array the values stored inside the
// ExodusII file must use the contiguous, internal ordering (see Section 4.5
// of the manual - "Internal (contiguously numbered) node and element IDs
// connectivity.")
std::vector<Point<spacedim>> vertices;
vertices.reserve(n_nodes);
- for (int vertex_n = 0; vertex_n < n_nodes; ++vertex_n)
- {
- switch (spacedim)
- {
- case 1:
- vertices.emplace_back(xs[vertex_n]);
- break;
- case 2:
- vertices.emplace_back(xs[vertex_n], ys[vertex_n]);
- break;
- case 3:
- vertices.emplace_back(xs[vertex_n], ys[vertex_n], zs[vertex_n]);
- break;
- default:
- Assert(spacedim <= 3, ExcNotImplemented());
- }
- }
+ {
+ std::vector<double> xs(n_nodes);
+ std::vector<double> ys(n_nodes);
+ std::vector<double> zs(n_nodes);
+
+ ierr = ex_get_coord(ex_id, xs.data(), ys.data(), zs.data());
+ AssertThrowExodusII(ierr);
+
+ for (int vertex_n = 0; vertex_n < n_nodes; ++vertex_n)
+ {
+ switch (spacedim)
+ {
+ case 1:
+ vertices.emplace_back(xs[vertex_n]);
+ break;
+ case 2:
+ vertices.emplace_back(xs[vertex_n], ys[vertex_n]);
+ break;
+ case 3:
+ vertices.emplace_back(xs[vertex_n], ys[vertex_n], zs[vertex_n]);
+ break;
+ default:
+ Assert(spacedim <= 3, ExcNotImplemented());
+ }
+ }
+ }
std::vector<int> element_block_ids(n_element_blocks);
ierr = ex_get_ids(ex_id, EX_ELEM_BLOCK, element_block_ids.data());
AssertThrowExodusII(ierr);
std::vector<CellData<dim>> cells;
+ cells.reserve(n_elements);
// Elements are grouped together by same reference cell type in element
// blocks. There may be multiple blocks for a single reference cell type,
// but "each element block may contain only one element type".
connection[elem_n + i] - 1;
}
cell.material_id = element_block_id;
- cells.push_back(cell);
+ cells.push_back(std::move(cell));
}
}