t8  UNKNOWN
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
41 
47 void
48 t8_dvertex_copy (const t8_dvertex_t *v, t8_dvertex_t *dest);
49 
54 int
55 t8_dvertex_compare (const t8_dvertex_t *l1, const t8_dvertex_t *l2);
56 
62 int
63 t8_dvertex_equal (const t8_dvertex_t *elem1, const t8_dvertex_t *elem2);
64 
70 void
71 t8_dvertex_parent (const t8_dvertex_t *v, t8_dvertex_t *parent);
72 
79 void
80 t8_dvertex_child (const t8_dvertex_t *v, t8_dvertex_t *child);
81 
88 void
90 
97 int
98 t8_dvertex_ancestor_id (const t8_dvertex_t *v, int level);
99 
105 int
107 
113 void
114 t8_dvertex_sibling (const t8_dvertex_t *v, int sibid, t8_dvertex_t *s);
115 
121 void
123 
128 int
130 
136 int
137 t8_dvertex_is_root_boundary (const t8_dvertex_t *p, int face);
138 
144 int
146 
153 void
155 
166 void
167 t8_dvertex_transform_face (const t8_dvertex_t *vertex1, t8_dvertex_t *vertex2);
168 
177 void
178 t8_dvertex_first_descendant (const t8_dvertex_t *v, t8_dvertex_t *s, int level);
179 
188 void
189 t8_dvertex_last_descendant (const t8_dvertex_t *v, t8_dvertex_t *s, int level);
190 
196 void
197 t8_dvertex_vertex_integer_coords (const t8_dvertex_t *elem, int vertex, int coords[]);
198 
204 void
205 t8_dvertex_vertex_ref_coords (const t8_dvertex_t *elem, int vertex, double coords[]);
206 
217 void
218 t8_dvertex_compute_reference_coords (const t8_dvertex_t *elem, const double *ref_coords, const size_t num_coords,
219  double *out_coords);
220 
226 t8_dvertex_linear_id (const t8_dvertex_t *elem, int level);
227 
234 int
236 
240 void
242 
246 void
248 
249 T8_EXTERN_C_END ();
250 
251 #endif /* T8_DVERTEX_BITS_H */
Definition: t8_dvertex.h:48
uint64_t t8_linearidx_t
A type for storing SFC indices.
Definition: t8.h:109
TODO: document this.
#define T8_DVERTEX_CHILDREN
The number of children that a vertex is refined into.
Definition: t8_dvertex.h:33
void t8_dvertex_compute_reference_coords(const t8_dvertex_t *elem, const double *ref_coords, const size_t num_coords, double *out_coords)
Convert points in the reference space of a vertex element to points in the reference space of the tre...
Definition: t8_dvertex_bits.c:178
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:77
int t8_dvertex_compare(const t8_dvertex_t *l1, const t8_dvertex_t *l2)
Compare two elements.
Definition: t8_dvertex_bits.c:44
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:70
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:197
void t8_dvertex_debug_print(const t8_dvertex_t *v)
Print a vertex.
Definition: t8_dvertex_bits.c:204
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:146
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:122
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:189
int t8_dvertex_equal(const t8_dvertex_t *elem1, const t8_dvertex_t *elem2)
Check if two elements are equal.
Definition: t8_dvertex_bits.c:38
void t8_dvertex_parent(const t8_dvertex_t *v, t8_dvertex_t *parent)
Compute the parent of a vertex.
Definition: t8_dvertex_bits.c:52
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:61
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:108
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:115
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:129
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:84
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:170
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:99
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:139
void t8_dvertex_vertex_integer_coords(const t8_dvertex_t *elem, int vertex, int coords[])
Compute the coordinates of a vertex (always 0).
Definition: t8_dvertex_bits.c:162
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:91
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:154
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:210
This file defines basic operations on an element in a refinement tree.