const UpdateFlags update_flags)
: n_quadrature_points(quadrature.size())
, internal_fe_face_values(
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- fe.reference_cell_type()),
+ fe.reference_cell_type()
+ .template get_default_linear_mapping<dim, spacedim>(),
fe,
quadrature,
update_flags)
, internal_fe_subface_values(
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- fe.reference_cell_type()),
+ fe.reference_cell_type()
+ .template get_default_linear_mapping<dim, spacedim>(),
fe,
quadrature,
update_flags)
, internal_fe_face_values_neighbor(
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- fe.reference_cell_type()),
+ fe.reference_cell_type()
+ .template get_default_linear_mapping<dim, spacedim>(),
fe,
quadrature,
update_flags)
, internal_fe_subface_values_neighbor(
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- fe.reference_cell_type()),
+ fe.reference_cell_type()
+ .template get_default_linear_mapping<dim, spacedim>(),
fe,
quadrature,
update_flags)
ReferenceCell::make_triangulation(reference_cell_type, tr);
const auto &mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- reference_cell_type);
+ reference_cell_type.template get_default_linear_mapping<dim, spacedim>();
// Choose a Gauss quadrature rule that is exact up to degree 2n-1
const unsigned int degree =
const unsigned int degree = fe.degree;
const auto &mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- reference_cell_type);
+ reference_cell_type
+ .template get_default_linear_mapping<dim, spacedim>();
const auto &q_fine =
ReferenceCell::get_gauss_type_quadrature<dim>(reference_cell_type,
degree + 1);
q_points_coarse[q](j) = q_points_fine[q](j);
Quadrature<dim> q_coarse(q_points_coarse, fine.get_JxW_values());
FEValues<dim, spacedim> coarse(
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- coarse_cell->reference_cell_type()),
+ coarse_cell->reference_cell_type()
+ .template get_default_linear_mapping<dim, spacedim>(),
fe,
q_coarse,
update_values);
*
* @note The use of this object should be avoided since it is only applicable
* in cases where a mesh consists exclusively of quadrilaterals or hexahedra.
- * Use ReferenceCell::get_default_linear_mapping() instead.
+ * Use
+ * `ReferenceCell::Type::get_hypercube<dim>().get_default_linear_mapping()`
+ * instead.
*/
template <int dim, int spacedim = dim>
struct StaticMappingQ1
double
volume(const Triangulation<dim, spacedim> &tria,
const Mapping<dim, spacedim> & mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()));
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>());
/**
* Return an approximation of the diameter of the smallest active cell of a
minimal_cell_diameter(
const Triangulation<dim, spacedim> &triangulation,
const Mapping<dim, spacedim> & mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()));
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>());
/**
* Return an approximation of the diameter of the largest active cell of a
maximal_cell_diameter(
const Triangulation<dim, spacedim> &triangulation,
const Mapping<dim, spacedim> & mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()));
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>());
/**
* Given a list of vertices (typically obtained using
extract_used_vertices(
const Triangulation<dim, spacedim> &container,
const Mapping<dim, spacedim> & mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()));
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>());
/**
* Find and return the index of the closest vertex to a given point in the
const typename Triangulation<dim, spacedim>::active_cell_iterator &cell,
const Point<spacedim> & position,
const Mapping<dim, spacedim> & mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()));
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>());
/**
* Compute a globally unique index for each vertex and hanging node
*/
Cache(const Triangulation<dim, spacedim> &tria,
const Mapping<dim, spacedim> & mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()));
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>());
/**
* Destructor.
permute_according_orientation(const std::array<T, N> &vertices,
const unsigned int orientation) const;
+ /**
+ * Return a default mapping of degree @p degree matching the current
+ * reference cell. If this reference cell is a hypercube, then the returned
+ * mapping is a MappingQGeneric; otherwise, it is an object of type
+ * MappingFE initialized with Simplex::FE_P (if the reference cell is a
+ * triangle or tetrahedron), with Simplex::FE_PyramidP (if the reference
+ * cell is a pyramid), or with Simplex::FE_WedgeP (if the reference cell is
+ * a wedge).
+ */
+ template <int dim, int spacedim>
+ std::unique_ptr<Mapping<dim, spacedim>>
+ get_default_mapping(const unsigned int degree) const;
+
+ /**
+ * Return a default linear mapping matching the current reference cell.
+ * If this reference cell is a hypercube, then the returned mapping
+ * is a MappingQ1; otherwise, it is an object of type MappingFE
+ * initialized with Simplex::FE_P (if the reference cell is a triangle or
+ * tetrahedron), with Simplex::FE_PyramidP (if the reference cell is a
+ * pyramid), or with Simplex::FE_WedgeP (if the reference cell is a wedge).
+ * In other words, the term "linear" in the name of the function has to be
+ * understood as $d$-linear (i.e., bilinear or trilinear) for some of the
+ * coordinate directions.
+ */
+ template <int dim, int spacedim>
+ const Mapping<dim, spacedim> &
+ get_default_linear_mapping() const;
+
/**
* Return a text representation of the reference cell represented by the
* current object.
make_triangulation(const Type & reference_cell,
Triangulation<dim, spacedim> &tria);
- /**
- * Return a default mapping of degree @ degree matching the given reference
- * cell. If this reference cell is a hypercube, then the returned mapping is a
- * MappingQGeneric; otherwise, it is an object of type MappingFE initialized
- * with Simplex::FE_P (if the reference cell is a triangle and tetrahedron),
- * with Simplex::FE_PyramidP (if the reference cell is a pyramid), or with
- * Simplex::FE_WedgeP (if the reference cell is a wedge).
- */
- template <int dim, int spacedim>
- std::unique_ptr<Mapping<dim, spacedim>>
- get_default_mapping(const Type &reference_cell, const unsigned int degree);
-
- /**
- * Return a default linear mapping matching the given reference cell.
- * If this reference cell is a hypercube, then the returned mapping
- * is a MappingQ1; otherwise, it is an object of type MappingFE
- * initialized with Simplex::FE_P (if the reference cell is a triangle and
- * tetrahedron), with Simplex::FE_PyramidP (if the reference cell is a
- * pyramid), or with Simplex::FE_WedgeP (if the reference cell is a wedge). In
- * other words, the term "linear" in the name of the function has to be
- * understood as $d$-linear (i.e., bilinear or trilinear) for some of the
- * coordinate directions.
- */
- template <int dim, int spacedim>
- const Mapping<dim, spacedim> &
- get_default_linear_mapping(const Type &reference_cell);
-
/**
* Return a default linear mapping that works for the given triangulation.
* Internally, this function calls the function above for the reference
const types::material_id material_id,
const Strategy strategy)
{
- estimate(ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+ estimate(ReferenceCell::get_default_linear_mapping(
dof_handler.get_triangulation()),
dof_handler,
quadrature,
const types::material_id material_id,
const Strategy strategy)
{
- estimate(ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+ estimate(ReferenceCell::get_default_linear_mapping(
dof_handler.get_triangulation()),
dof_handler,
quadrature,
const types::material_id material_id,
const Strategy strategy)
{
- estimate(ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+ estimate(ReferenceCell::get_default_linear_mapping(
dof_handler.get_triangulation()),
dof_handler,
quadrature,
const types::material_id material_id,
const Strategy strategy)
{
- estimate(ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+ estimate(ReferenceCell::get_default_linear_mapping(
dof_handler.get_triangulation()),
dof_handler,
quadrature,
& function_map,
AffineConstraints<double> & constraints,
const Mapping<dim, spacedim> &mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()));
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>());
/**
* This function does the same as the
const std::set<types::boundary_id> &boundary_ids,
AffineConstraints<double> & constraints,
const Mapping<dim, spacedim> & mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()));
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>());
/**
* Compute the constraints that correspond to boundary conditions of the
& function_map,
AffineConstraints<double> & constraints,
const Mapping<dim, spacedim> &mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()));
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>());
/**
* Same as above for homogeneous tangential-flux constraints.
const std::set<types::boundary_id> &boundary_ids,
AffineConstraints<double> & constraints,
const Mapping<dim, spacedim> & mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()));
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>());
//@}
} // namespace VectorTools
{
const Quadrature<dim> quad(fe.get_unit_support_points());
- const auto map_q = ReferenceCell::get_default_mapping<dim, spacedim>(
- fe.reference_cell_type(), fe.degree);
+ const auto map_q =
+ fe.reference_cell_type().template get_default_mapping<dim, spacedim>(
+ fe.degree);
FEValues<dim, spacedim> fe_v(*map_q,
fe,
quad,
const std::vector<Point<dim>> & particle_reference_locations,
ParticleHandler<dim, spacedim> & particle_handler,
const Mapping<dim, spacedim> & mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()));
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>());
/**
* A function that generates one particle at a random location in cell @p cell and with
const types::particle_index id,
std::mt19937 & random_number_generator,
const Mapping<dim, spacedim> &mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()));
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>());
/**
* A function that generates particles randomly in the domain with a
const types::particle_index n_particles_to_create,
ParticleHandler<dim, spacedim> & particle_handler,
const Mapping<dim, spacedim> & mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()),
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>(),
const unsigned int random_number_seed = 5432);
& global_bounding_boxes,
ParticleHandler<dim, spacedim> &particle_handler,
const Mapping<dim, spacedim> & mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()),
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>(),
const ComponentMask & components = ComponentMask(),
const std::vector<std::vector<double>> &properties = {});
*/
template <int dim, int spacedim = dim>
void
- quadrature_points(
- const Triangulation<dim, spacedim> &triangulation,
- const Quadrature<dim> & quadrature,
- const std::vector<std::vector<BoundingBox<spacedim>>>
- & global_bounding_boxes,
- ParticleHandler<dim, spacedim> &particle_handler,
- const Mapping<dim, spacedim> & mapping =
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- ReferenceCell::Type::get_hypercube<dim>()),
- const std::vector<std::vector<double>> &properties = {});
+ quadrature_points(const Triangulation<dim, spacedim> &triangulation,
+ const Quadrature<dim> & quadrature,
+ const std::vector<std::vector<BoundingBox<spacedim>>>
+ & global_bounding_boxes,
+ ParticleHandler<dim, spacedim> &particle_handler,
+ const Mapping<dim, spacedim> & mapping =
+ ReferenceCell::Type::get_hypercube<dim>()
+ .template get_default_linear_mapping<dim, spacedim>(),
+ const std::vector<std::vector<double>> &properties = {});
} // namespace Generators
} // namespace Particles
q.size(),
fe.n_dofs_per_cell(),
update_default,
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- fe.reference_cell_type()),
+ fe.reference_cell_type()
+ .template get_default_linear_mapping<dim, spacedim>(),
fe)
, quadrature(q)
{
: FEFaceValuesBase<dim, spacedim>(
fe.n_dofs_per_cell(),
update_flags,
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- fe.reference_cell_type()),
+ fe.reference_cell_type()
+ .template get_default_linear_mapping<dim, spacedim>(),
fe,
quadrature)
{
: FEFaceValuesBase<dim, spacedim>(
fe.n_dofs_per_cell(),
update_flags,
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- fe.reference_cell_type()),
+ fe.reference_cell_type()
+ .template get_default_linear_mapping<dim, spacedim>(),
fe,
quadrature)
{
template <int dim, int spacedim>
std::unique_ptr<Mapping<dim, spacedim>>
- get_default_mapping(const Type &reference_cell, const unsigned int degree)
+ Type::get_default_mapping(const unsigned int degree) const
{
- AssertDimension(dim, reference_cell.get_dimension());
+ AssertDimension(dim, get_dimension());
- if (reference_cell == Type::get_hypercube<dim>())
+ if (*this == Type::get_hypercube<dim>())
return std::make_unique<MappingQGeneric<dim, spacedim>>(degree);
- else if (reference_cell == Type::Tri || reference_cell == Type::Tet)
+ else if (*this == Type::Tri || *this == Type::Tet)
return std::make_unique<MappingFE<dim, spacedim>>(
Simplex::FE_P<dim, spacedim>(degree));
- else if (reference_cell == Type::Pyramid)
+ else if (*this == Type::Pyramid)
return std::make_unique<MappingFE<dim, spacedim>>(
Simplex::FE_PyramidP<dim, spacedim>(degree));
- else if (reference_cell == Type::Wedge)
+ else if (*this == Type::Wedge)
return std::make_unique<MappingFE<dim, spacedim>>(
Simplex::FE_WedgeP<dim, spacedim>(degree));
else
}
+
template <int dim, int spacedim>
const Mapping<dim, spacedim> &
- get_default_linear_mapping(const Type &reference_cell)
+ Type::get_default_linear_mapping() const
{
- AssertDimension(dim, reference_cell.get_dimension());
+ AssertDimension(dim, get_dimension());
- if (reference_cell == Type::get_hypercube<dim>())
+ if (*this == Type::get_hypercube<dim>())
{
return StaticMappingQ1<dim, spacedim>::mapping;
}
- else if (reference_cell == Type::Tri || reference_cell == Type::Tet)
+ else if (*this == Type::Tri || *this == Type::Tet)
{
static const MappingFE<dim, spacedim> mapping(
Simplex::FE_P<dim, spacedim>(1));
return mapping;
}
- else if (reference_cell == Type::Pyramid)
+ else if (*this == Type::Pyramid)
{
static const MappingFE<dim, spacedim> mapping(
Simplex::FE_PyramidP<dim, spacedim>(1));
return mapping;
}
- else if (reference_cell == Type::Wedge)
+ else if (*this == Type::Wedge)
{
static const MappingFE<dim, spacedim> mapping(
Simplex::FE_WedgeP<dim, spacedim>(1));
"cells of the triangulation. The triangulation you are "
"passing to this function uses multiple cell types."));
- return get_default_linear_mapping<dim, spacedim>(
- reference_cell_types.front());
+ return reference_cell_types.front()
+ .template get_default_linear_mapping<dim, spacedim>();
}
template std::unique_ptr<
Mapping<deal_II_dimension, deal_II_space_dimension>>
- get_default_mapping(const Type &reference_cell, const unsigned int degree);
+ Type::get_default_mapping(const unsigned int degree) const;
template const Mapping<deal_II_dimension, deal_II_space_dimension>
- &get_default_linear_mapping(const Type &reference_cell);
+ &Type::get_default_linear_mapping() const;
template const Mapping<deal_II_dimension, deal_II_space_dimension>
&get_default_linear_mapping(
// to check it, transform to the unit cell
// with a linear mapping
const Point<dim> new_unit =
- ReferenceCell::get_default_linear_mapping<dim,
- spacedim>(
- cell->reference_cell_type())
+ cell->reference_cell_type()
+ .template get_default_linear_mapping<dim,
+ spacedim>()
.transform_real_to_unit_cell(cell, new_bound);
// Now, we have to calculate the distance from
{
const TriaRawIterator<CellAccessor<dim, spacedim>> cell_iterator(*this);
return (GeometryInfo<dim>::is_inside_unit_cell(
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- reference_cell_type())
+ reference_cell_type()
+ .template get_default_linear_mapping<dim, spacedim>()
.transform_real_to_unit_cell(cell_iterator, p)));
}
catch (const Mapping<dim, spacedim>::ExcTransformationFailed &)
const UpdateFlags & update_flags,
const Quadrature<dim - 1> & face_quadrature,
const UpdateFlags & face_update_flags)
- : ScratchData(ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- fe.reference_cell_type()),
+ : ScratchData(fe.reference_cell_type()
+ .template get_default_linear_mapping<dim, spacedim>(),
fe,
quadrature,
update_flags,
const Quadrature<dim - 1> & face_quadrature,
const UpdateFlags & face_update_flags,
const UpdateFlags & neighbor_face_update_flags)
- : ScratchData(ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- fe.reference_cell_type()),
+ : ScratchData(fe.reference_cell_type()
+ .template get_default_linear_mapping<dim, spacedim>(),
fe,
quadrature,
update_flags,
{
// just call the respective function with Q1 mapping
approximate_derivative_tensor(
- ReferenceCell::get_default_linear_mapping<dim, spacedim>(
- cell->reference_cell_type()),
+ cell->reference_cell_type()
+ .template get_default_linear_mapping<dim, spacedim>(),
dof,
solution,
cell,