p4est
1.0
|
Routines for manipulating quadrants (neighbors, parents, children, etc.) More...
#include <p4est.h>
Go to the source code of this file.
Functions | |
void | p4est_quadrant_print (int log_priority, const p4est_quadrant_t *q) |
Prints one line with quadrant's x, y and level. | |
int | p4est_quadrant_is_equal (const p4est_quadrant_t *q1, const p4est_quadrant_t *q2) |
Test if two quadrants have equal Morton indices. | |
int | p4est_quadrant_overlaps (const p4est_quadrant_t *q1, const p4est_quadrant_t *q2) |
Test if two quadrants overlap. | |
int | p4est_quadrant_is_equal_piggy (const p4est_quadrant_t *q1, const p4est_quadrant_t *q2) |
Test if two quadrants have equal Morton indices and the same tree id. | |
int | p4est_quadrant_compare (const void *v1, const void *v2) |
Compare two quadrants in their Morton ordering. | |
int | p4est_quadrant_disjoint (const void *v1, const void *v2) |
Compare two quadrants in their Morton ordering, with equivalence if the two quadrants overlap. | |
int | p4est_quadrant_compare_piggy (const void *v1, const void *v2) |
Compare two quadrants in their Morton ordering and the which_tree member. | |
int | p4est_quadrant_compare_local_num (const void *v1, const void *v2) |
Compare two quadrants with respect to their local_num in the piggy3 member. | |
int | p4est_quadrant_equal_fn (const void *v1, const void *v2, const void *u) |
Test if two quadrants have equal Morton indices, callback version. | |
unsigned | p4est_quadrant_hash_fn (const void *v, const void *u) |
Computes a hash value for a quadrant by the lookup3 method. | |
int | p4est_node_equal_piggy_fn (const void *v1, const void *v2, const void *u) |
Test if two nodes are in the same tree and have equal Morton indices. | |
unsigned | p4est_node_hash_piggy_fn (const void *v, const void *u) |
Compute hash value of a node based on its tree and Morton index. | |
void | p4est_node_clamp_inside (const p4est_quadrant_t *n, p4est_quadrant_t *r) |
Clamp a node inside the unit tree if it sits on a high border. | |
void | p4est_node_unclamp (p4est_quadrant_t *n) |
Move a clamped node out on the border. | |
void | p4est_node_to_quadrant (const p4est_quadrant_t *n, int level, p4est_quadrant_t *q) |
Find the enclosing quadrant of a given node at a given level. | |
int | p4est_quadrant_contains_node (const p4est_quadrant_t *q, const p4est_quadrant_t *n) |
Decide if a node is completely contained within a quadrant. | |
int | p4est_quadrant_ancestor_id (const p4est_quadrant_t *q, int level) |
Compute the position of the ancestor of this child at level level within its siblings. | |
int | p4est_quadrant_child_id (const p4est_quadrant_t *q) |
Compute the position of this child within its siblings. | |
int | p4est_quadrant_is_inside_root (const p4est_quadrant_t *q) |
Test if a quadrant is inside the unit tree. | |
int | p4est_quadrant_is_inside_3x3 (const p4est_quadrant_t *q) |
Test if a quadrant is inside the 3x3 box around the root tree. | |
int | p4est_quadrant_is_outside_face (const p4est_quadrant_t *q) |
Test if a quadrant is outside a tree face boundary (no corner). | |
int | p4est_quadrant_is_outside_corner (const p4est_quadrant_t *q) |
Test if a quadrant is outside a tree corner boundary. | |
int | p4est_quadrant_is_node (const p4est_quadrant_t *q, int inside) |
Test if a quadrant is used to represent a mesh node. | |
int | p4est_quadrant_is_valid (const p4est_quadrant_t *q) |
Test if a quadrant has valid Morton indices and is inside the unit tree. | |
int | p4est_quadrant_is_extended (const p4est_quadrant_t *q) |
Test if a quadrant has valid Morton indices in the 3x3 box around root. | |
int | p4est_quadrant_is_sibling (const p4est_quadrant_t *q1, const p4est_quadrant_t *q2) |
Test if two quadrants are siblings. | |
int | p4est_quadrant_is_sibling_D (const p4est_quadrant_t *q1, const p4est_quadrant_t *q2) |
Test if two quadrants are siblings. | |
int | p4est_quadrant_is_family (const p4est_quadrant_t *q0, const p4est_quadrant_t *q1, const p4est_quadrant_t *q2, const p4est_quadrant_t *q3) |
Test if 4 quadrants are siblings in Morton ordering. | |
int | p4est_quadrant_is_familyv (const p4est_quadrant_t q[]) |
Test if 4 quadrants are siblings in Morton ordering, array version. | |
int | p4est_quadrant_is_familypv (p4est_quadrant_t *q[]) |
Test if 4 quadrants are siblings in Morton ordering, array version. | |
int | p4est_quadrant_is_parent (const p4est_quadrant_t *q, const p4est_quadrant_t *r) |
Test if a quadrant is the parent of another quadrant. | |
int | p4est_quadrant_is_parent_D (const p4est_quadrant_t *q, const p4est_quadrant_t *r) |
Test if a quadrant is the parent of another quadrant. | |
int | p4est_quadrant_is_ancestor (const p4est_quadrant_t *q, const p4est_quadrant_t *r) |
Test if a quadrant is an ancestor of another quadrant. | |
int | p4est_quadrant_is_ancestor_D (const p4est_quadrant_t *q, const p4est_quadrant_t *r) |
Test if a quadrant is an ancestor of another quadrant. | |
int | p4est_quadrant_is_next (const p4est_quadrant_t *q, const p4est_quadrant_t *r) |
Test if two quadrants follow each other in the tree with no holes. | |
int | p4est_quadrant_is_next_D (const p4est_quadrant_t *q, const p4est_quadrant_t *r) |
Test if two quadrants follow each other in the tree with no holes. | |
int | p4est_quadrant_overlaps_tree (p4est_tree_t *tree, const p4est_quadrant_t *q) |
Test if a quadrant has at least partial overlap with a tree. | |
int | p4est_quadrant_is_inside_tree (p4est_tree_t *tree, const p4est_quadrant_t *q) |
Test if a quadrant is completely contained within a tree. | |
void | p4est_quadrant_ancestor (const p4est_quadrant_t *q, int level, p4est_quadrant_t *r) |
Compute the ancestor of a quadrant at a given level. | |
void | p4est_quadrant_parent (const p4est_quadrant_t *q, p4est_quadrant_t *r) |
Compute the parent of a quadrant. | |
void | p4est_quadrant_sibling (const p4est_quadrant_t *q, p4est_quadrant_t *r, int sibling_id) |
Compute a specific sibling of a quadrant. | |
void | p4est_quadrant_face_neighbor (const p4est_quadrant_t *q, int face, p4est_quadrant_t *r) |
Compute the face neighbor of a quadrant. | |
p4est_topidx_t | p4est_quadrant_face_neighbor_extra (const p4est_quadrant_t *q, p4est_topidx_t t, int face, p4est_quadrant_t *r, int *nface, p4est_connectivity_t *conn) |
Compute the face neighbor of a quadrant, transforming across tree boundaries if necessary. | |
void | p4est_quadrant_half_face_neighbors (const p4est_quadrant_t *q, int face, p4est_quadrant_t n[], p4est_quadrant_t nur[]) |
Get the smaller face neighbors of q. | |
void | p4est_quadrant_all_face_neighbors (const p4est_quadrant_t *q, int face, p4est_quadrant_t n[]) |
Create all possible face neighbors of q. | |
void | p4est_quadrant_corner_neighbor (const p4est_quadrant_t *q, int corner, p4est_quadrant_t *r) |
Compute the corner neighbor of a quadrant. | |
void | p4est_quadrant_corner_neighbor_extra (const p4est_quadrant_t *q, p4est_locidx_t t, int corner, sc_array_t *quads, sc_array_t *treeids, sc_array_t *ncorners, p4est_connectivity_t *conn) |
Compute the corner neighbors of a quadrant, transforming across tree boundaries if necessary. | |
void | p4est_quadrant_half_corner_neighbor (const p4est_quadrant_t *q, int corner, p4est_quadrant_t *r) |
Compute the half size corner neighbor of a quadrant. | |
void | p4est_quadrant_corner_node (const p4est_quadrant_t *q, int corner, p4est_quadrant_t *r) |
Compute the corner node of a quadrant. | |
void | p4est_quadrant_children (const p4est_quadrant_t *q, p4est_quadrant_t *c0, p4est_quadrant_t *c1, p4est_quadrant_t *c2, p4est_quadrant_t *c3) |
Compute the 4 children of a quadrant. | |
void | p4est_quadrant_childrenv (const p4est_quadrant_t *q, p4est_quadrant_t c[]) |
Compute the 4 children of a quadrant, array version. | |
void | p4est_quadrant_childrenpv (const p4est_quadrant_t *q, p4est_quadrant_t *c[]) |
Compute the 4 children of a quadrant, array version. | |
void | p4est_quadrant_first_descendant (const p4est_quadrant_t *q, p4est_quadrant_t *fd, int level) |
Compute the first descendant of a quadrant on a given level. | |
void | p4est_quadrant_last_descendant (const p4est_quadrant_t *q, p4est_quadrant_t *ld, int level) |
Compute the last descendant of a quadrant on a given level. | |
void | p4est_quadrant_corner_descendant (const p4est_quadrant_t *q, p4est_quadrant_t *r, int c, int level) |
Compute the descendant of a quadrant touching a given corner. | |
void | p4est_nearest_common_ancestor (const p4est_quadrant_t *q1, const p4est_quadrant_t *q2, p4est_quadrant_t *r) |
Computes the nearest common ancestor of two quadrants in the same tree. | |
void | p4est_nearest_common_ancestor_D (const p4est_quadrant_t *q1, const p4est_quadrant_t *q2, p4est_quadrant_t *r) |
Computes the nearest common ancestor of two quadrants in the same tree. | |
void | p4est_quadrant_transform_face (const p4est_quadrant_t *q, p4est_quadrant_t *r, const int ftransform[]) |
Transforms a quadrant/node across a face between trees. | |
int | p4est_quadrant_touches_corner (const p4est_quadrant_t *q, int corner, int inside) |
Checks if a quadrant touches a corner (diagonally inside or outside). | |
void | p4est_quadrant_transform_corner (p4est_quadrant_t *q, int icorner, int inside) |
Move a quadrant inside or diagonally outside a corner position. | |
void | p4est_quadrant_shift_corner (const p4est_quadrant_t *q, p4est_quadrant_t *r, int corner) |
Shifts a quadrant until it touches the specified corner from the inside. | |
uint64_t | p4est_quadrant_linear_id (const p4est_quadrant_t *quadrant, int level) |
Computes the linear position of a quadrant in a uniform grid. | |
void | p4est_quadrant_set_morton (p4est_quadrant_t *quadrant, int level, uint64_t id) |
Set quadrant Morton indices based on linear position in uniform grid. |
Routines for manipulating quadrants (neighbors, parents, children, etc.)
void p4est_nearest_common_ancestor | ( | const p4est_quadrant_t * | q1, |
const p4est_quadrant_t * | q2, | ||
p4est_quadrant_t * | r | ||
) |
Computes the nearest common ancestor of two quadrants in the same tree.
[in] | q1 | First input quadrant. |
[in] | q2 | Second input quadrant. |
[in,out] | r | Existing quadrant whose Morton index will be filled. Its user_data will be untouched. |
void p4est_nearest_common_ancestor_D | ( | const p4est_quadrant_t * | q1, |
const p4est_quadrant_t * | q2, | ||
p4est_quadrant_t * | r | ||
) |
Computes the nearest common ancestor of two quadrants in the same tree.
Descriptive, slower version of p4est_nearest_common_ancestor. For debugging and educationial purposes only.
void p4est_node_clamp_inside | ( | const p4est_quadrant_t * | n, |
p4est_quadrant_t * | r | ||
) |
Clamp a node inside the unit tree if it sits on a high border.
[in] | n | Node to be clamped. Must not yet be clamped. |
[out] | r | Existing node overwritten by the clamped result. |
int p4est_node_equal_piggy_fn | ( | const void * | v1, |
const void * | v2, | ||
const void * | u | ||
) |
Test if two nodes are in the same tree and have equal Morton indices.
[in] | v1 | Pointer to a clamped or unclamped node, depending on u. |
[in] | v2 | Pointer to a clamped or unclamped node, depending on u. |
[in] | u | User data, points to an int holding the clamped-flag. |
unsigned p4est_node_hash_piggy_fn | ( | const void * | v, |
const void * | u | ||
) |
Compute hash value of a node based on its tree and Morton index.
[in] | v | Pointer to a clamped or unclamped node, depending on u. |
[in] | u | User data, points to an int holding the clamped-flag. |
void p4est_node_to_quadrant | ( | const p4est_quadrant_t * | n, |
int | level, | ||
p4est_quadrant_t * | q | ||
) |
Find the enclosing quadrant of a given node at a given level.
[in] | n | Clamped node. |
[in] | level | Level of the quadrant to be created. |
[out] | q | Output quadrant, n == q is permitted. |
void p4est_node_unclamp | ( | p4est_quadrant_t * | n | ) |
Move a clamped node out on the border.
[in] | n | Node to be unclamped in-place. |
void p4est_quadrant_all_face_neighbors | ( | const p4est_quadrant_t * | q, |
int | face, | ||
p4est_quadrant_t | n[] | ||
) |
Create all possible face neighbors of q.
Gets the face neighbors, possible assuming the 2-1 constraint. If the larger or smaller quadrants do not exist than they are returned as initialized by P4EST_QUADRANT_INIT.
The order of n[0] through n[3] are given in Morton ordering.
[in] | q | The quadrant whose face neighbors will be constructed. |
[in] | face | The face across which to generate the neighbors. |
[out] | n[0]..n[1] | Filled with the smaller possible face neighbors, which are half of the size if they exist or initialized to P4EST_QUADRANT_INIT. |
[out] | n[2] | Filled with the face neighbor, which is the same size. |
[out] | n[3] | Filled with the face neighbor, which is twice the size if it exists or initialized to P4EST_QUADRANT_INIT. |
void p4est_quadrant_ancestor | ( | const p4est_quadrant_t * | q, |
int | level, | ||
p4est_quadrant_t * | r | ||
) |
Compute the ancestor of a quadrant at a given level.
[in] | q | Input quadrant. |
[in] | level | A smaller level than q. |
[in,out] | r | Existing quadrent whose Morton index will be filled with the ancestor of q at the given level. |
int p4est_quadrant_ancestor_id | ( | const p4est_quadrant_t * | q, |
int | level | ||
) |
Compute the position of the ancestor of this child at level level within its siblings.
int p4est_quadrant_child_id | ( | const p4est_quadrant_t * | q | ) |
Compute the position of this child within its siblings.
void p4est_quadrant_children | ( | const p4est_quadrant_t * | q, |
p4est_quadrant_t * | c0, | ||
p4est_quadrant_t * | c1, | ||
p4est_quadrant_t * | c2, | ||
p4est_quadrant_t * | c3 | ||
) |
Compute the 4 children of a quadrant.
[in] | q | Input quadrant. |
[in,out] | c0 | First computed child. q may point to the same quadrant as c0. |
void p4est_quadrant_childrenpv | ( | const p4est_quadrant_t * | q, |
p4est_quadrant_t * | c[] | ||
) |
Compute the 4 children of a quadrant, array version.
[in] | q | Input quadrant. |
[in,out] | c | Pointers to the 4 computed children in z-order. q may point to the same quadrant as c[0]. |
void p4est_quadrant_childrenv | ( | const p4est_quadrant_t * | q, |
p4est_quadrant_t | c[] | ||
) |
Compute the 4 children of a quadrant, array version.
[in] | q | Input quadrant. |
[in,out] | c | The 4 computed children in z-order. q may point to the same quadrant as c[0]. |
int p4est_quadrant_compare | ( | const void * | v1, |
const void * | v2 | ||
) |
Compare two quadrants in their Morton ordering.
Both quadrants must be valid.
int p4est_quadrant_compare_local_num | ( | const void * | v1, |
const void * | v2 | ||
) |
Compare two quadrants with respect to their local_num in the piggy3 member.
int p4est_quadrant_compare_piggy | ( | const void * | v1, |
const void * | v2 | ||
) |
Compare two quadrants in their Morton ordering and the which_tree member.
Both quadrants must be extended (superset of valid, see below).
int p4est_quadrant_contains_node | ( | const p4est_quadrant_t * | q, |
const p4est_quadrant_t * | n | ||
) |
Decide if a node is completely contained within a quadrant.
[in] | q | Valid quadrant. |
[in] | n | Clamped node. |
void p4est_quadrant_corner_descendant | ( | const p4est_quadrant_t * | q, |
p4est_quadrant_t * | r, | ||
int | c, | ||
int | level | ||
) |
Compute the descendant of a quadrant touching a given corner.
[in] | q | Input quadrant. |
[in,out] | r | Existing quadrant whose Morton index will be filled. Its user_data will be untouched. |
[in] | c | The corner of q that r touches. |
[in] | level | The size of r. |
void p4est_quadrant_corner_neighbor | ( | const p4est_quadrant_t * | q, |
int | corner, | ||
p4est_quadrant_t * | r | ||
) |
Compute the corner neighbor of a quadrant.
[in] | q | Input quadrant, must be valid. |
[in] | corner | The corner across which to generate the neighbor. |
[in,out] | r | Existing quadrant whose Morton index will be filled. |
void p4est_quadrant_corner_neighbor_extra | ( | const p4est_quadrant_t * | q, |
p4est_locidx_t | t, | ||
int | corner, | ||
sc_array_t * | quads, | ||
sc_array_t * | treeids, | ||
sc_array_t * | ncorners, | ||
p4est_connectivity_t * | conn | ||
) |
Compute the corner neighbors of a quadrant, transforming across tree boundaries if necessary.
Only computes neighbors that are not face or edge neighbors.
[in] | q | Input quadrant, must be valid. |
[in] | t | Tree that contains . |
[in] | corner | The corner across which to generate the neighbor. |
[in,out] | quads | An initialized but empty array where the corner neighbors will be placed. |
[in,out] | treeids | An initialized but empty array where the ids of the trees containing the corner neighbors will be placed. |
[in,out] | ncorners | if not NULL, filled with the corners of quads that neighbor . |
[in] | conn | The connectivity structure for the forest. |
void p4est_quadrant_corner_node | ( | const p4est_quadrant_t * | q, |
int | corner, | ||
p4est_quadrant_t * | r | ||
) |
Compute the corner node of a quadrant.
[in] | q | Input quadrant, must be valid. |
[in] | corner | The corner across which to generate the neighbor. |
[in,out] | r | Node that will not be clamped inside. |
int p4est_quadrant_disjoint | ( | const void * | v1, |
const void * | v2 | ||
) |
Compare two quadrants in their Morton ordering, with equivalence if the two quadrants overlap.
int p4est_quadrant_equal_fn | ( | const void * | v1, |
const void * | v2, | ||
const void * | u | ||
) |
Test if two quadrants have equal Morton indices, callback version.
void p4est_quadrant_face_neighbor | ( | const p4est_quadrant_t * | q, |
int | face, | ||
p4est_quadrant_t * | r | ||
) |
Compute the face neighbor of a quadrant.
[in] | q | Input quadrant, must be valid. |
[in] | face | The face across which to generate the neighbor. |
[in,out] | r | Existing quadrant whose Morton index will be filled. |
p4est_topidx_t p4est_quadrant_face_neighbor_extra | ( | const p4est_quadrant_t * | q, |
p4est_topidx_t | t, | ||
int | face, | ||
p4est_quadrant_t * | r, | ||
int * | nface, | ||
p4est_connectivity_t * | conn | ||
) |
Compute the face neighbor of a quadrant, transforming across tree boundaries if necessary.
[in] | q | Input quadrant, must be valid. |
[in] | t | Tree that contains . |
[in] | face | The face across which to generate the neighbor. |
[in,out] | r | Existing quadrant whose Morton index will be filled. By convention, if there is no tree across , has the same Morton index as . |
[in,out] | nface | if not NULL, set to the face of that neighbors . nface is encoded with orientation information in the same manner as the tree_to_face array in the p4est_connectivity_t struct. |
[in] | conn | The connectivity structure for the forest. |
void p4est_quadrant_first_descendant | ( | const p4est_quadrant_t * | q, |
p4est_quadrant_t * | fd, | ||
int | level | ||
) |
Compute the first descendant of a quadrant on a given level.
[in] | q | Input quadrant. |
[out] | fd | First descendant of q on level level. |
[in] | level | Level must be greater equal than q's level. |
void p4est_quadrant_half_corner_neighbor | ( | const p4est_quadrant_t * | q, |
int | corner, | ||
p4est_quadrant_t * | r | ||
) |
Compute the half size corner neighbor of a quadrant.
[in] | q | The quadrant whose corner neighbor will be constructed. |
[in] | corner | The corner across which to generate the neighbor. |
[out] | r | Morton index filled with the half size corner neighbor. |
void p4est_quadrant_half_face_neighbors | ( | const p4est_quadrant_t * | q, |
int | face, | ||
p4est_quadrant_t | n[], | ||
p4est_quadrant_t | nur[] | ||
) |
Get the smaller face neighbors of q.
Gets the smaller face neighbors, which are half of the size assuming the 2-1 constant.
The order of the n[i] is given in the Morton ordering.
[in] | q | The quadrant whose face neighbors will be constructed. |
[in] | face | The face across which to generate the neighbors. |
[out] | n[0]..n[1] | Filled with the four smaller face neighbors. |
[out] | nur[0]..nur[1] | If not NULL, filled with smallest quadrants that fit in the upper right corners of n. |
int p4est_quadrant_is_ancestor | ( | const p4est_quadrant_t * | q, |
const p4est_quadrant_t * | r | ||
) |
Test if a quadrant is an ancestor of another quadrant.
[in] | q | Quadrant to be tested. |
[in] | r | Descendent quadrant. |
int p4est_quadrant_is_ancestor_D | ( | const p4est_quadrant_t * | q, |
const p4est_quadrant_t * | r | ||
) |
Test if a quadrant is an ancestor of another quadrant.
Descriptive, slower version of p4est_quadrant_is_ancestor. Contrary to p4est_quadrant_is_ancestor, it aborts for inter-tree q, r. For debugging and educational purposes only.
int p4est_quadrant_is_equal | ( | const p4est_quadrant_t * | q1, |
const p4est_quadrant_t * | q2 | ||
) |
Test if two quadrants have equal Morton indices.
int p4est_quadrant_is_equal_piggy | ( | const p4est_quadrant_t * | q1, |
const p4est_quadrant_t * | q2 | ||
) |
Test if two quadrants have equal Morton indices and the same tree id.
int p4est_quadrant_is_extended | ( | const p4est_quadrant_t * | q | ) |
Test if a quadrant has valid Morton indices in the 3x3 box around root.
[in] | q | Quadrant to be tested. |
int p4est_quadrant_is_familypv | ( | p4est_quadrant_t * | q[] | ) |
Test if 4 quadrants are siblings in Morton ordering, array version.
[in] | q | Array of 4 pointers to quadrants. |
int p4est_quadrant_is_familyv | ( | const p4est_quadrant_t | q[] | ) |
Test if 4 quadrants are siblings in Morton ordering, array version.
[in] | q | Array of 4 quadrants. |
int p4est_quadrant_is_inside_3x3 | ( | const p4est_quadrant_t * | q | ) |
Test if a quadrant is inside the 3x3 box around the root tree.
[in] | q | Quadrant to be tested. |
int p4est_quadrant_is_inside_root | ( | const p4est_quadrant_t * | q | ) |
Test if a quadrant is inside the unit tree.
[in] | q | Quadrant to be tested. |
int p4est_quadrant_is_next | ( | const p4est_quadrant_t * | q, |
const p4est_quadrant_t * | r | ||
) |
Test if two quadrants follow each other in the tree with no holes.
[in] | q | A quadrant |
[in] | r | Another quadrant |
int p4est_quadrant_is_next_D | ( | const p4est_quadrant_t * | q, |
const p4est_quadrant_t * | r | ||
) |
Test if two quadrants follow each other in the tree with no holes.
Descriptive, slower version of p4est_quadrant_is_next. For debugging and educational purposes only.
int p4est_quadrant_is_node | ( | const p4est_quadrant_t * | q, |
int | inside | ||
) |
Test if a quadrant is used to represent a mesh node.
[in] | q | Quadrant to be tested. |
[in] | inside | If true, boundary nodes must be clamped inside. If false, nodes must align with the quadrant grid. |
int p4est_quadrant_is_outside_corner | ( | const p4est_quadrant_t * | q | ) |
Test if a quadrant is outside a tree corner boundary.
[in] | q | Quadrant to be tested. |
int p4est_quadrant_is_outside_face | ( | const p4est_quadrant_t * | q | ) |
Test if a quadrant is outside a tree face boundary (no corner).
[in] | q | Quadrant to be tested. |
int p4est_quadrant_is_parent | ( | const p4est_quadrant_t * | q, |
const p4est_quadrant_t * | r | ||
) |
Test if a quadrant is the parent of another quadrant.
[in] | q | Quadrant to be tested. |
[in] | r | Possible child quadrant. |
int p4est_quadrant_is_parent_D | ( | const p4est_quadrant_t * | q, |
const p4est_quadrant_t * | r | ||
) |
Test if a quadrant is the parent of another quadrant.
Descriptive, slower version of p4est_quadrant_is_parent. For debugging and educational purposes only.
int p4est_quadrant_is_sibling | ( | const p4est_quadrant_t * | q1, |
const p4est_quadrant_t * | q2 | ||
) |
Test if two quadrants are siblings.
[in] | q1 | First quadrant to be tested. |
[in] | q2 | Second quadrant to be tested. |
int p4est_quadrant_is_sibling_D | ( | const p4est_quadrant_t * | q1, |
const p4est_quadrant_t * | q2 | ||
) |
Test if two quadrants are siblings.
Descriptive, slower version of p4est_quadrant_is_sibling. For debugging and educational purposes only.
int p4est_quadrant_is_valid | ( | const p4est_quadrant_t * | q | ) |
Test if a quadrant has valid Morton indices and is inside the unit tree.
[in] | q | Quadrant to be tested. |
void p4est_quadrant_last_descendant | ( | const p4est_quadrant_t * | q, |
p4est_quadrant_t * | ld, | ||
int | level | ||
) |
Compute the last descendant of a quadrant on a given level.
[in] | q | Input quadrant. |
[out] | ld | Last descendant of q on level level. |
[in] | level | Level must be greater equal than q's level. |
uint64_t p4est_quadrant_linear_id | ( | const p4est_quadrant_t * | quadrant, |
int | level | ||
) |
Computes the linear position of a quadrant in a uniform grid.
[in] | quadrant | Quadrant whose id will be computed. |
int p4est_quadrant_overlaps | ( | const p4est_quadrant_t * | q1, |
const p4est_quadrant_t * | q2 | ||
) |
Test if two quadrants overlap.
void p4est_quadrant_parent | ( | const p4est_quadrant_t * | q, |
p4est_quadrant_t * | r | ||
) |
Compute the parent of a quadrant.
[in] | q | Input quadrant. |
[in,out] | r | Existing quadrant whose Morton index will be filled with the Morton index of the parent of q. Its user_data will be untouched. |
void p4est_quadrant_print | ( | int | log_priority, |
const p4est_quadrant_t * | q | ||
) |
Prints one line with quadrant's x, y and level.
[in] | log_priority | see logpriorities in sc.h for the meanings of numerical priority values |
[in] | q | quadrant to print |
void p4est_quadrant_set_morton | ( | p4est_quadrant_t * | quadrant, |
int | level, | ||
uint64_t | id | ||
) |
Set quadrant Morton indices based on linear position in uniform grid.
[in,out] | quadrant | Quadrant whose Morton indices will be set. |
[in] | id | The linear position of this quadrant on a grid. |
void p4est_quadrant_shift_corner | ( | const p4est_quadrant_t * | q, |
p4est_quadrant_t * | r, | ||
int | corner | ||
) |
Shifts a quadrant until it touches the specified corner from the inside.
[in] | q | Valid input quadrant. |
[in,out] | r | Quadrant whose Morton index will be filled. |
[in] | corner | Corner index. |
void p4est_quadrant_sibling | ( | const p4est_quadrant_t * | q, |
p4est_quadrant_t * | r, | ||
int | sibling_id | ||
) |
Compute a specific sibling of a quadrant.
[in] | q | Input quadrant. |
[in,out] | r | Existing quadrant whose Morton index will be filled with the coordinates of sibling no. sibling_id of q. |
[in] | sibling_id | The id of the sibling computed, 0..3. |
void p4est_quadrant_transform_corner | ( | p4est_quadrant_t * | q, |
int | icorner, | ||
int | inside | ||
) |
Move a quadrant inside or diagonally outside a corner position.
[in,out] | q | This quadrant only requires a valid level. |
[in] | icorner | Number of the corner in 0..3. |
[int] | inside Boolean flag for inside or diagonally outside. |
void p4est_quadrant_transform_face | ( | const p4est_quadrant_t * | q, |
p4est_quadrant_t * | r, | ||
const int | ftransform[] | ||
) |
Transforms a quadrant/node across a face between trees.
[in] | q | Input quadrant/non-clamped node. |
[in,out] | r | Quadrant/node whose Morton index will be filled. |
[in] | ftransform | This array holds 9 integers. [0,2] The coordinate axis sequence of the origin face. [3,5] The coordinate axis sequence of the target face. [6,8] Edge reverse flag for axis 0; face code for 1. [1,4,7] 0 (unused for compatibility with 3D). |