Reference documentation for deal.II version 9.3.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members

#include <deal.II/grid/reference_cell.h>

Public Member Functions

constexpr ReferenceCell ()
 
Querying information about the kind of reference cells
bool is_hyper_cube () const
 
bool is_simplex () const
 
unsigned int get_dimension () const
 
Shape functions, mappings, quadratures defined on a reference cell
template<int dim>
double d_linear_shape_function (const Point< dim > &xi, const unsigned int i) const
 
template<int dim>
Tensor< 1, dim > d_linear_shape_function_gradient (const Point< dim > &xi, const unsigned int i) const
 
template<int dim, int spacedim = dim>
std::unique_ptr< Mapping< dim, spacedim > > get_default_mapping (const unsigned int degree) const
 
template<int dim, int spacedim = dim>
const Mapping< dim, spacedim > & get_default_linear_mapping () const
 
template<int dim>
Quadrature< dim > get_gauss_type_quadrature (const unsigned n_points_1D) const
 
template<int dim>
const Quadrature< dim > & get_nodal_type_quadrature () const
 
Querying the number of building blocks of a reference cell
unsigned int n_vertices () const
 
std_cxx20::ranges::iota_view< unsigned int, unsigned intvertex_indices () const
 
unsigned int n_lines () const
 
std_cxx20::ranges::iota_view< unsigned int, unsigned intline_indices () const
 
unsigned int n_faces () const
 
std_cxx20::ranges::iota_view< unsigned int, unsigned intface_indices () const
 
ReferenceCell face_reference_cell (const unsigned int face_no) const
 
template<int dim>
Tensor< 1, dim > unit_tangential_vectors (const unsigned int face_no, const unsigned int i) const
 
template<int dim>
Tensor< 1, dim > unit_normal_vectors (const unsigned int face_no) const
 
template<typename T , std::size_t N>
unsigned char compute_orientation (const std::array< T, N > &vertices_0, const std::array< T, N > &vertices_1) const
 
template<typename T , std::size_t N>
std::array< T, N > permute_according_orientation (const std::array< T, N > &vertices, const unsigned int orientation) const
 
ArrayView< const unsigned intfaces_for_given_vertex (const unsigned int vertex_index) const
 
Relationships between objects in the cell and on faces
unsigned int child_cell_on_face (const unsigned int face_n, const unsigned int subface_n, const unsigned char face_orientation=1) 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 face_to_cell_lines (const unsigned int face, const unsigned int line, const unsigned char face_orientation) const
 
unsigned int face_to_cell_vertices (const unsigned int face, const unsigned int vertex, const unsigned char face_orientation) const
 
unsigned int standard_to_real_face_vertex (const unsigned int vertex, const unsigned int face, const unsigned char face_orientation) const
 
unsigned int standard_to_real_face_line (const unsigned int line, const unsigned int face, const unsigned char face_orientation) const
 
bool standard_vs_true_line_orientation (const unsigned int line, const unsigned char face_orientation, const unsigned char line_orientation) const
 
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 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
 
Other functions
std::string to_string () const
 
constexpr operator std::uint8_t () const
 
constexpr bool operator== (const ReferenceCell &type) const
 
constexpr bool operator!= (const ReferenceCell &type) const
 
template<class Archive >
void serialize (Archive &archive, const unsigned int)
 

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
 

Friends

constexpr ReferenceCell internal::ReferenceCell::make_reference_cell_from_int (const std::uint8_t)
 

Detailed Description

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.

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 87 of file reference_cell.h.

Constructor & Destructor Documentation

◆ ReferenceCell() [1/2]

constexpr ReferenceCell::ReferenceCell ( )
inline

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 678 of file reference_cell.h.

◆ ReferenceCell() [2/2]

constexpr ReferenceCell::ReferenceCell ( const std::uint8_t  kind)
inlineprivate

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 577 of file reference_cell.h.

Member Function Documentation

◆ n_vertices_to_type()

ReferenceCell ReferenceCell::n_vertices_to_type ( const int  dim,
const unsigned int  n_vertices 
)
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 1526 of file reference_cell.h.

◆ is_hyper_cube()

bool ReferenceCell::is_hyper_cube ( ) const
inline

◆ is_simplex()

bool ReferenceCell::is_simplex ( ) const
inline

Return true if the object is a Vertex, Line, Triangle, or Tetrahedron.

Definition at line 770 of file reference_cell.h.

◆ get_dimension()

unsigned int ReferenceCell::get_dimension ( ) const
inline

Return the dimension of the reference cell represented by the current object.

Definition at line 780 of file reference_cell.h.

◆ d_linear_shape_function()

template<int dim>
double ReferenceCell::d_linear_shape_function ( const Point< dim > &  xi,
const unsigned int  i 
) const
inline

Compute the value of the \(i\)-th linear shape function at location \(\xi\) for the current reference-cell type.

Definition at line 1568 of file reference_cell.h.

◆ d_linear_shape_function_gradient()

template<int dim>
Tensor< 1, dim > ReferenceCell::d_linear_shape_function_gradient ( const Point< dim > &  xi,
const unsigned int  i 
) const
inline

Compute the gradient of the \(i\)-th linear shape function at location \(\xi\) for the current reference-cell type.

Definition at line 1662 of file reference_cell.h.

◆ get_default_mapping()

template<int dim, int spacedim>
std::unique_ptr< Mapping< dim, spacedim > > ReferenceCell::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 MappingQGeneric; 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 110 of file reference_cell.cc.

◆ get_default_linear_mapping()

template<int dim, int spacedim>
const Mapping< dim, spacedim > & ReferenceCell::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 137 of file reference_cell.cc.

◆ get_gauss_type_quadrature()

template<int dim>
Quadrature< dim > ReferenceCell::get_gauss_type_quadrature ( const unsigned  n_points_1D) const

Return a Gauss-type quadrature matching the given reference cell (QGauss, QGaussSimplex, QGaussPyramid, QGaussWedge).

Parameters
[in]n_points_1DThe 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 175 of file reference_cell.cc.

◆ get_nodal_type_quadrature()

template<int dim>
const Quadrature< dim > & ReferenceCell::get_nodal_type_quadrature ( ) const

Return a quadrature rule with the support points of the given reference cell.

Note
The weights of the quadrature object are left unfilled.

Definition at line 197 of file reference_cell.cc.

◆ n_vertices()

unsigned int ReferenceCell::n_vertices ( ) const
inline

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 802 of file reference_cell.h.

◆ vertex_indices()

std_cxx20::ranges::iota_view< unsigned int, unsigned int > ReferenceCell::vertex_indices ( ) const
inline

Return an object that can be thought of as an array containing all indices from zero to n_vertices().

Definition at line 880 of file reference_cell.h.

◆ n_lines()

unsigned int ReferenceCell::n_lines ( ) const
inline

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 828 of file reference_cell.h.

◆ line_indices()

std_cxx20::ranges::iota_view< unsigned int, unsigned int > ReferenceCell::line_indices ( ) const
inline

Return an object that can be thought of as an array containing all indices from zero to n_lines().

Definition at line 888 of file reference_cell.h.

◆ n_faces()

unsigned int ReferenceCell::n_faces ( ) const
inline

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 854 of file reference_cell.h.

◆ face_indices()

std_cxx20::ranges::iota_view< unsigned int, unsigned int > ReferenceCell::face_indices ( ) const
inline

Return an object that can be thought of as an array containing all indices from zero to n_faces().

Definition at line 896 of file reference_cell.h.

◆ face_reference_cell()

ReferenceCell ReferenceCell::face_reference_cell ( const unsigned int  face_no) const
inline

Return the reference-cell type of face face_no of the current object. For example, if the current object is ReferenceCells::Tetrahedron, then face_no must be between in the interval \([0,4)\) and the function will always return ReferenceCells::Triangle. If the current object is ReferenceCells::Hexahedron, then face_no must be between 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 904 of file reference_cell.h.

◆ child_cell_on_face()

unsigned int ReferenceCell::child_cell_on_face ( const unsigned int  face_n,
const unsigned int  subface_n,
const unsigned char  face_orientation = 1 
) const
inline

Return which child cells are adjacent to a certain face of the mother 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 face orientations is explained in this glossary entry.

Definition at line 942 of file reference_cell.h.

◆ standard_vertex_to_face_and_vertex_index()

std::array< unsigned int, 2 > ReferenceCell::standard_vertex_to_face_and_vertex_index ( const unsigned int  vertex) const
inline

For a given vertex in a cell, return a pair of a face index and a vertex index within this face.

Note
In practice, a vertex is of course generally part of more than one face, and one could return different faces and the corresponding index within. Which face this function chooses is often not of importance (and not exposed by this function on purpose).

Definition at line 1012 of file reference_cell.h.

◆ standard_line_to_face_and_line_index()

std::array< unsigned int, 2 > ReferenceCell::standard_line_to_face_and_line_index ( const unsigned int  line) const
inline

For a given line in a cell, return a pair of a face index and a line index within this face.

Note
In practice, a line is of course generally part of more than one face, and one could return different faces and the corresponding index within. Which face this function chooses is often not of importance (and not exposed by this function on purpose).

Definition at line 1069 of file reference_cell.h.

◆ face_to_cell_lines()

unsigned int ReferenceCell::face_to_cell_lines ( const unsigned int  face,
const unsigned int  line,
const unsigned char  face_orientation 
) const
inline

Map face line number to cell line number.

Definition at line 1136 of file reference_cell.h.

◆ face_to_cell_vertices()

unsigned int ReferenceCell::face_to_cell_vertices ( const unsigned int  face,
const unsigned int  vertex,
const unsigned char  face_orientation 
) const
inline

Map face vertex number to cell vertex number.

Definition at line 1202 of file reference_cell.h.

◆ standard_to_real_face_vertex()

unsigned int ReferenceCell::standard_to_real_face_vertex ( const unsigned int  vertex,
const unsigned int  face,
const unsigned char  face_orientation 
) const
inline

Correct vertex index depending on face orientation.

Definition at line 1287 of file reference_cell.h.

◆ standard_to_real_face_line()

unsigned int ReferenceCell::standard_to_real_face_line ( const unsigned int  line,
const unsigned int  face,
const unsigned char  face_orientation 
) const
inline

Correct line index depending on face orientation.

Definition at line 1385 of file reference_cell.h.

◆ standard_vs_true_line_orientation()

bool ReferenceCell::standard_vs_true_line_orientation ( const unsigned int  line,
const unsigned char  face_orientation,
const unsigned char  line_orientation 
) const
inline

Return whether the line with index line is oriented in standard direction within a cell, given the face_orientation of the face within the current cell, and line_orientation flag for the line within that face. true indicates that the line is oriented from vertex 0 to vertex 1, whereas it is the other way around otherwise. In 1d and 2d, this is always true, but in 3d it may be different, see the respective discussion in the documentation of the GeometryInfo class.

Definition at line 1798 of file reference_cell.h.

◆ unit_tangential_vectors()

template<int dim>
Tensor< 1, dim > ReferenceCell::unit_tangential_vectors ( const unsigned int  face_no,
const unsigned int  i 
) const
inline

Definition at line 1692 of file reference_cell.h.

◆ unit_normal_vectors()

template<int dim>
Tensor< 1, dim > ReferenceCell::unit_normal_vectors ( const unsigned int  face_no) const
inline

Return the unit normal vector of a face of the reference cell.

Definition at line 1768 of file reference_cell.h.

◆ compute_orientation()

template<typename T , std::size_t N>
unsigned char ReferenceCell::compute_orientation ( const std::array< T, N > &  vertices_0,
const std::array< T, N > &  vertices_1 
) const
inline

Determine the orientation of the current entity described by its vertices var_1 relative to an entity described by var_0.

Definition at line 1906 of file reference_cell.h.

◆ permute_according_orientation()

template<typename T , std::size_t N>
std::array< T, N > ReferenceCell::permute_according_orientation ( const std::array< T, N > &  vertices,
const unsigned int  orientation 
) const
inline

Inverse function of compute_orientation().

Definition at line 2001 of file reference_cell.h.

◆ faces_for_given_vertex()

ArrayView< const unsigned int > ReferenceCell::faces_for_given_vertex ( const unsigned int  vertex_index) const
inline

Return a vector of faces a given vertex_index belongs to.

Definition at line 694 of file reference_cell.h.

◆ exodusii_vertex_to_deal_vertex()

unsigned int ReferenceCell::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 241 of file reference_cell.cc.

◆ exodusii_face_to_deal_face()

unsigned int ReferenceCell::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 287 of file reference_cell.cc.

◆ unv_vertex_to_deal_vertex()

unsigned int ReferenceCell::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 337 of file reference_cell.cc.

◆ vtk_linear_type()

unsigned int ReferenceCell::vtk_linear_type ( ) const

Return a VTK linear shape constant that corresponds to the reference cell.

Definition at line 373 of file reference_cell.cc.

◆ vtk_quadratic_type()

unsigned int ReferenceCell::vtk_quadratic_type ( ) const

Return a VTK quadratic shape constant that corresponds to the reference cell.

Definition at line 402 of file reference_cell.cc.

◆ vtk_lagrange_type()

unsigned int ReferenceCell::vtk_lagrange_type ( ) const

Return a VTK Lagrange shape constant that corresponds to the reference cell.

Definition at line 431 of file reference_cell.cc.

◆ to_string()

std::string ReferenceCell::to_string ( ) const

Return a text representation of the reference cell represented by the current object.

Definition at line 80 of file reference_cell.cc.

◆ operator std::uint8_t()

constexpr ReferenceCell::operator std::uint8_t ( ) const
inline

Conversion operator to an integer.

Definition at line 583 of file reference_cell.h.

◆ operator==()

constexpr bool ReferenceCell::operator== ( const ReferenceCell type) const
inline

Operator for equality comparison.

Definition at line 591 of file reference_cell.h.

◆ operator!=()

constexpr bool ReferenceCell::operator!= ( const ReferenceCell type) const
inline

Operator for inequality comparison.

Definition at line 599 of file reference_cell.h.

◆ serialize()

template<class Archive >
void ReferenceCell::serialize ( Archive &  archive,
const unsigned  int 
)
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 686 of file reference_cell.h.

Friends And Related Function Documentation

◆ internal::ReferenceCell::make_reference_cell_from_int

constexpr ReferenceCell internal::ReferenceCell::make_reference_cell_from_int ( const std::uint8_t  )
friend

A kind of constructor – not quite private because it can be called by anyone, but at least hidden in an internal namespace.

Member Data Documentation

◆ kind

std::uint8_t ReferenceCell::kind
private

The variable that stores what this object actually corresponds to.

Definition at line 557 of file reference_cell.h.


The documentation for this class was generated from the following files: