p4est 2.8.6
p4est is a software library for parallel adaptive mesh refinement.
p8est_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) 2010 The University of Texas System
7 Additional copyright (C) 2011 individual authors
8 Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac
9
10 p4est is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 p4est is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with p4est; if not, write to the Free Software Foundation, Inc.,
22 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23*/
24
32#ifndef P8EST_GHOST_H
33#define P8EST_GHOST_H
34
35#include <p8est.h>
36
37SC_EXTERN_C_BEGIN;
38
40typedef struct
41{
42 int mpisize;
43 p4est_topidx_t num_trees;
53 sc_array_t ghosts;
61 sc_array_t mirrors;
77}
79
93 p8est_ghost_t * ghost);
94
100
115 p4est_topidx_t treeid,
116 int face,
117 const p8est_quadrant_t * q);
118
132
143
146
155 int which_proc,
156 p4est_topidx_t which_tree,
157 const p8est_quadrant_t * q);
158
167 int which_proc,
168 p4est_topidx_t which_tree,
169 const p8est_quadrant_t * q);
170
196 p8est_ghost_t * ghost,
197 p4est_topidx_t treeid,
198 const p8est_quadrant_t * q,
199 int *face, int *hang,
200 int *owner_rank);
201
224 p8est_ghost_t * ghost,
225 p4est_topidx_t treeid,
226 const p8est_quadrant_t * q,
227 sc_array_t * exists_arr,
228 sc_array_t * rproc_arr,
229 sc_array_t * rquad_arr);
230
241
248 p8est_ghost_t * ghost);
249
262 p8est_ghost_t * ghost,
263 void *ghost_data);
264
267{
270 p8est_t *p4est;
271 p8est_ghost_t *ghost;
272 int minlevel, maxlevel;
273 size_t data_size;
274 void *ghost_data;
275 int *qactive, *qbuffer;
276 sc_array_t requests, sbuffers;
277 sc_array_t rrequests, rbuffers;
278}
280
290 (p8est_t * p8est, p8est_ghost_t * ghost, void *ghost_data);
291
299
311 p8est_ghost_t * ghost,
312 size_t data_size,
313 void **mirror_data,
314 void *ghost_data);
315
328 (p8est_t * p8est, p8est_ghost_t * ghost,
329 size_t data_size, void **mirror_data, void *ghost_data);
330
338
356 p8est_ghost_t * ghost,
357 int minlevel,
358 int maxlevel,
359 size_t data_size,
360 void **mirror_data,
361 void *ghost_data);
362
375 (p8est_t * p8est, p8est_ghost_t * ghost, int minlevel, int maxlevel,
376 size_t data_size, void **mirror_data, void *ghost_data);
377
385
393 p8est_ghost_t * ghost);
394
395SC_EXTERN_C_END;
396
397#endif /* !P8EST_GHOST_H */
int32_t p4est_topidx_t
Typedef for counting topological entities (trees, tree vertices).
Definition: p4est_base.h:93
int32_t p4est_locidx_t
Typedef for processor-local indexing of quadrants and nodes.
Definition: p4est_base.h:106
The top-level 3D p8est interface.
p8est_connect_type_t
Characterize a type of adjacency.
Definition: p8est_connectivity.h:119
void p8est_ghost_exchange_data_end(p8est_ghost_exchange_t *exc)
Complete an asynchronous ghost data exchange.
p8est_ghost_t * p8est_ghost_new_local(p8est_t *p8est, p8est_connect_type_t ctype)
Generate an empty ghost layer.
void p8est_ghost_destroy(p8est_ghost_t *ghost)
Frees all memory used for the ghost layer.
int p8est_quadrant_exists(p8est_t *p8est, p8est_ghost_t *ghost, p4est_topidx_t treeid, const p8est_quadrant_t *q, sc_array_t *exists_arr, sc_array_t *rproc_arr, sc_array_t *rquad_arr)
Checks if quadrant exists in the local forest or the ghost layer.
p8est_ghost_exchange_t * p8est_ghost_exchange_custom_levels_begin(p8est_t *p8est, p8est_ghost_t *ghost, int minlevel, int maxlevel, size_t data_size, void **mirror_data, void *ghost_data)
Begin an asynchronous ghost data exchange by posting messages.
p8est_ghost_t * p8est_ghost_new(p8est_t *p8est, p8est_connect_type_t btype)
Builds the ghost layer.
unsigned p8est_ghost_checksum(p8est_t *p8est, p8est_ghost_t *ghost)
Compute the parallel checksum of a ghost layer.
int p8est_ghost_is_valid(p8est_t *p8est, p8est_ghost_t *ghost)
Examine if a ghost structure is valid as described above.
void p8est_ghost_exchange_custom_levels(p8est_t *p8est, p8est_ghost_t *ghost, int minlevel, int maxlevel, size_t data_size, void **mirror_data, void *ghost_data)
Transfer data for local quadrants that are ghosts to other processors.
void p8est_ghost_exchange_custom_levels_end(p8est_ghost_exchange_t *exc)
Complete an asynchronous ghost data exchange.
ssize_t p8est_ghost_tree_contains(p8est_ghost_t *ghost, int which_proc, p4est_topidx_t which_tree, const p8est_quadrant_t *q)
Conduct binary search for ancestor on range of the ghost layer.
int p8est_quadrant_find_owner(p8est_t *p8est, p4est_topidx_t treeid, int face, const p8est_quadrant_t *q)
Gets the processor id of a quadrant's owner.
struct p8est_ghost_exchange p8est_ghost_exchange_t
Transient storage for asynchronous ghost exchange.
void p8est_ghost_exchange_custom_end(p8est_ghost_exchange_t *exc)
Complete an asynchronous ghost data exchange.
void p8est_ghost_exchange_custom(p8est_t *p8est, p8est_ghost_t *ghost, size_t data_size, void **mirror_data, void *ghost_data)
Transfer data for local quadrants that are ghosts to other processors.
p8est_ghost_exchange_t * p8est_ghost_exchange_data_begin(p8est_t *p8est, p8est_ghost_t *ghost, void *ghost_data)
Begin an asynchronous ghost data exchange by posting messages.
int p8est_is_balanced(p8est_t *p8est, p8est_connect_type_t btype)
Check a forest to see if it is balanced.
p4est_locidx_t p8est_face_quadrant_exists(p8est_t *p8est, p8est_ghost_t *ghost, p4est_topidx_t treeid, const p8est_quadrant_t *q, int *face, int *hang, int *owner_rank)
Checks if quadrant exists in the local forest or the ghost layer.
size_t p8est_ghost_memory_used(p8est_ghost_t *ghost)
Calculate the memory usage of the ghost layer.
p8est_ghost_exchange_t * p8est_ghost_exchange_custom_begin(p8est_t *p8est, p8est_ghost_t *ghost, size_t data_size, void **mirror_data, void *ghost_data)
Begin an asynchronous ghost data exchange by posting messages.
ssize_t p8est_ghost_bsearch(p8est_ghost_t *ghost, int which_proc, p4est_topidx_t which_tree, const p8est_quadrant_t *q)
Conduct binary search for exact match on a range of the ghost layer.
void p8est_ghost_expand(p8est_t *p8est, p8est_ghost_t *ghost)
Expand the size of the ghost layer and mirrors by one additional layer of adjacency.
void p8est_ghost_exchange_data(p8est_t *p8est, p8est_ghost_t *ghost, void *ghost_data)
Transfer data for local quadrants that are ghosts to other processors.
The p4est forest datatype.
Definition: p4est.h:136
Transient storage for asynchronous ghost exchange.
Definition: p8est_ghost.h:267
int is_custom
False for p8est_ghost_exchange_data.
Definition: p8est_ghost.h:268
int maxlevel
Meaningful with is_levels.
Definition: p8est_ghost.h:272
int is_levels
Are we restricted to levels or not.
Definition: p8est_ghost.h:269
quadrants that neighbor the local domain
Definition: p8est_ghost.h:41
p4est_locidx_t * mirror_proc_fronts
like mirror_proc_mirrors, but limited to the outermost octants.
Definition: p8est_ghost.h:68
sc_array_t mirrors
An array of local quadrants that touch the parallel boundary from the inside, i.e....
Definition: p8est_ghost.h:61
p4est_locidx_t * mirror_proc_front_offsets
NULL until p8est_ghost_expand is called.
Definition: p8est_ghost.h:74
p4est_locidx_t * proc_offsets
mpisize + 1 ghost indices
Definition: p8est_ghost.h:55
p8est_connect_type_t btype
which neighbors are in the ghost layer
Definition: p8est_ghost.h:44
p4est_locidx_t * mirror_proc_mirrors
indices into mirrors grouped by outside processor rank and ascending within each rank
Definition: p8est_ghost.h:63
sc_array_t ghosts
An array of quadrants which make up the ghost layer around forest.
Definition: p8est_ghost.h:53
p4est_locidx_t * mirror_proc_offsets
mpisize + 1 indices into mirror_proc_mirrors
Definition: p8est_ghost.h:66
p4est_locidx_t * mirror_tree_offsets
num_trees + 1 mirror indices
Definition: p8est_ghost.h:62
p4est_locidx_t * tree_offsets
num_trees + 1 ghost indices
Definition: p8est_ghost.h:54
The 3D quadrant (i.e., octant) datatype.
Definition: p8est.h:68
The p8est forest datatype.
Definition: p8est.h:132