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_geometry_lagrange Struct Reference

Mapping with Lagrange basis functions. More...

#include <t8_geometry_lagrange.hxx>

Inheritance diagram for t8_geometry_lagrange:
t8_geometry_with_vertices t8_geometry

Public Member Functions

 t8_geometry_lagrange (int dim)
 Constructor of the Lagrange geometry with a given dimension. More...
 
t8_geometry_type_t t8_geom_get_type () const
 Get the type of this geometry. More...
 
void t8_geom_evaluate (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_points, double *out_coords) const
 Maps points from the reference space to the physical space \( \mathbb{R}^3 \). More...
 
virtual void t8_geom_evaluate_jacobian (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_points, double *jacobian) const
 Compute the Jacobian of the t8_geom_evaluate map at a point in the reference space. More...
 
virtual void t8_geom_load_tree_data (t8_cmesh_t cmesh, t8_gloidx_t gtreeid)
 Update a possible internal data buffer for per tree data. More...
 
- Public Member Functions inherited from t8_geometry_with_vertices
 t8_geometry_with_vertices (int dimension, std::string name)
 
virtual ~t8_geometry_with_vertices ()
 The destructor. More...
 
virtual bool t8_geom_tree_negative_volume () const
 Check if the currently active tree has a negative volume. More...
 
t8_geometry_type_t t8_geom_get_type () const
 Get the type of this geometry. More...
 
- Public Member Functions inherited from t8_geometry
 t8_geometry (int dim, std::string name)
 
virtual ~t8_geometry ()
 The destructor. More...
 
virtual void t8_geom_point_batch_inside_element (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, const double *points, const int num_points, int *is_inside, const double tolerance) const
 Query whether a batch of points lies inside an element. More...
 
int t8_geom_get_dimension () const
 Get the dimension of this geometry. More...
 
const std::string t8_geom_get_name () const
 Get the name of this geometry. More...
 
const size_t t8_geom_get_hash () const
 

Additional Inherited Members

- Protected Attributes inherited from t8_geometry_with_vertices
t8_gloidx_t active_tree
 
t8_eclass_t active_tree_class
 
const double * active_tree_vertices
 
- Protected Attributes inherited from t8_geometry
int dimension
 The dimension of reference space for which this is a geometry.
 
std::string name
 The name of this geometry.
 
size_t hash
 The hash of the name of this geometry.
 

Detailed Description

Mapping with Lagrange basis functions.

The enumeration of the nodal basis functions depends on the node numbering scheme. While this is a convention, we came up with the following rules to guide us when constructing new mappings:

  1. Be compatible with lower degree elements. It means that when we read the first n nodes, it gives a valid lower-degree element. This rule is made attainable by the fact that the nodes spanning the Lagrange basis are equidistant. As an example, consider a degree four segment element whose five nodes in increasing coordinate direction are numbered as 0-3-2-4-1. Reading the first two nodes gives us a valid linear segment, while reading two first three nodes provides a valid quadratic segment. In general, we need to find for an element of degree d which nodes coincide with the nodes of elements with degree lower than d. Those nodes must be numbered first.
  2. Faces are oriented outwards the volume (3D) or the plane (2D). This is just a convention to ensure that the node numbering be consistent.
  3. The mapping by the Lagrange geometry falls back to the linear geometry for degree one. It means that the starting point for the node number assignment is the numbering defined in the t8_element.c file.
  4. The node numbering is performed in increasing spatial dimension, which results in a hierarchical construction of elements. The node numbers are assigned based on increasing face IDs, then increasing edge IDs, then increasing vertex IDs. For volume elements, the volume nodes are assigned lastly. This hierarchical construction satisfies rule 1 at the mesh level.

You can verify these rules by checking the documentation of the t8_geom_xxx_basis methods of this class (e.g. t8_geometry_lagrange::t8_geom_t6_basis).

Constructor & Destructor Documentation

◆ t8_geometry_lagrange()

t8_geometry_lagrange::t8_geometry_lagrange ( int  dim)

Constructor of the Lagrange geometry with a given dimension.

The geometry is compatible with all tree types and uses as many vertices as the number of Lagrange basis functions used for the mapping. The vertices are saved via the t8_cmesh_set_tree_vertices function.

Parameters
[in]dim0 <= dim <= 3. Element dimension in the parametric space. E.g. dim = 2 for a T8_ECLASS_QUAD element.

Member Function Documentation

◆ t8_geom_evaluate()

void t8_geometry_lagrange::t8_geom_evaluate ( t8_cmesh_t  cmesh,
t8_gloidx_t  gtreeid,
const double *  ref_coords,
const size_t  num_points,
double *  out_coords 
) const
virtual

Maps points from the reference space to the physical space \( \mathbb{R}^3 \).

For linear elements, it gives the same result as t8_geom_compute_linear_geometry.

The mapping is performed via Lagrange interpolation according to

\( \mathbf{x}(\vec{\xi}) = \sum\limits_{i=1}^{N_{\mathrm{vertex}}} \psi_i(\vec{\xi}) \mathbf{x}_i \)

where \( \vec{\xi} \) is the point in the reference space to be mapped, \( \mathbf{x} \) is the mapped point we search, \( \psi_i(\vec{\xi}) \) are the basis functions associated with the vertices, and \( \mathbf{x}_i \) are the vertices of the current tree in the physical space. The basis functions are specific to the tree type, see e.g. t8_geom_t6_basis. The vertices of the current tree were set with t8_cmesh_set_tree_vertices.

Parameters
[in]cmeshThe cmesh in which the point lies.
[in]gtreeidThe global tree (of the cmesh) in which the reference point is.
[in]ref_coordsArray of dimension x num_points entries, specifying points in the reference space.
[in]num_pointsNumber of points to map. Currently, only one point is supported.
[out]out_coordsCoordinates of the mapped points in physical space of ref_coords. The length is num_points * 3.

Implements t8_geometry.

◆ t8_geom_evaluate_jacobian()

void t8_geometry_lagrange::t8_geom_evaluate_jacobian ( t8_cmesh_t  cmesh,
t8_gloidx_t  gtreeid,
const double *  ref_coords,
const size_t  num_points,
double *  jacobian 
) const
virtual

Compute the Jacobian of the t8_geom_evaluate map at a point in the reference space.

Parameters
[in]cmeshThe cmesh in which the point lies.
[in]gtreeidThe global tree (of the cmesh) in which the reference point is.
[in]ref_coordsArray of dimension x num_points entries, specifying points in the reference space.
[in]num_pointsNumber of points to map.
[out]jacobianThe Jacobian at ref_coords. Array of size num_points x dimension x 3. Indices \( 3 \cdot i\) , \( 3 \cdot i+1 \) , \( 3 \cdot i+2 \) correspond to the \( i \)-th column of the Jacobian (Entry \( 3 \cdot i + j \) is \( \frac{\partial f_j}{\partial x_i} \)).

Implements t8_geometry.

◆ t8_geom_get_type()

t8_geometry_type_t t8_geometry_lagrange::t8_geom_get_type ( ) const
inlinevirtual

Get the type of this geometry.

Returns
The type.

Implements t8_geometry.

◆ t8_geom_load_tree_data()

void t8_geometry_lagrange::t8_geom_load_tree_data ( t8_cmesh_t  cmesh,
t8_gloidx_t  gtreeid 
)
inlinevirtual

Update a possible internal data buffer for per tree data.

This function is called before the first coordinates in a new tree are evaluated. You can use it for example to load the polynomial degree of the Lagrange basis into an internal buffer (as is done in the Lagrange geometry).

Parameters
[in]cmeshThe cmesh.
[in]gtreeidThe global tree.

Reimplemented from t8_geometry_with_vertices.


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