t8  1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_forest_private.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 
28 /* TODO: begin documenting this file: make doxygen 2>&1 | grep t8_forest_private */
29 
30 #ifndef T8_FOREST_PRIVATE_H
31 #define T8_FOREST_PRIVATE_H
32 
33 #include <t8.h>
34 #include <t8_forest.h>
35 
36 T8_EXTERN_C_BEGIN ();
37 
38 /* TODO: document */
39 
40 /* For each tree in a forest compute its first and last descendant */
41 void t8_forest_compute_desc (t8_forest_t forest);
42 
43 /* Create the elements on this process given a uniform partition
44  * of the coarse mesh. */
45 void t8_forest_populate (t8_forest_t forest);
46 
57  forest,
59  eclass);
60 
67 
78  t8_scheme_cxx_t *scheme);
79 
90 
101 
102 /* Allocate memory for trees and set their values as in from.
103  * For each tree allocate enough element memory to fit the elements of from.
104  * If copy_elements is true, copy the elements of from into the element memory.
105  */
106 void t8_forest_copy_trees (t8_forest_t forest,
107  t8_forest_t from,
108  int copy_elements);
109 
124  t8_locidx_t ltreeid,
125  t8_locidx_t **face_neigh,
126  int8_t **ttf);
127 
137 
145  t8_locidx_t elem_in_tree);
146 
154  t8_locidx_t ltreeid);
155 
171 /* TODO: This finds the owner of the first descendant of element.
172  * We call this in owners_at_face where element is a descendant,
173  * add a flag that is true is element is a descendant, such that the
174  * first desc must not be created */
175 /* TODO: ext version with parameters: lower_bound, upper_bound, is_desc/is_leaf
176  * is it really needed to construct the tree owners? Cant we just use the global
177  * offset array?
178  */
180  t8_gloidx_t gtreeid,
181  t8_element_t *element,
182  t8_eclass_t eclass,
183  sc_array_t
184  *all_owners_of_tree);
185 
200  t8_gloidx_t gtreeid,
201  t8_element_t *element,
202  t8_eclass_t eclass);
203 
225  t8_gloidx_t gtreeid,
226  t8_element_t *element,
227  t8_eclass_t eclass,
228  int lower_bound,
229  int upper_bound,
230  int guess,
231  int element_is_desc);
232 
246  t8_element_t *element,
247  t8_gloidx_t gtreeid,
248  t8_eclass_t eclass,
249  int rank,
250  int element_is_desc);
251 
267  t8_gloidx_t gtreeid,
268  const t8_element_t
269  *element,
270  t8_eclass_t eclass,
271  int face,
272  sc_array_t *owners);
273 
292  t8_gloidx_t gtreeid,
293  const t8_element_t
294  *element,
295  t8_eclass_t eclass,
296  int *lower, int *upper);
297 
315  forest,
317  gtreeid,
318  const
320  *element,
322  eclass, int face,
323  int *lower,
324  int *upper);
325 
344  forest,
346  ltreeid,
347  const t8_element_t
348  *element,
349  int face,
350  sc_array_t
351  *owners);
352 
372  forest,
374  ltreeid,
375  const
377  *element,
378  int face,
379  int *lower,
380  int
381  *upper);
382 
400  ltreeid,
401  const t8_element_t
402  *elem,
404  *neighs[],
406  *neigh_scheme,
407  int face,
408  int num_neighs,
409  int dual_faces[]);
410 
419 
432  t8_gloidx_t gtreeid,
433  const t8_element_t
434  *element,
435  t8_eclass_scheme_c *ts);
436 
437 T8_EXTERN_C_END ();
438 
439 #endif /* !T8_FOREST_PRIVATE_H! */
This structure holds the connectivity data of the coarse mesh.
Definition: t8_cmesh_types.h:83
This structure holds the data of a local tree including the information about face neighbors.
Definition: t8_cmesh_types.h:189
This struct holds virtual functions for a particular element class.
Definition: t8_element_cxx.hxx:47
The t8_element_array_t is an array to store t8_element_t * of a given eclass_scheme implementation.
Definition: t8_containers.h:42
This structure is private to the implementation.
Definition: t8_forest_types.h:69
The scheme holds implementations for one or more element classes.
Definition: t8_element.h:51
The t8 tree datatype.
Definition: t8_forest_types.h:139
This is the administrative header file for t8code.
int64_t t8_gloidx_t
A type for global indexing that holds really big numbers.
Definition: t8.h:105
int32_t t8_locidx_t
A type for processor-local indexing.
Definition: t8.h:94
enum t8_eclass t8_eclass_t
This enumeration contains all possible element classes.
struct t8_element t8_element_t
Opaque structure for a generic element, only used as pointer.
Definition: t8_element.h:42
We define the forest of trees in this file.
int t8_forest_last_tree_shared(t8_forest_t forest)
return nonzero if the last tree of a forest is shared with a bigger process.
Definition: t8_forest_cxx.cxx:1427
int t8_forest_min_nonempty_level(t8_cmesh_t cmesh, t8_scheme_cxx_t *scheme)
Compute the minimum possible uniform refinement level on a cmesh such that no process is empty.
Definition: t8_forest_cxx.cxx:99
void t8_forest_element_owners_at_neigh_face_bounds(t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face, int *lower, int *upper)
Constant time algorithm to find bounds for the owner processes that own descendant of a face neighbor...
Definition: t8_forest_cxx.cxx:2855
void t8_forest_element_owners_at_face_bounds(t8_forest_t forest, t8_gloidx_t gtreeid, const t8_element_t *element, t8_eclass_t eclass, int face, int *lower, int *upper)
Constant time algorithm to compute lower and upper bounds for the owner processes of the face leafs o...
Definition: t8_forest_cxx.cxx:2786
t8_gloidx_t t8_forest_element_half_face_neighbors(t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *elem, t8_element_t *neighs[], t8_eclass_scheme_c *neigh_scheme, int face, int num_neighs, int dual_faces[])
Construct all face neighbors of half size of a given element.
Definition: t8_forest_cxx.cxx:1720
int t8_forest_element_find_owner_ext(t8_forest_t forest, t8_gloidx_t gtreeid, t8_element_t *element, t8_eclass_t eclass, int lower_bound, int upper_bound, int guess, int element_is_desc)
Find the owner process of a given element, if bounds for the owner process are known.
Definition: t8_forest_cxx.cxx:2298
void t8_forest_element_owners_at_face(t8_forest_t forest, t8_gloidx_t gtreeid, const t8_element_t *element, t8_eclass_t eclass, int face, sc_array_t *owners)
Find all owner processes that own descendant of a given element that touch a given face.
Definition: t8_forest_cxx.cxx:2719
void t8_forest_print_all_leaf_neighbors(t8_forest_t forest)
Iterate over all leafs of a forest and for each face compute the face neighbor leafs with t8_forest_l...
Definition: t8_forest_cxx.cxx:2095
t8_element_t * t8_forest_get_tree_element(t8_tree_t tree, t8_locidx_t elem_in_tree)
Return an element of a tree.
Definition: t8_forest_private.c:28
int t8_forest_element_find_owner_old(t8_forest_t forest, t8_gloidx_t gtreeid, t8_element_t *element, t8_eclass_t eclass, sc_array_t *all_owners_of_tree)
Find the owner process of a given element, deprecated version.
Definition: t8_forest_cxx.cxx:2477
int t8_forest_element_find_owner(t8_forest_t forest, t8_gloidx_t gtreeid, t8_element_t *element, t8_eclass_t eclass)
Find the owner process of a given element.
Definition: t8_forest_cxx.cxx:2466
void t8_forest_compute_elements_offset(t8_forest_t forest)
Given a forest whose trees are already filled with elements compute the element offset of each local ...
Definition: t8_forest.c:1421
int t8_forest_first_tree_shared(t8_forest_t forest)
return nonzero if the first tree of a forest is shared with a smaller process.
Definition: t8_forest_cxx.cxx:1421
t8_ctree_t t8_forest_get_coarse_tree_ext(t8_forest_t forest, t8_locidx_t ltreeid, t8_locidx_t **face_neigh, int8_t **ttf)
Given the local id of a tree in a forest, return the coarse tree of the cmesh that corresponds to thi...
Definition: t8_forest.c:1200
void t8_forest_compute_maxlevel(t8_forest_t forest)
Compute the maximum possible refinement level in a forest.
Definition: t8_forest_cxx.cxx:46
void t8_forest_element_owners_bounds(t8_forest_t forest, t8_gloidx_t gtreeid, const t8_element_t *element, t8_eclass_t eclass, int *lower, int *upper)
Constant time algorithm to compute lower and upper bounds for the owner processes of a given element.
Definition: t8_forest_cxx.cxx:2757
int t8_forest_element_check_owner(t8_forest_t forest, t8_element_t *element, t8_gloidx_t gtreeid, t8_eclass_t eclass, int rank, int element_is_desc)
Perform a constant runtime check if a given rank is owner of a given element.
Definition: t8_forest_cxx.cxx:2162
void t8_forest_element_owners_at_neigh_face(t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face, sc_array_t *owners)
Find all owner processes that own descendant of a face neighbor of a given local element that touch t...
Definition: t8_forest_cxx.cxx:2820
t8_element_array_t * t8_forest_get_tree_element_array(t8_forest_t forest, t8_locidx_t ltreeid)
Return the array of elements of a tree.
Definition: t8_forest_private.c:37
t8_eclass_scheme_c * t8_forest_get_eclass_scheme_before_commit(t8_forest_t forest, t8_eclass_t eclass)
Return the eclass scheme of a given element class associated to a forest.
Definition: t8_forest.c:1106
int t8_forest_element_has_leaf_desc(t8_forest_t forest, t8_gloidx_t gtreeid, const t8_element_t *element, t8_eclass_scheme_c *ts)
Compute whether for a given element there exist leaf or ghost leaf elements in the local forest that ...
Definition: t8_forest_cxx.cxx:2895