t8
1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
|
We define the ghost routine to create a layer of halo elements for a forest of trees in this file. More...
Go to the source code of this file.
Functions | |
void | t8_forest_ghost_init (t8_forest_ghost_t *pghost, t8_ghost_type_t ghost_type) |
t8_locidx_t | t8_forest_ghost_num_trees (t8_forest_t forest) |
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. More... | |
t8_locidx_t | t8_forest_ghost_tree_num_elements (t8_forest_t forest, t8_locidx_t lghost_tree) |
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. More... | |
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. More... | |
t8_eclass_t | t8_forest_ghost_get_tree_class (t8_forest_t forest, t8_locidx_t lghost_tree) |
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. More... | |
t8_element_t * | t8_forest_ghost_get_element (t8_forest_t forest, t8_locidx_t lghost_tree, t8_locidx_t lelement) |
int * | t8_forest_ghost_get_remotes (t8_forest_t forest, int *num_remotes) |
Return the array of remote ranks. More... | |
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. More... | |
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. More... | |
void | t8_forest_ghost_ref (t8_forest_ghost_t ghost) |
Increase the reference count of a ghost structure. More... | |
void | t8_forest_ghost_unref (t8_forest_ghost_t *pghost) |
Descrease the reference count of a ghost structure. More... | |
void | t8_forest_ghost_destroy (t8_forest_ghost_t *pghost) |
Verify that a ghost structure has only one reference left and destroy it. More... | |
void | t8_forest_ghost_create (t8_forest_t forest) |
Create one layer of ghost elements for a forest. More... | |
void | t8_forest_ghost_create_balanced_only (t8_forest_t forest) |
Create one layer of ghost elements for a forest. More... | |
void | t8_forest_ghost_create_topdown (t8_forest_t forest) |
We define the ghost routine to create a layer of halo elements for a forest of trees in this file.
void t8_forest_ghost_create | ( | t8_forest_t | forest | ) |
Create one layer of ghost elements for a forest.
[in,out] | forest | The forest. forest must be committed before calling this function. |
void t8_forest_ghost_create_balanced_only | ( | t8_forest_t | forest | ) |
Create one layer of ghost elements for a forest.
This version only works with balanced forests and is the original algorithm from p4est: Scalable Algorithms For Parallel Adaptive Mesh Refinement On Forests of Octrees
[in,out] | forest | The balanced forest/ forest must be committed before calling this function. |
void t8_forest_ghost_destroy | ( | t8_forest_ghost_t * | pghost | ) |
Verify that a ghost structure has only one reference left and destroy it.
This function is preferred over t8_ghost_unref when it is known that the last reference is to be deleted.
[in,out] | pghost | This ghost structure must have a reference count of one. It can be in any state (committed or not). Then it effectively calls t8_forest_ghost_unref. |
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.
[in] | forest | The forest. Ghost layer must exist. |
[in] | gtreeid | A global tree in forest. |
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.
[in] | forest | The forest. Ghost layer must exist. |
[in] | lghost_tree | The ghost tree id of a ghost tree. |
int* t8_forest_ghost_get_remotes | ( | t8_forest_t | forest, |
int * | num_remotes | ||
) |
Return the array of remote ranks.
[in] | forest | A forest with constructed ghost layer. |
[in,out] | num_remotes | On output the number of remote ranks is stored here. |
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.
[in] | forest | The forest with constructed ghost layer. |
[in] | lghost_tree | A local ghost id of a ghost tree. |
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.
[in] | forest | The forest. Ghost layer must exist. |
[in] | lghost_tree | The ghost tree id of a ghost tree. |
void t8_forest_ghost_ref | ( | t8_forest_ghost_t | ghost | ) |
Increase the reference count of a ghost structure.
[in,out] | ghost | On input, this ghost structure must exist with positive reference count. |
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.
[in] | forest | A forest with constructed ghost layer. |
[in] | remote | A remote rank of the ghost layer in forest. |
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.
[in] | forest | A forest with constructed ghost layer. |
[in] | remote | A remote rank of the ghost layer in forest. |
void t8_forest_ghost_unref | ( | t8_forest_ghost_t * | pghost | ) |
Descrease the reference count of a ghost structure.
If the counter reaches zero, the ghost structure is destroyed. See also t8_forest_ghost_destroy, which is to be preferred when it is known that the last reference to a cmesh is deleted.
[in,out] | pghost | On input, the ghost structure pointed to must exist with positive reference count. If the reference count reaches zero, the ghost structure is destroyed and this pointer is set to NULL. Otherwise, the pointer is not changed. |