27 auto topology = mesh.topology();
30 if (topology->cell_type() != mesh::CellType::triangle
31 and topology->cell_type() != mesh::CellType::tetrahedron)
33 throw std::runtime_error(
"Refinement only defined for simplices");
36 auto [refined_mesh, parent_cell, parent_facet]
40 const int D = topology->dim();
41 const std::int64_t n0 = topology->index_map(D)->size_global();
42 const std::int64_t n1 = refined_mesh.topology()->index_map(D)->size_global();
43 LOG(INFO) <<
"Number of cells increased from " << n0 <<
" to " << n1 <<
" ("
44 << 100.0 * (
static_cast<double>(n1) /
static_cast<double>(n0) - 1.0)
62 std::span<const std::int32_t> edges,
63 bool redistribute =
true)
65 auto topology = mesh.topology();
67 if (topology->cell_type() != mesh::CellType::triangle
68 and topology->cell_type() != mesh::CellType::tetrahedron)
70 throw std::runtime_error(
"Refinement only defined for simplices");
73 auto [refined_mesh, parent_cell, parent_facet]
77 const int D = topology->dim();
78 const std::int64_t n0 = topology->index_map(D)->size_global();
79 const std::int64_t n1 = refined_mesh.topology()->index_map(D)->size_global();
80 LOG(INFO) <<
"Number of cells increased from " << n0 <<
" to " << n1 <<
" ("
81 << 100.0 * (
static_cast<double>(n1) /
static_cast<double>(n0) - 1.0)
std::tuple< mesh::Mesh< T >, std::vector< std::int32_t >, std::vector< std::int8_t > > refine(const mesh::Mesh< T > &mesh, bool redistribute, Option option)
Uniform refine, optionally redistributing and optionally calculating the parent-child relationships`.
Definition plaza.h:459