p4est  1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6est_ghost.h
Go to the documentation of this file.
1 /*
2  This file is part of p4est.
3  p4est is a C library to manage a collection (a forest) of multiple
4  connected adaptive quadtrees or octrees in parallel.
5 
6  Copyright (C) 2014 The University of Texas System
7  Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac
8 
9  p4est is free software; you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13 
14  p4est is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with p4est; if not, write to the Free Software Foundation, Inc.,
21  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 */
23 
31 #ifndef P6EST_GHOST_H
32 #define P6EST_GHOST_H
33 
34 #include <p6est.h>
35 #include <p4est_ghost.h>
36 
37 SC_EXTERN_C_BEGIN;
38 
40 typedef struct p6est_ghost
41 {
42  int mpisize;
43  p4est_topidx_t num_trees;
85 }
87 
92 size_t p6est_ghost_memory_used (p6est_ghost_t * ghost);
93 
106  p4est_connect_type_t btype);
107 
114 void p6est_ghost_expand (p6est_t * p6est,
115  p6est_ghost_t * ghost);
116 
118 void p6est_ghost_destroy (p6est_ghost_t * ghost);
119 
127 ssize_t p6est_ghost_bsearch (p6est_ghost_t * ghost,
128  int which_proc,
129  p4est_topidx_t which_tree,
130  const p4est_quadrant_t * column,
131  const p2est_quadrant_t * layer);
132 
140 ssize_t p6est_ghost_contains (p6est_ghost_t * ghost,
141  int which_proc,
142  p4est_topidx_t which_tree,
143  const p4est_quadrant_t * column,
144  const p2est_quadrant_t * layer);
145 
168 int p6est_layer_exists (p6est_t * p6est,
169  p6est_ghost_t * ghost,
170  p4est_topidx_t treeid,
171  const p4est_quadrant_t * column,
172  const p2est_quadrant_t * layer,
173  sc_array_t * exists_arr,
174  sc_array_t * rproc_arr,
175  sc_array_t * rquad_arr);
176 
185 int p6est_is_balanced (p6est_t * p6est,
186  p8est_connect_type_t btype);
187 
193 unsigned p6est_ghost_checksum (p6est_t * p6est,
194  p6est_ghost_t * ghost);
195 
196 SC_EXTERN_C_END;
197 
198 #endif /* P6EST_GHOST_H */
quadrants that neighbor the local domain
Definition: p4est_ghost.h:39
A 1D quadrant datatype: this is used to encode a "layer" of a column in the 2D+1D AMR scheme...
Definition: p6est.h:125
columns of layers that neighbor the local domain
Definition: p6est_ghost.h:40
The p6est forest datatype.
Definition: p6est.h:163
size_t p6est_ghost_memory_used(p6est_ghost_t *ghost)
Calculate the memory usage of the ghost layer.
p4est_locidx_t * tree_offsets
num_trees + 1 ghost indices
Definition: p6est_ghost.h:60
sc_array_t * column_layer_offsets
array of p4est_locidx_t type: the offset of each ghost columns within the ghosts array of column-laye...
Definition: p6est_ghost.h:47
p6est_ghost_t * p6est_ghost_new(p6est_t *p4est, p4est_connect_type_t btype)
Builds the ghost layer.
Definition: p6est_ghost.c:482
p8est_connect_type_t
Characterize a type of adjacency.
Definition: p8est_connectivity.h:79
p4est_ghost_t * column_ghost
describes the ghost columns
Definition: p6est_ghost.h:46
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.
p4est_locidx_t * proc_offsets
mpisize + 1 ghost indices
Definition: p6est_ghost.h:61
p4est_locidx_t * mirror_tree_offsets
num_trees + 1 mirror indices
Definition: p6est_ghost.h:68
sc_array_t ghosts
An array of column-layers which make up the ghost layer around p6est.
Definition: p6est_ghost.h:59
p4est_locidx_t * mirror_proc_fronts
like mirror_proc_mirrors, but limited to the outermost octants.
Definition: p6est_ghost.h:75
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.
unsigned p6est_ghost_checksum(p6est_t *p6est, p6est_ghost_t *ghost)
Compute the parallel checksum of a ghost layer.
The sc_array object provides a large array of equal-size elements.
Definition: sc_containers.h:92
void p6est_ghost_destroy(p6est_ghost_t *ghost)
Frees all memory used for the ghost layer.
Definition: p6est_ghost.c:539
p4est_connect_type_t
Characterize a type of adjacency.
Definition: p4est_connectivity.h:77
A hybrid 2D+1D AMR extension.
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.
int32_t p4est_topidx_t
Typedef for counting topological entities (trees, tree vertices).
Definition: p4est_base.h:63
int32_t p4est_locidx_t
Typedef for processor-local indexing of quadrants and nodes.
Definition: p4est_base.h:74
int p6est_is_balanced(p6est_t *p6est, p8est_connect_type_t btype)
Check a forest to see if it is balanced.
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.
Definition: p6est_ghost.c:560
p4est_locidx_t * mirror_proc_offsets
mpisize + 1 indices into mirror_proc_mirrors
Definition: p6est_ghost.h:72
sc_array_t mirrors
An array of local quadrants that touch the parallel boundary from the inside, i.e., that are ghosts in the perspective of at least one other processor.
Definition: p6est_ghost.h:67
The 2D quadrant datatype.
Definition: p4est.h:65
passing quadrants and data to neighboring processes
p4est_locidx_t * mirror_proc_front_offsets
NULL until p4est_ghost_expand is called.
Definition: p6est_ghost.h:81
p4est_connect_type_t btype
which neighboring columns are in the ghost layer
Definition: p6est_ghost.h:44
p4est_locidx_t * mirror_proc_mirrors
indices into mirrors grouped by outside processor rank and ascending within each rank ...
Definition: p6est_ghost.h:69