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