t8  UNKNOWN
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
42 
48 void
49 t8_dline_copy (const t8_dline_t *l, t8_dline_t *dest);
50 
55 int
56 t8_dline_compare (const t8_dline_t *l1, const t8_dline_t *l2);
57 
63 int
64 t8_dline_equal (const t8_dline_t *elem1, const t8_dline_t *elem2);
65 
71 void
72 t8_dline_parent (const t8_dline_t *l, t8_dline_t *parent);
73 
82 void
83 t8_dline_ancestor (const t8_dline_t *t, int level, t8_dline_t *ancestor);
84 
91 void
92 t8_dline_child (const t8_dline_t *l, int childid, t8_dline_t *child);
93 
102 void
103 t8_dline_face_neighbour (const t8_dline_t *l, t8_dline_t *neigh, int face, int *dual_face);
104 
111 void
113 
120 int
121 t8_dline_ancestor_id (const t8_dline_t *l, int level);
122 
132 int
133 t8_dline_face_parent_face (const t8_dline_t *l, int face);
134 
140 int
141 t8_dline_child_id (const t8_dline_t *t);
142 
148 void
150 
155 int
156 t8_dline_is_familypv (const t8_dline_t *f[]);
157 
163 int
164 t8_dline_is_root_boundary (const t8_dline_t *p, int face);
165 
171 int
173 
180 void
182 
189 void
190 t8_dline_successor (const t8_dline_t *l, t8_dline_t *succ, int level);
191 
204 void
205 t8_dline_transform_face (const t8_dline_t *line1, t8_dline_t *line2, int orientation);
206 
215 int
216 t8_dline_extrude_face (const t8_dvertex_t *face, int root_face, t8_dline_t *line);
217 
226 void
227 t8_dline_first_descendant (const t8_dline_t *l, t8_dline_t *s, int level);
228 
237 void
238 t8_dline_last_descendant (const t8_dline_t *l, t8_dline_t *s, int level);
239 
245 void
246 t8_dline_vertex_integer_coords (const t8_dline_t *elem, const int vertex, int coords[]);
247 
255 void
256 t8_dline_vertex_ref_coords (const t8_dline_t *elem, const int vertex, double coordinates[1]);
257 
272 void
273 t8_dline_compute_reference_coords (const t8_dline_t *elem, const double *ref_coords, const size_t num_coords,
274  const size_t skip_coords, double *out_coords);
275 
281 t8_dline_linear_id (const t8_dline_t *elem, int level);
282 
289 int
290 t8_dline_is_valid (const t8_dline_t *l);
291 
295 void
297 
298 T8_EXTERN_C_END ();
299 
300 #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:109
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_compute_reference_coords(const t8_dline_t *elem, const double *ref_coords, const size_t num_coords, const size_t skip_coords, double *out_coords)
Convert points in the reference space of a line element to points in the reference space of the tree ...
Definition: t8_dline_bits.c:349
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:105
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:307
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:375
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:77
void t8_dline_parent(const t8_dline_t *l, t8_dline_t *parent)
Compute the parent of a line.
Definition: t8_dline_bits.c:61
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:316
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:174
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:87
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_vertex_integer_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:325
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:228
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:386
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:250
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:362
int t8_dline_equal(const t8_dline_t *elem1, const t8_dline_t *elem2)
Check if two elements are equal.
Definition: t8_dline_bits.c:55
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:244
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:197
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:182
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:142
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:160
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:262
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:337
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:278
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:125
TODO: document this.
This file defines basic operations on an element in a refinement tree.