File tsview.c

RCS Header

This program views the output of a time series saved using IlluMultiSave(). It basically just switches between timesteps; future versions may be more interesting. The neat part of it is that it loads multiprocessor data and displays it on a single CPU.


Included Files


Preprocessor definitions

#define _REENTRANT 1

#define ORBIT2 1

#define IMLIB2_EXISTS 1

#define _FORTIFY_SOURCE 2

#define HELP_STRING "tsview commands:\n <enter> Display next timestep\n b Display previous timestep\n i increment Set the next timestep increment\n ### Jump to timestep ###\n t Toggle Geomview transparency (3-D only)\n v Change field displayed (3-D only)\n d Dump geomview to picture (3-D only), creates basename-f%d.ppm\n a Dump all timesteps to pictures (3-D only)\n p [v1 v2 ...] Set contour values for plotting or \"auto\" (3-D only)\n r Reloads entries in a directory\n s size Set maximum dimension of PETSc viewer windows (2-D only)\n cx, cy, cz Toggle xcut, ycut, zcut (cut last row/plane of periodic DA)\n gx30-90, y,z Set plot x range to 30-90, same for y and z\n h/? Print this information\n q/x Quit tsview\n"

#define DPRINTF( fmt, args... )

#define __FUNCT__ "myfilter"

#define __FUNCT__ "main"


Global Variable basefilename

char* basefilename

Local Variables

help
static char help[]

line_read
Functions for reading the command line and avoiding reading empty lines
Probably this function is not Petsc safe, but we'll see.

static char* line_read


Global Function PetscSynchronizedFReadline()

int PetscSynchronizedFReadline ( MPI_Comm comm, char* message, char* string )

Global Function main()

This is main().

int main ( int argc, char* argv[] )

int main
It returns an int to the OS.
int argc
Argument count.
char* argv[]
Arguments.
After PETSc initialization, it gets the list of files matching the basename.
In the main loop, the various timesteps are displayed, with options:
The Illuminator-based 3-D viewer can only display one field at a time. At the beginning, that is field 0, and is cycled using the v command.


Global Function myfilter()

This function returns non-zero for "qualifying" file names which start with the stored files' basename and end with .cpu0000.meta. It is used as the select() function for scandir() in main().

int myfilter ( const struct dirent* direntry )

int myfilter
Returns non-zero for qualifying filenames.
const struct dirent* direntry
Directory entry with filename to test.

Global Function rl_gets()

char* rl_gets ( char* message )