// First, create a local mass matrix for the unit cell
Triangulation<dim, spacedim> tr;
- reference_cell_type.make_triangulation(tr);
+ ReferenceCell::make_triangulation(reference_cell_type, 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;
- reference_cell_type.make_triangulation(tria);
+ ReferenceCell::make_triangulation(reference_cell_type, 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
- Type::make_triangulation(Triangulation<dim, spacedim> &tria) const
+ make_triangulation(const Type & reference_cell,
+ Triangulation<dim, spacedim> &tria)
{
- AssertDimension(dim, this->get_dimension());
+ AssertDimension(dim, reference_cell.get_dimension());
- if (this->is_hyper_cube())
+ if (reference_cell == Type::get_hypercube<dim>())
{
GridGenerator::hyper_cube(tria, 0, 1);
}
- else if ((dim == 2) && (*this == Tri))
+ else if ((dim == 2) && (reference_cell == Type::Tri))
{
const std::vector<Point<spacedim>> vertices = {
Point<spacedim>(), // the origin
tria.create_triangulation(vertices, cells, {});
}
- else if ((dim == 3) && (*this == Tet))
+ else if ((dim == 3) && (reference_cell == Type::Tet))
{
AssertDimension(spacedim, 3);
tria.create_triangulation(vertices, cells, {});
}
- else if ((dim == 3) && (*this == Pyramid))
+ else if ((dim == 3) && (reference_cell == Type::Pyramid))
{
AssertDimension(spacedim, 3);
tria.create_triangulation(vertices, cells, {});
}
- else if ((dim == 3) && (*this == Wedge))
+ else if ((dim == 3) && (reference_cell == Type::Wedge))
{
AssertDimension(spacedim, 3);
const auto create_quadrature = [](const Type &reference_cell) {
Triangulation<dim> tria;
- reference_cell.make_triangulation(tria);
+ make_triangulation(reference_cell, 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 Type::make_triangulation(
- Triangulation<deal_II_dimension, deal_II_space_dimension> & tria) const;
+ template void make_triangulation(
+ const Type & reference_cell,
+ Triangulation<deal_II_dimension, deal_II_space_dimension> &tria);
template std::unique_ptr<
Mapping<deal_II_dimension, deal_II_space_dimension>>
Triangulation<3> dummy, tria;
- ReferenceCell::Type::Tet.make_triangulation(dummy);
+ ReferenceCell::make_triangulation(ReferenceCell::Type::Tet, dummy);
auto vertices = dummy.get_vertices();