ReferenceCellWrapper::ReferenceCellWrapper(const std::uint8_t &kind)
{
- cell_type = internal::ReferenceCell::make_reference_cell_from_int(kind);
+ cell_type = internal::make_reference_cell_from_int(kind);
}
internal::GenericDoFsPerObject
expand(const unsigned int dim,
const std::vector<unsigned int> &dofs_per_object,
- const dealii::ReferenceCell reference_cell);
+ const ReferenceCell reference_cell);
} // namespace internal
/**
* Geometric entity type of the @p e-th sub-entity of dimension @p d.
*/
- virtual dealii::ReferenceCell
+ virtual ReferenceCell
type_of_entity(const unsigned int d, const unsigned int e) const
{
Assert(false, ExcNotImplemented());
(void)d;
(void)e;
- return dealii::ReferenceCells::Vertex;
+ return ReferenceCells::Vertex;
}
/**
return {};
}
- dealii::ReferenceCell
+ ReferenceCell
type_of_entity(const unsigned int d, const unsigned int e) const override
{
(void)e;
if (d == 1)
- return dealii::ReferenceCells::Line;
+ return ReferenceCells::Line;
Assert(false, ExcNotImplemented());
- return dealii::ReferenceCells::Vertex;
+ return ReferenceCells::Vertex;
}
unsigned int
return {};
}
- virtual dealii::ReferenceCell
+ virtual ReferenceCell
type_of_entity(const unsigned int d, const unsigned int e) const override
{
(void)e;
if (d == 2)
- return dealii::ReferenceCells::Triangle;
+ return ReferenceCells::Triangle;
if (d == 1)
- return dealii::ReferenceCells::Line;
+ return ReferenceCells::Line;
Assert(false, ExcNotImplemented());
- return dealii::ReferenceCells::Vertex;
+ return ReferenceCells::Vertex;
}
unsigned int
return {};
}
- virtual dealii::ReferenceCell
+ virtual ReferenceCell
type_of_entity(const unsigned int d, const unsigned int e) const override
{
(void)e;
if (d == 2)
- return dealii::ReferenceCells::Quadrilateral;
+ return ReferenceCells::Quadrilateral;
if (d == 1)
- return dealii::ReferenceCells::Line;
+ return ReferenceCells::Line;
Assert(false, ExcNotImplemented());
- return dealii::ReferenceCells::Vertex;
+ return ReferenceCells::Vertex;
}
unsigned int
return {};
}
- virtual dealii::ReferenceCell
+ virtual ReferenceCell
type_of_entity(const unsigned int d, const unsigned int e) const override
{
(void)e;
if (d == 3)
- return dealii::ReferenceCells::Tetrahedron;
+ return ReferenceCells::Tetrahedron;
if (d == 2)
- return dealii::ReferenceCells::Triangle;
+ return ReferenceCells::Triangle;
if (d == 1)
- return dealii::ReferenceCells::Line;
+ return ReferenceCells::Line;
Assert(false, ExcNotImplemented());
- return dealii::ReferenceCells::Vertex;
+ return ReferenceCells::Vertex;
}
unsigned int
return {};
}
- virtual dealii::ReferenceCell
+ virtual ReferenceCell
type_of_entity(const unsigned int d, const unsigned int e) const override
{
(void)e;
if (d == 3)
- return dealii::ReferenceCells::Pyramid;
+ return ReferenceCells::Pyramid;
if (d == 2 && e == 0)
- return dealii::ReferenceCells::Quadrilateral;
+ return ReferenceCells::Quadrilateral;
else if (d == 2)
- return dealii::ReferenceCells::Triangle;
+ return ReferenceCells::Triangle;
if (d == 1)
- return dealii::ReferenceCells::Line;
+ return ReferenceCells::Line;
Assert(false, ExcNotImplemented());
- return dealii::ReferenceCells::Vertex;
+ return ReferenceCells::Vertex;
}
unsigned int
return {};
}
- virtual dealii::ReferenceCell
+ virtual ReferenceCell
type_of_entity(const unsigned int d, const unsigned int e) const override
{
(void)e;
if (d == 3)
- return dealii::ReferenceCells::Wedge;
+ return ReferenceCells::Wedge;
if (d == 2 && e > 1)
- return dealii::ReferenceCells::Quadrilateral;
+ return ReferenceCells::Quadrilateral;
else if (d == 2)
- return dealii::ReferenceCells::Triangle;
+ return ReferenceCells::Triangle;
if (d == 1)
- return dealii::ReferenceCells::Line;
+ return ReferenceCells::Line;
Assert(false, ExcNotImplemented());
- return dealii::ReferenceCells::Vertex;
+ return ReferenceCells::Vertex;
}
unsigned int
return {};
}
- virtual dealii::ReferenceCell
+ virtual ReferenceCell
type_of_entity(const unsigned int d, const unsigned int e) const override
{
(void)e;
if (d == 3)
- return dealii::ReferenceCells::Hexahedron;
+ return ReferenceCells::Hexahedron;
if (d == 2)
- return dealii::ReferenceCells::Quadrilateral;
+ return ReferenceCells::Quadrilateral;
if (d == 1)
- return dealii::ReferenceCells::Line;
+ return ReferenceCells::Line;
Assert(false, ExcNotImplemented());
- return dealii::ReferenceCells::Vertex;
+ return ReferenceCells::Vertex;
}
unsigned int
template <typename T = unsigned int>
struct Connectivity
{
- Connectivity(const unsigned int dim,
- const std::vector<dealii::ReferenceCell> &cell_types)
+ Connectivity(const unsigned int dim,
+ const std::vector<ReferenceCell> &cell_types)
: dim(dim)
, cell_types(cell_types)
{}
return quad_orientation;
}
- inline std::vector<dealii::ReferenceCell> &
+ inline std::vector<ReferenceCell> &
entity_types(const unsigned int structdim)
{
if (structdim == dim)
return quad_types;
}
- inline const std::vector<dealii::ReferenceCell> &
+ inline const std::vector<ReferenceCell> &
entity_types(const unsigned int structdim) const
{
if (structdim == dim)
}
private:
- const unsigned int dim;
- std::vector<dealii::ReferenceCell> cell_types;
+ const unsigned int dim;
+ std::vector<ReferenceCell> cell_types;
CRS<T> line_vertices;
CRS<T> cell_entities;
CRS<T> neighbors;
- std::vector<dealii::ReferenceCell> quad_types;
+ std::vector<ReferenceCell> quad_types;
};
build_face_entities_templated(
const unsigned int face_dimensionality,
const std::vector<std::shared_ptr<CellTypeBase>> &cell_types,
- const std::vector<dealii::ReferenceCell> & cell_types_index,
+ const std::vector<ReferenceCell> & cell_types_index,
const CRS<unsigned int> & crs,
CRS<unsigned int> & crs_d, // result
CRS<unsigned int> & crs_0, // result
keys; // key (sorted vertices), cell-entity index
std::vector<std::array<unsigned int, max_n_vertices>> ad_entity_vertices;
- std::vector<dealii::ReferenceCell> ad_entity_types;
+ std::vector<ReferenceCell> ad_entity_types;
std::vector<std::array<unsigned int, max_n_vertices>> ad_compatibility;
keys.reserve(n_entities);
build_face_entities(
const unsigned int face_dimensionality,
const std::vector<std::shared_ptr<CellTypeBase>> &cell_types,
- const std::vector<dealii::ReferenceCell> & cell_types_index,
+ const std::vector<ReferenceCell> & cell_types_index,
const CRS<unsigned int> & crs,
CRS<unsigned int> & crs_d,
CRS<unsigned int> & crs_0,
inline void
build_intersection(
const std::vector<std::shared_ptr<CellTypeBase>> &cell_types,
- const std::vector<dealii::ReferenceCell> & cell_types_index,
+ const std::vector<ReferenceCell> & cell_types_index,
const CRS<unsigned int> & con_cv,
const CRS<unsigned int> & con_cl,
const CRS<unsigned int> & con_lv,
const TriaObjectsOrientations & ori_cq,
CRS<unsigned int> & con_ql, // result
TriaObjectsOrientations & ori_ql, // result
- std::vector<dealii::ReferenceCell> & quad_t_id // result
+ std::vector<ReferenceCell> & quad_t_id // result
)
{
// reset output
Connectivity<T>
build_connectivity(const unsigned int dim,
const std::vector<std::shared_ptr<CellTypeBase>> &cell_t,
- const std::vector<dealii::ReferenceCell> &cell_t_id,
- const CRS<T> & con_cv)
+ const std::vector<ReferenceCell> &cell_t_id,
+ const CRS<T> & con_cv)
{
Connectivity<T> connectivity(dim, cell_t_id);
std::vector<std::shared_ptr<CellTypeBase>> cell_types_impl(8);
cell_types_impl[static_cast<types::geometric_entity_type>(
- dealii::ReferenceCells::Line)] = std::make_shared<CellTypeLine>();
+ ReferenceCells::Line)] = std::make_shared<CellTypeLine>();
cell_types_impl[static_cast<types::geometric_entity_type>(
- dealii::ReferenceCells::Triangle)] =
- std::make_shared<CellTypeTriangle>();
+ ReferenceCells::Triangle)] = std::make_shared<CellTypeTriangle>();
cell_types_impl[static_cast<types::geometric_entity_type>(
- dealii::ReferenceCells::Quadrilateral)] =
+ ReferenceCells::Quadrilateral)] =
std::make_shared<CellTypeQuadrilateral>();
cell_types_impl[static_cast<types::geometric_entity_type>(
- dealii::ReferenceCells::Tetrahedron)] =
- std::make_shared<CellTypeTetrahedron>();
+ ReferenceCells::Tetrahedron)] = std::make_shared<CellTypeTetrahedron>();
cell_types_impl[static_cast<types::geometric_entity_type>(
- dealii::ReferenceCells::Pyramid)] = std::make_shared<CellTypePyramid>();
+ ReferenceCells::Pyramid)] = std::make_shared<CellTypePyramid>();
cell_types_impl[static_cast<types::geometric_entity_type>(
- dealii::ReferenceCells::Wedge)] = std::make_shared<CellTypeWedge>();
+ ReferenceCells::Wedge)] = std::make_shared<CellTypeWedge>();
cell_types_impl[static_cast<types::geometric_entity_type>(
- dealii::ReferenceCells::Hexahedron)] =
- std::make_shared<CellTypeHexahedron>();
+ ReferenceCells::Hexahedron)] = std::make_shared<CellTypeHexahedron>();
// determine cell types and process vertices
std::vector<T> cell_vertices;
cell_vertices_ptr.reserve(cells.size() + 1);
cell_vertices_ptr.push_back(0);
- std::vector<dealii::ReferenceCell> cell_types_indices;
+ std::vector<ReferenceCell> cell_types_indices;
cell_types_indices.reserve(cells.size());
// loop over cells and create CRS
"CellData."));
#endif
- const dealii::ReferenceCell reference_cell =
- dealii::ReferenceCell::n_vertices_to_type(dim,
- cell.vertices.size());
+ const ReferenceCell reference_cell =
+ ReferenceCell::n_vertices_to_type(dim, cell.vertices.size());
- Assert(reference_cell != dealii::ReferenceCells::Invalid,
+ Assert(reference_cell != ReferenceCells::Invalid,
ExcNotImplemented());
AssertIndexRange(static_cast<types::geometric_entity_type>(
reference_cell),
namespace internal
{
- namespace ReferenceCell
- {
- /**
- * A helper function to create a ReferenceCell object from an
- * integer. ReferenceCell objects are "singletons" (actually,
- * "multitons" -- there are multiple, but they are only a handful and
- * these are all that can be used). What is then necessary is to
- * have a way to create these with their internal id to distinguish
- * the few possible ones in existence. We could do this via a public
- * constructor of ReferenceCell, but that would allow users
- * to create ones outside the range we envision, and we don't want to do
- * that. Rather, the constructor that takes an integer is made `private`
- * but we have this one function in an internal namespace that is a friend
- * of the class and can be used to create the objects.
- */
- constexpr dealii::ReferenceCell
- make_reference_cell_from_int(const std::uint8_t kind);
-
- } // namespace ReferenceCell
+ /**
+ * A helper function to create a ReferenceCell object from an integer.
+ * ReferenceCell objects are "singletons" (actually, "multitons" -- there are
+ * multiple, but they are only a handful and these are all that can be used).
+ * What is then necessary is to have a way to create these with their internal
+ * id to distinguish the few possible ones in existence. We could do this via
+ * a public constructor of ReferenceCell, but that would allow users to create
+ * ones outside the range we envision, and we don't want to do that. Rather,
+ * the constructor that takes an integer is made `private` but we have this
+ * one function in an internal namespace that is a friend of the class and can
+ * be used to create the objects.
+ */
+ constexpr ReferenceCell
+ make_reference_cell_from_int(const std::uint8_t kind);
} // namespace internal
* called by anyone, but at least hidden in an internal namespace.
*/
friend constexpr ReferenceCell
- internal::ReferenceCell::make_reference_cell_from_int(const std::uint8_t);
+ internal::make_reference_cell_from_int(const std::uint8_t);
friend std::ostream &
operator<<(std::ostream &out, const ReferenceCell &reference_cell);
namespace internal
{
- namespace ReferenceCell
+ inline constexpr ReferenceCell
+ make_reference_cell_from_int(const std::uint8_t kind)
{
- inline constexpr dealii::ReferenceCell
- make_reference_cell_from_int(const std::uint8_t kind)
- {
#ifndef DEAL_II_CXX14_CONSTEXPR_BUG
- // Make sure these are the only indices from which objects can be
- // created.
- Assert((kind == static_cast<std::uint8_t>(-1)) || (kind < 8),
- ExcInternalError());
+ // Make sure these are the only indices from which objects can be
+ // created.
+ Assert((kind == static_cast<std::uint8_t>(-1)) || (kind < 8),
+ ExcInternalError());
#endif
- // Call the private constructor, which we can from here because this
- // function is a 'friend'.
- return {kind};
- }
- } // namespace ReferenceCell
+ // Call the private constructor, which we can from here because this
+ // function is a 'friend'.
+ return {kind};
+ }
} // namespace internal
namespace ReferenceCells
{
constexpr const ReferenceCell Vertex =
- internal::ReferenceCell::make_reference_cell_from_int(0);
+ internal::make_reference_cell_from_int(0);
constexpr const ReferenceCell Line =
- internal::ReferenceCell::make_reference_cell_from_int(1);
+ internal::make_reference_cell_from_int(1);
constexpr const ReferenceCell Triangle =
- internal::ReferenceCell::make_reference_cell_from_int(2);
+ internal::make_reference_cell_from_int(2);
constexpr const ReferenceCell Quadrilateral =
- internal::ReferenceCell::make_reference_cell_from_int(3);
+ internal::make_reference_cell_from_int(3);
constexpr const ReferenceCell Tetrahedron =
- internal::ReferenceCell::make_reference_cell_from_int(4);
+ internal::make_reference_cell_from_int(4);
constexpr const ReferenceCell Pyramid =
- internal::ReferenceCell::make_reference_cell_from_int(5);
+ internal::make_reference_cell_from_int(5);
constexpr const ReferenceCell Wedge =
- internal::ReferenceCell::make_reference_cell_from_int(6);
+ internal::make_reference_cell_from_int(6);
constexpr const ReferenceCell Hexahedron =
- internal::ReferenceCell::make_reference_cell_from_int(7);
+ internal::make_reference_cell_from_int(7);
constexpr const ReferenceCell Invalid =
- internal::ReferenceCell::make_reference_cell_from_int(
- static_cast<std::uint8_t>(-1));
+ internal::make_reference_cell_from_int(static_cast<std::uint8_t>(-1));
/**
* Return the correct simplex reference cell type for the given dimension
/**
* Constructor.
*/
- NoPermutation(const dealii::ReferenceCell &entity_type,
- const ArrayView<const T> & vertices_0,
- const ArrayView<const T> & vertices_1)
+ NoPermutation(const ReferenceCell & entity_type,
+ const ArrayView<const T> &vertices_0,
+ const ArrayView<const T> &vertices_1)
: entity_type(entity_type)
, vertices_0(vertices_0)
, vertices_1(vertices_1)
/**
* Entity type.
*/
- const dealii::ReferenceCell entity_type;
+ const ReferenceCell entity_type;
/**
* First set of values.
GeometryInfo<dim>::vertices_per_cell>
vertices)
{
- const dealii::ReferenceCell reference_cell =
- dealii::ReferenceCell::n_vertices_to_type(dim, vertices.size());
+ const ReferenceCell reference_cell =
+ ReferenceCell::n_vertices_to_type(dim, vertices.size());
if (reference_cell == dealii::ReferenceCells::Line)
// Return the distance between the two vertices
/**
* Helper accessor function for quad_is_quadrilateral
*/
- dealii::ReferenceCell
+ ReferenceCell
get_quad_type(const std::size_t index) const;
/**
* Helper accessor function for quad_is_quadrilateral
*/
void
- set_quad_type(const std::size_t index,
- const dealii::ReferenceCell face_type);
+ set_quad_type(const std::size_t index, const ReferenceCell face_type);
/**
* The TriaObject containing the data of lines.
- inline dealii::ReferenceCell
+ inline ReferenceCell
TriaFaces::get_quad_type(const std::size_t index) const
{
AssertIndexRange(index, quad_is_quadrilateral.size());
inline void
- TriaFaces::set_quad_type(const std::size_t index,
- const dealii::ReferenceCell face_type)
+ TriaFaces::set_quad_type(const std::size_t index,
+ const ReferenceCell face_type)
{
AssertIndexRange(index, quad_is_quadrilateral.size());
Assert(face_type == ReferenceCells::Quadrilateral ||
*
* @note Used only for dim=2 and dim=3.
*/
- std::vector<dealii::ReferenceCell> reference_cell;
+ std::vector<ReferenceCell> reference_cell;
/**
* A cache for the vertex indices of the cells (`structdim == dim`), in
* Reference-cell type related to each quadrature and active quadrature
* index.
*/
- std::vector<std::vector<dealii::ReferenceCell>> reference_cell_types;
+ std::vector<std::vector<ReferenceCell>> reference_cell_types;
/**
* Internal function to compute the geometry for the case the mapping is
template <int dim>
unsigned int
reorder_face_derivative_indices(
- const unsigned int face_no,
- const unsigned int index,
- const dealii::ReferenceCell reference_cell =
- dealii::ReferenceCells::Invalid)
+ const unsigned int face_no,
+ const unsigned int index,
+ const ReferenceCell reference_cell = dealii::ReferenceCells::Invalid)
{
Assert(index < dim, ExcInternalError());
* are defined on each face.
*/
template <int dim>
- inline std::pair<dealii::ReferenceCell, dealii::hp::QCollection<dim - 1>>
+ inline std::pair<ReferenceCell, dealii::hp::QCollection<dim - 1>>
get_face_quadrature_collection(const Quadrature<dim> &quad,
const bool do_assert = true)
{
// to test there if dim<3.
static const auto has_fe_with_reference_cell =
[](const dealii::hp::FECollection<dim, spacedim> &fe_collection,
- const dealii::ReferenceCell & reference_cell) {
+ const ReferenceCell & reference_cell) {
for (unsigned int i = 0; i < fe_collection.size(); ++i)
if (fe_collection[i].reference_cell() == reference_cell)
return true;
for (unsigned int j = 0; j < finite_elements[i]->size(); ++j)
{
- const dealii::ReferenceCell reference_cell =
+ const ReferenceCell reference_cell =
(*finite_elements[i])[j].reference_cell();
if (reference_cell.is_hyper_cube())
for (unsigned int j = 0; j < finite_elements[i]->size(); ++j)
{
- const dealii::ReferenceCell reference_cell =
+ const ReferenceCell reference_cell =
(*finite_elements[i])[j].reference_cell();
// In 1d/2d and for hypercube/wedge/pyramid elements, we
internal::GenericDoFsPerObject
expand(const unsigned int dim,
const std::vector<unsigned int> &dofs_per_object,
- const dealii::ReferenceCell cell_type)
+ const ReferenceCell cell_type)
{
internal::GenericDoFsPerObject result;
tria_level.reference_cell.insert(
tria_level.reference_cell.end(),
total_cells - tria_level.reference_cell.size(),
- tria_level.dim == 2 ? dealii::ReferenceCells::Quadrilateral :
- dealii::ReferenceCells::Hexahedron);
+ tria_level.dim == 2 ? ReferenceCells::Quadrilateral :
+ ReferenceCells::Hexahedron);
}
}
}
level.neighbors.assign(size * max_faces_per_cell, {-1, -1});
- level.reference_cell.assign(size, dealii::ReferenceCells::Invalid);
+ level.reference_cell.assign(size, ReferenceCells::Invalid);
if (orientation_needed)
level.face_orientations.reinit(size * max_faces_per_cell);
<< ',' << spacedim << '>' << std::endl;
Triangulation<dim, spacedim> tria;
- GridGenerator::reference_cell(
- tria, internal::ReferenceCell::make_reference_cell_from_int(kind));
+ GridGenerator::reference_cell(tria,
+ internal::make_reference_cell_from_int(kind));
GridOut go;
go.write_msh(tria, "output.msh");
cat_file("output.msh");
<< ',' << spacedim << '>' << std::endl;
Triangulation<dim, spacedim> tria;
- GridGenerator::reference_cell(
- tria, internal::ReferenceCell::make_reference_cell_from_int(kind));
+ GridGenerator::reference_cell(tria,
+ internal::make_reference_cell_from_int(kind));
GridOut go;
go.write_msh(tria, "output.msh");