t8  1.2.0
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 t8_dprism_get_level (const t8_dprism_t *p);
43 
49 void t8_dprism_copy (const t8_dprism_t *p, t8_dprism_t *dest);
50 
55 int t8_dprism_compare (const t8_dprism_t *p1,
56  const t8_dprism_t *p2);
57 
64 void t8_dprism_init_linear_id (t8_dprism_t *p, int level,
65  t8_linearidx_t id);
66 
73 void t8_dprism_successor (const t8_dprism_t *p,
74  t8_dprism_t *succ, int level);
75 
82 void t8_dprism_parent (const t8_dprism_t *p,
83  t8_dprism_t *parent);
84 
94  t8_dprism_t *desc, int level);
100 int t8_dprism_child_id (const t8_dprism_t *p);
101 
107 
115  const t8_dprism_t *p2,
116  t8_dprism_t *r);
117 
122 void t8_dprism_boundary_face (const t8_dprism_t *p, int face,
123  t8_element_t *boundary);
124 
131  int face);
132 
140 
147 void t8_dprism_child (const t8_dprism_t *p, int childid,
148  t8_dprism_t *child);
149 
156 
162  int face);
170 int t8_dprism_face_neighbour (const t8_dprism_t *p, int face,
171  t8_dprism_t *neigh);
172 
181  int face, int corner);
182 
188 void t8_dprism_childrenpv (const t8_dprism_t *p,
189  int length, t8_dprism_t *c[]);
190 
197 int t8_dprism_ancestor_id (t8_dprism_t *p, int level);
198 
210  int face,
211  t8_dprism_t **children,
212  int num_children);
213 
222 int t8_dprism_face_child_face (const t8_dprism_t *elem,
223  int face, int face_child);
224 
234 int t8_dprism_face_parent_face (const t8_dprism_t *prism,
235  int face);
236 
246 int t8_dprism_tree_face (const t8_dprism_t *p, int face);
247 
259  int root_face);
260 
271 void t8_dprism_extrude_face (const t8_element_t *face,
272  t8_element_t *elem,
273  int root_face);
274 
284  t8_dprism_t *s, int level);
285 
295  t8_dprism_t *s, int corner,
296  int level);
297 
304 void t8_dprism_vertex_coords (const t8_dprism_t *elem,
305  int vertex, int coords[3]);
306 
314 void t8_dprism_vertex_ref_coords (const t8_dprism_t *elem,
315  int vertex,
316  double coords[3]);
317 
322 t8_linearidx_t t8_dprism_linear_id (const t8_dprism_t *p, int level);
323 
331 int t8_dprism_is_valid (const t8_dprism_t *p);
332 
337 void t8_dprism_debug_print (const t8_dprism_t *p);
338 
339 T8_EXTERN_C_END ();
340 
341 #endif /* T8_DPRISM_BITS_H */
Definition: t8_dprism.h:67
uint64_t t8_linearidx_t
A type for storing SFC indices.
Definition: t8.h:114
TODO: document this.
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 [0,...
Definition: t8_dprism_bits.c:568
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:506
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:321
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:232
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:255
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:175
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:275
int t8_dprism_is_inside_root(t8_dprism_t *p)
Test if a prism lies inside of the root prism, that is the triangle of level 0, anchor node (0,...
Definition: t8_dprism_bits.c:248
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:636
int t8_dprism_get_level(const t8_dprism_t *p)
Compute the level of a prism.
Definition: t8_dprism_bits.c:38
void t8_dprism_extrude_face(const t8_element_t *face, t8_element_t *elem, 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:411
void t8_dprism_vertex_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:553
void t8_dprism_parent(const t8_dprism_t *p, t8_dprism_t *parent)
Compute the parent of a prism.
Definition: t8_dprism_bits.c:107
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:265
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:285
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
void t8_dprism_debug_print(const t8_dprism_t *p)
Print the coordinates, the level and the type of a prism.
Definition: t8_dprism_bits.c:645
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:526
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:130
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:119
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:310
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:538
int t8_dprism_root_face_to_face(const t8_dprism_t *p, int root_face)
Given a prism and a face of the root prism.
Definition: t8_dprism_bits.c:404
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:45
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:379
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:200
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:370
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:465
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:333
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:395
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:584
void t8_dprism_children_at_face(const t8_dprism_t *p, int face, t8_dprism_t **children, int num_children)
Given a prism and a face of the prism, compute all children of the prism that touch the face.
Definition: t8_dprism_bits.c:349
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