xref: /petsc/src/ts/tutorials/advection-diffusion-reaction/reaction_diffusion.h (revision 3ea99036a5fedea4d39e7e77471d0ab500c249d7)
1 #ifndef REACTION_DIFFUSION_H
2 #define REACTION_DIFFUSION_H
3 
4 #include <petscts.h>
5 
6 /* Simple C struct that allows us to access the two velocity (x and y directions) values easily in the code */
7 typedef struct {
8   PetscScalar u, v;
9 } Field;
10 
11 /* Data structure to store the model parameters */
12 typedef struct {
13   PetscReal D1, D2, gamma, kappa;
14   PetscBool aijpc;
15   Vec       U;
16   Mat       A;
17   TS        ts;
18 } AppCtx;
19 
20 /* User-supplied functions for TS */
21 PetscErrorCode RHSFunction(TS, PetscReal, Vec, Vec, void *);
22 PetscErrorCode RHSJacobian(TS, PetscReal, Vec, Mat, Mat, void *);
23 PetscErrorCode IFunction(TS, PetscReal, Vec, Vec, Vec, void *);
24 PetscErrorCode IJacobian(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, void *);
25 #endif
26