t8
UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
|
A single coarse mesh cell with Lagrange geometry. More...
#include <t8_geometry_lagrange.hxx>
Public Member Functions | |
t8_lagrange_element (t8_eclass_t eclass, uint32_t degree, std::vector< double > &nodes) | |
Construct a new t8_lagrange_element object. More... | |
~t8_lagrange_element () | |
Destroy the t8_lagrange_element object. More... | |
t8_eclass_t | get_type () const |
Get the type of the element. More... | |
std::vector< t8_eclass_t > | face_classes () const |
Element classes of the faces of this element. More... | |
std::vector< double > | get_node_coords (uint32_t node) const |
Coordinates of the specified node. More... | |
std::vector< std::vector< double > > | get_node_coords (std::vector< uint32_t > &nodes) const |
Coordinates of the specified nodes. More... | |
std::vector< std::vector< uint32_t > > | get_face_nodes () const |
Node labels on the faces of the element. More... | |
std::vector< t8_lagrange_element > | decompose () const |
Decompose the element into its faces. More... | |
std::array< double, T8_ECLASS_MAX_DIM > | evaluate (const std::array< double, T8_ECLASS_MAX_DIM > &ref_point) const |
Physical coordinates of a point given in the reference domain. More... | |
std::vector< std::array< double, T8_ECLASS_MAX_DIM > > | sample (uint32_t n_point) const |
Sample random points in the reference domain. More... | |
std::array< double, T8_ECLASS_MAX_DIM > | map_on_face (t8_eclass eclass, const int face_id, const std::array< double, T8_ECLASS_MAX_DIM > &coord) const |
Map this element on the face of a higher-dimensional element. More... | |
void | write () const |
Save the geometry into a VTK file. More... | |
A single coarse mesh cell with Lagrange geometry.
This class is essentially a wrapper around a cmesh. By having a single element instead of a mesh, understanding and testing is made easier. Several topological utilities are provided, some specific to the Lagrange geometry, some valid for all the geometries in t8code.
t8_lagrange_element::t8_lagrange_element | ( | t8_eclass_t | eclass, |
uint32_t | degree, | ||
std::vector< double > & | nodes | ||
) |
Construct a new t8_lagrange_element object.
eclass | Element class (line, quad, etc.) |
degree | Polynomial degree (1, 2, ...) |
nodes | x,y,z coordinates of the nodes, adhering to the numbering convention. |
|
inline |
Destroy the t8_lagrange_element object.
The cmesh wrapped by this class is also destroyed.
std::vector< t8_lagrange_element > t8_lagrange_element::decompose | ( | ) | const |
Decompose the element into its faces.
t8_lagrange_element()-s of codimension 1 are created. The original element is not modified and the decomposition is not recursive. The faces can further be decomposed by calling this method on them.
std::array< double, T8_ECLASS_MAX_DIM > t8_lagrange_element::evaluate | ( | const std::array< double, T8_ECLASS_MAX_DIM > & | ref_point | ) | const |
Physical coordinates of a point given in the reference domain.
point | Parametric coordinates of the point to be mapped. For 2D elements, only the first two coordinates are considered. For the 1D line element, only the first. |
std::vector< t8_eclass_t > t8_lagrange_element::face_classes | ( | ) | const |
Element classes of the faces of this element.
std::vector< std::vector< uint32_t > > t8_lagrange_element::get_face_nodes | ( | ) | const |
Node labels on the faces of the element.
std::vector< std::vector< double > > t8_lagrange_element::get_node_coords | ( | std::vector< uint32_t > & | nodes | ) | const |
Coordinates of the specified nodes.
nodes | Node labels. Node numbering starts at 0. |
std::vector< double > t8_lagrange_element::get_node_coords | ( | uint32_t | node | ) | const |
Coordinates of the specified node.
node | Node label. Node numbering starts at 0. |
t8_eclass_t t8_lagrange_element::get_type | ( | ) | const |
Get the type of the element.
std::array< double, T8_ECLASS_MAX_DIM > t8_lagrange_element::map_on_face | ( | t8_eclass | eclass, |
const int | face_id, | ||
const std::array< double, T8_ECLASS_MAX_DIM > & | coord | ||
) | const |
Map this element on the face of a higher-dimensional element.
Example to map a line element onto the left face of a quad element. Code: mapOnFace (T8_ECLASS_QUAD, 0, std::vector<double> { 0.6 }) o : vertices of the elements + : point to map y ^ x | face 3 o------+--o --> 2 3 0.6 o ----<---- o faces (=edges in 2D) | | with CCW orientation | | face 0 v ^ face 1 + (0, 0.4) | | | x o ---->---- o --> 0 1 face 2
eclass | Element class of the element onto which we map. d-dimensional elements can only be mapped to the faces of d+1-dimensional elements. |
face_id | Face ID of the element onto which we map. Faces in an element are numbered according to the t8code conventions. The selected face must have the same type as the element from which we map. For instance, an element of type T8_ECLASS_QUAD can only be mapped onto face 4 of a T8_ECLASS_PYRAMID, since the other faces of a pyramidal element are triangles. |
coord | x,y,z coordinates of the point in this element. |
std::vector<std::array<double, T8_ECLASS_MAX_DIM> > t8_lagrange_element::sample | ( | uint32_t | n_point | ) | const |
Sample random points in the reference domain.
n_point | Number of points to generate. |
void t8_lagrange_element::write | ( | ) | const |
Save the geometry into a VTK file.