t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_forest_ghost.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_ghost */
29 
30 #ifndef T8_FOREST_GHOST_H
31 #define T8_FOREST_GHOST_H
32 
33 #include <t8.h>
35 
36 T8_EXTERN_C_BEGIN ();
37 
38 /* We enumerate the ghost trees by 0, 1, ..., num_ghost_trees - 1
39  * In the context of a forest we add the number of local trees as offset,
40  * so that we have a range of trees:
41  *
42  * | 0, 1, ..., num_trees - 1 | num_trees, ..., num_trees + num_ghosts - 1 |
43  *
44  * local trees ghost trees
45  *
46  * For the functions in this header an argument lghost_tree always
47  * means a number 0 <= lghost_tree < num_ghost_trees - 1
48  */
49 
50 /* TODO: comment */
51 void
52 t8_forest_ghost_init (t8_forest_ghost_t *pghost, t8_ghost_type_t ghost_type);
53 
54 /* TODO: document */
55 /* returns 0 if ghost structure doesnt exist */
57 t8_forest_ghost_num_trees (const t8_forest_t forest);
58 
67 
68 /* TODO: document */
70 t8_forest_ghost_tree_num_elements (t8_forest_t forest, t8_locidx_t lghost_tree);
71 
79 t8_forest_ghost_get_tree_elements (const t8_forest_t forest, const t8_locidx_t lghost_tree);
80 
92 
93 /* TODO: document */
95 t8_forest_ghost_get_tree_class (const t8_forest_t forest, const t8_locidx_t lghost_tree);
96 
105 t8_forest_ghost_get_global_treeid (const t8_forest_t forest, const t8_locidx_t lghost_tree);
106 
107 /* TODO: document */
108 t8_element_t *
109 t8_forest_ghost_get_element (t8_forest_t forest, t8_locidx_t lghost_tree, t8_locidx_t lelement);
110 
116 int *
117 t8_forest_ghost_get_remotes (t8_forest_t forest, int *num_remotes);
118 
127 
135 
140 void
142 
153 void
155 
162 void
164 
170 void
172 
181 void
183 
184 /* experimental version using the ghost_v3 algorithm */
185 void
186 t8_forest_ghost_create_topdown (t8_forest_t forest);
187 
188 T8_EXTERN_C_END ();
189 
190 #endif /* !T8_FOREST_GHOST_H */
The t8_element_array_t is an array to store t8_element_t * of a given eclass_scheme implementation.
Definition: t8_containers.h:42
Definition: t8_forest_types.h:191
This structure is private to the implementation.
Definition: t8_forest_types.h:69
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
t8_ghost_type_t
This type controls, which neighbors count as ghost elements.
Definition: t8_forest_general.h:42
t8_element_array_t * t8_forest_ghost_get_tree_elements(const t8_forest_t forest, const t8_locidx_t lghost_tree)
Get a pointer to the ghost element array of a ghost tree.
Definition: t8_forest_ghost.cxx:303
t8_locidx_t t8_forest_ghost_get_ghost_treeid(t8_forest_t forest, t8_gloidx_t gtreeid)
Given a global tree compute the ghost local tree id of it.
Definition: t8_forest_ghost.cxx:312
void t8_forest_ghost_ref(t8_forest_ghost_t ghost)
Increase the reference count of a ghost structure.
Definition: t8_forest_ghost.cxx:1909
void t8_forest_ghost_create(t8_forest_t forest)
Create one layer of ghost elements for a forest.
Definition: t8_forest_ghost.cxx:1506
t8_locidx_t t8_forest_ghost_remote_first_elem(t8_forest_t forest, int remote)
Return the local index of the first ghost element that belongs to a given remote rank.
Definition: t8_forest_ghost.cxx:1578
t8_locidx_t t8_forest_ghost_get_tree_element_offset(t8_forest_t forest, t8_locidx_t lghost_tree)
Return the element offset of a ghost tree.
Definition: t8_forest_ghost.cxx:284
t8_locidx_t t8_forest_ghost_remote_first_tree(t8_forest_t forest, int remote)
Return the first local ghost tree of a remote rank.
Definition: t8_forest_ghost.cxx:1560
t8_gloidx_t t8_forest_ghost_get_global_treeid(const t8_forest_t forest, const t8_locidx_t lghost_tree)
Given a local ghost tree compute the global tree id of it.
Definition: t8_forest_ghost.cxx:344
void t8_forest_ghost_create_balanced_only(t8_forest_t forest)
Create one layer of ghost elements for a forest.
Definition: t8_forest_ghost.cxx:1516
void t8_forest_ghost_destroy(t8_forest_ghost_t *pghost)
Verify that a ghost structure has only one reference left and destroy it.
Definition: t8_forest_ghost.cxx:1931
void t8_forest_ghost_unref(t8_forest_ghost_t *pghost)
Decrease the reference count of a ghost structure.
Definition: t8_forest_ghost.cxx:1917
int * t8_forest_ghost_get_remotes(t8_forest_t forest, int *num_remotes)
Return the array of remote ranks.
Definition: t8_forest_ghost.cxx:1540
We define here the datatypes needed for internal forest routines.