t8
1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
|
Definitions of pyramid-specific functions. More...
Go to the source code of this file.
Functions | |
void | t8_dpyramid_init_linear_id (t8_dpyramid_t *p, const int level, t8_linearidx_t id) |
Initialize a pyramid as the pyramid with a given global id in a uniform refinement of a given level. More... | |
int | t8_dpyramid_get_level (const t8_dpyramid_t *p) |
Compute the level of a pyramid. More... | |
void | t8_dpyramid_copy (const t8_dpyramid_t *source, t8_dpyramid_t *dest) |
Copy the data from source to dest. More... | |
t8_linearidx_t | t8_dpyramid_linear_id (const t8_dpyramid_t *p, const int level) |
Computes the linear position of a pyramid in an uniform grid. More... | |
void | t8_dpyramid_child (const t8_dpyramid_t *elem, const int child_id, t8_dpyramid_t *child) |
Compute the childid-th child in Morton order of a pyramid. More... | |
void | t8_dpyramid_children (const t8_dpyramid_t *p, t8_dpyramid_t **c) |
Compute the children of a pyramid, array version. More... | |
void | t8_dpyramid_children_at_face (const t8_dpyramid_t *p, const int face, t8_dpyramid_t *children[], const int num_children, int *child_indices) |
Given a pyramid and a face, compute all children touching this face. More... | |
int | t8_dpyramid_face_child_face (const t8_dpyramid_t *p, const int face, const int face_child) |
Given a face of a pyramid and a child number of a child of that face, return the face number of the child of the pyramid that matches the child face. More... | |
t8_element_shape_t | t8_dpyramid_face_shape (const t8_dpyramid_t *pyra, int face) |
Given the facenumber of a pyramid, return the shape of the face. More... | |
int | t8_dpyramid_get_face_corner (const t8_dpyramid_t *pyra, int face, int corner) |
Returns the corner number of a pyramid given a face of a pyramid and a corner number regarding that face. More... | |
void | t8_dpyramid_boundary_face (const t8_dpyramid_t *p, const int face, t8_element_t *boundary) |
Given a boundary element and a facenumber of this element, compute the boundary face. More... | |
int | t8_dpyramid_extrude_face (const t8_element_t *face, t8_dpyramid_t *p, const int root_face) |
Given a boundary face inside the root pyramids's face construct the element inside the root pyramid that has the given face as a face. More... | |
int | t8_dpyramid_compare (const t8_dpyramid_t *p1, const t8_dpyramid_t *p2) |
Compare two elements. More... | |
int | t8_dpyramid_is_family (t8_dpyramid_t **fam) |
Check wether a collection of 10 pyramids is a family in Morton order. More... | |
int | t8_dpyramid_is_root_boundary (const t8_dpyramid_t *p, const int face) |
Compute whether a given pyramid shares a given face with its root tree. More... | |
int | t8_dpyramid_face_neighbor_inside (const t8_dpyramid_t *p, t8_dpyramid_t *neigh, const int face, int *neigh_face) |
Compute the neighbor of p along a given face and the number of the dual face if the neighbor is inside the root pyramid. More... | |
int | t8_dpyramid_child_id (const t8_dpyramid_t *p) |
Compute the position of the ancestor of this child at level level within its siblings. More... | |
int | t8_dpyramid_is_inside_root (const t8_dpyramid_t *p) |
Returns zero if p is not inside root, 1 ow. More... | |
int | t8_dpyramid_tet_boundary (const t8_dpyramid_t *p, const int face) |
Check, if a tet of type 0 or 3 has a common face with its pyramid-ancestor. More... | |
int | t8_dpyramid_tree_face (const t8_dpyramid_t *p, const int face) |
compute if a given element lies on the tree boundary and return the face number of the tree face. More... | |
void | t8_dpyramid_first_descendant (const t8_dpyramid_t *p, t8_dpyramid_t *desc, const int level) |
Compute the first descendant of a pyramid at a given level. More... | |
void | t8_dpyramid_first_descendant_face (const t8_dpyramid_t *p, const int face, t8_dpyramid_t *first_desc, const int level) |
Construct the first descendant of a pyramid touching a given face. More... | |
void | t8_dpyramid_last_descendant (const t8_dpyramid_t *p, t8_dpyramid_t *desc, int level) |
Compute the last descendant of a pyramid at a given level. More... | |
void | t8_dpyramid_last_descendant_face (const t8_dpyramid_t *p, const int face, t8_dpyramid_t *last_desc, const int level) |
Construct the last descendant of a pyramid touching a given face. More... | |
void | t8_dpyramid_compute_coords (const t8_dpyramid_t *p, const int vertex, int coords[]) |
Compute the coordinates of a vertex of a pyramid. More... | |
void | t8_dpyramid_parent (const t8_dpyramid_t *p, t8_dpyramid_t *parent) |
Compute the parent of a given pyramid. More... | |
int | t8_dpyramid_num_corners (const t8_dpyramid_t *p) |
Compute the number of corners of a pyramid. More... | |
int | t8_dpyramid_num_children (const t8_dpyramid_t *p) |
Compute the number of children of p. More... | |
int | t8_dpyramid_num_siblings (const t8_dpyramid_t *p) |
Compute the number of siblings of p. More... | |
int | t8_dpyramid_num_faces (const t8_dpyramid_t *p) |
Return the number of faces of p. More... | |
int | t8_dpyramid_max_num_faces (const t8_dpyramid_t *p) |
Return the maximal number of faces of an element p. More... | |
int | t8_dpyramid_face_parent_face (const t8_dpyramid_t *elem, const int face) |
Given a face of an element return the face number of the parent of the element that matches the element's face. More... | |
int | t8_dpyramid_ancestor_id (const t8_dpyramid_t *p, const int level) |
Return the child-id of the ancestor of p at level level. More... | |
void | t8_dpyramid_ancestor (const t8_dpyramid_t *pyra, const int level, t8_dpyramid_t *anc) |
Compute the ancestor of pyra at a given level. More... | |
int | t8_dpyramid_type_at_level (const t8_dpyramid_t *p, const int level) |
Compute the type of a pyramid at a given level. More... | |
t8_element_shape_t | t8_dpyramid_shape (const t8_dpyramid_t *p) |
Returns the shape of the pyramid (pyramid or tetrahedron) More... | |
void | t8_dpyramid_successor (const t8_dpyramid_t *elem, t8_dpyramid_t *s, const int level) |
Computes the successor of a pyramid in a uniform grid of level level. More... | |
void | t8_dpyramid_vertex_reference_coords (const t8_dpyramid_t *elem, const int vertex, double coords[]) |
Compute the reference coordinates of a vertex of a pyramid when the tree (level 0 triangle) is embedded in [0,1]^3. More... | |
void | t8_dpyramid_nearest_common_ancestor (const t8_dpyramid_t *pyra1, const t8_dpyramid_t *pyra2, t8_dpyramid_t *nca) |
Compute the nearest common ancestor of two elements. More... | |
int | t8_dpyramid_is_valid (const t8_dpyramid_t *p) |
Query whether all entries of a pyramid are in valid ranges. More... | |
void | t8_dpyramid_debug_print (const t8_dpyramid_t *p) |
Print the coordinates, the level and the type of a pyramid. More... | |
Definitions of pyramid-specific functions.
void t8_dpyramid_ancestor | ( | const t8_dpyramid_t * | pyra, |
const int | level, | ||
t8_dpyramid_t * | anc | ||
) |
Compute the ancestor of pyra at a given level.
[in] | pyra | Input pyramid |
[in] | level | Level of the ancestor to compute |
[in,out] | anc | Allocated element that will be filled with the data of the ancestor. |
Compute the ancestor of pyra at a given level.
[in] | pyra | Input pyramid |
[in] | level | The level at which we want to compute anc |
[in,out] | anc | Allocated input element which will be filled by the data of the anc of pyra at level level |
int t8_dpyramid_ancestor_id | ( | const t8_dpyramid_t * | p, |
const int | level | ||
) |
Return the child-id of the ancestor of p at level level.
[in] | p | Input pyramid |
[in] | level | The ancestor-level |
void t8_dpyramid_boundary_face | ( | const t8_dpyramid_t * | p, |
const int | face, | ||
t8_element_t * | boundary | ||
) |
Given a boundary element and a facenumber of this element, compute the boundary face.
[in] | p | Input pyramid |
[in] | face | The face number of an element |
[in,out] | boundary | The boundary face |
void t8_dpyramid_child | ( | const t8_dpyramid_t * | elem, |
const int | child_id, | ||
t8_dpyramid_t * | child | ||
) |
Compute the childid-th child in Morton order of a pyramid.
[in] | elem | Input pyramid. |
[in,out] | childid | The id of the child, 0..7 in Morton order. |
[out] | child | Existing pyramid whose data will be filled with the date of t's childid-th child. |
int t8_dpyramid_child_id | ( | const t8_dpyramid_t * | p | ) |
Compute the position of the ancestor of this child at level level within its siblings.
[in] | p | pyramid to be considered. |
void t8_dpyramid_children | ( | const t8_dpyramid_t * | p, |
t8_dpyramid_t ** | c | ||
) |
Compute the children of a pyramid, array version.
[in] | p | Input pyramid |
[in,out] | c | Pointers to the computed children in Morton order |
void t8_dpyramid_children_at_face | ( | const t8_dpyramid_t * | p, |
const int | face, | ||
t8_dpyramid_t * | children[], | ||
const int | num_children, | ||
int * | child_indices | ||
) |
Given a pyramid and a face, compute all children touching this face.
[in] | p | Input pyramid |
[in] | face | The face to compute the childran at |
[in,out] | children | The children of p at face |
[in] | num_childrem | The number of children at this face |
[in,out] | child_indices | An array to be filled with the local-ids of the children. |
int t8_dpyramid_compare | ( | const t8_dpyramid_t * | p1, |
const t8_dpyramid_t * | p2 | ||
) |
Compare two elements.
returns negativ if p1 < p2, zero if p1 equals p2 and positiv if p1 > p2. If p2 is a copy of p1 then the elements are equal.
[in] | p1 | A pyramid |
[in] | p2 | Another pyramid |
void t8_dpyramid_compute_coords | ( | const t8_dpyramid_t * | p, |
const int | vertex, | ||
int | coords[] | ||
) |
Compute the coordinates of a vertex of a pyramid.
[in] | p | Input pyramid. |
[in] | vertex | The number of the vertex. |
[out] | coords | An array of 3 t8_dpyramid_coord_t that will be filled with the coordinates of the vertex. |
void t8_dpyramid_copy | ( | const t8_dpyramid_t * | source, |
t8_dpyramid_t * | dest | ||
) |
Copy the data from source to dest.
[in] | source | The source-pyramid |
[in,out] | dest | The destination |
void t8_dpyramid_debug_print | ( | const t8_dpyramid_t * | p | ) |
Print the coordinates, the level and the type of a pyramid.
[in] | p | The pyramid to print |
int t8_dpyramid_extrude_face | ( | const t8_element_t * | face, |
t8_dpyramid_t * | p, | ||
const int | root_face | ||
) |
Given a boundary face inside the root pyramids's face construct the element inside the root pyramid that has the given face as a face.
[in] | face | A face element. |
[in,out] | p | An 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_face | The index of the face of the root tree in which face lies. |
int t8_dpyramid_face_child_face | ( | const t8_dpyramid_t * | p, |
const int | face, | ||
const int | face_child | ||
) |
Given a face of a pyramid and a child number of a child of that face, return the face number of the child of the pyramid that matches the child face.
[in] | p | Input pyramid |
[in] | face | A face of p |
[in] | face_child | A number specifying a child on the face |
int t8_dpyramid_face_neighbor_inside | ( | const t8_dpyramid_t * | p, |
t8_dpyramid_t * | neigh, | ||
const int | face, | ||
int * | neigh_face | ||
) |
Compute the neighbor of p along a given face and the number of the dual face if the neighbor is inside the root pyramid.
Return 0 if the neighbor is not inside, 1 ow.
[in] | p | Input pyramid |
[in,out] | neigh | The neighbor of p |
[in] | face | The face of p along which neigh is computed |
[in,out] | neigh_face | The dual face |
int t8_dpyramid_face_parent_face | ( | const t8_dpyramid_t * | elem, |
const int | face | ||
) |
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.
[in] | elem | Input pyramid |
[in] | face | a face of elem |
t8_element_shape_t t8_dpyramid_face_shape | ( | const t8_dpyramid_t * | pyra, |
int | face | ||
) |
Given the facenumber of a pyramid, return the shape of the face.
[in] | pyra | Input pyramid |
[in] | face | The facenumber |
void t8_dpyramid_first_descendant | ( | const t8_dpyramid_t * | p, |
t8_dpyramid_t * | desc, | ||
const int | level | ||
) |
Compute the first descendant of a pyramid at a given level.
This is the descendant of the pyramid in a uniform level refinement that has the smallest id.
[in] | p | pyramid whose descendant is computed. |
[out] | desc | Existing pyramid whose data will be filled with the data of p's first descendant on level level. |
[in] | level | The refinement level. Must be greater than p's refinement level. |
void t8_dpyramid_first_descendant_face | ( | const t8_dpyramid_t * | p, |
const int | face, | ||
t8_dpyramid_t * | first_desc, | ||
const int | level | ||
) |
Construct the first descendant of a pyramid touching a given face.
[in] | p | pyramid whose descendant is computed. |
[in] | face | The face at which the descendant is computed |
[out] | first_desc | Existing pyramid whose data will be filled with the data of p's first descendant on level level. |
[in] | level | The refinement level. Must be greater than p's refinement level. |
int t8_dpyramid_get_face_corner | ( | const t8_dpyramid_t * | pyra, |
int | face, | ||
int | corner | ||
) |
Returns the corner number of a pyramid given a face of a pyramid and a corner number regarding that face.
[in] | pyra | Input pyramid |
[in] | face | The facenumber of a face of pyra |
[in] | corner | The cornernumber of a corner of face |
int t8_dpyramid_get_level | ( | const t8_dpyramid_t * | p | ) |
Compute the level of a pyramid.
[in] | p | Pyramid whose level is computed. |
void t8_dpyramid_init_linear_id | ( | t8_dpyramid_t * | p, |
const int | level, | ||
t8_linearidx_t | id | ||
) |
Initialize a pyramid as the pyramid with a given global id in a uniform refinement of a given level.
[in,out] | p | Existing pyramid whose data will be filled. |
[in] | level | level of uniform grid to be considered. |
[in] | id | Index to be considered. |
int t8_dpyramid_is_family | ( | t8_dpyramid_t ** | fam | ) |
Check wether a collection of 10 pyramids is a family in Morton order.
[in] | fam | A collection of pyramids |
int t8_dpyramid_is_inside_root | ( | const t8_dpyramid_t * | p | ) |
Returns zero if p is not inside root, 1 ow.
[in] | p | Pyramid to check |
int t8_dpyramid_is_root_boundary | ( | const t8_dpyramid_t * | p, |
const int | face | ||
) |
Compute whether a given pyramid shares a given face with its root tree.
[in] | p | The input pyramid |
[in] | face | A face of p |
int t8_dpyramid_is_valid | ( | const t8_dpyramid_t * | p | ) |
Query whether all entries of a pyramid are in valid ranges.
A pyramid is valid if and only if its triangle and line member are valid.
[in] | p | pyramid to be considered. |
void t8_dpyramid_last_descendant | ( | const t8_dpyramid_t * | p, |
t8_dpyramid_t * | desc, | ||
int | level | ||
) |
Compute the last descendant of a pyramid at a given level.
This is the descendant of the pyramid in a uniform level refinement that has the largest id.
[in] | p | pyramid whose descendant is computed. |
[out] | desc | Existing pyramid whose data will be filled with the data of p's last descendant on level level. |
[in] | level | The refinement level. Must be greater than p's refinement level. |
void t8_dpyramid_last_descendant_face | ( | const t8_dpyramid_t * | p, |
const int | face, | ||
t8_dpyramid_t * | last_desc, | ||
const int | level | ||
) |
Construct the last descendant of a pyramid touching a given face.
[in] | p | pyramid whose descendant is computed. |
[in] | face | The face at which the descendant is computed |
[out] | last_desc | Existing pyramid whose data will be filled with the data of p's first descendant on level level. |
[in] | level | The refinement level. Must be greater than p's refinement level. |
t8_linearidx_t t8_dpyramid_linear_id | ( | const t8_dpyramid_t * | p, |
const int | level | ||
) |
Computes the linear position of a pyramid in an uniform grid.
[in] | p | pyramid whose id will be computed. |
[in] | level | The level on which the linear-id should be computed. |
int t8_dpyramid_max_num_faces | ( | const t8_dpyramid_t * | p | ) |
Return the maximal number of faces of an element p.
[in] | p | Input pyramid |
void t8_dpyramid_nearest_common_ancestor | ( | const t8_dpyramid_t * | pyra1, |
const t8_dpyramid_t * | pyra2, | ||
t8_dpyramid_t * | nca | ||
) |
Compute the nearest common ancestor of two elements.
[in] | pyra1 | The first pyramid |
[in] | pyra2 | The second pyramid |
[in,out] | nca | Existing pyramid whose data will be filled with the data of pyra1 and pyra2 nearest common ancestor. |
int t8_dpyramid_num_children | ( | const t8_dpyramid_t * | p | ) |
Compute the number of children of p.
[in] | p | Input pyramid. |
int t8_dpyramid_num_corners | ( | const t8_dpyramid_t * | p | ) |
Compute the number of corners of a pyramid.
If pyramid has type less than 6, it is actually a tetrahedron.
[in] | p | Input pyramid. |
int t8_dpyramid_num_faces | ( | const t8_dpyramid_t * | p | ) |
Return the number of faces of p.
[in] | p | Input pyramid |
int t8_dpyramid_num_siblings | ( | const t8_dpyramid_t * | p | ) |
Compute the number of siblings of p.
[in] | p | Input pyramid |
void t8_dpyramid_parent | ( | const t8_dpyramid_t * | p, |
t8_dpyramid_t * | parent | ||
) |
Compute the parent of a given pyramid.
[in] | p | Input pyramid. |
[out] | parent | The parent of p. |
t8_element_shape_t t8_dpyramid_shape | ( | const t8_dpyramid_t * | p | ) |
Returns the shape of the pyramid (pyramid or tetrahedron)
[in] | p | Input pyramid. |
void t8_dpyramid_successor | ( | const t8_dpyramid_t * | elem, |
t8_dpyramid_t * | s, | ||
const int | level | ||
) |
Computes the successor of a pyramid in a uniform grid of level level.
[in] | elem | pyramid whose id will be computed. |
[in,out] | s | Existing pyramid whose data will be filled with the data of l's successor on level level. |
[in] | level | level of uniform grid to be considered. |
int t8_dpyramid_tet_boundary | ( | const t8_dpyramid_t * | p, |
const int | face | ||
) |
Check, if a tet of type 0 or 3 has a common face with its pyramid-ancestor.
[in] | p | input pyramid |
[in] | face | A face of p. |
int t8_dpyramid_tree_face | ( | const t8_dpyramid_t * | p, |
const int | face | ||
) |
compute if a given element lies on the tree boundary and return the face number of the tree face.
If not the return value is arbitrary
[in] | elem | pyramid |
[in] | face | a face of elem |
int t8_dpyramid_type_at_level | ( | const t8_dpyramid_t * | p, |
const int | level | ||
) |
Compute the type of a pyramid at a given level.
Starting from its own level, we iterate over the levels and compute the type of this level. If p is a tetrahedron, we compute it in a tetrahedral fashion up unto the last level where p is a tet and continue in a pyramidal fashion
[in] | p | Input pyramid |
[in] | level | The level at which the type is computed |
void t8_dpyramid_vertex_reference_coords | ( | const t8_dpyramid_t * | elem, |
const int | vertex, | ||
double | coords[] | ||
) |
Compute the reference coordinates of a vertex of a pyramid when the tree (level 0 triangle) is embedded in [0,1]^3.
[in] | elem | Input pyramid. |
[in] | vertex | The number of the vertex. |
[out] | coordinates | An array of 3 double that will be filled with the reference coordinates of the vertex. |