t8  UNKNOWN
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>
35 
36 T8_EXTERN_C_BEGIN ();
37 
38 /* TODO: document */
39 
58 int
59 t8_forest_is_incomplete_family (const t8_forest_t forest, const t8_locidx_t ltree_id, const t8_locidx_t el_considered,
60  t8_eclass_scheme_c *tscheme, t8_element_t **elements, const int elements_size);
61 
62 /* For each tree in a forest compute its first and last descendant */
63 void
64 t8_forest_compute_desc (t8_forest_t forest);
65 
66 /* Create the elements on this process given a uniform partition
67  * of the coarse mesh. */
68 void
69 t8_forest_populate (t8_forest_t forest);
70 
82 
88 void
90 
100 int
102 
112 int
114 
124 int
126 
127 /* Allocate memory for trees and set their values as in from.
128  * For each tree allocate enough element memory to fit the elements of from.
129  * If copy_elements is true, copy the elements of from into the element memory.
130  * Do not copy the first and last desc for each tree, as this is done outside in commit
131  */
132 void
133 t8_forest_copy_trees (t8_forest_t forest, t8_forest_t from, int copy_elements);
134 
149 t8_forest_get_coarse_tree_ext (t8_forest_t forest, t8_locidx_t ltreeid, t8_locidx_t **face_neigh, int8_t **ttf);
150 
159 void
161 
168 t8_element_t *
170 
179 
195 /* TODO: This finds the owner of the first descendant of element.
196  * We call this in owners_at_face where element is a descendant,
197  * add a flag that is true is element is a descendant, such that the
198  * first desc must not be created */
199 /* TODO: ext version with parameters: lower_bound, upper_bound, is_desc/is_leaf
200  * is it really needed to construct the tree owners? Cant we just use the global
201  * offset array?
202  */
203 int
205  sc_array_t *all_owners_of_tree);
206 
220 int
222 
243 int
245  int lower_bound, int upper_bound, int guess, int element_is_desc);
246 
259 int
261  int rank, int element_is_desc);
262 
277 void
279  t8_eclass_t eclass, int face, sc_array_t *owners);
280 
297 void
299  t8_eclass_t eclass, int *lower, int *upper);
300 
317 void
319  t8_eclass_t eclass, int face, int *lower, int *upper);
320 
338 void
339 t8_forest_element_owners_at_neigh_face (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face,
340  sc_array_t *owners);
341 
360 void
362  int face, int *lower, int *upper);
363 
381  t8_element_t *neighs[], t8_eclass_scheme_c *neigh_scheme, int face,
382  int num_neighs, int dual_faces[]);
383 
391 void
393 
405 int
407  t8_eclass_scheme_c *ts);
408 
409 T8_EXTERN_C_END ();
410 
411 #endif /* !T8_FOREST_PRIVATE_H */
This structure holds the connectivity data of the coarse mesh.
Definition: t8_cmesh_types.h:88
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:41
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:143
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:100
int32_t t8_locidx_t
A type for processor-local indexing.
Definition: t8.h:89
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:1364
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:223
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:2595
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 leaves ...
Definition: t8_forest_cxx.cxx:2539
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:1627
int t8_forest_is_incomplete_family(const t8_forest_t forest, const t8_locidx_t ltree_id, const t8_locidx_t el_considered, t8_eclass_scheme_c *tscheme, t8_element_t **elements, const int elements_size)
Check whether or not elements contains a (in)complete family and return the size of it or zero if no ...
Definition: t8_forest_cxx.cxx:48
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:2119
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:2479
void t8_forest_print_all_leaf_neighbors(t8_forest_t forest)
Iterate over all leaves of a forest and for each face compute the face neighbor leaves with t8_forest...
Definition: t8_forest_cxx.cxx:1938
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:2275
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:2266
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:1342
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:1358
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:1139
void t8_forest_compute_maxlevel(t8_forest_t forest)
Compute the maximum possible refinement level in a forest.
Definition: t8_forest_cxx.cxx:171
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:2513
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:2002
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:2564
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:36
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:1028
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:2627