// First, create a local mass matrix for the unit cell
Triangulation<dim, spacedim> tr;
- ReferenceCell::make_triangulation(reference_cell_type, tr);
+ reference_cell_type.make_triangulation(tr);
const auto &mapping =
reference_cell_type.template get_default_linear_mapping<dim, spacedim>();
// Set up meshes, one with a single
// reference cell and refine it once
Triangulation<dim, spacedim> tria;
- ReferenceCell::make_triangulation(reference_cell_type, tria);
+ reference_cell_type.make_triangulation(tria);
tria.begin_active()->set_refine_flag(RefinementCase<dim>(ref_case));
tria.execute_coarsening_and_refinement();
ArrayView<const unsigned int>
faces_for_given_vertex(const unsigned int vertex) const;
+ /*
+ * Create a (coarse) grid with a single cell of the shape of this
+ * reference cell.
+ */
+ template <int dim, int spacedim>
+ void
+ make_triangulation(Triangulation<dim, spacedim> &tria) const;
+
private:
/**
* The variable that stores what this object actually corresponds to.
return {};
}
- /*
- * Create a (coarse) grid with a single cell of the shape of the provided
- * reference cell.
- */
- template <int dim, int spacedim>
- void
- make_triangulation(const Type & reference_cell,
- Triangulation<dim, spacedim> &tria);
-
/**
* Return a default linear mapping that works for the given triangulation.
* Internally, this function calls the function above for the reference
template <int dim, int spacedim>
void
- make_triangulation(const Type & reference_cell,
- Triangulation<dim, spacedim> &tria)
+ Type::make_triangulation(Triangulation<dim, spacedim> &tria) const
{
- AssertDimension(dim, reference_cell.get_dimension());
-
- if (reference_cell == Type::get_hypercube<dim>())
+ if (this->is_hyper_cube())
{
GridGenerator::hyper_cube(tria, 0, 1);
}
- else if ((dim == 2) && (reference_cell == Type::Tri))
+ else if ((dim == 2) && (*this == Tri))
{
const std::vector<Point<spacedim>> vertices = {
Point<spacedim>(), // the origin
tria.create_triangulation(vertices, cells, {});
}
- else if ((dim == 3) && (reference_cell == Type::Tet))
+ else if ((dim == 3) && (*this == Tet))
{
AssertDimension(spacedim, 3);
tria.create_triangulation(vertices, cells, {});
}
- else if ((dim == 3) && (reference_cell == Type::Pyramid))
+ else if ((dim == 3) && (*this == Pyramid))
{
AssertDimension(spacedim, 3);
tria.create_triangulation(vertices, cells, {});
}
- else if ((dim == 3) && (reference_cell == Type::Wedge))
+ else if ((dim == 3) && (*this == Wedge))
{
AssertDimension(spacedim, 3);
const auto create_quadrature = [](const Type &reference_cell) {
Triangulation<dim> tria;
- make_triangulation(reference_cell, tria);
+ reference_cell.make_triangulation(tria);
return Quadrature<dim>(tria.get_vertices());
};
for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
{
#if deal_II_dimension <= deal_II_space_dimension
- template void make_triangulation(
- const Type & reference_cell,
- Triangulation<deal_II_dimension, deal_II_space_dimension> &tria);
+ template void Type::make_triangulation(
+ Triangulation<deal_II_dimension, deal_II_space_dimension> & tria) const;
template std::unique_ptr<
Mapping<deal_II_dimension, deal_II_space_dimension>>
Triangulation<3> dummy, tria;
- ReferenceCell::make_triangulation(ReferenceCell::Type::Tet, dummy);
+ ReferenceCell::Type::Tet.make_triangulation(dummy);
auto vertices = dummy.get_vertices();