16#ifndef dealii_tria_reference_cell_h
17#define dealii_tria_reference_cell_h
35template <
int dim,
int spacedim>
62 DEAL_II_CONSTEXPR ::ReferenceCell
174 const unsigned int i)
const;
185 template <
int dim,
int spacedim = dim>
186 std::unique_ptr<Mapping<dim, spacedim>>
200 template <
int dim,
int spacedim = dim>
279 vertex(
const unsigned int v)
const;
399 const unsigned int subface,
400 const unsigned char face_orientation = 1)
const;
411 std::array<unsigned int, 2>
423 std::array<unsigned int, 2>
431 const unsigned int line,
432 const unsigned char face_orientation)
const;
439 const unsigned int vertex,
440 const unsigned char face_orientation)
const;
447 const unsigned int face,
448 const unsigned char face_orientation)
const;
455 const unsigned int face,
456 const unsigned char face_orientation)
const;
470 const unsigned char face_orientation,
471 const bool line_orientation)
const;
548 const unsigned int i)
const;
561 template <
typename T, std::
size_t N>
564 const std::array<T, N> &vertices_1)
const;
569 template <
typename T, std::
size_t N>
572 const unsigned int orientation)
const;
652 constexpr operator std::uint8_t()
const;
671 template <
class Archive>
673 serialize(Archive &archive,
const unsigned int );
700 friend std::ostream &
703 friend std::istream &
735inline constexpr ReferenceCell::operator std::uint8_t()
const
762 inline DEAL_II_CONSTEXPR ::ReferenceCell
767 Assert((kind ==
static_cast<std::uint8_t
>(-1)) || (kind < 8),
806 static_cast<std::uint8_t
>(-1));
836template <
class Archive>
867 {{{0, 2}}, {{0, 1}}, {{1, 2}}}};
875 {{{0, 1, 2}}, {{0, 1, 3}}, {{0, 2, 3}}, {{1, 2, 3}}}};
958 std::vector<double>({
volume()}));
1240 const unsigned int face,
1241 const unsigned int subface,
1242 const unsigned char face_orientation_raw)
const
1258 {{{0, 1}}, {{1, 2}}, {{2, 0}}}};
1260 return subcells[face][subface];
1309inline std::array<unsigned int, 2>
1311 const unsigned int vertex)
const
1329 {{{0, 0}}, {{0, 1}}, {{1, 1}}, {{X, X}}, {{X, X}}, {{X, X}}}};
1340 {{{0, 0}}, {{0, 1}}, {{0, 2}}, {{1, 2}}, {{X, X}}, {{X, X}}}};
1347 {{{0, 0}}, {{0, 1}}, {{0, 2}}, {{0, 3}}, {{1, 2}}, {{X, X}}}};
1354 {{{0, 1}}, {{0, 0}}, {{0, 2}}, {{1, 0}}, {{1, 1}}, {{1, 2}}}};
1369inline std::array<unsigned int, 2>
1371 const unsigned int line)
const
1393 static const std::array<unsigned int, 2> table[6] = {
1394 {{0, 0}}, {{0, 1}}, {{0, 2}}, {{1, 1}}, {{1, 2}}, {{2, 1}}};
1400 static const std::array<unsigned int, 2> table[8] = {{{0, 0}},
1413 static const std::array<unsigned int, 2> table[9] = {{{0, 0}},
1438 const unsigned int line,
1439 const unsigned char face_orientation)
const
1475 {{{0, 1, 2}}, {{0, 3, 4}}, {{2, 5, 3}}, {{1, 4, 5}}}};
1520 const unsigned int vertex,
1521 const unsigned char face_orientation)
const
1542 {{{0, 1}}, {{1, 2}}, {{2, 0}}}};
1544 return table[face][face_orientation != 0u ?
vertex : (1 -
vertex)];
1558 {{{0, 1, 2}}, {{1, 0, 3}}, {{0, 2, 3}}, {{2, 1, 3}}}};
1561 vertex, face, face_orientation)];
1573 vertex, face, face_orientation)];
1585 vertex, face, face_orientation)];
1605 const unsigned int vertex,
1606 const unsigned int face,
1607 const unsigned char face_orientation)
const
1624 return table[face_orientation][
vertex];
1641 return table[face_orientation][
vertex];
1662 return table[face_orientation][
vertex];
1684 return table[face_orientation][
vertex];
1704 const unsigned int line,
1705 const unsigned int face,
1706 const unsigned char face_orientation)
const
1736 return table[face_orientation][line];
1757 return table[face_orientation][line];
1779 return table[face_orientation][line];
1876 ExcMessage(
"The combination of dim = " + std::to_string(dim) +
1877 " and n_vertices = " + std::to_string(
n_vertices) +
1878 " does not correspond to a known reference cell type."));
1887 const unsigned int i)
const
1890 if (*
this == ReferenceCells::get_hypercube<dim>())
1943 const double Q14 = 0.25;
1946 const double r = xi[
std::min(0, dim - 1)];
1947 const double s = xi[
std::min(1, dim - 1)];
1948 const double t = xi[
std::min(2, dim - 1)];
1950 if (fabs(t - 1.0) > 1.0e-14)
1952 ration = (r * s * t) / (1.0 - t);
1960 return Q14 * ((1.0 - r) * (1.0 - s) - t + ration);
1962 return Q14 * ((1.0 + r) * (1.0 - s) - t - ration);
1964 return Q14 * ((1.0 - r) * (1.0 + s) - t - ration);
1966 return Q14 * ((1.0 + r) * (1.0 + s) - t + ration);
1981 const unsigned int i)
const
1984 if (*
this == ReferenceCells::get_hypercube<dim>())
2050 return Point<dim>(1. / 4., 1. / 4., 1. / 4.);
2056 return Point<dim>(1. / 2., 1. / 2., 1. / 2.);
2076 ExcMessage(
"Vertices are zero-dimensional objects and "
2077 "as a consequence have no coordinates. You "
2078 "cannot meaningfully ask whether a point is "
2079 "inside a vertex (within a certain tolerance) "
2080 "without coordinate values."));
2083 else if (*
this == ReferenceCells::get_hypercube<dim>())
2085 for (
unsigned int d = 0; d < dim; ++d)
2086 if ((p[d] < -tolerance) || (p[d] > 1 + tolerance))
2090 else if (*
this == ReferenceCells::get_simplex<dim>())
2093 for (
unsigned int d = 0; d < dim; ++d)
2094 if (p[d] < -tolerance)
2106 for (
unsigned int d = 0; d < dim; ++d)
2108 return (sum <= 1 + tolerance *
std::sqrt(1. * dim));
2129 const unsigned int i)
const
2134 if (*
this == ReferenceCells::get_hypercube<dim>())
2142 static const std::array<Tensor<1, dim>, 3> table = {
2147 return table[face_no];
2161 +
std::pow(1.0 / 3.0, 1.0 / 4.0))}}}};
2163 return table[face_no][i];
2176 return table[face_no][i];
2183 {{
Point<dim>(+1.0 / sqrt(2.0), 0, +1.0 / sqrt(2.0)),
2185 {{
Point<dim>(+1.0 / sqrt(2.0), 0, -1.0 / sqrt(2.0)),
2188 Point<dim>(0, +1.0 / sqrt(2.0), +1.0 / sqrt(2.0))}},
2190 Point<dim>(0, +1.0 / sqrt(2.0), -1.0 / sqrt(2.0))}}}};
2192 return table[face_no][i];
2223 unit_tangential_vectors<dim>(face_no, 1));
2235 const unsigned int line,
2236 const unsigned char face_orientation_raw,
2237 const bool line_orientation)
const
2241 static const bool bool_table[2][2][2][2] = {
2253 {{
true,
false}, {
false,
true}}}};
2259 return (line_orientation ==
2260 bool_table[line / 2][face_orientation][face_flip][face_rotation]);
2272 template <
typename T, std::
size_t N>
2302 for (
unsigned int i = 0; i < n_vertices; ++i)
2305 if (i + 1 != n_vertices)
2309 out <<
"] is not a permutation of [";
2311 for (
unsigned int i = 0; i < n_vertices; ++i)
2314 if (i + 1 != n_vertices)
2318 out <<
"]." << std::endl;
2340template <
typename T, std::
size_t N>
2343 const std::array<T, N> &vertices_1)
const
2348 const std::array<T, 2> i{{vertices_0[0], vertices_0[1]}};
2349 const std::array<T, 2> j{{vertices_1[0], vertices_1[1]}};
2352 if (i == std::array<T, 2>{{j[0], j[1]}})
2356 if (i == std::array<T, 2>{{j[1], j[0]}})
2361 const std::array<T, 3> i{{vertices_0[0], vertices_0[1], vertices_0[2]}};
2362 const std::array<T, 3> j{{vertices_1[0], vertices_1[1], vertices_1[2]}};
2365 if (i == std::array<T, 3>{{j[0], j[1], j[2]}})
2369 if (i == std::array<T, 3>{{j[1], j[2], j[0]}})
2373 if (i == std::array<T, 3>{{j[2], j[0], j[1]}})
2377 if (i == std::array<T, 3>{{j[0], j[2], j[1]}})
2381 if (i == std::array<T, 3>{{j[2], j[1], j[0]}})
2385 if (i == std::array<T, 3>{{j[1], j[0], j[2]}})
2390 const std::array<T, 4> i{
2391 {vertices_0[0], vertices_0[1], vertices_0[2], vertices_0[3]}};
2392 const std::array<T, 4> j{
2393 {vertices_1[0], vertices_1[1], vertices_1[2], vertices_1[3]}};
2396 if (i == std::array<T, 4>{{j[0], j[1], j[2], j[3]}})
2400 if (i == std::array<T, 4>{{j[2], j[0], j[3], j[1]}})
2404 if (i == std::array<T, 4>{{j[3], j[2], j[1], j[0]}})
2408 if (i == std::array<T, 4>{{j[1], j[3], j[0], j[2]}})
2412 if (i == std::array<T, 4>{{j[0], j[2], j[1], j[3]}})
2416 if (i == std::array<T, 4>{{j[2], j[3], j[0], j[1]}})
2420 if (i == std::array<T, 4>{{j[3], j[1], j[2], j[0]}})
2424 if (i == std::array<T, 4>{{j[1], j[0], j[3], j[2]}})
2435template <
typename T, std::
size_t N>
2436inline std::array<T, N>
2439 const unsigned int orientation)
const
2441 std::array<T, 4> temp;
2445 switch (orientation)
2459 switch (orientation)
2485 switch (orientation)
2520 std::array<T, N> temp_;
2521 std::copy_n(temp.begin(), N, temp_.begin());
Abstract base class for mapping classes.
static Point< dim, Number > unit_vector(const unsigned int i)
ArrayView< const unsigned int > faces_for_given_vertex(const unsigned int vertex_index) const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > vertex_indices() const
unsigned int n_vertices() const
bool is_hyper_cube() const
unsigned int vtk_linear_type() const
void serialize(Archive &archive, const unsigned int)
unsigned int face_to_cell_vertices(const unsigned int face, const unsigned int vertex, const unsigned char face_orientation) const
unsigned char compute_orientation(const std::array< T, N > &vertices_0, const std::array< T, N > &vertices_1) const
std::array< unsigned int, 2 > standard_vertex_to_face_and_vertex_index(const unsigned int vertex) const
Quadrature< dim > get_gauss_type_quadrature(const unsigned n_points_1D) const
bool standard_vs_true_line_orientation(const unsigned int line, const unsigned char face_orientation, const bool line_orientation) const
Point< dim > vertex(const unsigned int v) const
unsigned int standard_to_real_face_vertex(const unsigned int vertex, const unsigned int face, const unsigned char face_orientation) const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > isotropic_child_indices() const
std::array< unsigned int, 2 > standard_line_to_face_and_line_index(const unsigned int line) const
double d_linear_shape_function(const Point< dim > &xi, const unsigned int i) const
unsigned int child_cell_on_face(const unsigned int face, const unsigned int subface, const unsigned char face_orientation=1) const
Tensor< 1, dim > unit_tangential_vectors(const unsigned int face_no, const unsigned int i) const
std::array< T, N > permute_according_orientation(const std::array< T, N > &vertices, const unsigned int orientation) const
bool contains_point(const Point< dim > &p, const double tolerance=0) const
unsigned int n_isotropic_children() const
unsigned int gmsh_element_type() const
unsigned int n_faces() const
constexpr ReferenceCell()
unsigned int exodusii_vertex_to_deal_vertex(const unsigned int vertex_n) const
unsigned int unv_vertex_to_deal_vertex(const unsigned int vertex_n) const
std::unique_ptr< Mapping< dim, spacedim > > get_default_mapping(const unsigned int degree) const
Quadrature< dim > get_midpoint_quadrature() const
unsigned int vtk_quadratic_type() const
unsigned int n_lines() const
unsigned int vtk_lagrange_type() const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > line_indices() const
unsigned int get_dimension() const
ReferenceCell face_reference_cell(const unsigned int face_no) const
unsigned int exodusii_face_to_deal_face(const unsigned int face_n) const
static ReferenceCell n_vertices_to_type(const int dim, const unsigned int n_vertices)
unsigned int standard_to_real_face_line(const unsigned int line, const unsigned int face, const unsigned char face_orientation) const
friend std::istream & operator>>(std::istream &in, ReferenceCell &reference_cell)
const Mapping< dim, spacedim > & get_default_linear_mapping() const
std::string to_string() const
unsigned int face_to_cell_lines(const unsigned int face, const unsigned int line, const unsigned char face_orientation) const
constexpr bool operator!=(const ReferenceCell &type) const
constexpr bool operator==(const ReferenceCell &type) const
Point< dim > barycenter() const
const Quadrature< dim > & get_nodal_type_quadrature() const
Tensor< 1, dim > unit_normal_vectors(const unsigned int face_no) const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > face_indices() const
friend std::ostream & operator<<(std::ostream &out, const ReferenceCell &reference_cell)
Tensor< 1, dim > d_linear_shape_function_gradient(const Point< dim > &xi, const unsigned int i) const
const ::ReferenceCell entity_type
const std::array< T, N > vertices_0
const std::array< T, N > vertices_1
virtual void print_info(std::ostream &out) const override
virtual ~NoPermutation() noexcept override=default
NoPermutation(const ::ReferenceCell &entity_type, const std::array< T, N > &vertices_0, const std::array< T, N > &vertices_1)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_CONSTEXPR
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
constexpr const ReferenceCell Tetrahedron
constexpr const ReferenceCell Quadrilateral
constexpr const ReferenceCell Wedge
constexpr const ReferenceCell Pyramid
constexpr const ReferenceCell Invalid
constexpr const ReferenceCell Triangle
constexpr const ReferenceCell Hexahedron
constexpr const ReferenceCell & get_hypercube()
constexpr const ReferenceCell Vertex
constexpr const ReferenceCell Line
constexpr const ReferenceCell & get_simplex()
bool get_bit(const unsigned char number, const unsigned int n)
constexpr ::ReferenceCell make_reference_cell_from_int(const std::uint8_t kind)
static const unsigned int invalid_unsigned_int
boost::integer_range< IncrementableType > iota_view
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > pow(const ::VectorizedArray< Number, width > &, const Number p)
typename internal::ndarray::HelperArray< T, Ns... >::type ndarray
std::istream & operator>>(std::istream &in, ReferenceCell &reference_cell)
std::ostream & operator<<(std::ostream &out, const ReferenceCell &reference_cell)
static unsigned int standard_to_real_line_vertex(const unsigned int vertex, const bool line_orientation=true)
static unsigned int child_cell_on_face(const RefinementCase< dim > &ref_case, const unsigned int face, const unsigned int subface, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false, const RefinementCase< dim - 1 > &face_refinement_case=RefinementCase< dim - 1 >::isotropic_refinement)
static unsigned int standard_to_real_face_vertex(const unsigned int vertex, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false)
static unsigned int face_to_cell_vertices(const unsigned int face, const unsigned int vertex, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false)
static std::array< unsigned int, 2 > standard_hex_line_to_quad_line_index(const unsigned int line)
static unsigned int standard_to_real_face_line(const unsigned int line, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false)
static std::array< unsigned int, 2 > standard_hex_vertex_to_quad_vertex_index(const unsigned int vertex)
static std::array< unsigned int, 2 > standard_quad_vertex_to_line_vertex_index(const unsigned int vertex)
static double d_linear_shape_function(const Point< dim > &xi, const unsigned int i)
static unsigned int face_to_cell_lines(const unsigned int face, const unsigned int line, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false)
static Tensor< 1, dim > d_linear_shape_function_gradient(const Point< dim > &xi, const unsigned int i)
constexpr Tensor< 1, dim, Number > cross_product_2d(const Tensor< 1, dim, Number > &src)
constexpr Tensor< 1, dim, typename ProductType< Number1, Number2 >::type > cross_product_3d(const Tensor< 1, dim, Number1 > &src1, const Tensor< 1, dim, Number2 > &src2)