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

This 2D example program refines a domain given by an ABAQUS .inp file. More...

#include <p4est_bits.h>
#include <p4est_vtk.h>

Functions

static int refine_fn (p4est_t *p4est, p4est_topidx_t which_tree, p4est_quadrant_t *quadrant)
 Callback function to decide on refinement. More...
 
int main (int argc, char **argv)
 The main function of the step2 example program. More...
 

Variables

static int refine_level = 0
 We're not using p4est->user_pointer here but take a shortcut.
 

Detailed Description

This 2D example program refines a domain given by an ABAQUS .inp file.

Function Documentation

int main ( int  argc,
char **  argv 
)

The main function of the step2 example program.

It creates a connectivity from an ABAQUS .inp file 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.

Here we use uniform refinement. Note that this function is not suitable for recursive refinement and must be used in an iterative fashion.