t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
Public Member Functions
t8_lagrange_element Class Reference

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_tface_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_elementdecompose () const
 Decompose the element into its faces. More...
 
std::array< double, T8_ECLASS_MAX_DIMevaluate (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_DIMmap_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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ t8_lagrange_element()

t8_lagrange_element::t8_lagrange_element ( t8_eclass_t  eclass,
uint32_t  degree,
std::vector< double > &  nodes 
)

Construct a new t8_lagrange_element object.

Parameters
eclassElement class (line, quad, etc.)
degreePolynomial degree (1, 2, ...)
nodesx,y,z coordinates of the nodes, adhering to the numbering convention.

◆ ~t8_lagrange_element()

t8_lagrange_element::~t8_lagrange_element ( )
inline

Destroy the t8_lagrange_element object.

The cmesh wrapped by this class is also destroyed.

Member Function Documentation

◆ decompose()

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.

Returns
Lagrange elements from the faces.

◆ evaluate()

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.

Parameters
pointParametric 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.
Returns
Coordinates in the physical space.

◆ face_classes()

std::vector< t8_eclass_t > t8_lagrange_element::face_classes ( ) const

Element classes of the faces of this element.

Returns
Element classes of the faces, enumerated according to the face ordering conventions of t8code.

◆ get_face_nodes()

std::vector< std::vector< uint32_t > > t8_lagrange_element::get_face_nodes ( ) const

Node labels on the faces of the element.

Returns
Node labels on each face of the element.

◆ get_node_coords() [1/2]

std::vector< std::vector< double > > t8_lagrange_element::get_node_coords ( std::vector< uint32_t > &  nodes) const

Coordinates of the specified nodes.

Parameters
nodesNode labels. Node numbering starts at 0.
Returns
x,y,z coordinates of the nodes.

◆ get_node_coords() [2/2]

std::vector< double > t8_lagrange_element::get_node_coords ( uint32_t  node) const

Coordinates of the specified node.

Parameters
nodeNode label. Node numbering starts at 0.
Returns
x,y,z coordinates of the node.

◆ get_type()

t8_eclass_t t8_lagrange_element::get_type ( ) const

Get the type of the element.

Returns
Element class of the element.

◆ map_on_face()

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
Parameters
eclassElement class of the element onto which we map. d-dimensional elements can only be mapped to the faces of d+1-dimensional elements.
face_idFace 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.
coordx,y,z coordinates of the point in this element.
Returns
x,y,z coordinates of the mapped point.

◆ sample()

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.

Parameters
n_pointNumber of points to generate.
Returns
Coordinates of the points, given in x,y,z.

◆ write()

void t8_lagrange_element::write ( ) const

Save the geometry into a VTK file.

Remarks
Note that the geometry is exported as a linear cell for now, so the exported result is accurate for degree 1 only.

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