Date: 2022-03-04T17:39:33+00:00

Actual source code: sundials.h

      2: /*
      3:     Provides a PETSc interface to SUNDIALS. Alan Hindmarsh's parallel ODE
      4:    solver developed at LLNL.
      5: */

      7: #if !defined(PETSC_SUNDIALS_H)
      8: #define PETSC_SUNDIALS_H

     10: #include <petsc/private/tsimpl.h>
     11: #include <petsc/private/pcimpl.h>
     12: #include <petsc/private/matimpl.h>

     14: /*
     15:    Include files specific for SUNDIALS
     16: */
     17: #if defined(PETSC_HAVE_SUNDIALS2)

     19: EXTERN_C_BEGIN
     20: #include <cvode/cvode.h>                  /* prototypes for CVODE fcts. */
     21: #include <cvode/cvode_spgmr.h>            /* prototypes and constants for CVSPGMR solver */
     22: #include <nvector/nvector_parallel.h>     /* definition N_Vector and macro NV_DATA_P  */
     23: EXTERN_C_END

     25: typedef struct {
     26:   Vec update;           /* work vector where new solution is formed */
     27:   Vec ydot;             /* work vector the time derivative is stored */
     28:   Vec w1,w2;            /* work space vectors for function evaluation */

     30:   /* PETSc peconditioner objects used by SUNDIALS */
     31:   PetscInt                  cvode_type;   /* the SUNDIALS method, BDF or ADAMS  */
     32:   TSSundialsGramSchmidtType gtype;
     33:   PetscReal                 linear_tol;
     34:   PetscReal                 mindt,maxdt;

     36:   /* Variables used by Sundials */
     37:   MPI_Comm  comm_sundials;
     38:   PetscReal reltol;
     39:   PetscReal abstol;          /* only for using SS flag in SUNDIALS */
     40:   N_Vector  y;               /* current solution */
     41:   void      *mem;
     42:   PetscBool monitorstep;     /* flag for monitor internal steps; itask=V_ONE_STEP or itask=CV_NORMAL*/
     43:   PetscInt  maxl;            /* max dimension of the Krylov subspace to be used */
     44:   PetscInt  maxord;          /* max order of BDF / Adams method */
     45: } TS_Sundials;
     46: #endif

     48: #endif