p4est  1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
p6est_ghost.h File Reference

passing columns of layers and data to neighboring processes More...

#include <p6est.h>
#include <p4est_ghost.h>

Go to the source code of this file.

Data Structures

struct  p6est_ghost_t
 columns of layers that neighbor the local domain More...
 

Functions

size_t p6est_ghost_memory_used (p6est_ghost_t *ghost)
 Calculate the memory usage of the ghost layer. More...
 
p6est_ghost_tp6est_ghost_new (p6est_t *p4est, p4est_connect_type_t btype)
 Builds the ghost layer. More...
 
void p6est_ghost_expand (p6est_t *p6est, p6est_ghost_t *ghost)
 Expand the size of the ghost layer and mirrors by one additional layer of adjacency. More...
 
void p6est_ghost_destroy (p6est_ghost_t *ghost)
 Frees all memory used for the ghost layer. More...
 
ssize_t p6est_ghost_bsearch (p6est_ghost_t *ghost, int which_proc, p4est_topidx_t which_tree, const p4est_quadrant_t *column, const p2est_quadrant_t *layer)
 Conduct binary search for exact match on a range of the ghost layer. More...
 
ssize_t p6est_ghost_contains (p6est_ghost_t *ghost, int which_proc, p4est_topidx_t which_tree, const p4est_quadrant_t *column, const p2est_quadrant_t *layer)
 Conduct binary search for ancestor on range of the ghost layer. More...
 
int p6est_layer_exists (p6est_t *p6est, p6est_ghost_t *ghost, p4est_topidx_t treeid, const p4est_quadrant_t *column, const p2est_quadrant_t *layer, sc_array_t *exists_arr, sc_array_t *rproc_arr, sc_array_t *rquad_arr)
 Checks if layer exists in the local forest or the ghost layer. More...
 
int p6est_is_balanced (p6est_t *p6est, p8est_connect_type_t btype)
 Check a forest to see if it is balanced. More...
 
unsigned p6est_ghost_checksum (p6est_t *p6est, p6est_ghost_t *ghost)
 Compute the parallel checksum of a ghost layer. More...
 

Detailed Description

passing columns of layers and data to neighboring processes

Function Documentation

ssize_t p6est_ghost_bsearch ( p6est_ghost_t ghost,
int  which_proc,
p4est_topidx_t  which_tree,
const p4est_quadrant_t column,
const p2est_quadrant_t layer 
)

Conduct binary search for exact match on a range of the ghost layer.

Parameters
[in]ghostThe ghost layer.
[in]which_procThe owner of the searched quadrant. Can be -1.
[in]which_treeThe tree of the searched quadrant. Can be -1.
[in]qValid quadrant is searched in the ghost layer.
Returns
Offset in the ghost layer, or -1 if not found.
unsigned p6est_ghost_checksum ( p6est_t p6est,
p6est_ghost_t ghost 
)

Compute the parallel checksum of a ghost layer.

Parameters
[in]p4estThe MPI information of this p4est will be used.
[in]ghostA ghost layer obtained from the p4est.
Returns
Parallel checksum on rank 0, 0 otherwise.
ssize_t p6est_ghost_contains ( p6est_ghost_t ghost,
int  which_proc,
p4est_topidx_t  which_tree,
const p4est_quadrant_t column,
const p2est_quadrant_t layer 
)

Conduct binary search for ancestor on range of the ghost layer.

Parameters
[in]ghostThe ghost layer.
[in]which_procThe owner of the searched quadrant. Can be -1.
[in]which_treeThe tree of the searched quadrant. Can be -1.
[in]qValid quadrant's ancestor is searched.
Returns
Offset in the ghost layer, or -1 if not found.
void p6est_ghost_destroy ( p6est_ghost_t ghost)

Frees all memory used for the ghost layer.

void p6est_ghost_expand ( p6est_t p6est,
p6est_ghost_t ghost 
)

Expand the size of the ghost layer and mirrors by one additional layer of adjacency.

Parameters
[in]p6estThe forest from which the ghost layer was generated.
[in,out]ghostThe ghost layer to be expanded.
size_t p6est_ghost_memory_used ( p6est_ghost_t ghost)

Calculate the memory usage of the ghost layer.

Parameters
[in]ghostGhost layer structure.
Returns
Memory used in bytes.
p6est_ghost_t* p6est_ghost_new ( p6est_t p4est,
p4est_connect_type_t  btype 
)

Builds the ghost layer.

This will gather the quadrants from each neighboring proc to build one layer of face and corner based ghost elements around the ones they own.

Parameters
[in]p4estThe forest for which the ghost layer will be generated.
[in]btypeWhich ghosts to include (across face, corner or default, full).
Returns
A fully initialized ghost layer.
int p6est_is_balanced ( p6est_t p6est,
p8est_connect_type_t  btype 
)

Check a forest to see if it is balanced.

This function builds the ghost layer and discards it when done.

Parameters
[in]p4estThe p4est to be tested.
[in]btypeBalance type (face, corner or default, full).
Returns
Returns true if balanced, false otherwise.
int p6est_layer_exists ( p6est_t p6est,
p6est_ghost_t ghost,
p4est_topidx_t  treeid,
const p4est_quadrant_t column,
const p2est_quadrant_t layer,
sc_array_t exists_arr,
sc_array_t rproc_arr,
sc_array_t rquad_arr 
)

Checks if layer exists in the local forest or the ghost layer.

For quadrants across tree corners it checks if the quadrant exists in any of the corner neighbors, thus it can execute multiple queries.

Parameters
[in]p4estThe forest in which to search for q
[in]ghostThe ghost layer in which to search for q
[in]treeidThe tree to which q belongs (can be extended).
[in]columnThe column that is being searched for.
[in]layerThe layer that is being searched for.
[in,out]exists_arrMust exist and be of of elem_size = sizeof (int) for inter-tree corner cases. Is resized by this function to one entry for each corner search and set to true/false depending on its existence in the local forest or ghost_layer.
[in,out]rproc_arrIf not NULL is filled with one rank per query.
[in,out]rquad_arrIf not NULL is filled with one quadrant per query. Its piggy3 member is defined as well.
Returns
true if the quadrant exists in the local forest or in the ghost_layer, and false if doesn't exist in either.