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

Iteration over mesh topology via callbacks. More...

#include <p8est.h>
#include <p8est_ghost.h>

Go to the source code of this file.

Data Structures

struct  p8est_iter_volume_info_t
 The information that is available to the user-defined p8est_iter_volume_t callback function. More...
 
struct  p8est_iter_face_side_t
 Information about one side of a face in the forest. More...
 
union  p8est_iter_face_side_t::p8est_iter_face_side_data
 
struct  p8est_iter_face_info_t
 The information that is available to the user-defined p8est_iter_face_t callback. More...
 
struct  p8est_iter_edge_side_t
 
union  p8est_iter_edge_side_t::p8est_iter_edge_side_data
 
struct  p8est_iter_edge_info_t
 The information about all sides of an edge in the forest. More...
 
struct  p8est_iter_corner_side_t
 
struct  p8est_iter_corner_info_t
 The information that is availalbe to the user-defined p8est_iter_corner_t callback. More...
 

Typedefs

typedef 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 process. More...
 
typedef 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: the face can be a 2:1 hanging face, it does not have to be conformal. More...
 
typedef 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 quadrants that touch it i.e. More...
 
typedef 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 quadrants that touch it. More...
 

Functions

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 forest. More...
 
static p8est_iter_corner_side_tp8est_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.
 
static p8est_iter_corner_side_tp8est_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.
 
static p8est_iter_edge_side_tp8est_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.
 
static p8est_iter_edge_side_tp8est_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.
 
static p8est_iter_face_side_tp8est_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.
 
static p8est_iter_face_side_tp8est_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.
 

Detailed Description

Iteration over mesh topology via callbacks.

Typedef Documentation

typedef 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 quadrants that touch it.

i.e. the callback will not execute on a corner that sits on a hanging face or edge.

Parameters
[in]infoinformation about a quadrant provided to the user
[in,out]user_datathe user context passed to p8est_iterate()
Note
the forest does not need to be corner balanced for p8est_iterate() to execute a callback function at corners, only face and edge balanced.
typedef 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 quadrants that touch it i.e.

the callback will not execute on an edge the sits on a hanging face.

Parameters
[in]infoinformation about a quadrant provided to the user
[in,out]user_datathe user context passed to p8est_iterate()
Note
the forest must be edge balanced for p8est_iterate() to execute a callback function on edges.
typedef 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: the face can be a 2:1 hanging face, it does not have to be conformal.

Parameters
[in]infoinformation about a quadrant provided to the user
[in,out]user_datathe user context passed to p8est_iterate()
Note
the forest must be face balanced for p8est_iterate() to execute a callback function on faces (see p8est_balance()).
typedef 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 process.

Parameters
[in]infoinformation about a quadrant provided to the user
[in,out]user_datathe user context passed to p8est_iterate()

Function Documentation

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 forest.

The ghost_layer may be NULL. The user_data pointer is not touched by p8est_iterate, but is passed to each of the callbacks. Any of the callback functions may be NULL. The callback functions are interspersed with each other, i.e. some face callbacks will occur between volume callbacks, and some edge callbacks will occur between face callbacks, etc.:

1) volume callbacks occur in the sorted Morton-index order. 2) a face callback is not executed until after the volume callbacks have been executed for the quadrants that share it. 3) an edge callback is not executed until the face callbacks have been executed for all faces that touch the edge. 4) a corner callback is not executed until the edge callbacks have been executed for all edges that touch the corner. 5) it is not always the case that every face callback for a given quadrant is executed before any of the edge or corner callbacks, and it is not always the case that every edge callback for a given quadrant is executed before any of the corner callbacks. 6) callbacks are not executed at faces, edges or corners that only involve ghost quadrants, i.e. that are not adjacent in the local section of the forest.

Parameters
[in]p4estthe forest
[in]ghost_layeroptional: when not given, callbacks at the boundaries of the local partition cannot provide quadrant data about ghost quadrants: missing (p8est_quadrant_t *) pointers are set to NULL, missing indices are set to -1.
[in,out]user_dataoptional context to supply to each callback
[in]iter_volumecallback function for every quadrant's interior
[in]iter_facecallback function for every face between quadrants
[in]iter_edgecallback function for every edge between quadrants
[in]iter_cornercallback function for every corner between quadrants