t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_dpyramid_bits.h
Go to the documentation of this file.
1 /*
2  This file is part of t8code.
3  t8code is a C library to manage a collection (a forest) of multiple
4  connected adaptive space-trees of general element classes in parallel.
5 
6  Copyright (C) 2015 the developers
7 
8  t8code is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  t8code is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with t8code; if not, write to the Free Software Foundation, Inc.,
20  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 */
22 
27 #ifndef T8_DPYRAMID_BITS_H
28 #define T8_DPYRAMID_BITS_H
29 
30 #include "t8_element.h"
31 #include "t8_dpyramid.h"
32 
33 T8_EXTERN_C_BEGIN ();
34 
41 void
43 
48 int
50 
55 void
56 t8_dpyramid_copy (const t8_dpyramid_t *source, t8_dpyramid_t *dest);
57 
64 t8_dpyramid_linear_id (const t8_dpyramid_t *p, const int level);
65 
72 void
73 t8_dpyramid_child (const t8_dpyramid_t *elem, const int child_id, t8_dpyramid_t *child);
74 
79 void
81 
89 void
90 t8_dpyramid_children_at_face (const t8_dpyramid_t *p, const int face, t8_dpyramid_t *children[], const int num_children,
91  int *child_indices);
92 
100 int
101 t8_dpyramid_face_child_face (const t8_dpyramid_t *p, const int face, const int face_child);
102 
109 t8_dpyramid_face_shape (const t8_dpyramid_t *pyra, int face);
110 
117 int
118 t8_dpyramid_get_face_corner (const t8_dpyramid_t *pyra, int face, int corner);
119 
124 void
125 t8_dpyramid_boundary_face (const t8_dpyramid_t *p, const int face, t8_element_t *boundary);
126 
135 int
136 t8_dpyramid_extrude_face (const t8_element_t *face, t8_dpyramid_t *p, const int root_face);
137 
144 int
145 t8_dpyramid_compare (const t8_dpyramid_t *p1, const t8_dpyramid_t *p2);
146 
152 int
153 t8_dpyramid_equal (const t8_dpyramid_t *elem1, const t8_dpyramid_t *elem2);
154 
159 int
161 
167 int
168 t8_dpyramid_is_root_boundary (const t8_dpyramid_t *p, const int face);
169 
177 int
178 t8_dpyramid_face_neighbor_inside (const t8_dpyramid_t *p, t8_dpyramid_t *neigh, const int face, int *neigh_face);
179 
184 int
186 
190 int
192 
198 int
199 t8_dpyramid_tet_boundary (const t8_dpyramid_t *p, const int face);
200 
207 int
208 t8_dpyramid_tree_face (const t8_dpyramid_t *p, const int face);
209 
218 void
219 t8_dpyramid_first_descendant (const t8_dpyramid_t *p, t8_dpyramid_t *desc, const int level);
220 
228 void
229 t8_dpyramid_first_descendant_face (const t8_dpyramid_t *p, const int face, t8_dpyramid_t *first_desc, const int level);
230 
238 void
239 t8_dpyramid_last_descendant (const t8_dpyramid_t *p, t8_dpyramid_t *desc, int level);
240 
247 void
248 t8_dpyramid_last_descendant_face (const t8_dpyramid_t *p, const int face, t8_dpyramid_t *last_desc, const int level);
249 
255 void
256 t8_dpyramid_compute_integer_coords (const t8_dpyramid_t *elem, const int vertex, int coords[]);
257 
262 void
264 
270 int
272 
277 int
279 
284 int
286 
291 int
293 
297 int
299 
305 int
306 t8_dpyramid_face_parent_face (const t8_dpyramid_t *elem, const int face);
307 
312 int
313 t8_dpyramid_ancestor_id (const t8_dpyramid_t *p, const int level);
314 
321 void
322 t8_dpyramid_ancestor (const t8_dpyramid_t *pyra, const int level, t8_dpyramid_t *ancestor);
323 
330 int
331 t8_dpyramid_type_at_level (const t8_dpyramid_t *p, const int level);
332 
339 
345 void
346 t8_dpyramid_successor (const t8_dpyramid_t *elem, t8_dpyramid_t *s, const int level);
347 
353 void
354 t8_dpyramid_vertex_reference_coords (const t8_dpyramid_t *elem, const int vertex, double coords[]);
355 
366 void
367 t8_dpyramid_compute_reference_coords (const t8_dpyramid_t *elem, const double *ref_coords, const size_t num_coords,
368  double *out_coords);
369 
377 void
379 
386 int
388 
389 T8_EXTERN_C_END ();
390 
391 #endif /* T8_DPYRAMID_BITS_H */
This data type stores a pyramid.
Definition: t8_dpyramid.h:65
uint64_t t8_linearidx_t
A type for storing SFC indices.
Definition: t8.h:109
TODO: document this.
t8_element_shape_t t8_dpyramid_shape(const t8_dpyramid_t *p)
Returns the shape of the pyramid (pyramid or tetrahedron)
Definition: t8_dpyramid_bits.c:1445
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.
Definition: t8_dpyramid_bits.c:257
void t8_dpyramid_ancestor(const t8_dpyramid_t *pyra, const int level, t8_dpyramid_t *ancestor)
Compute the ancestor of pyra at a given level.
Definition: t8_dpyramid_bits.c:1607
int t8_dpyramid_equal(const t8_dpyramid_t *elem1, const t8_dpyramid_t *elem2)
Check if two elements are equal.
Definition: t8_dpyramid_bits.c:387
void t8_dpyramid_parent(const t8_dpyramid_t *p, t8_dpyramid_t *parent)
Compute the parent of a given pyramid.
Definition: t8_dpyramid_bits.c:1408
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.
Definition: t8_dpyramid_bits.c:332
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.
Definition: t8_dpyramid_bits.c:850
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.
Definition: t8_dpyramid_bits.c:819
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 embedd...
Definition: t8_dpyramid_bits.c:1549
int t8_dpyramid_num_siblings(const t8_dpyramid_t *p)
Compute the number of siblings of p.
Definition: t8_dpyramid_bits.c:1095
int t8_dpyramid_is_valid(const t8_dpyramid_t *p)
Query whether all entries of a pyramid are in valid ranges.
Definition: t8_dpyramid_bits.c:1755
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 eleme...
Definition: t8_dpyramid_bits.c:708
int t8_dpyramid_num_faces(const t8_dpyramid_t *p)
Return the number of faces of p.
Definition: t8_dpyramid_bits.c:1108
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 insid...
Definition: t8_dpyramid_bits.c:905
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 c...
Definition: t8_dpyramid_bits.c:1364
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 t...
Definition: t8_dpyramid_bits.c:1195
void t8_dpyramid_compute_integer_coords(const t8_dpyramid_t *elem, const int vertex, int coords[])
Compute the coordinates of a vertex of a pyramid.
Definition: t8_dpyramid_bits.c:1503
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.
Definition: t8_dpyramid_bits.c:919
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.
Definition: t8_dpyramid_bits.c:463
int t8_dpyramid_num_children(const t8_dpyramid_t *p)
Compute the number of children of p.
Definition: t8_dpyramid_bits.c:1083
int t8_dpyramid_compare(const t8_dpyramid_t *p1, const t8_dpyramid_t *p2)
Compare two elements.
Definition: t8_dpyramid_bits.c:394
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.
Definition: t8_dpyramid_bits.c:1009
int t8_dpyramid_max_num_faces(const t8_dpyramid_t *p)
Return the maximal number of faces of an element p.
Definition: t8_dpyramid_bits.c:1120
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.
Definition: t8_dpyramid_bits.c:1379
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.
Definition: t8_dpyramid_bits.c:1034
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 f...
Definition: t8_dpyramid_bits.c:1394
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.
Definition: t8_dpyramid_bits.c:1633
void t8_dpyramid_children(const t8_dpyramid_t *p, t8_dpyramid_t **c)
Compute the children of a pyramid, array version.
Definition: t8_dpyramid_bits.c:1314
int t8_dpyramid_is_family(t8_dpyramid_t **fam)
Check whether a collection of 10 pyramids is a family in Morton order.
Definition: t8_dpyramid_bits.c:266
int t8_dpyramid_type_at_level(const t8_dpyramid_t *p, const int level)
Compute the type of a pyramid at a given level.
Definition: t8_dpyramid_bits.c:516
void t8_dpyramid_copy(const t8_dpyramid_t *source, t8_dpyramid_t *dest)
Copy the data from source to dest.
Definition: t8_dpyramid_bits.c:377
int t8_dpyramid_num_corners(const t8_dpyramid_t *p)
Compute the number of corners of a pyramid.
Definition: t8_dpyramid_bits.c:1071
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.
Definition: t8_dpyramid_bits.c:970
void t8_dpyramid_compute_reference_coords(const t8_dpyramid_t *elem, const double *ref_coords, const size_t num_coords, double *out_coords)
Convert points in the reference space of a pyramid element to points in the reference space of the tr...
Definition: t8_dpyramid_bits.c:1561
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.
Definition: t8_dpyramid_bits.c:1489
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.
Definition: t8_dpyramid_bits.c:1262
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.
Definition: t8_dpyramid_bits.c:1132
int t8_dpyramid_is_inside_root(const t8_dpyramid_t *p)
Returns zero if p is not inside root, 1 ow.
Definition: t8_dpyramid_bits.c:880
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.
Definition: t8_dpyramid_bits.c:544
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.
Definition: t8_dpyramid_bits.c:1324
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.
Definition: t8_dpyramid_bits.c:1283
int t8_dpyramid_get_level(const t8_dpyramid_t *p)
Compute the level of a pyramid.
Definition: t8_dpyramid_bits.c:421
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
t8_eclass_t t8_element_shape_t
Type definition for the geometric shape of an element.
Definition: t8_element_shape.h:38