RCS Header: /cvsroot/petscgraphics/chts.c,v 1.27 2004/03/07 01:56:18 hazelsct Exp
This is the Cahn Hilliard timestepping code. It is provided here as an
example usage of the Illuminator Distributed Visualization Library.
Included Files
- #include "cahnhill.h"
- #include </usr/lib/petsc/include/petscts.h>
- #include </usr/lib/petsc/include/petscda.h>
Preprocessor definitions
#define DPRINTF( fmt, args... )
#define __FUNCT__ "ch_ts_monitor"
#define __FUNCT__ "main"
#define __FUNCT__ "FormInitialCondition"
#define __FUNCT__ "InitializeProblem"
Local Variables
help
static char help[]
Like it says, put together the initial condition.
int FormInitialCondition ( AppCtx* user, Vec X )
- int FormInitialCondition
- Returns zero or error.
- AppCtx* user
- The user context structure.
- Vec X
- Vector in which to place the initial condition.
This takes the gory details of initialization out of the way (importing
parameters into the user context, etc.).
int InitializeProblem ( AppCtx* user, Vec* xvec )
- int InitializeProblem
- Returns zero or error.
- AppCtx* user
- The user context to fill.
- Vec* xvec
- Vector into which to put the initial condition.
Wrapper for
ch_jacobian_2d() in cahnhill.c.
int ch_ts_jacobian_2d ( TS thets, PetscScalar time, Vec X, Mat* A, Mat* B, MatStructure* flag, void* ptr )
- int ch_ts_jacobian_2d
- Usual return: zero or error.
- TS thets
- Timestepping context, ignored here.
- PetscScalar time
- Current time, also ignored.
- Vec X
- Current solution vector.
- Mat* A
- Place to put the new Jacobian.
- Mat* B
- Place to put the new conditioning matrix.
- MatStructure* flag
- Flag describing the volatility of the structure.
- void* ptr
- User data pointer.
Wrapper for
ch_jacobian_3d() in cahnhill.c.
int ch_ts_jacobian_3d ( TS thets, PetscScalar time, Vec X, Mat* A, Mat* B, MatStructure* flag, void* ptr )
- int ch_ts_jacobian_3d
- Usual return: zero or error.
- TS thets
- Timestepping context, ignored here.
- PetscScalar time
- Current time, also ignored.
- Vec X
- Current solution vector.
- Mat* A
- Place to put the new Jacobian.
- Mat* B
- Place to put the new conditioning matrix.
- MatStructure* flag
- Flag describing the volatility of the structure.
- void* ptr
- User data pointer.
Monitor routine which displays the current state, using
Illuminator's geomview
front-end (unless -no_contours is used); and also saves it using
IlluMultiSave()
if -save_data is specified.
int ch_ts_monitor ( TS thets, int stepno, PetscScalar time, Vec X, void* ptr )
- int ch_ts_monitor
- Usual return: zero or error.
- TS thets
- Timestepping context, ignored here.
- int stepno
- Current time step number.
- PetscScalar time
- Current time.
- Vec X
- Vector of current solved field values.
- void* ptr
- User data pointer.
Wrapper for
ch_residual_vector_2d() in cahnhill.c.
int ch_ts_residual_vector_2d ( TS thets, PetscScalar time, Vec X, Vec F, void* ptr )
- int ch_ts_residual_vector_2d
- Usual return: zero or error.
- TS thets
- Timestepping context, ignored here.
- PetscScalar time
- Current time, also ignored.
- Vec X
- Current solution vector.
- Vec F
- Function vector to return.
- void* ptr
- User data pointer.
Wrapper for
ch_residual_vector_3d() in cahnhill.c.
int ch_ts_residual_vector_3d ( TS thets, PetscScalar time, Vec X, Vec F, void* ptr )
- int ch_ts_residual_vector_3d
- Usual return: zero or error.
- TS thets
- Timestepping context, ignored here.
- PetscScalar time
- Current time, also ignored.
- Vec X
- Current solution vector.
- Vec F
- Function vector to return.
- void* ptr
- User data pointer.
The usual main function.
int main ( int argc, char** argv )
- int main
- Returns 0 or error.
- int argc
- Number of args.
- char** argv
- The args.