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_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 funcions 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 t8_forest_ghost_init (t8_forest_ghost_t *pghost,
52  t8_ghost_type_t ghost_type);
53 
54 /* TODO: document */
55 /* returns 0 if ghost structure doesnt exist */
56 t8_locidx_t t8_forest_ghost_num_trees (t8_forest_t forest);
57 
65  forest,
67  lghost_tree);
68 
69 /* TODO: document */
70 t8_locidx_t t8_forest_ghost_tree_num_elements (t8_forest_t forest,
72  lghost_tree);
73 
82  lghost_tree);
83 
94  t8_gloidx_t gtreeid);
95 
96 /* TODO: document */
97 t8_eclass_t t8_forest_ghost_get_tree_class (t8_forest_t forest,
98  t8_locidx_t lghost_tree);
99 
109  lghost_tree);
110 
111 /* TODO: document */
112 t8_element_t *t8_forest_ghost_get_element (t8_forest_t forest,
113  t8_locidx_t lghost_tree,
114  t8_locidx_t lelement);
115 
122  int *num_remotes);
123 
131  int remote);
132 
139  int remote);
140 
146 
159 
168 
174 void t8_forest_ghost_create (t8_forest_t forest);
175 
185 
186 /* experimental version using the ghost_v3 algorithm */
187 void t8_forest_ghost_create_topdown (t8_forest_t forest);
188 
189 T8_EXTERN_C_END ();
190 
191 #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:185
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: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
t8_ghost_type_t
This type controls, which neighbors count as ghost elements.
Definition: t8_forest.h:46
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:342
void t8_forest_ghost_ref(t8_forest_ghost_t ghost)
Increase the reference count of a ghost structure.
Definition: t8_forest_ghost.cxx:2099
t8_gloidx_t t8_forest_ghost_get_global_treeid(t8_forest_t forest, t8_locidx_t lghost_tree)
Given a local ghost tree compute the global tree id of it.
Definition: t8_forest_ghost.cxx:375
void t8_forest_ghost_create(t8_forest_t forest)
Create one layer of ghost elements for a forest.
Definition: t8_forest_ghost.cxx:1655
t8_element_array_t * t8_forest_ghost_get_tree_elements(t8_forest_t forest, t8_locidx_t lghost_tree)
Get a pointer to the ghost element array of a ghost tree.
Definition: t8_forest_ghost.cxx:332
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:1727
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:311
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:1709
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:1665
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:2121
void t8_forest_ghost_unref(t8_forest_ghost_t *pghost)
Descrease the reference count of a ghost structure.
Definition: t8_forest_ghost.cxx:2107
int * t8_forest_ghost_get_remotes(t8_forest_t forest, int *num_remotes)
Return the array of remote ranks.
Definition: t8_forest_ghost.cxx:1689
We define here the datatypes needed for internal forest routines.