p4est 2.8.8
p4est is a software library for parallel adaptive mesh refinement.
Loading...
Searching...
No Matches
p8est_iterate.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_ITERATE_H
33#define P8EST_ITERATE_H
34
35#include <p8est_ghost.h>
36
37SC_EXTERN_C_BEGIN;
38
56
63 void *user_data);
64
74
83
109
122{
123 p8est_t *p4est;
124 p8est_ghost_t *ghost_layer;
125 int8_t orientation;
130 sc_array_t sides; /* array of p8est_iter_face_side_t type */
131}
133
145 void *user_data);
146
156
165
166/* The information that is available to the user-defined p8est_iter_edge_t
167 * callback.
168 *
169 * If a \a quad is local (\a is_ghost is false), then its \a quadid indexes
170 * the tree's quadrant array; otherwise, it indexes the ghosts array. If the
171 * edge is hanging, then the quadrants are listed in z-order. If an edge is in
172 * the interior of a tree, orientation is 0; if an edge is between trees,
173 * orientation is the same as edge orientation in the connectivity. If a
174 * quadrant should be present, but it is not included in the ghost layer, then
175 * quad = NULL, is_ghost is true, and quadid = -1.
176 *
177 * the \a faces field provides some additional information about the local
178 * neighborhood: if side[i]->faces[j] == side[k]->faces[l], this indicates that
179 * there is a common face between these two sides of the edge.
180 */
204
213{
214 p8est_t *p4est;
215 p8est_ghost_t *ghost_layer;
218 sc_array_t sides;
219}
221
233 void *user_data);
234
235/* Information about one side of a corner in the forest. If a \a quad is local,
236 * then its \a quadid indexes the tree's quadrant array; otherwise, it indexes
237 * the ghosts array.
238 *
239 * the \a faces and \a edges field provides some additional information about
240 * the local neighborhood: if side[i]->faces[j] == side[k]->faces[l], this
241 * indicates that there is a common face between these two sides of the
242 * corner.
243 */
256
267{
268 p8est_t *p4est;
269 p8est_ghost_t *ghost_layer;
272 sc_array_t sides;
273}
275
289 void *user_data);
290
331 p8est_ghost_t * ghost_layer,
332 void *user_data,
333 p8est_iter_volume_t iter_volume,
334 p8est_iter_face_t iter_face,
335 p8est_iter_edge_t iter_edge,
336 p8est_iter_corner_t iter_corner);
337
341p8est_iter_cside_array_index_int (sc_array_t * array, int it)
342{
343 P4EST_ASSERT (array->elem_size == sizeof (p8est_iter_corner_side_t));
344 P4EST_ASSERT (it >= 0 && (size_t) it < array->elem_count);
345
346 return (p8est_iter_corner_side_t *)
347 (array->array + sizeof (p8est_iter_corner_side_t) * (size_t) it);
348}
349
353p8est_iter_cside_array_index (sc_array_t * array, size_t it)
354{
355 P4EST_ASSERT (array->elem_size == sizeof (p8est_iter_corner_side_t));
356 P4EST_ASSERT (it < array->elem_count);
357
358 return (p8est_iter_corner_side_t *)
359 (array->array + sizeof (p8est_iter_corner_side_t) * it);
360}
361
365p8est_iter_eside_array_index_int (sc_array_t * array, int it)
366{
367 P4EST_ASSERT (array->elem_size == sizeof (p8est_iter_edge_side_t));
368 P4EST_ASSERT (it >= 0 && (size_t) it < array->elem_count);
369
370 return (p8est_iter_edge_side_t *)
371 (array->array + sizeof (p8est_iter_edge_side_t) * (size_t) it);
372}
373
377p8est_iter_eside_array_index (sc_array_t * array, size_t it)
378{
379 P4EST_ASSERT (array->elem_size == sizeof (p8est_iter_edge_side_t));
380 P4EST_ASSERT (it < array->elem_count);
381
382 return (p8est_iter_edge_side_t *)
383 (array->array + sizeof (p8est_iter_edge_side_t) * it);
384}
385
389p8est_iter_fside_array_index_int (sc_array_t * array, int it)
390{
391 P4EST_ASSERT (array->elem_size == sizeof (p8est_iter_face_side_t));
392 P4EST_ASSERT (it >= 0 && (size_t) it < array->elem_count);
393
394 return (p8est_iter_face_side_t *)
395 (array->array + sizeof (p8est_iter_face_side_t) * (size_t) it);
396}
397
401p8est_iter_fside_array_index (sc_array_t * array, size_t it)
402{
403 P4EST_ASSERT (array->elem_size == sizeof (p8est_iter_face_side_t));
404 P4EST_ASSERT (it < array->elem_count);
405
406 return (p8est_iter_face_side_t *)
407 (array->array + sizeof (p8est_iter_face_side_t) * it);
408}
409
410SC_EXTERN_C_END;
411
412#endif /* !P8EST_ITERATE_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
Passing quadrants and data to neighboring processes.
struct p8est_iter_volume_info p8est_iter_volume_info_t
The information that is available to the user-defined p8est_iter_volume_t callback function.
struct p8est_iter_face_side p8est_iter_face_side_t
Information about one side of a face in the forest.
p8est_iter_corner_side_t * p8est_iter_cside_array_index_int(sc_array_t *array, int it)
Return a pointer to a iter_corner_side array element indexed by a int.
Definition p8est_iterate.h:341
void(* p8est_iter_edge_t)(p8est_iter_edge_info_t *info, void *user_data)
The prototype for a function that p8est_iterate will execute wherever the edge is an edge of all quad...
Definition p8est_iterate.h:232
struct p8est_iter_corner_info p8est_iter_corner_info_t
The information that is available to the user-defined p8est_iter_corner_t callback.
struct p8est_iter_edge_side_full p8est_iter_edge_side_full_t
Shortcut to access full edge information.
void(* p8est_iter_corner_t)(p8est_iter_corner_info_t *info, void *user_data)
The prototype for a function that p8est_iterate will execute wherever the corner is a corner for all ...
Definition p8est_iterate.h:288
p8est_iter_face_side_t * p8est_iter_fside_array_index_int(sc_array_t *array, int it)
Return a pointer to a iter_face_side array element indexed by a int.
Definition p8est_iterate.h:389
void(* p8est_iter_volume_t)(p8est_iter_volume_info_t *info, void *user_data)
The prototype for a function that p8est_iterate() will execute at every quadrant local to the current...
Definition p8est_iterate.h:62
void(* p8est_iter_face_t)(p8est_iter_face_info_t *info, void *user_data)
The prototype for a function that p8est_iterate() will execute wherever two quadrants share a face: t...
Definition p8est_iterate.h:144
p8est_iter_face_side_t * p8est_iter_fside_array_index(sc_array_t *array, size_t it)
Return a pointer to a iter_face_side array element indexed by a size_t.
Definition p8est_iterate.h:401
p8est_iter_edge_side_t * p8est_iter_eside_array_index(sc_array_t *array, size_t it)
Return a pointer to a iter_edge_side array element indexed by a size_t.
Definition p8est_iterate.h:377
void p8est_iterate(p8est_t *p4est, p8est_ghost_t *ghost_layer, void *user_data, p8est_iter_volume_t iter_volume, p8est_iter_face_t iter_face, p8est_iter_edge_t iter_edge, p8est_iter_corner_t iter_corner)
Execute the user-supplied callback functions at every volume, face, edge and corner in the local fore...
struct p8est_iter_face_side_hanging p8est_iter_face_side_hanging_t
Shortcut to access hanging face information.
p8est_iter_corner_side_t * p8est_iter_cside_array_index(sc_array_t *array, size_t it)
Return a pointer to a iter_corner_side array element indexed by a size_t.
Definition p8est_iterate.h:353
struct p8est_iter_edge_info p8est_iter_edge_info_t
The information about all sides of an edge in the forest.
struct p8est_iter_face_side_full p8est_iter_face_side_full_t
Shortcut to access full face information.
struct p8est_iter_face_info p8est_iter_face_info_t
The information that is available to the user-defined p8est_iter_face_t callback.
p8est_iter_edge_side_t * p8est_iter_eside_array_index_int(sc_array_t *array, int it)
Return a pointer to a iter_edge_side array element indexed by a int.
Definition p8est_iterate.h:365
struct p8est_iter_edge_side_hanging p8est_iter_edge_side_hanging_t
Shortcut to access hanging edge information.
The p4est forest datatype.
Definition p4est.h:150
Quadrants that neighbor the local domain.
Definition p8est_ghost.h:46
The information that is available to the user-defined p8est_iter_corner_t callback.
Definition p8est_iterate.h:267
int8_t tree_boundary
boolean: interior face (0), tree boundary face (true)
Definition p8est_iterate.h:270
sc_array_t sides
array of p8est_iter_corner_side_t type
Definition p8est_iterate.h:272
Definition p8est_iterate.h:245
p4est_locidx_t quadid
the index in the tree or ghost array
Definition p8est_iterate.h:251
int8_t corner
which of the quadrant's corners touches this corner
Definition p8est_iterate.h:247
int8_t faces[3]
internal work data
Definition p8est_iterate.h:252
int8_t edges[3]
internal work data
Definition p8est_iterate.h:253
p4est_topidx_t treeid
the tree that contains quad
Definition p8est_iterate.h:246
int8_t is_ghost
boolean: local (0) or ghost (1)
Definition p8est_iterate.h:249
The information about all sides of an edge in the forest.
Definition p8est_iterate.h:213
int8_t tree_boundary
boolean: interior face (0), tree boundary face (true)
Definition p8est_iterate.h:216
sc_array_t sides
array of p8est_iter_edge_side_t type
Definition p8est_iterate.h:218
Shortcut to access full edge information.
Definition p8est_iterate.h:149
p8est_quadrant_t * quad
the actual quadrant
Definition p8est_iterate.h:151
p4est_locidx_t quadid
index in tree or ghost array
Definition p8est_iterate.h:152
int8_t is_ghost
boolean: local (0) or ghost
Definition p8est_iterate.h:150
Shortcut to access hanging edge information.
Definition p8est_iterate.h:159
p4est_locidx_t quadid[2]
index in tree or ghost array
Definition p8est_iterate.h:162
p8est_quadrant_t * quad[2]
the actual quadrant
Definition p8est_iterate.h:161
int8_t is_ghost[2]
boolean: local (0) or ghost
Definition p8est_iterate.h:160
Definition p8est_iterate.h:182
int8_t edge
which quadrant side the edge touches
Definition p8est_iterate.h:184
int8_t orientation
the orientation of each quadrant relative to this edge, as in the definition of p8est_connectivity_t
Definition p8est_iterate.h:186
int8_t is_hanging
boolean: one full quad (0) or two smaller quads (1)
Definition p8est_iterate.h:190
p4est_topidx_t treeid
the tree on this side
Definition p8est_iterate.h:183
The information that is available to the user-defined p8est_iter_face_t callback.
Definition p8est_iterate.h:122
int8_t orientation
the orientation of the sides to each other, as in the definition of p8est_connectivity_t
Definition p8est_iterate.h:125
int8_t tree_boundary
boolean: interior face (0), tree boundary face (true)
Definition p8est_iterate.h:128
Shortcut to access full face information.
Definition p8est_iterate.h:67
int8_t is_ghost
boolean: local (0) or ghost
Definition p8est_iterate.h:68
p8est_quadrant_t * quad
the actual quadrant
Definition p8est_iterate.h:69
p4est_locidx_t quadid
index in tree or ghost array
Definition p8est_iterate.h:70
Shortcut to access hanging face information.
Definition p8est_iterate.h:77
int8_t is_ghost[4]
boolean: local (0) or ghost
Definition p8est_iterate.h:78
p8est_quadrant_t * quad[4]
the actual quadrant
Definition p8est_iterate.h:79
p4est_locidx_t quadid[4]
index in tree or ghost array
Definition p8est_iterate.h:80
Information about one side of a face in the forest.
Definition p8est_iterate.h:92
int8_t face
which quadrant side the face touches
Definition p8est_iterate.h:94
p4est_topidx_t treeid
the tree on this side
Definition p8est_iterate.h:93
int8_t is_hanging
boolean: one full quad (0) or four smaller quads (1)
Definition p8est_iterate.h:96
The information that is available to the user-defined p8est_iter_volume_t callback function.
Definition p8est_iterate.h:47
p8est_quadrant_t * quad
the quadrant of the callback
Definition p8est_iterate.h:50
p4est_locidx_t quadid
id in quad's tree array (see p8est_tree_t)
Definition p8est_iterate.h:51
p4est_topidx_t treeid
the tree containing quad
Definition p8est_iterate.h:53
The 3D quadrant (i.e., octant) datatype.
Definition p8est.h:72
The p8est forest datatype.
Definition p8est.h:146
p8est_iter_edge_side_hanging_t hanging
if is_hanging, use is.hanging to access per-quadrant data
Definition p8est_iterate.h:198
p8est_iter_edge_side_full_t full
if !is_hanging, use is.full to access per-quadrant data
Definition p8est_iterate.h:195
p8est_iter_face_side_full_t full
if !is_hanging, use is.full to access per-quadrant data
Definition p8est_iterate.h:101
p8est_iter_face_side_hanging_t hanging
if is_hanging, use is.hanging to access per-quadrant data
Definition p8est_iterate.h:104