p4est  1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p8est_bits.h
Go to the documentation of this file.
1 /*
2  This file is part of p4est.
3  p4est is a C library to manage a collection (a forest) of multiple
4  connected adaptive quadtrees or octrees in parallel.
5 
6  Copyright (C) 2010 The University of Texas System
7  Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac
8 
9  p4est is free software; you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13 
14  p4est is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with p4est; if not, write to the Free Software Foundation, Inc.,
21  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 */
23 
31 #ifndef P8EST_BITS_H
32 #define P8EST_BITS_H
33 
34 #include <p8est.h>
35 
36 SC_EXTERN_C_BEGIN;
37 
43 void p8est_quadrant_print (int log_priority,
44  const p8est_quadrant_t * q);
45 
50  const p8est_quadrant_t * q2);
51 
57  const p8est_quadrant_t * q2);
58 
64  q1,
65  const p8est_quadrant_t *
66  q2);
67 
74 int p8est_quadrant_compare (const void *v1, const void *v2);
75 
82 int p8est_quadrant_disjoint (const void *v1, const void *v2);
83 
90 int p8est_quadrant_compare_piggy (const void *v1,
91  const void *v2);
92 
98 int p8est_quadrant_compare_local_num (const void *v1,
99  const void *v2);
100 
104 int p8est_quadrant_equal_fn (const void *v1, const void *v2,
105  const void *u);
106 
109 unsigned p8est_quadrant_hash_fn (const void *v, const void *u);
110 
116 int p8est_node_equal_piggy_fn (const void *v1,
117  const void *v2, const void *u);
118 
123 unsigned p8est_node_hash_piggy_fn (const void *v, const void *u);
124 
130  p8est_quadrant_t * r);
131 
136 
143  int level, p8est_quadrant_t * q);
144 
150  const p8est_quadrant_t * n);
151 
157  int level);
158 
163 
169  q);
170 
176 
182  q);
183 
189  q);
190 
199  q, int *edge);
200 
206  q);
207 
215  int inside);
216 
222 
228 
235  const p8est_quadrant_t * q2);
236 
242  const p8est_quadrant_t * q2);
243 
247  const p8est_quadrant_t * q1,
248  const p8est_quadrant_t * q2,
249  const p8est_quadrant_t * q3,
250  const p8est_quadrant_t * q4,
251  const p8est_quadrant_t * q5,
252  const p8est_quadrant_t * q6,
253  const p8est_quadrant_t * q7);
254 
259 
264 
271  const p8est_quadrant_t * r);
272 
278  const p8est_quadrant_t * r);
279 
286  const p8est_quadrant_t * r);
287 
294  const p8est_quadrant_t * r);
295 
303  const p8est_quadrant_t * r);
304 
310  const p8est_quadrant_t * r);
311 
315  const p8est_quadrant_t * q);
316 
320  const p8est_quadrant_t *
321  q);
322 
332  int level, p8est_quadrant_t * r);
333 
343  p8est_quadrant_t * r);
344 
352  p8est_quadrant_t * r,
353  int sibling_id);
354 
362  int face,
363  p8est_quadrant_t * r);
364 
382  * q, p4est_topidx_t t,
383  int face,
384  p8est_quadrant_t * r,
385  int *nface,
387  conn);
388 
403  * q, int face,
404  p8est_quadrant_t n[],
406  nur[]);
407 
426  * q, int face,
427  p8est_quadrant_t n[]);
428 
436  int edge,
437  p8est_quadrant_t * r);
438 
456  * q, p4est_locidx_t t,
457  int edge, sc_array_t *
458  quads, sc_array_t *
459  treeids,
460  sc_array_t * nedges,
462  conn);
463 
471  q, int corner,
472  p8est_quadrant_t * r);
473 
490  q, p4est_locidx_t t,
491  int corner,
492  sc_array_t * quads,
493  sc_array_t *
494  treeids,
495  sc_array_t *
496  ncorners,
498  * conn);
499 
507  p8est_quadrant_t * q,
508  int corner,
510  r);
511 
519  int corner,
520  p8est_quadrant_t * r);
521 
529  p8est_quadrant_t * c0,
530  p8est_quadrant_t * c1,
531  p8est_quadrant_t * c2,
532  p8est_quadrant_t * c3,
533  p8est_quadrant_t * c4,
534  p8est_quadrant_t * c5,
535  p8est_quadrant_t * c6,
536  p8est_quadrant_t * c7);
537 
545  p8est_quadrant_t c[]);
546 
554  p8est_quadrant_t * c[]);
555 
562  q, p8est_quadrant_t * fd,
563  int level);
564 
571  q, p8est_quadrant_t * ld,
572  int level);
573 
582  q, p8est_quadrant_t * r,
583  int c, int level);
584 
594  q1,
595  const p8est_quadrant_t *
596  q2, p8est_quadrant_t * r);
597 
603  q1,
604  const p8est_quadrant_t *
605  q2,
606  p8est_quadrant_t * r);
607 
618  p8est_quadrant_t * r,
619  const int ftransform[]);
620 
624  int edge, int inside);
625 
634  p8est_quadrant_t * r,
635  const p8est_edge_info_t *
636  ei,
637  const
639  et, int inside);
640 
659  p8est_quadrant_t * r,
660  p8est_quadrant_t * rup,
661  p8est_quadrant_t * rdown,
662  int edge);
663 
667  int corner, int inside);
668 
675  int corner, int inside);
676 
683  p8est_quadrant_t * r,
684  int corner);
685 
693  quadrant, int level);
694 
702  int level, uint64_t id);
703 
704 SC_EXTERN_C_END;
705 
706 #endif /* !P8EST_BITS_H */
int p8est_quadrant_is_outside_edge(const p8est_quadrant_t *q)
Test if a quadrant is outside a tree edge boundary (no corner).
void p8est_node_clamp_inside(const p8est_quadrant_t *n, p8est_quadrant_t *r)
Clamp a node inside the unit tree if it sits on a high border.
void p8est_quadrant_corner_neighbor_extra(const p8est_quadrant_t *q, p4est_locidx_t t, int corner, sc_array_t *quads, sc_array_t *treeids, sc_array_t *ncorners, p8est_connectivity_t *conn)
Compute the corner neighbors of a quadrant, transforming across tree boundaries if necessary...
void p8est_quadrant_transform_edge(const p8est_quadrant_t *q, p8est_quadrant_t *r, const p8est_edge_info_t *ei, const p8est_edge_transform_t *et, int inside)
Transforms a quadrant across an edge between trees.
unsigned p8est_quadrant_hash_fn(const void *v, const void *u)
Computes a hash value for a quadrant by the lookup3 method.
void p8est_node_to_quadrant(const p8est_quadrant_t *n, int level, p8est_quadrant_t *q)
Find the enclosing quadrant of a given node at a given level.
void p8est_nearest_common_ancestor_D(const p8est_quadrant_t *q1, const p8est_quadrant_t *q2, p8est_quadrant_t *r)
Computes the nearest common ancestor of two quadrants in the same tree.
int p8est_quadrant_is_node(const p8est_quadrant_t *q, int inside)
Test if a quadrant is used to represent a mesh node.
void p8est_quadrant_transform_corner(p8est_quadrant_t *r, int corner, int inside)
Move a quadrant inside or diagonally outside a corner position.
void p8est_quadrant_print(int log_priority, const p8est_quadrant_t *q)
Prints one line with quadrant's x, y, z and level.
void p8est_node_unclamp(p8est_quadrant_t *n)
Move a clamped node out on the border.
int p8est_quadrant_compare_piggy(const void *v1, const void *v2)
Compare two quadrants in their Morton ordering and the which_tree member.
int p8est_quadrant_disjoint(const void *v1, const void *v2)
Compare two quadrants in their Morton ordering, with equivalence if the two quadrants overlap...
int p8est_quadrant_is_next(const p8est_quadrant_t *q, const p8est_quadrant_t *r)
Test if two quadrants follow each other in the tree with no holes.
Definition: p8est_connectivity.h:206
void p8est_quadrant_children(const p8est_quadrant_t *q, p8est_quadrant_t *c0, p8est_quadrant_t *c1, p8est_quadrant_t *c2, p8est_quadrant_t *c3, p8est_quadrant_t *c4, p8est_quadrant_t *c5, p8est_quadrant_t *c6, p8est_quadrant_t *c7)
Compute the 8 children of a quadrant.
int p8est_quadrant_is_outside_edge_extra(const p8est_quadrant_t *q, int *edge)
Test if a quadrant is outside a tree edge boundary (no corner).
int p8est_quadrant_is_next_D(const p8est_quadrant_t *q, const p8est_quadrant_t *r)
Test if two quadrants follow each other in the tree with no holes.
Definition: p8est_connectivity.h:213
void p8est_quadrant_face_neighbor(const p8est_quadrant_t *q, int face, p8est_quadrant_t *r)
Compute the face neighbor of a quadrant.
void p8est_quadrant_corner_neighbor(const p8est_quadrant_t *q, int corner, p8est_quadrant_t *r)
Compute the corner neighbor of a quadrant.
int p8est_quadrant_is_inside_3x3(const p8est_quadrant_t *q)
Test if a quadrant is inside the 3x3 box around the root tree.
void p8est_quadrant_set_morton(p8est_quadrant_t *quadrant, int level, uint64_t id)
Set quadrant Morton indices based on linear position in uniform grid.
The top-level 3D p8est interface.
int p8est_quadrant_is_familypv(p8est_quadrant_t *q[])
Test if 8 quadrants are siblings in Morton ordering, array version.
int p8est_quadrant_is_outside_face(const p8est_quadrant_t *q)
Test if a quadrant is outside a tree face boundary (no edge or corner).
int p8est_quadrant_is_equal(const p8est_quadrant_t *q1, const p8est_quadrant_t *q2)
Test if two quadrants have equal Morton indices.
int p8est_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.
int p8est_quadrant_is_sibling(const p8est_quadrant_t *q1, const p8est_quadrant_t *q2)
Test if two quadrants are siblings.
void p8est_quadrant_childrenv(const p8est_quadrant_t *q, p8est_quadrant_t c[])
Compute the 8 children of a quadrant, array version.
int p8est_quadrant_is_inside_tree(p8est_tree_t *tree, const p8est_quadrant_t *q)
Test if a quadrant is completely contained within a tree.
int p8est_quadrant_is_family(const p8est_quadrant_t *q0, const p8est_quadrant_t *q1, const p8est_quadrant_t *q2, const p8est_quadrant_t *q3, const p8est_quadrant_t *q4, const p8est_quadrant_t *q5, const p8est_quadrant_t *q6, const p8est_quadrant_t *q7)
Test if 8 quadrants are siblings in Morton ordering.
void p8est_quadrant_ancestor(const p8est_quadrant_t *q, int level, p8est_quadrant_t *r)
Compute the ancestor of a quadrant at a given level.
void p8est_quadrant_corner_descendant(const p8est_quadrant_t *q, p8est_quadrant_t *r, int c, int level)
Compute the descendant of a quadrant touching a given corner.
void p8est_quadrant_edge_neighbor_extra(const p8est_quadrant_t *q, p4est_locidx_t t, int edge, sc_array_t *quads, sc_array_t *treeids, sc_array_t *nedges, p8est_connectivity_t *conn)
Compute the edge neighbors of a quadrant, transforming across tree boundaries if necessary.
void p8est_quadrant_shift_corner(const p8est_quadrant_t *q, p8est_quadrant_t *r, int corner)
Shifts a quadrant until it touches the specified corner from the inside.
int p8est_quadrant_compare_local_num(const void *v1, const void *v2)
Compare two quadrants with respect to their local_num in the piggy3 member.
void p8est_quadrant_sibling(const p8est_quadrant_t *q, p8est_quadrant_t *r, int sibling_id)
Compute a specific sibling of a quadrant.
int p8est_quadrant_is_parent(const p8est_quadrant_t *q, const p8est_quadrant_t *r)
Test if a quadrant is the parent of another quadrant.
void p8est_quadrant_all_face_neighbors(const p8est_quadrant_t *q, int face, p8est_quadrant_t n[])
Create all possible face neighbors of q.
int p8est_quadrant_overlaps_tree(p8est_tree_t *tree, const p8est_quadrant_t *q)
Test if a quadrant has at least partial overlap with a tree.
This structure holds the 3D inter-tree connectivity information.
Definition: p8est_connectivity.h:158
int p8est_quadrant_is_valid(const p8est_quadrant_t *q)
Test if a quadrant has valid Morton indices and is inside the unit tree.
The 3D quadrant (i.e.
Definition: p8est.h:61
int p8est_quadrant_is_outside_corner(const p8est_quadrant_t *q)
Test if a quadrant is outside a tree corner boundary.
int p8est_quadrant_is_extended(const p8est_quadrant_t *q)
Test if a quadrant has valid Morton indices in the 3x3 box around root.
int p8est_quadrant_is_familyv(const p8est_quadrant_t q[])
Test if 8 quadrants are siblings in Morton ordering, array version.
p4est_locidx_t p8est_quadrant_face_neighbor_extra(const p8est_quadrant_t *q, p4est_topidx_t t, int face, p8est_quadrant_t *r, int *nface, p8est_connectivity_t *conn)
Compute the face neighbor of a quadrant, transforming across tree boundaries if necessary.
void p8est_quadrant_transform_face(const p8est_quadrant_t *q, p8est_quadrant_t *r, const int ftransform[])
Transforms a quadrant/node across a face between trees.
int p8est_quadrant_ancestor_id(const p8est_quadrant_t *q, int level)
Compute the position of the ancestor of this child at level level within its siblings.
int p8est_quadrant_is_equal_piggy(const p8est_quadrant_t *q1, const p8est_quadrant_t *q2)
Test if two quadrants have equal Morton indices and the same tree id.
void p8est_quadrant_shift_edge(const p8est_quadrant_t *q, p8est_quadrant_t *r, p8est_quadrant_t *rup, p8est_quadrant_t *rdown, int edge)
Shifts a quadrant until it touches the specified edge from the inside.
The sc_array object provides a large array of equal-size elements.
Definition: sc_containers.h:92
int p8est_quadrant_is_parent_D(const p8est_quadrant_t *q, const p8est_quadrant_t *r)
Test if a quadrant is the parent of another quadrant.
int p8est_quadrant_is_ancestor(const p8est_quadrant_t *q, const p8est_quadrant_t *r)
Test if a quadrant is an ancestor of another quadrant.
int p8est_quadrant_child_id(const p8est_quadrant_t *q)
Compute the position of this child within its siblings.
void p8est_nearest_common_ancestor(const p8est_quadrant_t *q1, const p8est_quadrant_t *q2, p8est_quadrant_t *r)
Computes the nearest common ancestor of two quadrants in the same tree.
int p8est_quadrant_touches_edge(const p8est_quadrant_t *q, int edge, int inside)
Checks if a quadrant touches an edge (diagonally inside or outside).
void p8est_quadrant_parent(const p8est_quadrant_t *q, p8est_quadrant_t *r)
Compute the parent of a quadrant.
void p8est_quadrant_first_descendant(const p8est_quadrant_t *q, p8est_quadrant_t *fd, int level)
Compute the first descendant of a quadrant on a given level.
void p8est_quadrant_half_face_neighbors(const p8est_quadrant_t *q, int face, p8est_quadrant_t n[], p8est_quadrant_t nur[])
Get the smaller face neighbors of q.
int p8est_quadrant_contains_node(const p8est_quadrant_t *q, const p8est_quadrant_t *n)
Decide if a node is completely contained within a quadrant.
int p8est_quadrant_is_sibling_D(const p8est_quadrant_t *q1, const p8est_quadrant_t *q2)
Test if two quadrants are siblings.
int32_t p4est_topidx_t
Typedef for counting topological entities (trees, tree vertices).
Definition: p4est_base.h:63
int32_t p4est_locidx_t
Typedef for processor-local indexing of quadrants and nodes.
Definition: p4est_base.h:74
void p8est_quadrant_last_descendant(const p8est_quadrant_t *q, p8est_quadrant_t *ld, int level)
Compute the last descendant of a quadrant on a given level.
int p8est_quadrant_overlaps(const p8est_quadrant_t *q1, const p8est_quadrant_t *q2)
Test if two quadrants overlap.
unsigned p8est_node_hash_piggy_fn(const void *v, const void *u)
Compute hash value of a node based on its tree and Morton index.
uint64_t p8est_quadrant_linear_id(const p8est_quadrant_t *quadrant, int level)
Computes the linear position of a quadrant in a uniform grid.
The p8est tree datatype.
Definition: p8est.h:104
int p8est_quadrant_is_inside_root(const p8est_quadrant_t *q)
Test if a quadrant is inside the unit tree.
void p8est_quadrant_half_corner_neighbor(const p8est_quadrant_t *q, int corner, p8est_quadrant_t *r)
Compute the half size corner neighbor of a quadrant.
int p8est_quadrant_equal_fn(const void *v1, const void *v2, const void *u)
Test if two quadrants have equal Morton indices, callback version.
void p8est_quadrant_edge_neighbor(const p8est_quadrant_t *q, int edge, p8est_quadrant_t *r)
Compute the edge neighbor of a quadrant.
int p8est_quadrant_compare(const void *v1, const void *v2)
Compare two quadrants in their Morton ordering.
void p8est_quadrant_corner_node(const p8est_quadrant_t *q, int corner, p8est_quadrant_t *r)
Compute the corner node of a quadrant.
void p8est_quadrant_childrenpv(const p8est_quadrant_t *q, p8est_quadrant_t *c[])
Compute the 8 children of a quadrant, array version.
int p8est_quadrant_is_ancestor_D(const p8est_quadrant_t *q, const p8est_quadrant_t *r)
Test if a quadrant is an ancestor of another quadrant.
int p8est_quadrant_touches_corner(const p8est_quadrant_t *q, int corner, int inside)
Checks if a quadrant touches a corner (diagonally inside or outside).