t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_dprism_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_DPRISM_BITS_H
28 #define T8_DPRISM_BITS_H
29 
30 #include <t8_element.h>
32 
33 T8_EXTERN_C_BEGIN ();
34 
36 extern int t8_dprism_face_corners[5][4];
37 
42 int
44 
50 void
51 t8_dprism_copy (const t8_dprism_t *p, t8_dprism_t *dest);
52 
57 int
58 t8_dprism_compare (const t8_dprism_t *p1, const t8_dprism_t *p2);
59 
65 int
66 t8_dprism_equal (const t8_dprism_t *elem1, const t8_dprism_t *elem2);
67 
74 void
76 
83 void
84 t8_dprism_successor (const t8_dprism_t *p, t8_dprism_t *succ, int level);
85 
92 void
93 t8_dprism_parent (const t8_dprism_t *p, t8_dprism_t *parent);
94 
103 void
104 t8_dprism_first_descendant (const t8_dprism_t *p, t8_dprism_t *desc, int level);
109 int
111 
116 int
118 
125 void
127 
132 void
133 t8_dprism_boundary_face (const t8_dprism_t *p, int face, t8_element_t *boundary);
134 
140 int
141 t8_dprism_is_root_boundary (const t8_dprism_t *p, int face);
142 
147 int
149 
155 void
156 t8_dprism_child (const t8_dprism_t *p, int childid, t8_dprism_t *child);
157 
164 t8_dprism_face_shape (const t8_dprism_t *p, int face);
165 
170 int
171 t8_dprism_num_face_children (const t8_dprism_t *p, int face);
172 
180 int
181 t8_dprism_face_neighbour (const t8_dprism_t *p, int face, t8_dprism_t *neigh);
182 
189 int
190 t8_dprism_get_face_corner (const t8_dprism_t *p, int face, int corner);
191 
197 void
198 t8_dprism_childrenpv (const t8_dprism_t *p, int length, t8_dprism_t *c[]);
199 
205 int
206 t8_dprism_ancestor_id (t8_dprism_t *p, int level);
207 
215 void
216 t8_dprism_children_at_face (const t8_dprism_t *p, int face, t8_dprism_t **children, int num_children,
217  int *child_indices);
218 
226 int
227 t8_dprism_face_child_face (const t8_dprism_t *elem, int face, int face_child);
228 
236 int
237 t8_dprism_face_parent_face (const t8_dprism_t *prism, int face);
238 
246 int
247 t8_dprism_tree_face (const t8_dprism_t *p, int face);
248 
257 void
258 t8_dprism_extrude_face (const t8_element_t *face, t8_element_t *elem, const int root_face);
259 
267 void
268 t8_dprism_last_descendant (const t8_dprism_t *p, t8_dprism_t *s, int level);
269 
278 void
279 t8_dprism_corner_descendant (const t8_dprism_t *p, t8_dprism_t *s, int corner, int level);
280 
286 void
287 t8_dprism_vertex_integer_coords (const t8_dprism_t *elem, int vertex, int coords[3]);
288 
296 void
297 t8_dprism_vertex_ref_coords (const t8_dprism_t *elem, int vertex, double coords[3]);
298 
308 void
309 t8_dprism_compute_reference_coords (const t8_dprism_t *elem, const double *ref_coords, const size_t num_coords,
310  double *out_coords);
311 
317 t8_dprism_linear_id (const t8_dprism_t *p, int level);
318 
325 int
327 
328 T8_EXTERN_C_END ();
329 
330 #endif /* T8_DPRISM_BITS_H */
Definition: t8_dprism.h:67
uint64_t t8_linearidx_t
A type for storing SFC indices.
Definition: t8.h:109
TODO: document this.
void t8_dprism_extrude_face(const t8_element_t *face, t8_element_t *elem, const int root_face)
Given a boundary face inside a root tree's face construct the element inside the root tree that has t...
Definition: t8_dprism_bits.c:399
void t8_dprism_vertex_ref_coords(const t8_dprism_t *elem, int vertex, double coords[3])
Compute the reference coordinates of a vertex of a prism when the tree (level 0) is embedded in .
Definition: t8_dprism_bits.c:547
void t8_dprism_first_descendant(const t8_dprism_t *p, t8_dprism_t *desc, int level)
Compute the first descendant of a prism at a given level.
Definition: t8_dprism_bits.c:487
void t8_dprism_childrenpv(const t8_dprism_t *p, int length, t8_dprism_t *c[])
Compute the 8 children of a prism, array version.
Definition: t8_dprism_bits.c:315
int t8_dprism_is_root_boundary(const t8_dprism_t *p, int face)
Compute whether a given prism shares a given face with its root tree.
Definition: t8_dprism_bits.c:228
void t8_dprism_child(const t8_dprism_t *p, int childid, t8_dprism_t *child)
Compute the childid-th child in Morton order of a prism.
Definition: t8_dprism_bits.c:250
void t8_dprism_nearest_common_ancestor(const t8_dprism_t *p1, const t8_dprism_t *p2, t8_dprism_t *r)
Computes the nearest common ancestor of two prisms in the same tree.
Definition: t8_dprism_bits.c:173
int t8_dprism_num_face_children(const t8_dprism_t *p, int face)
Compute the number of children at a given face.
Definition: t8_dprism_bits.c:270
int t8_dprism_is_inside_root(t8_dprism_t *p)
Test if a prism lies inside of the root prism, that is the prism of level 0, anchor node (0,...
Definition: t8_dprism_bits.c:244
int t8_dprism_is_valid(const t8_dprism_t *p)
Query whether all entries of a prism are in valid ranges.
Definition: t8_dprism_bits.c:623
int t8_dprism_get_level(const t8_dprism_t *p)
Compute the level of a prism.
Definition: t8_dprism_bits.c:32
void t8_dprism_parent(const t8_dprism_t *p, t8_dprism_t *parent)
Compute the parent of a prism.
Definition: t8_dprism_bits.c:105
t8_element_shape_t t8_dprism_face_shape(const t8_dprism_t *p, int face)
Return the shape of a face.
Definition: t8_dprism_bits.c:260
int t8_dprism_face_neighbour(const t8_dprism_t *p, int face, t8_dprism_t *neigh)
Compute the face neighbor of a prism.
Definition: t8_dprism_bits.c:279
void t8_dprism_init_linear_id(t8_dprism_t *p, int level, t8_linearidx_t id)
Initialize a prism as the prism with a given global id in a uniform refinement of a given level.
Definition: t8_dprism_bits.c:75
int t8_dprism_equal(const t8_dprism_t *elem1, const t8_dprism_t *elem2)
Check if two elements are equal.
Definition: t8_dprism_bits.c:47
void t8_dprism_compute_reference_coords(const t8_dprism_t *elem, const double *ref_coords, const size_t num_coords, double *out_coords)
Convert points in the reference space of a prism element to points in the reference space of the tree...
Definition: t8_dprism_bits.c:563
void t8_dprism_last_descendant(const t8_dprism_t *p, t8_dprism_t *s, int level)
Compute the last descendant of a prism at a given level.
Definition: t8_dprism_bits.c:507
int t8_dprism_is_familypv(t8_dprism_t **fam)
Check whether a collection of eight prism is a family in Morton order.
Definition: t8_dprism_bits.c:128
int t8_dprism_child_id(const t8_dprism_t *p)
Compute the position of the ancestor of this child at level level within its siblings.
Definition: t8_dprism_bits.c:117
int t8_dprism_face_corners[5][4]
Look-up table for the corners of each face.
Definition: t8_dprism_bits.c:29
int t8_dprism_get_face_corner(const t8_dprism_t *p, int face, int corner)
Return the corner number of a prism corresponding to a given face corner.
Definition: t8_dprism_bits.c:304
void t8_dprism_corner_descendant(const t8_dprism_t *p, t8_dprism_t *s, int corner, int level)
Compute the descendant of a prism in a given corner.
Definition: t8_dprism_bits.c:519
void t8_dprism_copy(const t8_dprism_t *p, t8_dprism_t *dest)
Copy all values from one prism to another.
Definition: t8_dprism_bits.c:39
int t8_dprism_face_parent_face(const t8_dprism_t *prism, int face)
Given a face of a prism return the face number of the parent of the prism that matches the prism's fa...
Definition: t8_dprism_bits.c:374
void t8_dprism_boundary_face(const t8_dprism_t *p, int face, t8_element_t *boundary)
Constructs the boundary element of a prism at a given face.
Definition: t8_dprism_bits.c:197
int t8_dprism_face_child_face(const t8_dprism_t *elem, int face, int face_child)
Given a face of a prism and a child number of a child of that face, return the face number of the chi...
Definition: t8_dprism_bits.c:365
void t8_dprism_children_at_face(const t8_dprism_t *p, int face, t8_dprism_t **children, int num_children, int *child_indices)
Given a prism and a face of the prism, compute all children of the prism that touch the face.
Definition: t8_dprism_bits.c:334
void t8_dprism_successor(const t8_dprism_t *p, t8_dprism_t *succ, int level)
Computes the successor of a prism in a uniform grid of level level.
Definition: t8_dprism_bits.c:452
int t8_dprism_compare(const t8_dprism_t *p1, const t8_dprism_t *p2)
Compare two elements.
Definition: t8_dprism_bits.c:53
int t8_dprism_ancestor_id(t8_dprism_t *p, int level)
Compute the position of the ancestor of this child at level level within its siblings.
Definition: t8_dprism_bits.c:326
void t8_dprism_vertex_integer_coords(const t8_dprism_t *elem, int vertex, int coords[3])
Compute the coordinates of a vertex of a prism.
Definition: t8_dprism_bits.c:533
int t8_dprism_tree_face(const t8_dprism_t *p, int face)
Given a prism and a face of this prism.
Definition: t8_dprism_bits.c:390
t8_linearidx_t t8_dprism_linear_id(const t8_dprism_t *p, int level)
Computes the linear position of a prism in an uniform grid.
Definition: t8_dprism_bits.c:575
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