Actual source code: contexts.cxx
1: #include <petscsys.h>
3: /*
4: REQUIRES configuration of PETSc with option --download-adolc.
6: For documentation on ADOL-C, see
7: $PETSC_ARCH/externalpackages/ADOL-C-2.6.0/ADOL-C/doc/adolc-manual.pdf
8: */
10: #ifndef ADOLCCTX
11: #define ADOLCCTX
12: typedef struct {
13: /* No ADOL-C annotation */
14: PetscBool no_an;
16: /* Compressed Jacobian computation */
17: PetscBool sparse, sparse_view, sparse_view_done;
18: PetscScalar **Seed, **Rec, *rec;
19: PetscInt p;
21: /* Matrix dimensions, number of parameters */
22: PetscInt m, n, num_params;
23: } AdolcCtx;
24: #endif
26: /* Matrix (free) context */
27: #ifndef MATCTX
28: #define MATCTX
29: typedef struct {
30: PetscReal time;
31: Vec X;
32: Vec Xdot;
33: Vec localX0;
34: PetscReal shift;
35: PetscInt m, n;
36: PetscInt tag1, tag2;
37: TS ts;
38: PetscBool flg;
39: PetscLogEvent event1, event2, event3, event4;
40: } AdolcMatCtx;
41: #endif