HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
petscinterface_struct.h
Go to the documentation of this file.
1 
6 #ifdef with_petsc
7 
8 #ifndef _PETSC_INTERFACE_STRUCT_H_
9 #define _PETSC_INTERFACE_STRUCT_H_
10 
11 #include <sys/time.h>
12 #include <vector>
13 #include <string>
14 
15 /* include PETSc header files */
16 #include <petscsys.h>
17 #include <petscvec.h>
18 #include <petscmat.h>
19 #include <petscts.h>
20 #include <petscdmshell.h>
21 
22 /* some definitions */
23 
25 #define _MAX_STRING_SIZE_ 500
26 
27 #define _EXPLICIT_ 0
28 
29 #define _IMPLICIT_ 1
30 
42 typedef struct _petsccontext_ {
43 
45  int rank;
46 
48  int nproc;
49 
51  void *simobj;
52 
54  int nsims;
55 
57  PetscReal shift;
58 
60  double waqt;
61 
63  double t_start;
64 
66  double dt;
67 
69  std::vector<double> stage_times;
70 
73 
75  int tic;
76 
79  int npoints;
80 
83  int ndofs;
84 
89  std::vector<int*> points;
90 
92  int* offsets;
93 
94  /* flags for implicit treatment */
105 
108 
110  std::string precon_matrix_type;
111 
114 
116  double jfnk_eps;
117 
124  std::vector<double*> globalDOF;
125 
127  struct timeval iter_start_time;
129  struct timeval iter_end_time;
131  double iter_wctime;
133  double ti_runtime;
134 
135 #ifdef with_librom
136 
139  std::string rom_mode;
141  std::vector<double> op_times_arr;
142 #endif
143 } PETScContext;
144 
145 #endif
146 
147 #endif
148 
std::vector< int * > points
std::vector< double > stage_times
std::vector< double > op_times_arr
Structure containing the variables for time-integration with PETSc.
std::vector< double * > globalDOF
std::string precon_matrix_type