t8  1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_dline_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_DLINE_BITS_H
28 #define T8_DLINE_BITS_H
29 
30 #include <t8_element.h>
33 
34 T8_EXTERN_C_BEGIN ();
35 
40 int t8_dline_get_level (const t8_dline_t *l);
41 
47 void t8_dline_copy (const t8_dline_t *l, t8_dline_t *dest);
48 
53 int t8_dline_compare (const t8_dline_t *l1,
54  const t8_dline_t *l2);
55 
61 void t8_dline_parent (const t8_dline_t *l, t8_dline_t *parent);
62 
71 void t8_dline_ancestor (const t8_dline_t *t, int level,
72  t8_dline_t *ancestor);
73 
80 void t8_dline_child (const t8_dline_t *l, int childid,
81  t8_dline_t *child);
82 
91 void t8_dline_face_neighbour (const t8_dline_t *l,
92  t8_dline_t *neigh, int face,
93  int *dual_face);
94 
102  const t8_dline_t *t2,
103  t8_dline_t *r);
104 
111 int t8_dline_ancestor_id (const t8_dline_t *l, int level);
112 
122 int t8_dline_face_parent_face (const t8_dline_t *l, int face);
123 
129 int t8_dline_child_id (const t8_dline_t *t);
130 
136 void t8_dline_childrenpv (const t8_dline_t *t,
138 
143 int t8_dline_is_familypv (const t8_dline_t *f[]);
144 
150 int t8_dline_is_root_boundary (const t8_dline_t *p, int face);
151 
157 int t8_dline_is_inside_root (const t8_dline_t *l);
158 
165 void t8_dline_init_linear_id (t8_dline_t *l, int level,
166  t8_linearidx_t id);
167 
174 void t8_dline_successor (const t8_dline_t *l,
175  t8_dline_t *succ, int level);
176 
189 void t8_dline_transform_face (const t8_dline_t *line1,
190  t8_dline_t *line2,
191  int orientation);
192 
201 int t8_dline_extrude_face (const t8_dvertex_t *face,
202  int root_face, t8_dline_t *line);
203 
213  t8_dline_t *s, int level);
214 
223 void t8_dline_last_descendant (const t8_dline_t *l,
224  t8_dline_t *s, int level);
225 
231 void t8_dline_vertex_coords (const t8_dline_t *elem,
232  const int vertex, int coords[]);
233 
241 void t8_dline_vertex_ref_coords (const t8_dline_t *elem,
242  const int vertex,
243  double coordinates[1]);
244 
249 t8_linearidx_t t8_dline_linear_id (const t8_dline_t *elem, int level);
250 
257 int t8_dline_is_valid (const t8_dline_t *l);
258 
262 void t8_dline_debug_print (const t8_dline_t *l);
263 
267 void t8_dline_init (t8_dline_t *l);
268 
269 T8_EXTERN_C_END ();
270 
271 #endif /* T8_DLINE_BITS_H */
Definition: t8_dline.h:53
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_DLINE_CHILDREN
The number of children that a line is refined into.
Definition: t8_dline.h:33
void t8_dline_face_neighbour(const t8_dline_t *l, t8_dline_t *neigh, int face, int *dual_face)
Compute the face neighbor of a line.
Definition: t8_dline_bits.c:100
void t8_dline_first_descendant(const t8_dline_t *l, t8_dline_t *s, int level)
Compute the first descendant of a line at a given level.
Definition: t8_dline_bits.c:309
int t8_dline_is_valid(const t8_dline_t *l)
Query whether all entries of a line are in valid ranges.
Definition: t8_dline_bits.c:366
void t8_dline_vertex_coords(const t8_dline_t *elem, const int vertex, int coords[])
Compute the first or second vertex of a line.
Definition: t8_dline_bits.c:327
void t8_dline_ancestor(const t8_dline_t *t, int level, t8_dline_t *ancestor)
Compute the ancestor of a line at a given level.
Definition: t8_dline_bits.c:72
void t8_dline_parent(const t8_dline_t *l, t8_dline_t *parent)
Compute the parent of a line.
Definition: t8_dline_bits.c:56
void t8_dline_last_descendant(const t8_dline_t *l, t8_dline_t *s, int level)
Compute the last descendant of a line at a given level.
Definition: t8_dline_bits.c:318
int t8_dline_child_id(const t8_dline_t *t)
Compute the position of the ancestor of this child at level level within its siblings.
Definition: t8_dline_bits.c:172
void t8_dline_child(const t8_dline_t *l, int childid, t8_dline_t *child)
Compute the childid-th child in Morton order of a line.
Definition: t8_dline_bits.c:82
void t8_dline_copy(const t8_dline_t *l, t8_dline_t *dest)
Copy all values from one line to another.
Definition: t8_dline_bits.c:32
void t8_dline_debug_print(const t8_dline_t *l)
Print a line.
Definition: t8_dline_bits.c:378
int t8_dline_is_familypv(const t8_dline_t *f[])
Check whether a collection of two lines is a family in Morton order.
Definition: t8_dline_bits.c:211
int t8_dline_get_level(const t8_dline_t *l)
Compute the level of a line.
Definition: t8_dline_bits.c:26
int t8_dline_is_root_boundary(const t8_dline_t *p, int face)
Compute whether a given line shares a given face with its root tree.
Definition: t8_dline_bits.c:229
void t8_dline_init(t8_dline_t *l)
Set default values for a line, such that it passes t8_dline_is_valid.
Definition: t8_dline_bits.c:384
void t8_dline_init_linear_id(t8_dline_t *l, int level, t8_linearidx_t id)
Initialize a line as the line with a given global id in a uniform refinement of a given level.
Definition: t8_dline_bits.c:251
t8_linearidx_t t8_dline_linear_id(const t8_dline_t *elem, int level)
Computes the linear position of a line in an uniform grid.
Definition: t8_dline_bits.c:353
int t8_dline_is_inside_root(const t8_dline_t *l)
Test if a line lies inside of the root line, that is the line of level 0, anchor node (0,...
Definition: t8_dline_bits.c:245
int t8_dline_extrude_face(const t8_dvertex_t *face, int root_face, t8_dline_t *line)
Given a vertex at the boundary of a line at a root tree boundary, construct the line from it.
Definition: t8_dline_bits.c:195
void t8_dline_childrenpv(const t8_dline_t *t, t8_dline_t *c[T8_DLINE_CHILDREN])
Compute the 2 children of a line, array version.
Definition: t8_dline_bits.c:180
int t8_dline_compare(const t8_dline_t *l1, const t8_dline_t *l2)
Compare two elements.
Definition: t8_dline_bits.c:38
int t8_dline_ancestor_id(const t8_dline_t *l, int level)
Compute the position of the ancestor of this child at level level within its siblings.
Definition: t8_dline_bits.c:140
int t8_dline_face_parent_face(const t8_dline_t *l, int face)
Given a face of a line return the face number of the parent of the line that matches the line's face.
Definition: t8_dline_bits.c:158
void t8_dline_successor(const t8_dline_t *l, t8_dline_t *succ, int level)
Computes the successor of a line in a uniform grid of level level.
Definition: t8_dline_bits.c:263
void t8_dline_vertex_ref_coords(const t8_dline_t *elem, const int vertex, double coordinates[1])
Compute the coordinates of a vertex of a line when the tree (level 0 line) is embedded in [0,...
Definition: t8_dline_bits.c:340
void t8_dline_transform_face(const t8_dline_t *line1, t8_dline_t *line2, int orientation)
Suppose we have two trees that share a common face f.
Definition: t8_dline_bits.c:279
void t8_dline_nearest_common_ancestor(const t8_dline_t *t1, const t8_dline_t *t2, t8_dline_t *r)
Computes the nearest common ancestor of two lines in the same tree.
Definition: t8_dline_bits.c:121
TODO: document this.
This file defines basic operations on an element in a refinement tree.