t8  1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_dvertex_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_DVERTEX_BITS_H
28 #define T8_DVERTEX_BITS_H
29 
30 #include <t8_element.h>
32 
33 T8_EXTERN_C_BEGIN ();
34 
39 int t8_dvertex_get_level (const t8_dvertex_t *v);
40 
46 void t8_dvertex_copy (const t8_dvertex_t *v,
47  t8_dvertex_t *dest);
48 
53 int t8_dvertex_compare (const t8_dvertex_t *l1,
54  const t8_dvertex_t *l2);
55 
61 void t8_dvertex_parent (const t8_dvertex_t *v,
62  t8_dvertex_t *parent);
63 
70 void t8_dvertex_child (const t8_dvertex_t *v,
71  t8_dvertex_t *child);
72 
80  *t1,
81  const t8_dvertex_t
82  *t2, t8_dvertex_t *r);
83 
90 int t8_dvertex_ancestor_id (const t8_dvertex_t *v, int level);
91 
97 int t8_dvertex_child_id (const t8_dvertex_t *t);
98 
104 void t8_dvertex_sibling (const t8_dvertex_t *v, int sibid,
105  t8_dvertex_t *s);
106 
112 void t8_dvertex_childrenpv (const t8_dvertex_t *t,
114  *c[T8_DVERTEX_CHILDREN]);
115 
120 int t8_dvertex_is_familypv (const t8_dvertex_t *f[]);
121 
128  int face);
129 
136 
143 void t8_dvertex_init_linear_id (t8_dvertex_t *v, int level,
144  t8_linearidx_t id);
145 
156 void t8_dvertex_transform_face (const t8_dvertex_t *vertex1,
157  t8_dvertex_t *vertex2);
158 
168  t8_dvertex_t *s, int level);
169 
179  t8_dvertex_t *s, int level);
180 
186 void t8_dvertex_vertex_coords (const t8_dvertex_t *elem,
187  int vertex, int coords[]);
188 
195  int vertex,
196  double coords[]);
197 
203  int level);
204 
211 int t8_dvertex_is_valid (const t8_dvertex_t *v);
212 
216 void t8_dvertex_debug_print (const t8_dvertex_t *v);
217 
221 void t8_dvertex_init (t8_dvertex_t *v);
222 
223 T8_EXTERN_C_END ();
224 
225 #endif /* T8_DVERTEX_BITS_H */
Definition: t8_dvertex.h:48
uint64_t t8_linearidx_t
A type for storing SFC indices.
Definition: t8.h:114
TODO: document this.
#define T8_DVERTEX_CHILDREN
The number of children that a vertex is refined into.
Definition: t8_dvertex.h:33
int t8_dvertex_ancestor_id(const t8_dvertex_t *v, int level)
Compute the position of the ancestor of this child at level level within its siblings.
Definition: t8_dvertex_bits.c:72
int t8_dvertex_compare(const t8_dvertex_t *l1, const t8_dvertex_t *l2)
Compare two elements.
Definition: t8_dvertex_bits.c:38
void t8_dvertex_nearest_common_ancestor(const t8_dvertex_t *t1, const t8_dvertex_t *t2, t8_dvertex_t *r)
Computes the nearest common ancestor of two vertexs in the same tree.
Definition: t8_dvertex_bits.c:64
int t8_dvertex_is_valid(const t8_dvertex_t *v)
Query whether all entries of a vertex are in valid ranges.
Definition: t8_dvertex_bits.c:185
void t8_dvertex_debug_print(const t8_dvertex_t *v)
Print a vertex.
Definition: t8_dvertex_bits.c:192
void t8_dvertex_first_descendant(const t8_dvertex_t *v, t8_dvertex_t *s, int level)
Compute the first descendant of a vertex at a given level.
Definition: t8_dvertex_bits.c:142
int t8_dvertex_is_inside_root(const t8_dvertex_t *v)
Test if a vertex lies inside of the root vertex, that is the vertex of level 0, anchor node (0,...
Definition: t8_dvertex_bits.c:118
int t8_dvertex_get_level(const t8_dvertex_t *v)
Compute the level of a vertex.
Definition: t8_dvertex_bits.c:26
t8_linearidx_t t8_dvertex_linear_id(const t8_dvertex_t *elem, int level)
Computes the linear position of a vertex in an uniform grid.
Definition: t8_dvertex_bits.c:177
void t8_dvertex_parent(const t8_dvertex_t *v, t8_dvertex_t *parent)
Compute the parent of a vertex.
Definition: t8_dvertex_bits.c:46
void t8_dvertex_child(const t8_dvertex_t *v, t8_dvertex_t *child)
Compute the childid-th child in Morton order of a vertex.
Definition: t8_dvertex_bits.c:55
int t8_dvertex_is_familypv(const t8_dvertex_t *f[])
Check whether a collection of two vertexs is a family in Morton order.
Definition: t8_dvertex_bits.c:104
int t8_dvertex_is_root_boundary(const t8_dvertex_t *p, int face)
Compute whether a given vertex shares a given face with its root tree.
Definition: t8_dvertex_bits.c:111
void t8_dvertex_vertex_coords(const t8_dvertex_t *elem, int vertex, int coords[])
Compute the coordinates of a vertex (always 0).
Definition: t8_dvertex_bits.c:159
void t8_dvertex_init_linear_id(t8_dvertex_t *v, int level, t8_linearidx_t id)
Initialize a vertex as the vertex with a given global id in a uniform refinement of a given level.
Definition: t8_dvertex_bits.c:125
int t8_dvertex_child_id(const t8_dvertex_t *t)
Compute the position of the ancestor of this child at level level within its siblings.
Definition: t8_dvertex_bits.c:79
void t8_dvertex_copy(const t8_dvertex_t *v, t8_dvertex_t *dest)
Copy all values from one vertex to another.
Definition: t8_dvertex_bits.c:32
void t8_dvertex_vertex_ref_coords(const t8_dvertex_t *elem, int vertex, double coords[])
Compute the coordinates of a vertex (always 0) inside the [0,1]^0 reference space.
Definition: t8_dvertex_bits.c:168
void t8_dvertex_childrenpv(const t8_dvertex_t *t, t8_dvertex_t *c[T8_DVERTEX_CHILDREN])
Compute the 2 children of a vertex, array version.
Definition: t8_dvertex_bits.c:94
void t8_dvertex_transform_face(const t8_dvertex_t *vertex1, t8_dvertex_t *vertex2)
Suppose we have two trees that share a common vertex face f.
Definition: t8_dvertex_bits.c:135
void t8_dvertex_sibling(const t8_dvertex_t *v, int sibid, t8_dvertex_t *s)
Compute the sibling of a vertex.
Definition: t8_dvertex_bits.c:86
void t8_dvertex_last_descendant(const t8_dvertex_t *v, t8_dvertex_t *s, int level)
Compute the last descendant of a vertex at a given level.
Definition: t8_dvertex_bits.c:151
void t8_dvertex_init(t8_dvertex_t *v)
Set default values for a vertex, such that it passes t8_dvertex_is_valid.
Definition: t8_dvertex_bits.c:198
This file defines basic operations on an element in a refinement tree.