t8  1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
Public Member Functions | Data Fields | Protected Attributes
t8_eclass_scheme Struct Referenceabstract

This struct holds virtual functions for a particular element class. More...

#include <t8_element_cxx.hxx>

Inheritance diagram for t8_eclass_scheme:
t8_default_scheme_common_c t8_default_scheme_hex_c t8_default_scheme_line_c t8_default_scheme_prism_c t8_default_scheme_pyramid_c t8_default_scheme_quad_c t8_default_scheme_tet_c t8_default_scheme_tri_c t8_default_scheme_vertex_c

Public Member Functions

virtual ~ t8_eclass_scheme ()
 The destructor. More...
 
virtual size_t t8_element_size (void) const
 The virtual table for a particular implementation of an element class. More...
 
virtual int t8_element_refines_irregular (void) const =0
 Returns true, if there is one element in the tree, that does not refine into 2^dim children. More...
 
virtual int t8_element_maxlevel (void) const =0
 Return the maximum allowed level for any element of a given class. More...
 
virtual t8_eclass_t t8_element_child_eclass (int childid) const =0
 Return the type of each child in the ordering of the implementation. More...
 
virtual int t8_element_level (const t8_element_t *elem) const =0
 Return the level of a particular element. More...
 
virtual void t8_element_copy (const t8_element_t *source, t8_element_t *dest) const =0
 Copy all entries of source to dest. More...
 
virtual int t8_element_compare (const t8_element_t *elem1, const t8_element_t *elem2) const =0
 Compare two elements. More...
 
virtual void t8_element_parent (const t8_element_t *elem, t8_element_t *parent) const =0
 Compute the parent of a given element elem and store it in parent. More...
 
virtual int t8_element_num_siblings (const t8_element_t *elem) const =0
 Compute the number of siblings of an element. More...
 
virtual void t8_element_sibling (const t8_element_t *elem, int sibid, t8_element_t *sibling) const =0
 Compute a specific sibling of a given element elem and store it in sibling. More...
 
virtual int t8_element_num_corners (const t8_element_t *elem) const =0
 Compute the number of corners of a given element. More...
 
virtual int t8_element_num_faces (const t8_element_t *elem) const =0
 Compute the number of faces of a given element. More...
 
virtual int t8_element_max_num_faces (const t8_element_t *elem) const =0
 Compute the maximum number of faces of a given element and all of its descendants. More...
 
virtual int t8_element_num_children (const t8_element_t *elem) const =0
 Return the number of children of an element when it is refined. More...
 
virtual int t8_element_num_face_children (const t8_element_t *elem, int face) const =0
 Return the number of children of an element's face when the element is refined. More...
 
virtual int t8_element_get_face_corner (const t8_element_t *element, int face, int corner) const =0
 Return the corner number of an element's face corner. More...
 
virtual int t8_element_get_corner_face (const t8_element_t *element, int corner, int face) const =0
 Return the face numbers of the faces sharing an element's corner. More...
 
virtual void t8_element_child (const t8_element_t *elem, int childid, t8_element_t *child) const =0
 Construct the child element of a given number. More...
 
virtual void t8_element_children (const t8_element_t *elem, int length, t8_element_t *c[]) const =0
 Construct all children of a given element. More...
 
virtual int t8_element_child_id (const t8_element_t *elem) const =0
 Compute the child id of an element. More...
 
virtual int t8_element_ancestor_id (const t8_element_t *elem, int level) const =0
 Compute the ancestor id of an element, that is the child id at a given level. More...
 
virtual int t8_element_is_family (t8_element_t **fam) const =0
 Query whether a given set of elements is a family or not. More...
 
virtual void t8_element_nca (const t8_element_t *elem1, const t8_element_t *elem2, t8_element_t *nca) const =0
 Compute the nearest common ancestor of two elements. More...
 
virtual t8_element_shape_t t8_element_face_shape (const t8_element_t *elem, int face) const =0
 Compute the shape of the face of an element. More...
 
virtual void t8_element_children_at_face (const t8_element_t *elem, int face, t8_element_t *children[], int num_children, int *child_indices) const =0
 Given an element and a face of the element, compute all children of the element that touch the face. More...
 
virtual int t8_element_face_child_face (const t8_element_t *elem, int face, int face_child) const =0
 Given a face of an element and a child number of a child of that face, return the face number of the child of the element that matches the child face. More...
 
virtual int t8_element_face_parent_face (const t8_element_t *elem, int face) const =0
 Given a face of an element return the face number of the parent of the element that matches the element's face. More...
 
virtual int t8_element_tree_face (const t8_element_t *elem, int face) const =0
 Given an element and a face of this element. More...
 
virtual void t8_element_transform_face (const t8_element_t *elem1, t8_element_t *elem2, int orientation, int sign, int is_smaller_face) const =0
 Suppose we have two trees that share a common face f. More...
 
virtual int t8_element_extrude_face (const t8_element_t *face, const t8_eclass_scheme_c *face_scheme, t8_element_t *elem, int root_face) const =0
 Given a boundary face inside a root tree's face construct the element inside the root tree that has the given face as a face. More...
 
virtual void t8_element_boundary_face (const t8_element_t *elem, int face, t8_element_t *boundary, const t8_eclass_scheme_c *boundary_scheme) const =0
 Construct the boundary element at a specific face. More...
 
virtual void t8_element_first_descendant_face (const t8_element_t *elem, int face, t8_element_t *first_desc, int level) const =0
 Construct the first descendant of an element at a given level that touches a given face. More...
 
virtual void t8_element_last_descendant_face (const t8_element_t *elem, int face, t8_element_t *last_desc, int level) const =0
 Construct the last descendant of an element at a given level that touches a given face. More...
 
virtual void t8_element_boundary (const t8_element_t *elem, int min_dim, int length, t8_element_t **boundary) const =0
 Construct all codimension-one boundary elements of a given element. More...
 
virtual int t8_element_is_root_boundary (const t8_element_t *elem, int face) const =0
 Compute whether a given element shares a given face with its root tree. More...
 
virtual int t8_element_face_neighbor_inside (const t8_element_t *elem, t8_element_t *neigh, int face, int *neigh_face) const =0
 Construct the face neighbor of a given element if this face neighbor is inside the root tree. More...
 
virtual t8_element_shape_t t8_element_shape (const t8_element_t *elem) const =0
 Return the shape of an allocated element according its type. More...
 
virtual void t8_element_set_linear_id (t8_element_t *elem, int level, t8_linearidx_t id) const =0
 Initialize the entries of an allocated element according to a given linear id in a uniform refinement. More...
 
virtual t8_linearidx_t t8_element_get_linear_id (const t8_element_t *elem, int level) const =0
 Compute the linear id of a given element in a hypothetical uniform refinement of a given level. More...
 
virtual void t8_element_first_descendant (const t8_element_t *elem, t8_element_t *desc, int level) const =0
 Compute the first descendant of a given element. More...
 
virtual void t8_element_last_descendant (const t8_element_t *elem, t8_element_t *desc, int level) const =0
 Compute the last descendant of a given element. More...
 
virtual void t8_element_successor (const t8_element_t *t, t8_element_t *s, int level) const =0
 Construct the successor in a uniform refinement of a given element. More...
 
virtual int t8_element_root_len (const t8_element_t *elem) const =0
 Compute the root length of a given element, that is the length of its level 0 ancestor. More...
 
virtual void t8_element_vertex_reference_coords (const t8_element_t *t, const int vertex, double coords[]) const =0
 Compute the coordinates of a given element vertex inside a reference tree that is embedded into [0,1]^d (d = dimension). More...
 
virtual void t8_element_reference_coords (const t8_element_t *elem, const double *ref_coords, const void *user_data, double *out_coords) const =0
 Convert a point in the reference space of an element to a point in the reference space of the tree. More...
 
virtual t8_element_tt8_element_array_index (sc_array_t *array, size_t it) const
 Return a pointer to a t8_element in an array indexed by a size_t. More...
 
virtual t8_gloidx_t t8_element_count_leafs (const t8_element_t *t, int level) const =0
 Count how many leaf descendants of a given uniform level an element would produce. More...
 
virtual t8_gloidx_t t8_element_count_leafs_from_root (int level) const =0
 Count how many leaf descendants of a given uniform level the root element will produce. More...
 
virtual void t8_element_general_function (const t8_element_t *elem, const void *indata, void *outdata) const =0
 This function has no defined effect but each implementation is free to provide its own meaning of it. More...
 
virtual void t8_element_new (int length, t8_element_t **elem) const =0
 Allocate memory for an array of elements of a given class and initialize them. More...
 
virtual void t8_element_init (int length, t8_element_t *elem, int called_new) const =0
 Initialize an array of allocated elements. More...
 
virtual void t8_element_destroy (int length, t8_element_t **elem) const =0
 Deallocate an array of elements. More...
 

Data Fields

t8_eclass_t eclass
 The element class.
 

Protected Attributes

size_t element_size
 This scheme defines the operations for a particular element class. More...
 
void * ts_context
 Anonymous implementation context.
 

Detailed Description

This struct holds virtual functions for a particular element class.

Constructor & Destructor Documentation

◆ ~ t8_eclass_scheme()

virtual t8_eclass_scheme::~ t8_eclass_scheme ( )
inlinevirtual

The destructor.

It does nothing but has to be defined since we may want to delete an eclass_scheme that is actually inherited (for example t8_default_scheme_quad) and providing an implementation for the destructor ensures that the destructor of the child class will be executed.

Member Function Documentation

◆ t8_element_ancestor_id()

virtual int t8_eclass_scheme::t8_element_ancestor_id ( const t8_element_t elem,
int  level 
) const
pure virtual

Compute the ancestor id of an element, that is the child id at a given level.

Parameters
[in]elemThis must be a valid element.
[in]levelA refinement level. Must satisfy level < elem.level
Returns
The child_id of elem in regard to its level ancestor.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_array_index()

t8_element_t * t8_eclass_scheme::t8_element_array_index ( sc_array_t *  array,
size_t  it 
) const
virtual

Return a pointer to a t8_element in an array indexed by a size_t.

Parameters
[in]arrayThe sc_array storing \t t8_element_t pointers.
[in]itThe index of the element that should be returned.
Returns
A pointer to the it-th element in array. We provide a default implementation of this routine that should suffice for most use cases.

◆ t8_element_boundary()

virtual void t8_eclass_scheme::t8_element_boundary ( const t8_element_t elem,
int  min_dim,
int  length,
t8_element_t **  boundary 
) const
pure virtual

Construct all codimension-one boundary elements of a given element.

Parameters
[in]elemThe input element.
[in]faceA face of elem.
Returns
True if face is a subface of the element's root element.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_boundary_face()

virtual void t8_eclass_scheme::t8_element_boundary_face ( const t8_element_t elem,
int  face,
t8_element_t boundary,
const t8_eclass_scheme_c boundary_scheme 
) const
pure virtual

Construct the boundary element at a specific face.

Parameters
[in]elemThe input element.
[in]faceThe index of the face of which to construct the boundary element.
[in,out]boundaryAn allocated element of dimension of element minus 1. The entries will be filled with the entries of the face of element.
[in]boundary_schemeThe scheme for the eclass of the boundary face. If elem is of class T8_ECLASS_VERTEX, then boundary must be NULL and will not be modified.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_child()

virtual void t8_eclass_scheme::t8_element_child ( const t8_element_t elem,
int  childid,
t8_element_t child 
) const
pure virtual

Construct the child element of a given number.

Parameters
[in]elemThis must be a valid element, bigger than maxlevel.
[in]childidThe number of the child to construct.
[in,out]childThe storage for this element must exist and match the element class of the child. For a pyramid, for example, it may be either a tetrahedron or a pyramid depending on childid. This can be checked by t8_element_child_eclass. On output, a valid element. It is valid to call this function with elem = child.
See also
t8_element_child_eclass

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_child_eclass()

virtual t8_eclass_t t8_eclass_scheme::t8_element_child_eclass ( int  childid) const
pure virtual

Return the type of each child in the ordering of the implementation.

Parameters
[in]childidMust be between 0 and the number of children (exclusive). The number of children is defined in t8_element_num_children.
Returns
The type for the given child.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_child_id()

virtual int t8_eclass_scheme::t8_element_child_id ( const t8_element_t elem) const
pure virtual

Compute the child id of an element.

Parameters
[in]elemThis must be a valid element.
Returns
The child id of elem.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_children()

virtual void t8_eclass_scheme::t8_element_children ( const t8_element_t elem,
int  length,
t8_element_t c[] 
) const
pure virtual

Construct all children of a given element.

Parameters
[in]elemThis must be a valid element, bigger than maxlevel.
[in]lengthThe length of the output array c must match the number of children.
[in,out]cThe storage for these length elements must exist and match the element class in the children's ordering. On output, all children are valid. It is valid to call this function with elem = c[0].
See also
t8_element_num_children
t8_element_child_eclass

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_children_at_face()

virtual void t8_eclass_scheme::t8_element_children_at_face ( const t8_element_t elem,
int  face,
t8_element_t children[],
int  num_children,
int *  child_indices 
) const
pure virtual

Given an element and a face of the element, compute all children of the element that touch the face.

Parameters
[in]elemThe element.
[in]faceA face of elem.
[in,out]childrenAllocated elements, in which the children of elem that share a face with face are stored. They will be stored in order of their linear id.
[in]num_childrenThe number of elements in children. Must match the number of children that touch face. t8_element_num_face_children
[in,out]child_indicesIf not NULL, an array of num_children integers must be given, on output its i-th entry is the child_id of the i-th face_child. It is valid to call this function with elem = children[0].

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_compare()

virtual int t8_eclass_scheme::t8_element_compare ( const t8_element_t elem1,
const t8_element_t elem2 
) const
pure virtual

Compare two elements.

Parameters
[in]elem1The first element.
[in]elem2The second element.
Returns
negativ if elem1 < elem2, zero if elem1 equals elem2 and positiv if elem1 > elem2. If elem2 is a copy of elem1 then the elements are equal.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_copy()

virtual void t8_eclass_scheme::t8_element_copy ( const t8_element_t source,
t8_element_t dest 
) const
pure virtual

Copy all entries of source to dest.

dest must be an existing element. No memory is allocated by this function.

Parameters
[in]sourceThe element whose entries will be copied to dest.
[in,out]destThis element's entries will be overwritted with the entries of source.
Note
source and dest may point to the same element.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_count_leafs()

virtual t8_gloidx_t t8_eclass_scheme::t8_element_count_leafs ( const t8_element_t t,
int  level 
) const
pure virtual

Count how many leaf descendants of a given uniform level an element would produce.

Parameters
[in]tThe element to be checked.
[in]levelA refinement level.
Returns
Suppose t is uniformly refined up to level level. The return value is the resulting number of elements (of the given level). If level < t8_element_level(t), the return value should be 0.

Example: If t is a line element that refines into 2 line elements on each level, then the return value is max(0, 2^{level - level(t)}). Thus, if t's level is 0, and level = 3, the return value is 2^3 = 8.

Implemented in t8_default_scheme_common_c.

◆ t8_element_count_leafs_from_root()

virtual t8_gloidx_t t8_eclass_scheme::t8_element_count_leafs_from_root ( int  level) const
pure virtual

Count how many leaf descendants of a given uniform level the root element will produce.

Parameters
[in]levelA refinement level.
Returns
The value of t8_element_count_leafs if the input element is the root (level 0) element.

This is a convenience function, and can be implemented via t8_element_count_leafs.

Implemented in t8_default_scheme_common_c.

◆ t8_element_destroy()

virtual void t8_eclass_scheme::t8_element_destroy ( int  length,
t8_element_t **  elem 
) const
pure virtual

Deallocate an array of elements.

Parameters
[in]lengthThe number of elements in the array.
[in,out]elemsOn input an array of length many allocated element pointers. On output all these pointers will be freed. elem itself will not be freed by this function.

Implemented in t8_default_scheme_common_c.

◆ t8_element_extrude_face()

virtual int t8_eclass_scheme::t8_element_extrude_face ( const t8_element_t face,
const t8_eclass_scheme_c face_scheme,
t8_element_t elem,
int  root_face 
) const
pure virtual

Given a boundary face inside a root tree's face construct the element inside the root tree that has the given face as a face.

Parameters
[in]faceA face element.
[in]face_schemeThe scheme for the face element.
[in,out]elemAn allocated element. The entries will be filled with the data of the element that has face as a face and lies within the root tree.
[in]root_faceThe index of the face of the root tree in which face lies.
Returns
The face number of the face of elem that coincides with face.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_face_child_face()

virtual int t8_eclass_scheme::t8_element_face_child_face ( const t8_element_t elem,
int  face,
int  face_child 
) const
pure virtual

Given a face of an element and a child number of a child of that face, return the face number of the child of the element that matches the child face.

 x ---- x   x      x           x ---- x
 |      |   |      |           |   |  | <-- f
 |      |   |      x           |   x--x
 |      |   |                  |      |
 x ---- x   x                  x ---- x
  elem    face  face_child    Returns the face number f
Parameters
[in]elemThe element.
[in]faceThen number of the face.
[in]face_childA number 0 <= face_child < num_face_children, specifying a child of elem that shares a face with face. These children are counted in linear order. This coincides with the order of children from a call to t8_element_children_at_face.
Returns
The face number of the face of a child of elem that conincides with face_child.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_face_neighbor_inside()

virtual int t8_eclass_scheme::t8_element_face_neighbor_inside ( const t8_element_t elem,
t8_element_t neigh,
int  face,
int *  neigh_face 
) const
pure virtual

Construct the face neighbor of a given element if this face neighbor is inside the root tree.

Return 0 otherwise.

Parameters
[in]elemThe element to be considered.
[in,out]neighIf the face neighbor of elem along face is inside the root tree, this element's data is filled with the data of the face neighbor. Otherwise the data can be modified arbitrarily.
[in]faceThe number of the face along which the neighbor should be constructed.
[out]neigh_faceThe number of face as viewed from neigh. An arbitrary value, if the neighbor is not inside the root tree.
Returns
True if neigh is inside the root tree. False if not. In this case neigh's data can be arbitrary on output.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_face_parent_face()

virtual int t8_eclass_scheme::t8_element_face_parent_face ( const t8_element_t elem,
int  face 
) const
pure virtual

Given a face of an element return the face number of the parent of the element that matches the element's face.

Or return -1 if no face of the parent matches the face.

Parameters
[in]elemThe element.
[in]faceThen number of the face.
Returns
If face of elem is also a face of elem's parent, the face number of this face. Otherwise -1.
Note
For the root element this function always returns face.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_face_shape()

virtual t8_element_shape_t t8_eclass_scheme::t8_element_face_shape ( const t8_element_t elem,
int  face 
) const
pure virtual

Compute the shape of the face of an element.

Parameters
[in]elemThe element.
[in]faceA face of elem.
Returns
The element shape of the face. I.e. T8_ECLASS_LINE for quads, T8_ECLASS_TRIANGLE for tets and depending on the face number either T8_ECLASS_QUAD or T8_ECLASS_TRIANGLE for prisms.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_first_descendant()

virtual void t8_eclass_scheme::t8_element_first_descendant ( const t8_element_t elem,
t8_element_t desc,
int  level 
) const
pure virtual

Compute the first descendant of a given element.

Parameters
[in]elemThe element whose descendant is computed.
[out]descThe first element in a uniform refinement of elem of the given level.
[in]levelThe level, at which the descendant is computed.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_first_descendant_face()

virtual void t8_eclass_scheme::t8_element_first_descendant_face ( const t8_element_t elem,
int  face,
t8_element_t first_desc,
int  level 
) const
pure virtual

Construct the first descendant of an element at a given level that touches a given face.

Parameters
[in]elemThe input element.
[in]faceA face of elem.
[in,out]first_descAn allocated element. This element's data will be filled with the data of the first descendant of elem that shares a face with face.
[in]levelThe level, at which the first descendant is constructed

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_general_function()

virtual void t8_eclass_scheme::t8_element_general_function ( const t8_element_t elem,
const void *  indata,
void *  outdata 
) const
pure virtual

This function has no defined effect but each implementation is free to provide its own meaning of it.

Thus this function can be used to compute or lookup very scheme implementation specific data.

Parameters
[in]elemAn valid element
[in]indataPointer to input data
[out]outdataPointer to output data. For the correct usage of indata and outdata see the specific implementations of the scheme. For example the default scheme triangle and tetrahedron implementations use this function to return the type of a tri/tet to the caller.

Implemented in t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, and t8_default_scheme_common_c.

◆ t8_element_get_corner_face()

virtual int t8_eclass_scheme::t8_element_get_corner_face ( const t8_element_t element,
int  corner,
int  face 
) const
pure virtual

Return the face numbers of the faces sharing an element's corner.

Example quad: 2 x — x 3 | | | | face 1 0 x — x 1 face 2 Thus for corner = 1 the output is: face=0 : 2, face=1: 1

Parameters
[in]elementThe element.
[in]cornerA corner index for the face.
[in]faceA face index for corner.
Returns
The face number of the face-th face at corner.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_get_face_corner()

virtual int t8_eclass_scheme::t8_element_get_face_corner ( const t8_element_t element,
int  face,
int  corner 
) const
pure virtual

Return the corner number of an element's face corner.

Example quad: 2 x — x 3 | | | | face 1 0 x — x 1 Thus for face = 1 the output is: corner=0 : 1, corner=1: 3

Parameters
[in]elementThe element.
[in]faceA face index for element.
[in]cornerA corner index for the face 0 <= corner < num_face_corners.
Returns
The corner number of the corner-th vertex of face.

The order in which the corners must be given is determined by the eclass of element: LINE/QUAD/TRIANGLE: No specific order. HEX : In Z-order of the face starting with the lowest corner number. TET : Starting with the lowest corner number counterclockwise as seen from 'outside' of the element.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_get_linear_id()

virtual t8_linearidx_t t8_eclass_scheme::t8_element_get_linear_id ( const t8_element_t elem,
int  level 
) const
pure virtual

Compute the linear id of a given element in a hypothetical uniform refinement of a given level.

Parameters
[in]elemThe element whose id we compute.
[in]levelThe level of the uniform refinement to consider.
Returns
The linear id of the element.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_init()

virtual void t8_eclass_scheme::t8_element_init ( int  length,
t8_element_t elem,
int  called_new 
) const
pure virtual

Initialize an array of allocated elements.

Parameters
[in]lengthThe number of elements to be initialized.
[in,out]elemsOn input an array of length many allocated elements.
[in]called_newTrue if the elements in elem were created by a call to t8_element_new. False if no element in elem was created in this way. The case that only some elements were created by t8_element_new should never occur.
Note
In debugging mode, an element that was passed to t8_element_init must pass t8_element_is_valid.
If an element was created by t8_element_new then t8_element_init may not be called for it. Thus, t8_element_new should initialize an element in the same way as a call to t8_element_init would. Thus, if called_new is true this function should usually do nothing.
See also
t8_element_new
t8_element_is_valid

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_is_family()

virtual int t8_eclass_scheme::t8_element_is_family ( t8_element_t **  fam) const
pure virtual

Query whether a given set of elements is a family or not.

Parameters
[in]famAn array of as many elements as an element of class ts has siblings.
Returns
Zero if fam is not a family, nonzero if it is.
Note
level 0 elements do not form a family.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_is_root_boundary()

virtual int t8_eclass_scheme::t8_element_is_root_boundary ( const t8_element_t elem,
int  face 
) const
pure virtual

Compute whether a given element shares a given face with its root tree.

Parameters
[in]elemThe input element.
[in]faceA face of elem.
Returns
True if face is a subface of the element's root element.
Note
You can compute the corresponding face number of the tree via t8_element_tree_face.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_last_descendant()

virtual void t8_eclass_scheme::t8_element_last_descendant ( const t8_element_t elem,
t8_element_t desc,
int  level 
) const
pure virtual

Compute the last descendant of a given element.

Parameters
[in]elemThe element whose descendant is computed.
[out]descThe last element in a uniform refinement of elem of the given level.
[in]levelThe level, at which the descendant is computed.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_last_descendant_face()

virtual void t8_eclass_scheme::t8_element_last_descendant_face ( const t8_element_t elem,
int  face,
t8_element_t last_desc,
int  level 
) const
pure virtual

Construct the last descendant of an element at a given level that touches a given face.

Parameters
[in]elemThe input element.
[in]faceA face of elem.
[in,out]last_descAn allocated element. This element's data will be filled with the data of the last descendant of elem that shares a face with face.
[in]levelThe level, at which the last descendant is constructed

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_level()

virtual int t8_eclass_scheme::t8_element_level ( const t8_element_t elem) const
pure virtual

Return the level of a particular element.

Parameters
[in]elemThe element whose level should be returned.
Returns
The level of elem.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_max_num_faces()

virtual int t8_eclass_scheme::t8_element_max_num_faces ( const t8_element_t elem) const
pure virtual

Compute the maximum number of faces of a given element and all of its descendants.

Parameters
[in]elemThe element.
Returns
The maximum number of faces of elem and its descendants.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_maxlevel()

virtual int t8_eclass_scheme::t8_element_maxlevel ( void  ) const
pure virtual

Return the maximum allowed level for any element of a given class.

Returns
The maximum allowed level for elements of class ts.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_nca()

virtual void t8_eclass_scheme::t8_element_nca ( const t8_element_t elem1,
const t8_element_t elem2,
t8_element_t nca 
) const
pure virtual

Compute the nearest common ancestor of two elements.

That is, the element with highest level that still has both given elements as descendants.

Parameters
[in]elem1The first of the two input elements.
[in]elem2The second of the two input elements.
[in,out]ncaThe storage for this element must exist and match the element class of the child. On output the unique nearest common ancestor of elem1 and elem2.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_new()

virtual void t8_eclass_scheme::t8_element_new ( int  length,
t8_element_t **  elem 
) const
pure virtual

Allocate memory for an array of elements of a given class and initialize them.

Parameters
[in]lengthThe number of elements to be allocated.
[in,out]elemsOn input an array of length many unallocated element pointers. On output all these pointers will point to an allocated and initialized element.
Note
Not every element that is created in t8code will be created by a call to this function. However, if an element is not created using t8_element_new, then it is guaranteed that t8_element_init is called on it.
In debugging mode, an element that was created with t8_element_new must pass t8_element_is_valid.
If an element was created by t8_element_new then t8_element_init may not be called for it. Thus, t8_element_new should initialize an element in the same way as a call to t8_element_init would.
See also
t8_element_init
t8_element_is_valid

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, t8_default_scheme_hex_c, and t8_default_scheme_common_c.

◆ t8_element_num_children()

virtual int t8_eclass_scheme::t8_element_num_children ( const t8_element_t elem) const
pure virtual

Return the number of children of an element when it is refined.

Parameters
[in]elemThe element whose number of children is returned.
Returns
The number of children of elem if it is to be refined.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_num_corners()

virtual int t8_eclass_scheme::t8_element_num_corners ( const t8_element_t elem) const
pure virtual

Compute the number of corners of a given element.

Parameters
[in]elemThe element.
Returns
The number of corners of elem.

Implemented in t8_default_scheme_pyramid_c, and t8_default_scheme_common_c.

◆ t8_element_num_face_children()

virtual int t8_eclass_scheme::t8_element_num_face_children ( const t8_element_t elem,
int  face 
) const
pure virtual

Return the number of children of an element's face when the element is refined.

Parameters
[in]elemThe element whose face is considered.
[in]faceA face of elem.
Returns
The number of children of face if elem is to be refined.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_num_faces()

virtual int t8_eclass_scheme::t8_element_num_faces ( const t8_element_t elem) const
pure virtual

Compute the number of faces of a given element.

Parameters
[in]elemThe element.
Returns
The number of faces of elem.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_num_siblings()

virtual int t8_eclass_scheme::t8_element_num_siblings ( const t8_element_t elem) const
pure virtual

Compute the number of siblings of an element.

That is the number of Children of its parent.

Parameters
[in]elemThe element.
Returns
The number of siblings of element. Note that this number is >= 1, since we count the element itself as a sibling.

Implemented in t8_default_scheme_pyramid_c, and t8_default_scheme_common_c.

◆ t8_element_parent()

virtual void t8_eclass_scheme::t8_element_parent ( const t8_element_t elem,
t8_element_t parent 
) const
pure virtual

Compute the parent of a given element elem and store it in parent.

parent needs to be an existing element. No memory is allocated by this function. elem and parent can point to the same element, then the entries of elem are overwritten by the ones of its parent.

Parameters
[in]elemThe element whose parent will be computed.
[in,out]parentThis element's entries will be overwritten by those of elem's parent. The storage for this element must exist and match the element class of the parent. For a pyramid, for example, it may be either a tetrahedron or a pyramid depending on elem's childid.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_reference_coords()

virtual void t8_eclass_scheme::t8_element_reference_coords ( const t8_element_t elem,
const double *  ref_coords,
const void *  user_data,
double *  out_coords 
) const
pure virtual

Convert a point in the reference space of an element to a point in the reference space of the tree.

Parameters
[in]elemThe element.
[in]coords_inputThe coordinates of the point in the reference space of the element.
[in]user_dataUser data.
[out]out_coordsThe coordinates of the point in the reference space of the tree.

Implemented in t8_default_scheme_common_c, t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_refines_irregular()

virtual int t8_eclass_scheme::t8_element_refines_irregular ( void  ) const
pure virtual

Returns true, if there is one element in the tree, that does not refine into 2^dim children.

Returns false otherwise.

Returns
non-zero if there is one element in the tree that does not refine into 2^dim children.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_root_len()

virtual int t8_eclass_scheme::t8_element_root_len ( const t8_element_t elem) const
pure virtual

Compute the root length of a given element, that is the length of its level 0 ancestor.

Parameters
[in]elemThe element whose root length should be computed.
Returns
The root length of elem

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_set_linear_id()

virtual void t8_eclass_scheme::t8_element_set_linear_id ( t8_element_t elem,
int  level,
t8_linearidx_t  id 
) const
pure virtual

Initialize the entries of an allocated element according to a given linear id in a uniform refinement.

Parameters
[in,out]elemThe element whose entries will be set.
[in]levelThe level of the uniform refinement to consider.
[in]idThe linear id. id must fulfil 0 <= id < 'number of leafs in the uniform refinement'

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_shape()

virtual t8_element_shape_t t8_eclass_scheme::t8_element_shape ( const t8_element_t elem) const
pure virtual

Return the shape of an allocated element according its type.

For example, a child of an element can be an element of a different shape and has to be handled differently - according to its shape.

Parameters
[in]elemThe element to be considered
Returns
The shape of the element as an eclass

Implemented in t8_default_scheme_pyramid_c, and t8_default_scheme_common_c.

◆ t8_element_sibling()

virtual void t8_eclass_scheme::t8_element_sibling ( const t8_element_t elem,
int  sibid,
t8_element_t sibling 
) const
pure virtual

Compute a specific sibling of a given element elem and store it in sibling.

sibling needs to be an existing element. No memory is allocated by this function. elem and sibling can point to the same element, then the entries of elem are overwritten by the ones of its sibid-th sibling.

Parameters
[in]elemThe element whose sibling will be computed.
[in]sibidThe id of the sibling computed.
[in,out]siblingThis element's entries will be overwritten by those of elem's sibid-th sibling. The storage for this element must exist and match the element class of the sibling.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_size()

size_t t8_eclass_scheme::t8_element_size ( void  ) const
virtual

The virtual table for a particular implementation of an element class.

Return the size of any element of a given class.

Returns
The size of an element of class ts. We provide a default implementation of this routine that should suffice for most use cases.

◆ t8_element_successor()

virtual void t8_eclass_scheme::t8_element_successor ( const t8_element_t t,
t8_element_t s,
int  level 
) const
pure virtual

Construct the successor in a uniform refinement of a given element.

Parameters
[in]elem1The element whose successor should be constructed.
[in,out]elem2The element whose entries will be set.
[in]levelThe level of the uniform refinement to consider.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_transform_face()

virtual void t8_eclass_scheme::t8_element_transform_face ( const t8_element_t elem1,
t8_element_t elem2,
int  orientation,
int  sign,
int  is_smaller_face 
) const
pure virtual

Suppose we have two trees that share a common face f.

Given an element e that is a subface of f in one of the trees and given the orientation of the tree connection, construct the face element of the respective tree neighbor that logically coincides with e but lies in the coordinate system of the neighbor tree.

Parameters
[in]elem1The face element.
[in,out]elem2On return the face elment elem1 with respective to the coordinate system of the other tree.
[in]orientationThe orientation of the tree-tree connection.
See also
t8_cmesh_set_join
Parameters
[in]signDepending on the topological orientation of the two tree faces, either 0 (both faces have opposite orientation) or 1 (both faces have the same top. orientattion). t8_eclass_face_orientation
[in]is_smaller_faceFlag to declare whether elem1 belongs to the smaller face. A face f of tree T is smaller than f' of T' if either the eclass of T is smaller or if the classes are equal and f<f'. The orientation is defined in relation to the smaller face.
Note
elem1 and elem2 may point to the same element.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_tree_face()

virtual int t8_eclass_scheme::t8_element_tree_face ( const t8_element_t elem,
int  face 
) const
pure virtual

Given an element and a face of this element.

If the face lies on the tree boundary, return the face number of the tree face. If not the return value is arbitrary. You can call t8_element_is_root_boundary to query whether the face is at the tree boundary.

Parameters
[in]elemThe element.
[in]faceThe index of a face of elem.
Returns
The index of the tree face that face is a subface of, if face is on a tree boundary. Any arbitrary integer if is not at a tree boundary.
Warning
The return value may look like a valid face of the tree even if the element does not lie on the root boundary.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

◆ t8_element_vertex_reference_coords()

virtual void t8_eclass_scheme::t8_element_vertex_reference_coords ( const t8_element_t t,
const int  vertex,
double  coords[] 
) const
pure virtual

Compute the coordinates of a given element vertex inside a reference tree that is embedded into [0,1]^d (d = dimension).

Parameters
[in]tThe element to be considered.
[in]vertexThe id of the vertex whose coordinates shall be computed.
[out]coordsAn array of at least as many doubles as the element's dimension whose entries will be filled with the coordinates of vertex.

Implemented in t8_default_scheme_vertex_c, t8_default_scheme_tri_c, t8_default_scheme_tet_c, t8_default_scheme_quad_c, t8_default_scheme_pyramid_c, t8_default_scheme_prism_c, t8_default_scheme_line_c, and t8_default_scheme_hex_c.

Field Documentation

◆ element_size

size_t t8_eclass_scheme::element_size
protected

This scheme defines the operations for a particular element class.

The size in bytes of an element of class eclass


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