![]() |
deal.II version GIT relicensing-6809-ge913b9bb34 2026-09-25 17:20:01+00:00
|
#include <deal.II/grid/reference_cell.h>
A type that describes the kinds of reference cells that can be used. This includes quadrilaterals and hexahedra (i.e., "hypercubes"), triangles and tetrahedra (simplices), and the pyramids and wedges necessary when using mixed 3d meshes. This class then describes geometric, topological, and other kinds of information about these kinds of reference cells. This includes how many vertices or faces a certain kind of reference cell has (topological information), where these vertices lie, what the cell's volume or center of mass is (geometric information), and how to output these cells in various output formats or what appropriate quadrature rules are. The documentation of this class is separated into a number of sections to group the many member functions into different categories such as those mentioned above.
Objects of this type should not be created in user code, and as a consequence the class does not have a user-accessible constructor other than the default constructor (which creates an invalid object). Rather, there is a finite number of specific reference cell objects defined in the ReferenceCells namespace that completely enumerate all of the possible values. User codes should therefore rely exclusively on assigning ReferenceCell objects from these special objects, and comparing against those special objects.
The purposes and intents of this class are described in the reference cell glossary entry.
Definition at line 128 of file reference_cell.h.
Public Member Functions | |
| constexpr | ReferenceCell () |
Querying information about the kind of reference cells | |
| constexpr bool | is_hyper_cube () const |
| constexpr bool | is_simplex () const |
| constexpr unsigned int | get_dimension () const |
Shape functions, mappings, quadratures defined on a reference cell | |
| double | d_linear_shape_function (const Point< dim > &xi, const unsigned int i) const |
| Tensor< 1, dim > | d_linear_shape_function_gradient (const Point< dim > &xi, const unsigned int i) const |
| template<int spacedim = dim> | |
| std::unique_ptr< Mapping< dim, spacedim > > | get_default_mapping (const unsigned int degree) const |
| template<int spacedim = dim> | |
| const Mapping< dim, spacedim > & | get_default_linear_mapping () const |
| Quadrature< dim > | get_gauss_type_quadrature (const unsigned n_points_1d) const |
| Quadrature< dim > | get_midpoint_quadrature () const |
| const Quadrature< dim > & | get_nodal_type_quadrature () const |
Querying the number of building blocks of a reference cell | |
| constexpr unsigned int | n_vertices () const |
| std_cxx20::ranges::iota_view< unsigned int, unsigned int > | vertex_indices () const |
| Point< dim > | vertex (const unsigned int v) const |
| constexpr unsigned int | n_lines () const |
| std_cxx20::ranges::iota_view< unsigned int, unsigned int > | line_indices () const |
| constexpr unsigned int | n_faces () const |
| std_cxx20::ranges::iota_view< unsigned int, unsigned int > | face_indices () const |
| std_cxx20::ranges::iota_view< unsigned int, unsigned int > | face_indices_by_type (const ReferenceCell< dim - 1 > &face_ref_type) const |
| constexpr unsigned int | n_isotropic_refinement_choices () const |
| IsotropicRefinementChoice | get_isotropic_refinement_choice (const unsigned int ref_choice) const |
| constexpr unsigned int | n_isotropic_children () const |
| unsigned int | n_children (const RefinementCase< dim > ref_case=RefinementCase< dim >::isotropic_refinement) const |
| std_cxx20::ranges::iota_view< unsigned int, unsigned int > | isotropic_child_indices () const |
| std::pair< unsigned int, RefinementCase< dim - 1 > > | equivalent_refinement_case (const types::geometric_orientation combined_face_orientation, const internal::SubfaceCase< dim > subface_case, const unsigned int subface_no) const |
| ArrayView< const RefinementCase< dim > > | refinement_cases () const |
| constexpr ReferenceCell< dim - 1 > | face_reference_cell (const unsigned int face_index) const |
| double | volume () const |
| double | face_measure (const unsigned int face_no) const |
| Point< dim > | barycenter () const |
| bool | contains_point (const Point< dim > &p, const double tolerance=0) const |
| Point< dim > | closest_point (const Point< dim > &p) const |
| Tensor< 1, dim > | face_tangent_vector (const unsigned int face_no, const unsigned int i) const |
| Tensor< 1, dim > | face_normal_vector (const unsigned int face_no) const |
| unsigned int | n_face_orientations (const unsigned int face_no) const |
| template<typename T , std::size_t N> | |
| types::geometric_orientation | compute_orientation (const std::array< T, N > &vertices_0, const std::array< T, N > &vertices_1) const |
| template<typename T > | |
| types::geometric_orientation | get_combined_orientation (const ArrayView< const T > &vertices_0, const ArrayView< const T > &vertices_1) const |
| template<typename T > | |
| boost::container::small_vector< T, 8 > | permute_by_combined_orientation (const ArrayView< const T > &vertices, const types::geometric_orientation orientation) const |
| types::geometric_orientation | get_inverse_combined_orientation (const types::geometric_orientation orientation) const |
| ArrayView< const unsigned int > | faces_for_given_vertex (const unsigned int vertex_index) const |
| const ndarray< unsigned int, 13, 4 > & | new_isotropic_child_face_lines (const unsigned int refinement_choice) const |
| const ndarray< unsigned int, 13, 4, 2 > & | new_isotropic_child_face_line_vertices (const unsigned int refinement_choice) const |
| const ndarray< unsigned int, 10, 6 > & | new_isotropic_child_cell_faces (const unsigned int refinement_choice) const |
| const ndarray< unsigned int, 10, 8 > & | new_isotropic_child_cell_vertices (const unsigned int refinement_choice) const |
Relationships between objects in the cell and on faces | |
| unsigned int | child_cell_on_face (const unsigned int face, const unsigned int subface, const types::geometric_orientation combined_orientation) const |
| std::array< unsigned int, 2 > | standard_vertex_to_face_and_vertex_index (const unsigned int vertex) const |
| std::array< unsigned int, 2 > | standard_line_to_face_and_line_index (const unsigned int line) const |
| unsigned int | line_to_cell_vertices (const unsigned int line, const unsigned int vertex) const |
| unsigned int | face_to_cell_lines (const unsigned int face, const unsigned int line, const types::geometric_orientation face_orientation) const |
| unsigned int | face_to_cell_vertices (const unsigned int face, const unsigned int vertex, const types::geometric_orientation face_orientation) const |
| unsigned int | face_and_line_to_cell_vertices (const unsigned int face, const unsigned int line, const unsigned int vertex, const types::geometric_orientation face_orientation) const |
| Point< dim > | face_vertex_location (const unsigned int face, const unsigned int vertex) const |
| Point< dim > | subface_vertex_location (const unsigned int face_no, const unsigned int subface_no, const unsigned int subface_vertex_no, const RefinementCase< dim - 1 > face_refinement_case) const |
| unsigned int | standard_to_real_face_vertex (const unsigned int vertex, const unsigned int face, const types::geometric_orientation face_orientation) const |
| unsigned int | standard_to_real_face_line (const unsigned int line, const unsigned int face, const types::geometric_orientation face_orientation) const |
| types::geometric_orientation | face_to_cell_line_orientation (const unsigned int face_line_no, const unsigned int face_no, const types::geometric_orientation face_orientation, const types::geometric_orientation line_orientation) const |
| Convert a line orientation defined relative to a face to the canonical per-cell line orientation. | |
| unsigned int | opposite_face_index (const unsigned int face_no) const |
| Return the index of the face opposite to a given face on the reference cell. | |
Translating between deal.II indexing and formats used by other programs | |
| unsigned int | exodusii_vertex_to_deal_vertex (const unsigned int vertex_n) const |
| unsigned int | exodusii_face_to_deal_face (const unsigned int face_n) const |
| unsigned int | ucd_vertex_to_deal_vertex (const unsigned int vertex_n) const |
| unsigned int | unv_vertex_to_deal_vertex (const unsigned int vertex_n) const |
| unsigned int | vtk_linear_type () const |
| unsigned int | vtk_quadratic_type () const |
| unsigned int | vtk_lagrange_type () const |
| unsigned int | vtk_lexicographic_to_node_index (const std::array< unsigned, dim > &node_indices, const std::array< unsigned, dim > &nodes_per_direction, const bool legacy_format) const |
| unsigned int | vtk_vertex_to_deal_vertex (const unsigned int vertex_index) const |
| unsigned int | gmsh_element_type () const |
Static Public Member Functions | |
| static ReferenceCell | n_vertices_to_type (const int dim_, const unsigned int n_vertices) |
Private Member Functions | |
| constexpr | ReferenceCell (const std::uint8_t kind) |
Private Attributes | |
| std::uint8_t | kind |
Static Private Attributes | |
| static constexpr ndarray< unsigned int, 1, 1 > | vertex_vertex_permutations |
| static constexpr ndarray< unsigned int, 3, 4 > | line_vertex_permutations |
| static constexpr ndarray< unsigned int, 6, 4 > | triangle_vertex_permutations |
| static constexpr ndarray< unsigned int, 8, 4 > | quadrilateral_vertex_permutations |
| static constexpr ndarray< unsigned int, 6, 3 > | triangle_line_permutations |
| static constexpr ndarray< unsigned int, 8, 4 > | quadrilateral_line_permutations |
Friends | |
| template<int dim_> | |
| constexpr ReferenceCell< dim_ > | internal::make_reference_cell_from_int (const std::uint8_t) |
| template<int dim_> | |
| std::ostream & | operator<< (std::ostream &out, const ReferenceCell< dim_ > &reference_cell) |
| template<int dim_> | |
| std::istream & | operator>> (std::istream &in, ReferenceCell< dim_ > &reference_cell) |
Other functions | |
| static constexpr std::size_t | memory_consumption () |
| std::string | to_string () const |
| constexpr | operator std::uint8_t () const |
| constexpr bool | operator== (const ReferenceCell< dim > &type) const |
| template<int dim2> | |
| constexpr bool | operator== (const ReferenceCell< dim2 > &type) const |
| constexpr bool | operator!= (const ReferenceCell< dim > &type) const |
| template<int dim2> | |
| constexpr bool | operator!= (const ReferenceCell< dim2 > &type) const |
| template<class Archive > | |
| void | serialize (Archive &archive, const unsigned int) |
|
inlineconstexpr |
Default constructor. Initialize this object as an invalid object. The end result is that the current object equals ReferenceCells::Invalid.
Generally, ReferenceCell objects are created by assignment from the special objects in namespace ReferenceCells, which is the only way to obtain a valid object.
Definition at line 1474 of file reference_cell.h.
|
inlineexplicitconstexprprivate |
Constructor. This is the constructor used to create the different static member variables of this class. It is private but can be called by a function in an internal namespace that is a friend of this class.
Definition at line 1262 of file reference_cell.h.
|
inlinestatic |
Return the correct ReferenceCell for a given structural dimension and number of vertices. For example, if dim==2 and n_vertices==4, this function will return ReferenceCells::Quadrilateral. But if dim==3 and n_vertices==4, it will return ReferenceCells::Tetrahedron.
Definition at line 3714 of file reference_cell.h.
|
inlineconstexpr |
Return true if the object is a ReferenceCells::Vertex, ReferenceCells::Line, ReferenceCells::Quadrilateral, or ReferenceCells::Hexahedron.
Definition at line 2163 of file reference_cell.h.
|
inlineconstexpr |
Return true if the object is a Vertex, Line, Triangle, or Tetrahedron.
Definition at line 2174 of file reference_cell.h.
|
inlineconstexpr |
Return the dimension of the reference cell represented by the current object. This value, of course, simply equals the dim template argument of this class.
Definition at line 2185 of file reference_cell.h.
|
inline |
Compute the value of the \(i\)-th linear shape function at location \(\xi\) for the current reference-cell type.
For ReferenceCells::Vertex, the reference cell is a zero-dimensional point in a zero-dimensional space: i.e., asking about the value of a polynomial doesn't make sense since there cannot be any independent variables. To enable dimension-independent programming we define the zero-dimensional value to be 1.
Definition at line 3725 of file reference_cell.h.
|
inline |
Compute the gradient of the \(i\)-th linear shape function at location \(\xi\) for the current reference-cell type.
Definition at line 3833 of file reference_cell.h.
| std::unique_ptr< Mapping< dim, spacedim > > ReferenceCell< dim >::get_default_mapping | ( | const unsigned int | degree | ) | const |
Return a default mapping of degree degree matching the current reference cell. If this reference cell is a hypercube, then the returned mapping is a MappingQ; otherwise, it is an object of type MappingFE initialized with FE_SimplexP (if the reference cell is a triangle or tetrahedron), with FE_PyramidP (if the reference cell is a pyramid), or with FE_WedgeP (if the reference cell is a wedge).
Definition at line 477 of file reference_cell.cc.
| const Mapping< dim, spacedim > & ReferenceCell< dim >::get_default_linear_mapping | ( | ) | 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 FE_SimplexP (if the reference cell is a triangle or tetrahedron), with FE_PyramidP (if the reference cell is a pyramid), or with 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.
Definition at line 507 of file reference_cell.cc.
| Quadrature< dim > ReferenceCell< dim >::get_gauss_type_quadrature | ( | const unsigned | n_points_1d | ) | const |
Return a Gauss-type quadrature matching the given reference cell (QGauss, QGaussSimplex, QGaussPyramid, QGaussWedge).
| [in] | n_points_1d | The number of quadrature points in each direction (QGauss) or an indication of what polynomial degree needs to be integrated exactly for the other types. |
Definition at line 541 of file reference_cell.cc.
| Quadrature< dim > ReferenceCell< dim >::get_midpoint_quadrature | ( | ) | const |
Return a quadrature object that has a single quadrature point at the barycenter of the cell with quadrature weight equal to the volume of the reference cell. This quadrature formula is exact for integrals of constant and linear integrands.
The object returned by this function generalizes what the QMidpoint class represents to other reference cells.
Definition at line 2194 of file reference_cell.h.
| const Quadrature< dim > & ReferenceCell< dim >::get_nodal_type_quadrature | ( | ) | const |
Return a quadrature rule whose quadrature points are the vertices of the given reference cell. For 1d line segments, this corresponds to the quadrature points of the trapezoidal rule, which by taking tensor products easily generalizes also to other hypercube elements (see also QTrapezoid). For all reference cell shapes, the quadrature points are ordered in the same order as the vertices of the reference cell.
Definition at line 564 of file reference_cell.cc.
|
inlineconstexpr |
Return the number of vertices that make up the reference cell in question. A vertex is a "corner" (a zero-dimensional object) of the reference cell.
Definition at line 2204 of file reference_cell.h.
|
inline |
Return an object that can be thought of as an array containing all indices from zero to n_vertices().
Definition at line 2708 of file reference_cell.h.
| Point< dim > ReferenceCell< dim >::vertex | ( | const unsigned int | v | ) | const |
Return the location of the vth vertex of the reference cell that corresponds to the current object.
Because the ReferenceCell class does not have a dim argument, it has to be explicitly specified in the call to this function.
Definition at line 2296 of file reference_cell.h.
|
inlineconstexpr |
Return the number of lines that make up the reference cell in question. A line is an "edge" (a one-dimensional object) of the reference cell.
Definition at line 2250 of file reference_cell.h.
|
inline |
Return an object that can be thought of as an array containing all indices from zero to n_lines().
Definition at line 2718 of file reference_cell.h.
|
inlineconstexpr |
Return the number of faces that make up the reference cell in question. A face is a (dim-1)-dimensional object bounding the reference cell.
Definition at line 2404 of file reference_cell.h.
|
inline |
Return an object that can be thought of as an array containing all indices from zero to n_faces().
Definition at line 2445 of file reference_cell.h.
|
inline |
Return an object that can be thought of as an array containing the indices of the given cell's faces of the desired type face_ref_type. Indices form a continuous range that is empty in case no face of such type exists.
Definition at line 2455 of file reference_cell.h.
|
inlineconstexpr |
Return the number of refinement directions of the cell.
Definition at line 2523 of file reference_cell.h.
|
inline |
Return the refinement possibility ref_choice.
Definition at line 2556 of file reference_cell.h.
|
inlineconstexpr |
Return the number of cells one would get by isotropically refining the current cell. Here, "isotropic refinement" means that we subdivide in each "direction" of a cell. For example, a square would be refined into four children by introducing new vertices along each edge and a new vertex in the cell center. For triangles, one would introduce new vertices at the center of each edge, and connect them to obtain four children. Similar constructions can be done for the other reference cell types.
Definition at line 2594 of file reference_cell.h.
| unsigned int ReferenceCell< dim >::n_children | ( | const RefinementCase< dim > | ref_case = RefinementCase<dim>::isotropic_refinement | ) | const |
Return the number of cells one would get by refining the current cell with the given refinement case.
Definition at line 2627 of file reference_cell.h.
|
inline |
Return an object that can be thought of as an array containing all indices from zero to n_isotropic_children().
Definition at line 2698 of file reference_cell.h.
| std::pair< unsigned int, RefinementCase< dim - 1 > > ReferenceCell< dim >::equivalent_refinement_case | ( | const types::geometric_orientation | combined_face_orientation, |
| const internal::SubfaceCase< dim > | subface_case, | ||
| const unsigned int | subface_no | ||
| ) | const |
Convert an internal::SubfaceCase into its equivalent RefinementCase. For example, SubfacePossibilities<3>::Possibilities::y1x2x is is geometrically equivalent to RefinementPossibilities<3>::cut_xy.
(0, isotropic_refinement).subface_case in this context and only read subface_no. Hence, in 2d, this function does the same thing and returns (subface_no, isotropic_refinement).Definition at line 303 of file reference_cell.cc.
|
inline |
Return an ArrayView of the possible refinements (e.g., RefinementPossibilities<2>::cut_x) of the current ReferenceCell. This ArrayView will not include RefinementPossibilities<dim>::no_refinement: instead, for elements which do not yet support refinement (e.g., ReferenceCell<dim>::Pyramid) the ArrayView will be empty.
Definition at line 2728 of file reference_cell.h.
|
inlineconstexpr |
Return the reference-cell type of face face_index of the current object. For example, if the current object is ReferenceCells::Tetrahedron, then face_index must be in the interval \([0,4)\) and the function will always return ReferenceCells::Triangle. If the current object is ReferenceCells::Hexahedron, then face_index must be in the interval \([0,6)\) and the function will always return ReferenceCells::Quadrilateral. For wedges and pyramids, the returned object may be either ReferenceCells::Triangle or ReferenceCells::Quadrilateral, depending on the given index.
Definition at line 2802 of file reference_cell.h.
|
inline |
Return which child cells are adjacent to a certain face of the parent cell.
For example, in 2d the layout of a quadrilateral cell is as follows:
* 3 * 2-->--3 * | | * 0 ^ ^ 1 * | | * 0-->--1 * 2 *
Vertices and faces are indicated with their numbers, faces also with their directions.
Now, when refined, the layout is like this:
* *---*---* * | 2 | 3 | * *---*---* * | 0 | 1 | * *---*---* *
Thus, the child cells on face 0 are (ordered in the direction of the face) 0 and 2, on face 3 they are 2 and 3, etc.
For three spatial dimensions, the exact order of the children is laid down in the general documentation of this class.
The face_orientation argument is meant exclusively for quadrilaterals and hexahedra at the moment. It determines how this function handles faces oriented in the standard and non-standard orientation. It represents a bit-code for the overall face_orientation, face_flip and face_rotation and defaults to the standard orientation. The concept of combined orientations is explained in this glossary entry.
Definition at line 2842 of file reference_cell.h.
|
inline |
For a given vertex in a cell, return a pair of a face index and a vertex index within this face.
Definition at line 2928 of file reference_cell.h.
|
inline |
For a given line in a cell, return a pair of a face index and a line index within this face.
Definition at line 3005 of file reference_cell.h.
|
inline |
Map line vertex number to cell vertex number, i.e., return the cell vertex number of the vertexth vertex of line line.
The order of the lines, as well as their direction (which in turn determines which vertices are first and second on a line) is the canonical one in deal.II, as described in the general documentation of this class.
Definition at line 3070 of file reference_cell.h.
|
inline |
Map face line number to cell line number. In other words, for a given face and a line (edge) of this face, return the how many'th line within this cell we are talking about.
If the current object is ReferenceCells::Vertex or ReferenceCells::Line, then this function throws an exception because for these reference cells, faces have no lines. For two-dimensional reference cells (i.e., if the current object is ReferenceCells::Triangle or ReferenceCells::Quadrilateral), each face consists of (is identical to) exactly one line and the function consequently returns face. For three-dimensional reference cells, each face is bounded by several lines and the the function's mapping is more complicated.
r satisfies r<n_lines(). Definition at line 3164 of file reference_cell.h.
|
inline |
Map face vertex number to cell vertex number. In other words, for a given face and a vertex of this face, return the how many'th vertex within this cell we are talking about.
If the current object is ReferenceCells::Vertex, then this function throws an exception because vertex objects have no faces. For ReferenceCells::Line, the faces each have (and are identical to) one vertex and so the function simply returns face. For two- and three-dimensional reference cells each face is bounded by several vertices and the the function's mapping is more complicated.
face < this->n_faces() vertex < this->face_reference_cell(face).n_vertices() r satisfies r<n_vertices(). Definition at line 3243 of file reference_cell.h.
|
inline |
Map the vertex number of a specific line of a face to cell vertex number. In other words, for a given face, a line (edge) of this face, and a vertex of this line, return the how many'th vertex within this cell we are talking about.
If the current object is ReferenceCells::Vertex or ReferenceCells::Line, then this function throws an exception because these objects have no faces or because the faces are points that have no lines. For two-dimensional reference cells, each face is composed of (and is identical to) exactly one line and so the function simply returns face_to_cell_vertices(face, vertex, face_orientation). For three-dimensional reference cells each face is bounded by several vertices and the the function's mapping is more complicated.
r satisfies r<n_vertices(). Definition at line 3343 of file reference_cell.h.
| Point< dim > ReferenceCell< dim >::face_vertex_location | ( | const unsigned int | face, |
| const unsigned int | vertex | ||
| ) | const |
For a given face, in standard orientation, return the location of one of its vertices in the ambient space of the cell. For example, for a square or triangular 2d cell, the zeroth vertex of its zeroth face is located at \((0,0)\) – a location in 2d space.
| [in] | face | The number of face. This number must be between zero and n_faces(). |
| [in] | vertex | The number of the vertex within the face. This number must be between zero and face_reference_cell(face).n_vertices(). |
dim-dimensional space.reference_cell.face_vertex_location<dim>(f,v) is identical to calling reference_cell.vertex<dim>( reference_cell.face_to_cell_vertices(
f, v, numbers::default_geometric_orientation)). Definition at line 3445 of file reference_cell.h.
| Point< dim > ReferenceCell< dim >::subface_vertex_location | ( | const unsigned int | face_no, |
| const unsigned int | subface_no, | ||
| const unsigned int | subface_vertex_no, | ||
| const RefinementCase< dim - 1 > | face_refinement_case | ||
| ) | const |
For a given subface, in standard orientation, return the location of one of its vertices.
| [in] | face_no | Index of the face. |
| [in] | subface_no | Index of the subface within that face. |
| [in] | subface_vertex_no | Index of the vertex within the subface. |
| [in] | face_refinement_case | The way in which the current face is refined. |
Definition at line 267 of file reference_cell.cc.
|
inline |
Get vertex index of vertex vertex belonging to face face of the current cell while accounting for orientation face_orientation .
Definition at line 3456 of file reference_cell.h.
|
inline |
Get line index of line line belonging to face face of the current cell while accounting for orientation face_orientation .
Definition at line 3504 of file reference_cell.h.
|
inline |
Convert a line orientation defined relative to a face to the canonical per-cell line orientation.
Line orientations are used in both face and line contexts. Since a line is always shared by two faces, it may need to be reversed (relative to the first face) on the second face to guarantee that the per-face lines always point in their canonical directions (e.g., so that lines 0 and 1 of a quadrilateral point up and lines 2 and 3 point right) and that the vertex ordering on that line remains correct.
To achieve this, this function computes the per-cell line orientation based on the face's number, orientation and line number.
| [in] | face_line_no | The index of the line on the face. |
| [in] | face_no | The number of the face. |
| [in] | face_orientation | The orientation of the face. |
| [in] | line_orientation | The orientation of the line on the given face. |
Definition at line 4317 of file reference_cell.h.
|
inline |
Return the index of the face opposite to a given face on the reference cell.
This function returns the face index that is considered opposite to face_no on the reference cell. For hypercube elements, faces come in natural opposite pairs, such as left/right or top/bottom for a quadrilateral.
For simplex reference cells, the notion of an opposite face is not geometrically meaningful. In these cases, the function returns the next face index by cycling through the indices.
For pyramid reference cells, the function returns the index of the quadrilateral face when given the face index of the quadrilateral. For the triangular faces, it returns the opposite triangular face index.
For wedge reference cells, the function returns the opposite triangular face when one of the triangular face indices is given. For quadrilateral faces of a wedge, again the function cycles through the face indices of the quadrilaterals.
| [in] | face_no | Index of a face of the current cell. |
face_no on the reference cell. Definition at line 4442 of file reference_cell.h.
|
inline |
Return the \(d\)-dimensional volume of the reference cell that corresponds to the current object, where \(d\) is the dimension of the space it lives in. For example, since the quadrilateral reference cell is \([0,1]^2\), its volume is one, whereas the volume of the reference triangle is 0.5 because it occupies the area \(\{0 \le x,y \le 1, x+y\le 1\}\).
For ReferenceCells::Vertex, the reference cell is a zero-dimensional point in a zero-dimensional space. As a consequence, one cannot meaningfully define a volume for it. The function returns one for this case, because this makes it possible to define useful quadrature rules based on the center of a reference cell and its volume.
Definition at line 3883 of file reference_cell.h.
|
inline |
Return the \(d - 1\)-dimensional measure of the face of a reference cell that corresponds to the current object, where \(d\) is the dimension of the space it lives in.
In this context the measure of a face depends on both the type of reference cell as well as the face number (i.e., *this and face_no). For example, the measures of the sides of a ReferenceCells::Triangle are \(1\), \(\sqrt{2}\), and \(1\), respectively, whereas the measures of the sides of a ReferenceCells::Quadrilateral are all \(1\).
Definition at line 3924 of file reference_cell.h.
|
inline |
Return the barycenter (i.e., the center of mass) of the reference cell that corresponds to the current object. The function is not called center() because one can define the center of an object in a number of different ways whereas the barycenter of a reference cell \(K\) is unambiguously defined as
\[ \mathbf x_K = \frac{1}{V} \int_K \mathbf x \; dx \]
where \(V\) is the volume of the reference cell (see also the volume() function).
Definition at line 3985 of file reference_cell.h.
|
inline |
Return true if the given point is inside the reference cell of the present space dimension up to some tolerance. This function accepts an additional parameter (which defaults to zero) which specifies by how much the point position may actually be outside the true reference cell. This is useful because in practice we may often not be able to compute the coordinates of a point in reference coordinates exactly, but only up to numerical roundoff. For example, strictly speaking one would expect that for points on the boundary of the reference cell, the function would return true if the tolerance was zero. But in practice, this may or may not actually be true; for example, the point \((1/3, 2/3)\) is on the boundary of the reference triangle because \(1/3+2/3 \le 1\), but since neither of its coordinates are exactly representable in floating point arithmetic, the floating point representations of \(1/3\) and \(2/3\) may or may not add up to anything that is less than or equal to one.
The tolerance parameter may be less than zero, indicating that the point should be safely inside the cell.
Definition at line 4026 of file reference_cell.h.
| Point< dim > ReferenceCell< dim >::closest_point | ( | const Point< dim > & | p | ) | const |
Return the point on the surface of the reference cell closest (in the Euclidean norm) to p.
Definition at line 1439 of file reference_cell.cc.
|
inline |
Return \(i\)-th unit tangent vector to a face of the reference cell. The vectors are arranged in such an order that the cross product between the two vectors returns the face normal vector.
dim-1. Definition at line 4171 of file reference_cell.h.
|
inline |
Return the unit normal vector of a face of the reference cell.
Definition at line 4264 of file reference_cell.h.
|
inline |
Return the number of orientations for a face in the ReferenceCell. For example, for hexahedra this is 8 for every face since quadrilaterals have 8 possible orientations.
Definition at line 4290 of file reference_cell.h.
|
inline |
Determine the orientation of the current entity described by its vertices vertices_1 relative to an entity described by vertices_0. The two arrays given as arguments can be arrays of global vertex indices or local vertex indices, arrays of vertex locations, or arrays of any other objects identifying the vertices and the order in which they are encountered in a cell.
The size of the arrays, i.e., the template argument N, must be equal to or larger than the number of vertices of the current entity. If it is larger, only those elements of the input and output arrays are read from or written to that correspond to valid vertex indices.
Definition at line 4593 of file reference_cell.h.
| types::geometric_orientation ReferenceCell< dim >::get_combined_orientation | ( | const ArrayView< const T > & | vertices_0, |
| const ArrayView< const T > & | vertices_1 | ||
| ) | const |
Determine the relative orientation of the current entity described by its vertices vertices_1 relative to an entity described by vertices_0. Relative orientations are special cases of permutations since every vertex has to appear in the list of vertices of a reoriented cell as well; however, not every permutation can denote the same cell: For example, a square's vertices can be rotated by 90, 180, or 270 degrees, and the cell can be inverted (in essence looking at it from the other side), but one can't just exchange the order of two adjacent vertices because then the resulting cell is no longer a square but an object with two edges that cross each other.
The two arrays given as arguments can be arrays of global vertex indices or local vertex indices, arrays of vertex locations, or arrays of any other objects identifying the vertices and the order in which they are encountered in a cell.
The size of the input arrays must be equal to the number of vertices of the current entity.
Definition at line 4617 of file reference_cell.h.
| boost::container::small_vector< T, 8 > ReferenceCell< dim >::permute_by_combined_orientation | ( | const ArrayView< const T > & | vertices, |
| const types::geometric_orientation | orientation | ||
| ) | const |
This is the inverse function to get_combined_orientation(): Given a set of vertex-associated objects (such as vertex indices, locations, etc.) and a desired orientation permutation, return the permuted vertex information.
The size of the input array must be equal to the number of vertices of the current entity. The output is an array or permuted quantities of the same size. It is a vector that can store up to and including as many elements as cells can have vertices (namely eight, as in the case of hexahedra in 3d).
Definition at line 4683 of file reference_cell.h.
|
inline |
Return the inverse orientation. This is the value such that calling permute_by_combined_orientation() with o and then calling it again with get_inverse_combined_orientation(o) is the identity operation.
Definition at line 4726 of file reference_cell.h.
|
inline |
Return a vector of faces a given vertex_index belongs to.
Definition at line 1501 of file reference_cell.h.
| const ndarray< unsigned int, 13, 4 > & ReferenceCell< dim >::new_isotropic_child_face_lines | ( | const unsigned int | refinement_choice | ) | const |
Return a two-dimensional array new_quad_lines, where new_quad_lines[q] lists the lines building up the q'th quad required for isotropic refinement. For technical reasons, new_quad_lines[q] is of size (12, 4), but only the first (n_faces(), n_lines()) entries are used, with the rest being set to numbers::invalid_unsigned_int.
The chosen isotropic refinement (see ReferenceCell<dim>::get_isotropic_refinement_choice) is provided by refinement_choice .
Definition at line 1576 of file reference_cell.h.
| const ndarray< unsigned int, 13, 4, 2 > & ReferenceCell< dim >::new_isotropic_child_face_line_vertices | ( | const unsigned int | refinement_choice | ) | const |
Return a three-dimensional array quad_lines_vertices, where quad_lines_vertices[q][l] lists the pairs of vertices defining the l'th line of the q'th quad. It is used during isotropic refinement to determine the orientation of the l'th line in the q'th quad. For technical reasons, quad_lines_vertices is of the given size but only some entries are used (see occurrences within execute_refinement_isotropic() in tria.cc for more details).
The chosen isotropic refinement (see ReferenceCell<dim>::get_isotropic_refinement_choice) is provided by refinement_choice .
Definition at line 1724 of file reference_cell.h.
| const ndarray< unsigned int, 10, 6 > & ReferenceCell< dim >::new_isotropic_child_cell_faces | ( | const unsigned int | refinement_choice | ) | const |
Return a two-dimensional array cell_quads, where cell_quads[c] lists the quads of the c'th new child required for isotropic refinement. For technical reasons, cell_quads[c] is of size 6, but only the first n_faces() entries are used, with the rest being set to numbers::invalid_unsigned_int.
The chosen isotropic refinement (see ReferenceCell<dim>::get_isotropic_refinement_choice) is provided by refinement_choice .
Definition at line 1882 of file reference_cell.h.
| const ndarray< unsigned int, 10, 8 > & ReferenceCell< dim >::new_isotropic_child_cell_vertices | ( | const unsigned int | refinement_choice | ) | const |
Return a two-dimensional array cell_vertices, where cell_vertices[c] lists the vertices of the c'th new child required for isotropic refinement. For technical reasons, cell_vertices[c] is of size 8, but only the first n_vertices() entries are used, with the rest being set to numbers::invalid_unsigned_int.
The chosen isotropic refinement (see ReferenceCell<dim>::get_isotropic_refinement_choice) is provided by refinement_choice .
Definition at line 2025 of file reference_cell.h.
| unsigned int ReferenceCell< dim >::exodusii_vertex_to_deal_vertex | ( | const unsigned int | vertex_n | ) | const |
Map an ExodusII vertex number to a deal.II vertex number.
Definition at line 612 of file reference_cell.cc.
| unsigned int ReferenceCell< dim >::exodusii_face_to_deal_face | ( | const unsigned int | face_n | ) | const |
Map an ExodusII face number to a deal.II face number.
Definition at line 671 of file reference_cell.cc.
| unsigned int ReferenceCell< dim >::ucd_vertex_to_deal_vertex | ( | const unsigned int | vertex_n | ) | const |
Map a UCD vertex number to a deal.II vertex number.
Definition at line 732 of file reference_cell.cc.
| unsigned int ReferenceCell< dim >::unv_vertex_to_deal_vertex | ( | const unsigned int | vertex_n | ) | const |
Map a UNV vertex number to a deal.II vertex number.
Definition at line 792 of file reference_cell.cc.
| unsigned int ReferenceCell< dim >::vtk_linear_type | ( | ) | const |
Return a VTK linear shape constant that corresponds to the reference cell.
Definition at line 833 of file reference_cell.cc.
| unsigned int ReferenceCell< dim >::vtk_quadratic_type | ( | ) | const |
Return a VTK quadratic shape constant that corresponds to the reference cell.
Definition at line 872 of file reference_cell.cc.
| unsigned int ReferenceCell< dim >::vtk_lagrange_type | ( | ) | const |
Return a VTK Lagrange shape constant that corresponds to the reference cell.
Definition at line 911 of file reference_cell.cc.
| unsigned int ReferenceCell< dim >::vtk_lexicographic_to_node_index | ( | const std::array< unsigned, dim > & | node_indices, |
| const std::array< unsigned, dim > & | nodes_per_direction, | ||
| const bool | legacy_format | ||
| ) | const |
Given a set of node indices of the form \((i)\) or \((i,j)\) or \((i,j,k)\) (depending on whether the reference cell is in 1d, 2d, or 3d), return the index the VTK format uses for this node for cells that are subdivided as many times in each of the coordinate directions as described by the second argument. For a uniformly subdivided cell, the second argument is an array whose elements will all be equal.
The last argument, legacy_format, indicates whether to use the old, VTK legacy format (when true) or the new, VTU format (when false).
Modified from https://github.com/Kitware/VTK/blob/265ca48a79a36538c95622c237da11133608bbe5/Common/DataModel/vtkLagrangeCurve.cxx#L478
Modified from https://github.com/Kitware/VTK/blob/265ca48a/Common/DataModel/vtkLagrangeQuadrilateral.cxx#L558
Modified from https://github.com/Kitware/VTK/blob/265ca48a/Common/DataModel/vtkLagrangeHexahedron.cxx#L734 (legacy_format=true) and from https://github.com/Kitware/VTK/blob/256fe70de00e3441f126276ca4a8c5477d0bcb86/Common/DataModel/vtkHigherOrderHexahedron.cxx#L593 (legacy_format=false). The two versions differ regarding the ordering of lines 10 and 11 (clockwise vs. anti-clockwise). See also: https://github.com/Kitware/VTK/blob/7a0b92864c96680b1f42ee84920df556fc6ebaa3/Documentation/release/dev/node-numbering-change-for-VTK_LAGRANGE_HEXAHEDRON.md
Definition at line 950 of file reference_cell.cc.
| unsigned int ReferenceCell< dim >::vtk_vertex_to_deal_vertex | ( | const unsigned int | vertex_index | ) | const |
Map a VTK vertex number to a deal.II vertex number.
Definition at line 1145 of file reference_cell.cc.
| unsigned int ReferenceCell< dim >::gmsh_element_type | ( | ) | const |
Return the GMSH element type code that corresponds to the reference cell.
Definition at line 1205 of file reference_cell.cc.
| std::string ReferenceCell< dim >::to_string | ( | ) | const |
Return a text representation of the reference cell represented by the current object.
Definition at line 82 of file reference_cell.cc.
|
inlineconstexpr |
Conversion operator to an integer.
Definition at line 1269 of file reference_cell.h.
|
inlineconstexpr |
Operator for equality comparison.
Definition at line 1278 of file reference_cell.h.
|
inlineconstexpr |
Operator for equality comparison against an object with a dimension other than dim (which the compiler would do with the overload of the operator above). Since the dimensions do not match, the comparison is necessarily false.
Definition at line 1288 of file reference_cell.h.
|
inlineconstexpr |
Operator for inequality comparison.
Definition at line 1297 of file reference_cell.h.
|
inlineconstexpr |
Operator for inequality comparison against an object with a dimension other than dim (which the compiler would do with the overload of the operator above). Since the dimensions do not match, the two objects cannot be the same and this overload consequently always returns true.
Definition at line 1307 of file reference_cell.h.
|
inline |
Write and read the data of this object from a stream for the purpose of serialization using the BOOST serialization library.
Definition at line 1483 of file reference_cell.h.
|
inlinestaticconstexpr |
Return the number of bytes used by an instance of this class.
Definition at line 1492 of file reference_cell.h.
|
friend |
A kind of constructor – not quite private because it can be called by anyone, but at least hidden in an internal namespace.
|
friend |
|
friend |
|
private |
The variable that stores what this object actually corresponds to.
Definition at line 1139 of file reference_cell.h.
|
staticconstexprprivate |
Table containing all 'vertex' permutations for a vertex. Defined analogously to line_vertex_permutations et al to make things work the same way in 1d.
Definition at line 1154 of file reference_cell.h.
|
staticconstexprprivate |
Table containing all vertex permutations for a line.
Definition at line 1160 of file reference_cell.h.
|
staticconstexprprivate |
Table containing all vertex permutations for all rotations of a triangle.
Definition at line 1167 of file reference_cell.h.
|
staticconstexprprivate |
Table containing all vertex permutations for all rotations of a quadrilateral.
Definition at line 1180 of file reference_cell.h.
|
staticconstexprprivate |
Table containing all line permutations for all rotations of a triangle.
Definition at line 1194 of file reference_cell.h.
|
staticconstexprprivate |
Table containing all line permutations for all rotations of a quadrilateral.
Definition at line 1206 of file reference_cell.h.