p4est
1.0
|
This 2D example program refines a domain based on given image data. More...
Defines | |
#define | P4EST_STEP1_PATTERN_LEVEL 5 |
The resolution of the image data in powers of two. | |
#define | P4EST_STEP1_PATTERN_LENGTH (1 << P4EST_STEP1_PATTERN_LEVEL) |
The dimension of the image data. | |
Functions | |
static int | refine_fn (p4est_t *p4est, p4est_topidx_t which_tree, p4est_quadrant_t *quadrant) |
Callback function to decide on refinement. | |
int | main (int argc, char **argv) |
The main function of the step1 example program. | |
Variables | |
static const int | plv = P4EST_STEP1_PATTERN_LEVEL |
Shortcut. | |
static const int | ple = P4EST_STEP1_PATTERN_LENGTH |
Shortcut. |
This 2D example program refines a domain based on given image data.
The image file hw32.h has been created with the GIMP and is compiled in.
#define P4EST_STEP1_PATTERN_LENGTH (1 << P4EST_STEP1_PATTERN_LEVEL) |
The dimension of the image data.
#define P4EST_STEP1_PATTERN_LEVEL 5 |
The resolution of the image data in powers of two.
int main | ( | int | argc, |
char ** | argv | ||
) |
The main function of the step1 example program.
It creates a connectivity and forest, refines it, and writes a VTK file.
static int refine_fn | ( | p4est_t * | p4est, |
p4est_topidx_t | which_tree, | ||
p4est_quadrant_t * | quadrant | ||
) | [static] |
Callback function to decide on refinement.
Refinement and coarsening is controlled by callback functions. This function is called for every processor-local quadrant in order; its return value is understood as a boolean refinement flag. In this example we use the image file hw32.h to determine the refinement.