RCS Header: /cvsroot/petscgraphics/geomview.c,v 1.6 2003/04/30 19:34:55 hazelsct Exp
This file has the Geomview interface, including the PETSc vector gather
operations to bring everything to CPU 0.
Included Files
- #include </usr/lib/petsc/include/petscvec.h>
Preprocessor definitions
#define DPRINTF( fmt, args... )
#define __FUNCT__ "GeomviewBegin"
#define __FUNCT__ "GeomviewEnd"
#define __FUNCT__ "GeomviewDisplayTriangulation"
External Variables
num_triangles
Declared in illuminator.c, this gives the current number of triangles on
this node.
extern int num_triangles
vertices
Declared in illuminator.c, this array stores the corner coordinates and
color information for each triangle.
extern PetscScalar vertices[]
Local Variables
pfd
Stream holding the pipe to the Geomview process. It is initialized to
NULL, then set by GeomviewBegin, and cleared by GeomviewEnd. This can be
used as a flag to determine whether the Geomview display is open.
static FILE* pfd
Spawn a new geomview process. Most of this was shamelessly ripped from Ken
Brakke's Surface Evolver.
int GeomviewBegin ( MPI_Comm comm )
- int GeomviewBegin
- Returns 0 or an error code.
- MPI_Comm comm
- MPI communicator for rank information, if NULL it uses
PETSC_COMM_WORLD.
Pipe the current triangulation to Geomview for display. Much of this is
based on Ken Brakke's Surface Evolver.
int GeomviewDisplayTriangulation ( MPI_Comm comm, PetscScalar* minmax, char* name, PetscTruth transparent )
- int GeomviewDisplayTriangulation
- Returns 0 or an error code.
- MPI_Comm comm
- MPI communicator for rank information, if NULL it uses
PETSC_COMM_WORLD.
- PetscScalar* minmax
- Position of block corners: xmin, xmax, ymin, ymax, zmin, zmax.
- char* name
- Name to give the Geomview OOGL object which we create.
- PetscTruth transparent
- Geomview transparency flag.
First, this creates global and local vectors for all of the triangle
vertices.
It then gathers (``scatters'') all vertex data to processor zero,
and puts them in an array.
Finally, it sends everything to Geomview,
and cleans up the mess, resetting the number of triangles to zero.
Exit the current running Geomview process and close its pipe. Based in part
on Ken Brakke's Surface Evolver.
int GeomviewEnd ( MPI_Comm comm )
- int GeomviewEnd
- Returns 0 or an error code.
- MPI_Comm comm
- MPI communicator for rank information, if NULL it uses
PETSC_COMM_WORLD.