Actual source code: reaction_diffusion.h

  1: #include <petscts.h>

  3: /* Simple C struct that allows us to access the two velocity (x and y directions) values easily in the code */
  4: typedef struct {
  5:   PetscScalar u, v;
  6: } Field;

  8: /* Data structure to store the model parameters */
  9: typedef struct {
 10:   PetscReal D1, D2, gamma, kappa;
 11:   PetscBool aijpc;
 12:   Vec       U;
 13:   Mat       A;
 14:   TS        ts;
 15: } AppCtx;

 17: /* User-supplied functions for TS */
 18: PetscErrorCode RHSFunction(TS, PetscReal, Vec, Vec, void *);
 19: PetscErrorCode RHSJacobian(TS, PetscReal, Vec, Mat, Mat, void *);
 20: PetscErrorCode IFunction(TS, PetscReal, Vec, Vec, Vec, void *);
 21: PetscErrorCode IJacobian(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, void *);