File libluminate/petsc.c

RCS Header

This is the petsc.c main file. It has all of the PETSc-dependent functions.


Included Files


Preprocessor definitions

#define ORBIT2 1

#define IMLIB2_EXISTS 1

#define __FUNCT__ "DATriangulateRange"

#define __FUNCT__ "DATriangulateLocalRange"

#define __FUNCT__ "IllErrorHandler"


Global Function DATriangulateLocalRange()

Calculate vertices of isoquant triangles in a 3-D distributed array. This takes a PETSc DA object, does some sanity checks, calculates array sizes, and then gets array and passes it to Draw3DBlock for triangulation.

int DATriangulateLocalRange ( ISurface Surf, DA theda, Vec localX, int this, PetscScalar* minmax, int n_quants, PetscScalar* isoquants, PetscScalar* colors, int xmin, int xmax, int ymin, int ymax, int zmin, int zmax )

int DATriangulateLocalRange
Returns 0 or an error code.
ISurface Surf
ISurface object into which to draw this DA's isoquants.
DA theda
The PETSc distributed array object.
Vec localX
PETSc local vector object associated with the DA with data we'd like to graph.
int this
Index of the field we'd like to draw.
PetscScalar* minmax
Position of block corners: xmin, xmax, ymin, ymax, zmin, zmax.
int n_quants
Number of isoquant surfaces to draw (isoquant values). Note PETSC_DECIDE is not a valid option here, because it's impossible to know the global maximum and minimum and have consistent contours without user-supplied information.
PetscScalar* isoquants
Array of function values at which to draw isoquants.
PetscScalar* colors
Array of color R,G,B,A quads for each isoquant.
int xmin
Smallest grid x-coordinate to render.
int xmax
Largest grid x-coordinate to render, -1 goes to full x maximum, -2 in periodic systems goes to one short of x maximum.
int ymin
Smallest grid y-coordinate to render.
int ymax
Largest grid y-coordinate to render, -1 goes to full y maximum, -2 in periodic systems goes to one short of y maximum.
int zmin
Smallest grid z-coordinate to render.
int zmax
Largest grid z-coordinate to render, -1 goes to full z maximum, -2 in periodic systems goes to one short of z maximum.

Global Function DATriangulateRange()

Calculate vertices of isoquant triangles in a 3-D distributed array. This takes a PETSc DA object, does some sanity checks, calculates array sizes, gets the local vector and array, and then calls DATriangulateLocal() to do the rest. Note that global array access (i.e. this function) is necessary for using default isoquant values, since we need to be able to calculate the maximum and minimum on the global array.

int DATriangulateRange ( ISurface Surf, DA theda, Vec globalX, int this, PetscScalar* minmax, int n_quants, PetscScalar* isoquants, PetscScalar* colors, int xmin, int xmax, int ymin, int ymax, int zmin, int zmax )

int DATriangulateRange
Returns 0 or an error code.
ISurface Surf
ISurface object into which to draw this DA's isoquants.
DA theda
The PETSc distributed array object.
Vec globalX
PETSc global vector object associated with the DA with data we'd like to graph.
int this
Index of the field we'd like to draw.
PetscScalar* minmax
Position of block corners: xmin, xmax, ymin, ymax, zmin, zmax.
int n_quants
Number of isoquant surfaces to draw (isoquant values), or PETSC_DECIDE to use red, yellow, green, blue at 0.2, 0.4, 0.6 and 0.8 between the vector's global minimum and maximum values.
PetscScalar* isoquants
Array of function values at which to draw isoquants, or PETSC_NULL if n_quants=PETSC\_DECIDE.
PetscScalar* colors
Array of color R,G,B,A quads for each isoquant, or PETSC_NULL if n_quants=PETSC\_DECIDE.
int xmin
Smallest grid x-coordinate to render.
int xmax
Largest grid x-coordinate to render, -1 goes to full x maximum, -2 in periodic systems goes to one short of x maximum.
int ymin
Smallest grid y-coordinate to render.
int ymax
Largest grid y-coordinate to render, -1 goes to full y maximum, -2 in periodic systems goes to one short of y maximum.
int zmin
Smallest grid z-coordinate to render.
int zmax
Largest grid z-coordinate to render, -1 goes to full z maximum, -2 in periodic systems goes to one short of z maximum.

Global Function IllErrorHandler()

Handle errors, in this case the PETSc way.

int IllErrorHandler ( int id, char* message )

int IllErrorHandler
Returns the error code supplied.
int id
Index of the error, defined in petscerror.h.
char* message
Text of the error message.