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_default_scheme_common_c Class Referenceabstract
Inheritance diagram for t8_default_scheme_common_c:
t8_eclass_scheme 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_default_scheme_common_c ()
 Destructor for all default schemes.
 
virtual void t8_element_deinit (int length, t8_element_t *elem) const override
 Deinitialize an array of allocated elements. More...
 
virtual int t8_element_num_corners (const t8_element_t *elem) const
 Compute the number of corners of a given element.
 
virtual void t8_element_new (int length, t8_element_t **elem) const
 Allocate space for a bunch of elements.
 
virtual void t8_element_destroy (int length, t8_element_t **elem) const
 Deallocate space for a bunch of elements.
 
virtual t8_element_shape_t t8_element_shape (const t8_element_t *elem) const
 Return the shape of an element.
 
virtual t8_gloidx_t t8_element_count_leaves (const t8_element_t *t, int level) const
 Count how many leaf descendants of a given uniform level an element would produce. More...
 
virtual int t8_element_num_siblings (const t8_element_t *elem) const
 Compute the number of siblings of an element. More...
 
virtual t8_gloidx_t t8_element_count_leaves_from_root (int level) const
 Count how many leaf descendants of a given uniform level the root element will produce. More...
 
virtual void t8_element_reference_coords (const t8_element_t *elem, const double *ref_coords, const size_t num_coords, double *out_coords) const =0
 Convert points in the reference space of an element to points in the reference space of the tree. More...
 
virtual void t8_element_anchor (const t8_element_t *elem, int anchor[3]) const =0
 Get the integer coordinates of the anchor node of an element. More...
 
virtual void t8_element_debug_print (const t8_element_t *elem) const
 Print a given element. More...
 
- Public Member Functions inherited from t8_eclass_scheme
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 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 int t8_element_equal (const t8_element_t *elem1, const t8_element_t *elem2) const =0
 Check if two elements are equal. 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 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_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 *const *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 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 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) const =0
 Construct the successor in a uniform refinement of a given element. 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 int t8_element_is_valid (const t8_element_t *elem) const =0
 Query whether a given element can be considered as 'valid' and it is safe to perform any of the above algorithms on it. More...
 
virtual void t8_element_to_string (const t8_element_t *elem, char *debug_string, const int string_size) const =0
 Fill a string with readable information about the element. More...
 
virtual void t8_element_init (int length, t8_element_t *elem) const =0
 Initialize an array of allocated elements. More...
 
virtual void t8_element_root (t8_element_t *elem) const =0
 create the root element More...
 
virtual void t8_element_MPI_Pack (t8_element_t **const elements, const unsigned int count, void *send_buffer, int buffer_size, int *position, sc_MPI_Comm comm) const =0
 Pack multiple elements into contiguous memory, so they can be sent via MPI. More...
 
virtual void t8_element_MPI_Pack_size (const unsigned int count, sc_MPI_Comm comm, int *pack_size) const =0
 Determine an upper bound for the size of the packed message of count elements. More...
 
virtual void t8_element_MPI_Unpack (void *recvbuf, const int buffer_size, int *position, t8_element_t **elements, const unsigned int count, sc_MPI_Comm comm) const =0
 Unpack multiple elements from contiguous memory that was received via MPI. More...
 

Additional Inherited Members

- Data Fields inherited from t8_eclass_scheme
t8_eclass_t eclass
 The element class.
 
- Protected Attributes inherited from t8_eclass_scheme
size_t element_size
 The size in bytes of an element of class eclass.
 
void * ts_context
 Anonymous implementation context.
 

Member Function Documentation

◆ t8_element_anchor()

virtual void t8_default_scheme_common_c::t8_element_anchor ( const t8_element_t elem,
int  anchor[3] 
) const
pure virtual

Get the integer coordinates of the anchor node of an element.

The default scheme implements the Morton type SFCs. In these SFCs the elements are positioned in a cube [0,1]^(dL) with dimension d (=0,1,2,3) and L the maximum refinement level. All element vertices have integer coordinates in this cube and the anchor node is the first of all vertices (index 0). It also has the lowest x,y and z coordinates.

Parameters
[in]elemThe element.
[out]anchorThe integer coordinates of the anchor node in the cube [0,1]^(dL)

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_leaves()

t8_gloidx_t t8_default_scheme_common_c::t8_element_count_leaves ( const t8_element_t t,
int  level 
) const
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). Each default element (except pyramids) refines into 2^{dim * (level - level(t))} children.

Implements t8_eclass_scheme.

◆ t8_element_count_leaves_from_root()

t8_gloidx_t t8_default_scheme_common_c::t8_element_count_leaves_from_root ( int  level) const
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_leaves if the input element is the root (level 0) element.

Implements t8_eclass_scheme.

◆ t8_element_debug_print()

void t8_default_scheme_common_c::t8_element_debug_print ( const t8_element_t elem) const
virtual

Print a given element.

For a example for a triangle print the coordinates and the level of the triangle. This function is only available in the debugging configuration.

Parameters
[in]elemThe element to print

Implements t8_eclass_scheme.

◆ t8_element_deinit()

void t8_default_scheme_common_c::t8_element_deinit ( int  length,
t8_element_t elem 
) const
overridevirtual

Deinitialize an array of allocated elements.

Parameters
[in]lengthThe number of elements to be deinitialized.
[in,out]elemsOn input an array of length many allocated and initialized elements, on output an array of length many allocated, but not initialized elements.
Note
Call this function if you called t8_element_init on the element pointers.
See also
t8_element_init

Implements t8_eclass_scheme.

◆ t8_element_num_siblings()

int t8_default_scheme_common_c::t8_element_num_siblings ( const t8_element_t elem) const
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.

Implements t8_eclass_scheme.

Reimplemented in t8_default_scheme_pyramid_c.

◆ t8_element_reference_coords()

virtual void t8_default_scheme_common_c::t8_element_reference_coords ( const t8_element_t elem,
const double *  ref_coords,
const size_t  num_coords,
double *  out_coords 
) const
pure virtual

Convert points in the reference space of an element to points in the reference space of the tree.

Parameters
[in]elemThe element.
[in]coords_inputThe coordinates \( [0,1]^\mathrm{dim} \) of the point in the reference space of the element.
[in]num_coordsNumber of \( dim\)-sized coordinates to evaluate.
[out]out_coordsThe coordinates of the points in the reference space of the tree.

Implements t8_eclass_scheme.

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.


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