p4est 2.8.7.456-de8c6
p4est is a software library for parallel adaptive mesh refinement.
Loading...
Searching...
No Matches
Functions
p4est_dune.h File Reference

Provide various functions to interface dune to a p4est mesh. More...

#include <p4est_iterate.h>
Include dependency graph for p4est_dune.h:

Go to the source code of this file.

Functions

void p4est_dune_iterate_balanced (p4est_t *p4est, p4est_ghost_t *ghost_layer, void *user_data, p4est_iter_volume_t iter_volume, p4est_iter_face_t iter_face)
 Volume and face iterator over a 2:1 balanced forest.
 
void p4est_dune_iterate (p4est_t *p4est, p4est_ghost_t *ghost_layer, void *user_data, p4est_iter_volume_t iter_volume, p4est_iter_face_t iter_face)
 Execute user supplied callbacks at every local volume and face.
 

Detailed Description

Provide various functions to interface dune to a p4est mesh.

For example, populate element corner and face number tables, where the range for each codimension begins with 0 and is contiguous.

We also provide a face-only variant of the iterator that visits all small quadrants on one side of a hanging face from separate callbacks in order.

Function Documentation

◆ p4est_dune_iterate()

void p4est_dune_iterate ( p4est_t *  p4est,
p4est_ghost_t *  ghost_layer,
void *  user_data,
p4est_iter_volume_t  iter_volume,
p4est_iter_face_t  iter_face 
)

Execute user supplied callbacks at every local volume and face.

Execute the user-supplied callback functions at every volume and face in the local forest. When multiple small quadrants are on the other side of the face of a large quadrant, the callback is executed for every small face neighbor in turn, with the same large quadrant on the other side. The user_data pointer is not touched by the iterator, only passed to each of the callbacks. Any of the callbacks may be NULL. The callback functions are interspersed with each other, i.e. some face callbacks will occur between volume callbacks:

  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. The face callbacks for the small elements at the same hanging face are executed right after each other in their Morton-index order.
  4. Callbacks are not executed at faces that only involve ghost quadrants, i.e. that are not adjacent in the local section of the forest.

The convention for the context information passed to the callbacks is the same as for p4est_iterate with the following exception: For a hanging face, we call the callback anew for every small neighbor quadrant with the same large neighbor quadrant. The hanging side data (see p4est_iter_face_side_hanging_t) is populated at index [0] each time, and we store the number of the small quadrant within the order of its face siblings in the variable is.hanging.quadid[1], values in [0, 2).

Parameters
[in]p4estThe forest to iterate over. It is not required to be 2:1 balanced.
[in]ghost_layerValid ghost structure or NULL.
[in,out]user_dataoptional context to supply to each callback.
[in]iter_volumecallback function for every quadrant interior.
[in]iter_facecallback function for every face between.

◆ p4est_dune_iterate_balanced()

void p4est_dune_iterate_balanced ( p4est_t *  p4est,
p4est_ghost_t *  ghost_layer,
void *  user_data,
p4est_iter_volume_t  iter_volume,
p4est_iter_face_t  iter_face 
)

Volume and face iterator over a 2:1 balanced forest.

See p4est_dune_iterate for a detailed reference.