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