File chts.c

RCS Header

This is the Cahn Hilliard timestepping code. It is provided here as an example usage of the Illuminator Distributed Visualization Library.


Included Files


Preprocessor definitions

#define ORBIT2 1

#define _REENTRANT 1

#define IMLIB2_EXISTS 1

#define _FORTIFY_SOURCE 2

#define DPRINTF( fmt, args... )

#define __FUNCT__ "ch_ts_monitor"

#define __FUNCT__ "main"

#define __FUNCT__ "FormInitialCondition"

#define __FUNCT__ "InitializeProblem"


Global Variable Surf

ISurface Surf

Global Variable Disp

IDisplay Disp

Local Variables

help
static char help[]

Global Function FormInitialCondition()

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.

Global Function InitializeProblem()

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.

Global Function ch_ts_jacobian_2d()

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.

Global Function ch_ts_jacobian_3d()

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.

Global Function ch_ts_monitor()

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.

Global Function ch_ts_residual_vector_2d()

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.

Global Function ch_ts_residual_vector_3d()

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.

Global Function main()

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.