31 #ifndef T8_ELEMENT_C_INTERFACE_H
32 #define T8_ELEMENT_C_INTERFACE_H
307 int num_children,
int *child_indices);
384 int orientation,
int sign,
int is_smaller_face);
573 #ifdef T8_ENABLE_DEBUG
613 const int string_size);
662 void *send_buffer,
const int buffer_size,
int *position, sc_MPI_Comm comm);
684 t8_element_t **elements,
const unsigned int count, sc_MPI_Comm comm);
This struct holds virtual functions for a particular element class.
Definition: t8_element_cxx.hxx:41
int64_t t8_gloidx_t
A type for global indexing that holds really big numbers.
Definition: t8.h:100
uint64_t t8_linearidx_t
A type for storing SFC indices.
Definition: t8.h:109
This file defines basic operations on an element in a refinement tree.
struct t8_element t8_element_t
Opaque structure for a generic element, only used as pointer.
Definition: t8_element.h:42
void t8_element_successor(const t8_eclass_scheme_c *ts, const t8_element_t *elem1, t8_element_t *elem2)
Construct the successor in a uniform refinement of a given element.
Definition: t8_element_c_interface.cxx:361
void t8_element_MPI_Unpack(const t8_eclass_scheme_c *ts, void *recvbuf, const int buffer_size, int *position, t8_element_t **elements, const unsigned int count, sc_MPI_Comm comm)
Unpack multiple elements from contiguous memory that was received via MPI.
Definition: t8_element_c_interface.cxx:461
size_t t8_element_size(const t8_eclass_scheme_c *ts)
Return the size of any element of a given class.
Definition: t8_element_c_interface.cxx:34
void t8_element_new(const t8_eclass_scheme_c *ts, int length, t8_element_t **elems)
Allocate memory for an array of elements of a given class and initialize them.
Definition: t8_element_c_interface.cxx:421
int t8_element_get_corner_face(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int corner, int face)
Compute the face numbers of the faces sharing an element's corner.
Definition: t8_element_c_interface.cxx:162
int t8_element_refines_irregular(const t8_eclass_scheme_c *ts)
Returns true, if there is one element in the tree, that does not refine into 2^dim children.
Definition: t8_element_c_interface.cxx:42
t8_linearidx_t t8_element_get_linear_id(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int level)
Compute the linear id of a given element in a hypothetical uniform refinement of a given level.
Definition: t8_element_c_interface.cxx:337
void t8_element_MPI_Pack_size(const t8_eclass_scheme_c *ts, const unsigned int count, sc_MPI_Comm comm, int *pack_size)
Determine an upper bound for the size of the packed message of count elements.
Definition: t8_element_c_interface.cxx:454
void t8_element_nca(const t8_eclass_scheme_c *ts, const t8_element_t *elem1, const t8_element_t *elem2, t8_element_t *nca)
Compute the nearest common ancestor of two elements.
Definition: t8_element_c_interface.cxx:210
t8_gloidx_t t8_element_count_leaves(const t8_eclass_scheme_c *ts, const t8_element_t *t, int level)
Count how many leaf descendants of a given uniform level an element would produce.
Definition: t8_element_c_interface.cxx:378
void t8_element_parent(const t8_eclass_scheme_c *ts, const t8_element_t *elem, t8_element_t *parent)
Compute the parent of a given element elem and store it in parent.
Definition: t8_element_c_interface.cxx:90
int t8_element_num_siblings(const t8_eclass_scheme_c *ts, const t8_element_t *elem)
Compute the number of siblings of an element.
Definition: t8_element_c_interface.cxx:98
void t8_element_vertex_reference_coords(const t8_eclass_scheme_c *ts, const t8_element_t *t, const int vertex, double coords[])
Compute the coordinates of a given element vertex inside a reference tree that is embedded into [0,...
Definition: t8_element_c_interface.cxx:369
int t8_element_extrude_face(const t8_eclass_scheme_c *ts, const t8_element_t *face, const t8_eclass_scheme_c *face_scheme, t8_element_t *elem, int root_face)
Given a boundary face inside a root tree's face construct the element inside the root tree that has t...
Definition: t8_element_c_interface.cxx:268
void t8_element_sibling(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int sibid, t8_element_t *sibling)
Compute a specific sibling of a given element elem and store it in sibling.
Definition: t8_element_c_interface.cxx:106
t8_element_shape_t t8_element_shape(const t8_eclass_scheme_c *ts, const t8_element_t *elem)
Return the shape of an allocated element according its type.
Definition: t8_element_c_interface.cxx:329
int t8_element_compare(const t8_eclass_scheme_c *ts, const t8_element_t *elem1, const t8_element_t *elem2)
Compare two elements with respect to the scheme.
Definition: t8_element_c_interface.cxx:74
void t8_element_children(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int length, t8_element_t *c[])
Construct all children of a given element.
Definition: t8_element_c_interface.cxx:178
void t8_element_debug_print(const t8_eclass_scheme_c *ts, const t8_element_t *elem)
Print a given element.
Definition: t8_element_c_interface.cxx:403
void t8_element_copy(const t8_eclass_scheme_c *ts, const t8_element_t *source, t8_element_t *dest)
Copy all entries of source to dest.
Definition: t8_element_c_interface.cxx:66
void t8_element_root(const t8_eclass_scheme_c *ts, t8_element_t *elem)
Fills an element with the root element.
Definition: t8_element_c_interface.cxx:437
int t8_element_face_neighbor_inside(const t8_eclass_scheme_c *ts, const t8_element_t *elem, t8_element_t *neigh, int face, int *neigh_face)
Construct the face neighbor of a given element if this face neighbor is inside the root tree.
Definition: t8_element_c_interface.cxx:320
int t8_element_is_family(const t8_eclass_scheme_c *ts, t8_element_t *const *fam)
Query whether a given set of elements is a family or not.
Definition: t8_element_c_interface.cxx:202
void t8_element_last_descendant(const t8_eclass_scheme_c *ts, const t8_element_t *elem, t8_element_t *desc, int level)
Compute the last descendant of a given element.
Definition: t8_element_c_interface.cxx:353
int t8_element_max_num_faces(const t8_eclass_scheme_c *ts, const t8_element_t *elem)
Compute the maximum number of faces of a given element and all of its descendants.
Definition: t8_element_c_interface.cxx:130
int t8_element_child_id(const t8_eclass_scheme_c *ts, const t8_element_t *elem)
Compute the child id of an element.
Definition: t8_element_c_interface.cxx:186
void t8_element_set_linear_id(const t8_eclass_scheme_c *ts, t8_element_t *elem, int level, t8_linearidx_t id)
Initialize the entries of an allocated element according to a given linear id in a uniform refinement...
Definition: t8_element_c_interface.cxx:304
int t8_element_num_face_children(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int face)
Compute the number of children of an element's face when the element is refined.
Definition: t8_element_c_interface.cxx:146
int t8_element_equal(const t8_eclass_scheme_c *ts, const t8_element_t *elem1, const t8_element_t *elem2)
Check if two elements are equal.
Definition: t8_element_c_interface.cxx:82
int t8_element_maxlevel(const t8_eclass_scheme_c *ts)
Return the maximum allowed level for any element of a given class.
Definition: t8_element_c_interface.cxx:50
int t8_element_ancestor_id(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int level)
Compute the ancestor id of an element, that is the child id at a given level.
Definition: t8_element_c_interface.cxx:194
void t8_element_boundary_face(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int face, t8_element_t *boundary, const t8_eclass_scheme_c *boundary_scheme)
Construct the boundary element at a specific face.
Definition: t8_element_c_interface.cxx:277
void t8_element_transform_face(const t8_eclass_scheme_c *ts, const t8_element_t *elem1, t8_element_t *elem2, int orientation, int sign, int is_smaller_face)
Suppose we have two trees that share a common face f.
Definition: t8_element_c_interface.cxx:259
int t8_element_num_children(const t8_eclass_scheme_c *ts, const t8_element_t *elem)
Compute the number of children of an element when it is refined.
Definition: t8_element_c_interface.cxx:138
int t8_element_num_faces(const t8_eclass_scheme_c *ts, const t8_element_t *elem)
Compute the number of faces of an element.
Definition: t8_element_c_interface.cxx:122
void t8_element_to_string(const t8_eclass_scheme_c *ts, const t8_element_t *elem, char *debug_string, const int string_size)
Fill a string with readable information about the element.
Definition: t8_element_c_interface.cxx:411
void t8_element_MPI_Pack(const t8_eclass_scheme_c *ts, t8_element_t **const elements, const unsigned int count, void *send_buffer, const int buffer_size, int *position, sc_MPI_Comm comm)
Pack multiple elements into contiguous memory, so they can be sent via MPI.
Definition: t8_element_c_interface.cxx:445
void t8_element_first_descendant(const t8_eclass_scheme_c *ts, const t8_element_t *elem, t8_element_t *desc, int level)
Compute the first descendant of a given element.
Definition: t8_element_c_interface.cxx:345
int t8_element_is_root_boundary(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int face)
Compute whether a given element shares a given face with its root tree.
Definition: t8_element_c_interface.cxx:312
int t8_element_is_valid(const t8_eclass_scheme_c *ts, const t8_element_t *elem)
Query whether a given element can be considered as 'valid' and it is safe to perform any of the above...
Definition: t8_element_c_interface.cxx:395
t8_element_shape_t t8_element_face_shape(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int face)
Compute the shape of the face of an element.
Definition: t8_element_c_interface.cxx:218
int t8_element_face_child_face(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int face, int face_child)
Given a face of an element and a child number of a child of that face, return the face number of the ...
Definition: t8_element_c_interface.cxx:235
void t8_element_first_descendant_face(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int face, t8_element_t *first_desc, int level)
Construct the first descendant of an element at a given level that touches a given face.
Definition: t8_element_c_interface.cxx:286
void t8_element_children_at_face(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int face, t8_element_t *children[], int num_children, int *child_indices)
Given an element and a face of the element, compute all children of the element that touch the face.
Definition: t8_element_c_interface.cxx:226
int t8_element_get_face_corner(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int face, int corner)
Return the corner number of an element's face corner.
Definition: t8_element_c_interface.cxx:154
void t8_element_last_descendant_face(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int face, t8_element_t *last_desc, int level)
Construct the last descendant of an element at a given level that touches a given face.
Definition: t8_element_c_interface.cxx:295
void t8_element_child(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int childid, t8_element_t *child)
Construct the child element of a given number.
Definition: t8_element_c_interface.cxx:170
int t8_element_num_corners(const t8_eclass_scheme_c *ts, const t8_element_t *elem)
Compute the number of corners of an element.
Definition: t8_element_c_interface.cxx:114
int t8_element_tree_face(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int face)
Given an element and a face of this element.
Definition: t8_element_c_interface.cxx:251
void t8_element_destroy(const t8_eclass_scheme_c *ts, int length, t8_element_t **elems)
Deallocate an array of elements.
Definition: t8_element_c_interface.cxx:429
t8_gloidx_t t8_element_count_leaves_from_root(const t8_eclass_scheme_c *ts, int level)
Count how many leaf descendants of a given uniform level the root element will produce.
Definition: t8_element_c_interface.cxx:386
int t8_element_face_parent_face(const t8_eclass_scheme_c *ts, const t8_element_t *elem, int face)
Given a face of an element return the face number of the parent of the element that matches the eleme...
Definition: t8_element_c_interface.cxx:243
t8_eclass_t t8_element_shape_t
Type definition for the geometric shape of an element.
Definition: t8_element_shape.h:38