// loop over cells and create CRS
for (const auto &cell : cells)
{
- const ReferenceCell::Type cell_type =
- ReferenceCell::n_vertices_to_type(dim, cell.vertices.size());
+ const ReferenceCell::Type reference_cell_type =
+ ReferenceCell::Type::n_vertices_to_type(dim, cell.vertices.size());
- Assert(cell_type != ReferenceCell::Type::Invalid,
+ Assert(reference_cell_type != ReferenceCell::Type::Invalid,
ExcNotImplemented());
- AssertIndexRange(static_cast<types::geometric_entity_type>(cell_type),
+ AssertIndexRange(static_cast<types::geometric_entity_type>(
+ reference_cell_type),
cell_types_impl.size());
Assert(cell_types_impl[static_cast<types::geometric_entity_type>(
- cell_type)]
+ reference_cell_type)]
.get() != nullptr,
ExcNotImplemented());
- cell_types_indices.push_back(cell_type);
+ cell_types_indices.push_back(reference_cell_type);
// create CRS of vertices (to remove template argument dim)
for (const auto &vertex : cell.vertices)
static constexpr const Type &
get_simplex();
-
/**
* Return the correct hypercube reference cell type for the given dimension
* `dim`. Depending on the template argument `dim`, this function returns a
static constexpr const Type &
get_hypercube();
+ /**
+ * Return the correct ReferenceCell::Type for a given structural dimension
+ * and number of vertices. For example, if `dim==2` and `n_vertices==4`,
+ * this function will return `Quad`. But if `dim==3` and `n_vertices==4`, it
+ * will return `Tri`.
+ */
+ static Type
+ n_vertices_to_type(const int dim, const unsigned int n_vertices);
+
/**
* Default constructor. Initialize this object as an invalid object.
*/
}
}
- /**
- * Retrieve the correct ReferenceCell::Type for a given structural dimension
- * and number of vertices.
- */
+
+
inline Type
- n_vertices_to_type(const int dim, const unsigned int n_vertices)
+ Type::n_vertices_to_type(const int dim, const unsigned int n_vertices)
{
AssertIndexRange(dim, 4);
AssertIndexRange(n_vertices, 9);
- const auto X = Type::Invalid;
+ const auto X = Type::Invalid;
static const std::array<std::array<ReferenceCell::Type, 9>,
4>
table = {
vertices)
{
const ReferenceCell::Type reference_cell_type =
- ReferenceCell::n_vertices_to_type(dim, vertices.size());
+ ReferenceCell::Type::n_vertices_to_type(dim, vertices.size());
if (reference_cell_type == ReferenceCell::Type::Line)
// Return the distance between the two vertices
const unsigned int local_face_n = face_id % max_faces_per_cell;
const CellData<dim> &cell = cells[face_id / max_faces_per_cell];
const ReferenceCell::Type cell_type =
- ReferenceCell::n_vertices_to_type(dim, cell.vertices.size());
+ ReferenceCell::Type::n_vertices_to_type(dim,
+ cell.vertices.size());
const ReferenceCell::internal::Info::Base &info =
ReferenceCell::internal::Info::get_cell(cell_type);
const unsigned int deal_face_n =