p4est 2.8.7.456-de8c6
p4est is a software library for parallel adaptive mesh refinement.
Loading...
Searching...
No Matches
p4est_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
34#ifndef P4EST_GHOST_H
35#define P4EST_GHOST_H
36
37#include <p4est.h>
38
39SC_EXTERN_C_BEGIN;
40
85
98int p4est_ghost_is_valid (p4est_t * p4est,
99 p4est_ghost_t * ghost);
100
105size_t p4est_ghost_memory_used (p4est_ghost_t * ghost);
106
120int p4est_quadrant_find_owner (p4est_t * p4est,
121 p4est_topidx_t treeid,
122 int face,
123 const p4est_quadrant_t * q);
124
136p4est_ghost_t *p4est_ghost_new (p4est_t * p4est,
138
147p4est_ghost_t *p4est_ghost_new_local (p4est_t * p4est,
149
151void p4est_ghost_destroy (p4est_ghost_t * ghost);
152
160ssize_t p4est_ghost_bsearch (p4est_ghost_t * ghost,
161 int which_proc,
162 p4est_topidx_t which_tree,
163 const p4est_quadrant_t * q);
164
172ssize_t p4est_ghost_contains (p4est_ghost_t * ghost,
173 int which_proc,
174 p4est_topidx_t which_tree,
175 const p4est_quadrant_t * q);
176
201p4est_locidx_t p4est_face_quadrant_exists (p4est_t * p4est,
202 p4est_ghost_t * ghost,
203 p4est_topidx_t treeid,
204 const p4est_quadrant_t * q,
205 int *face, int *hang,
206 int *owner_rank);
207
229int p4est_quadrant_exists (p4est_t * p4est,
230 p4est_ghost_t * ghost,
231 p4est_topidx_t treeid,
232 const p4est_quadrant_t * q,
233 sc_array_t * exists_arr,
234 sc_array_t * rproc_arr,
235 sc_array_t * rquad_arr);
236
245int p4est_is_balanced (p4est_t * p4est,
247
253unsigned p4est_ghost_checksum (p4est_t * p4est,
254 p4est_ghost_t * ghost);
255
267void p4est_ghost_exchange_data (p4est_t * p4est,
268 p4est_ghost_t * ghost,
269 void *ghost_data);
270
273{
280 size_t data_size;
282 int *qactive;
283 int *qbuffer;
284 sc_array_t requests;
285 sc_array_t sbuffers;
286 sc_array_t rrequests;
287 sc_array_t rbuffers;
288}
290
301p4est_ghost_exchange_t *p4est_ghost_exchange_data_begin
302 (p4est_t * p4est, p4est_ghost_t * ghost, void *ghost_data);
303
309void p4est_ghost_exchange_data_end
311
322void p4est_ghost_exchange_custom (p4est_t * p4est,
323 p4est_ghost_t * ghost,
324 size_t data_size,
325 void **mirror_data,
326 void *ghost_data);
327
342p4est_ghost_exchange_t *p4est_ghost_exchange_custom_begin
343 (p4est_t * p4est, p4est_ghost_t * ghost,
344 size_t data_size, void **mirror_data, void *ghost_data);
345
351void p4est_ghost_exchange_custom_end
353
370void p4est_ghost_exchange_custom_levels (p4est_t * p4est,
371 p4est_ghost_t * ghost,
372 int minlevel,
373 int maxlevel,
374 size_t data_size,
375 void **mirror_data,
376 void *ghost_data);
377
396p4est_ghost_exchange_t *p4est_ghost_exchange_custom_levels_begin
397 (p4est_t * p4est, p4est_ghost_t * ghost, int minlevel, int maxlevel,
398 size_t data_size, void **mirror_data, void *ghost_data);
399
405void p4est_ghost_exchange_custom_levels_end
407
414void p4est_ghost_expand (p4est_t * p4est,
415 p4est_ghost_t * ghost);
416
417SC_EXTERN_C_END;
418
419#endif /* !P4EST_GHOST_H */
The top-level 2D p4est interface.
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
p4est_connect_type_t
Characterize a type of adjacency.
Definition p4est_connectivity.h:113
struct p4est_ghost_exchange p4est_ghost_exchange_t
Transient storage for asynchronous ghost exchange.
struct p4est_ghost p4est_ghost_t
Quadrants that neighbor the local domain.
Transient storage for asynchronous ghost exchange.
Definition p4est_ghost.h:273
int * qbuffer
p4est->mpisize many integers
Definition p4est_ghost.h:283
int * qactive
p4est->mpisize many integers
Definition p4est_ghost.h:282
int is_levels
Are we restricted to levels or not.
Definition p4est_ghost.h:275
int maxlevel
Meaningful with is_levels.
Definition p4est_ghost.h:279
int is_custom
False for p4est_ghost_exchange_data.
Definition p4est_ghost.h:274
sc_array_t rrequests
Array of receive requests.
Definition p4est_ghost.h:286
sc_array_t requests
Array of send requests.
Definition p4est_ghost.h:284
p4est_t * p4est
The forest used for reference.
Definition p4est_ghost.h:276
void * ghost_data
Allocated contiguous array for ghost data.
Definition p4est_ghost.h:281
size_t data_size
The data size to transfer per quadrant.
Definition p4est_ghost.h:280
sc_array_t sbuffers
Array of send buffers.
Definition p4est_ghost.h:285
sc_array_t rbuffers
Array of receive buffers.
Definition p4est_ghost.h:287
p4est_ghost_t * ghost
The ghost layer used for reference.
Definition p4est_ghost.h:277
int minlevel
Meaningful with is_levels.
Definition p4est_ghost.h:278
Quadrants that neighbor the local domain.
Definition p4est_ghost.h:46
sc_array_t ghosts
An array of p4est_quadrant_t quadrants which make up the ghost layer around p4est.
Definition p4est_ghost.h:59
p4est_locidx_t * mirror_tree_offsets
num_trees + 1 mirror indices
Definition p4est_ghost.h:68
p4est_locidx_t * mirror_proc_front_offsets
NULL until p4est_ghost_expand is called.
Definition p4est_ghost.h:80
p4est_topidx_t num_trees
number of trees of the ghost
Definition p4est_ghost.h:48
p4est_locidx_t * mirror_proc_offsets
mpisize + 1 indices into mirror_proc_mirrors
Definition p4est_ghost.h:72
sc_array_t mirrors
An array of local quadrants that touch the parallel boundary from the inside, i.e....
Definition p4est_ghost.h:67
p4est_locidx_t * proc_offsets
mpisize + 1 ghost indices
Definition p4est_ghost.h:61
p4est_locidx_t * mirror_proc_fronts
like mirror_proc_mirrors, but limited to the outermost octants.
Definition p4est_ghost.h:74
p4est_locidx_t * tree_offsets
num_trees + 1 ghost indices
Definition p4est_ghost.h:60
p4est_locidx_t * mirror_proc_mirrors
indices into mirrors grouped by outside processor rank and ascending within each rank
Definition p4est_ghost.h:69
int mpisize
MPI size of the ghost.
Definition p4est_ghost.h:47
p4est_connect_type_t btype
which neighbors are in the ghost layer
Definition p4est_ghost.h:49
The 2D quadrant datatype.
Definition p4est.h:76
The p4est forest datatype.
Definition p4est.h:150