t8  1.2.0
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 
42  const int level,
43  t8_linearidx_t id);
44 
50 
55 void t8_dpyramid_copy (const t8_dpyramid_t *source,
56  t8_dpyramid_t *dest);
57 
64  const int level);
65 
72 void t8_dpyramid_child (const t8_dpyramid_t *elem,
73  const int child_id,
74  t8_dpyramid_t *child);
75 
80 void t8_dpyramid_children (const t8_dpyramid_t *p,
81  t8_dpyramid_t **c);
82 
91  const int face,
92  t8_dpyramid_t *children[],
93  const int num_children,
94  int *child_indices);
95 
104  const int face,
105  const int face_child);
106 
113  int face);
114 
122  int face, int corner);
123 
129  const int face,
130  t8_element_t *boundary);
131 
144 int t8_dpyramid_extrude_face (const t8_element_t *face,
145  t8_dpyramid_t *p,
146  const int root_face);
147 
155 int t8_dpyramid_compare (const t8_dpyramid_t *p1,
156  const t8_dpyramid_t *p2);
157 
163 
170  const int face);
171 
180  t8_dpyramid_t *neigh,
181  const int face,
182  int *neigh_face);
183 
189 int t8_dpyramid_child_id (const t8_dpyramid_t *p);
190 
195 
202  const int face);
203 
211  const int face);
212 
222  t8_dpyramid_t *desc,
223  const int level);
224 
233  const int face,
235  *first_desc,
236  const int level);
237 
247  t8_dpyramid_t *desc,
248  int level);
249 
258  const int face,
260  *last_desc,
261  const int level);
262 
270  const int vertex,
271  int coords[]);
272 
277 void t8_dpyramid_parent (const t8_dpyramid_t *p,
278  t8_dpyramid_t *parent);
279 
287 
293 
299 
304 int t8_dpyramid_num_faces (const t8_dpyramid_t *p);
305 
310 
318  const int face);
319 
325  const int level);
326 
334 void t8_dpyramid_ancestor (const t8_dpyramid_t *pyra,
335  const int level,
336  t8_dpyramid_t *anc);
337 
346  const int level);
347 
353 
360 void t8_dpyramid_successor (const t8_dpyramid_t *elem,
361  t8_dpyramid_t *s, const int level);
362 
371  *elem,
372  const int vertex,
373  double coords[]);
374 
383  *pyra1,
384  const t8_dpyramid_t
385  *pyra2,
386  t8_dpyramid_t *nca);
387 
395 int t8_dpyramid_is_valid (const t8_dpyramid_t *p);
396 
402 void t8_dpyramid_debug_print (const t8_dpyramid_t *p);
403 
404 T8_EXTERN_C_END ();
405 
406 #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:114
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:1623
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:294
void t8_dpyramid_compute_coords(const t8_dpyramid_t *p, const int vertex, int coords[])
Compute the coordinates of a vertex of a pyramid.
Definition: t8_dpyramid_bits.c:1686
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:1583
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:395
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:956
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:922
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:1727
int t8_dpyramid_num_siblings(const t8_dpyramid_t *p)
Compute the number of siblings of p.
Definition: t8_dpyramid_bits.c:1230
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:1930
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:804
void t8_dpyramid_debug_print(const t8_dpyramid_t *p)
Print the coordinates, the level and the type of a pyramid.
Definition: t8_dpyramid_bits.c:1972
int t8_dpyramid_num_faces(const t8_dpyramid_t *p)
Return the number of faces of p.
Definition: t8_dpyramid_bits.c:1245
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:1019
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:1535
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:1339
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:1036
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:532
int t8_dpyramid_num_children(const t8_dpyramid_t *p)
Compute the number of children of p.
Definition: t8_dpyramid_bits.c:1217
int t8_dpyramid_compare(const t8_dpyramid_t *p1, const t8_dpyramid_t *p2)
Compare two elements.
Definition: t8_dpyramid_bits.c:456
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:1135
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:1258
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:1554
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:1162
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:1569
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:1774
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:1477
int t8_dpyramid_is_family(t8_dpyramid_t **fam)
Check wether a collection of 10 pyramids is a family in Morton order.
Definition: t8_dpyramid_bits.c:304
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:596
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:446
int t8_dpyramid_num_corners(const t8_dpyramid_t *p)
Compute the number of corners of a pyramid.
Definition: t8_dpyramid_bits.c:1204
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:1093
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:1670
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:1416
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.
Definition: t8_dpyramid_bits.c:1747
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:1271
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:989
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:625
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:1488
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:1441
int t8_dpyramid_get_level(const t8_dpyramid_t *p)
Compute the level of a pyramid.
Definition: t8_dpyramid_bits.c:485
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