MFEM  v3.3.2
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
sundials.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_SUNDIALS
13 #define MFEM_SUNDIALS
14 
15 #include "../config/config.hpp"
16 
17 #ifdef MFEM_USE_SUNDIALS
18 
19 #ifdef MFEM_USE_MPI
20 #include <mpi.h>
21 #endif
22 
23 #include "ode.hpp"
24 #include "solvers.hpp"
25 
26 #include <cvode/cvode.h>
27 #include <arkode/arkode.h>
28 #include <kinsol/kinsol.h>
29 
30 struct KINMemRec;
31 
32 namespace mfem
33 {
34 
35 /** @brief Abstract base class, wrapping the custom linear solvers interface in
36  SUNDIALS' CVODE and ARKODE solvers. */
37 /** For a given ODE system
38 
39  dx/dt = f(x,t)
40 
41  the purpose of this class is to facilitate the (approximate) solution of
42  linear systems of the form
43 
44  (I - γJ) y = b, J = J(x,t) = df/dx
45 
46  for given b, x, t and γ, where γ = GetTimeStep() is a scaled time step. */
48 {
49 public:
50  enum {CVODE, ARKODE} type; ///< Is CVODE or ARKODE using this object?
51 
52 protected:
55 
56  /// Get the current scaled time step, gamma, from @a sundials_mem.
57  double GetTimeStep(void *sundials_mem);
58  /// Get the TimeDependentOperator associated with @a sundials_mem.
60 
61 public:
62  /** @name Linear solver interface methods.
63  These four functions and their parameters are documented in Section 7 of
64  http://computation.llnl.gov/sites/default/files/public/cv_guide.pdf
65  and Section 7.4 of
66  http://computation.llnl.gov/sites/default/files/public/ark_guide.pdf
67 
68  The first argument, @a sundials_mem, is one of the pointer types,
69  CVodeMem or ARKodeMem, depending on the value of the data member @a type.
70  */
71  ///@{
72  virtual int InitSystem(void *sundials_mem) = 0;
73  virtual int SetupSystem(void *sundials_mem, int conv_fail,
74  const Vector &y_pred, const Vector &f_pred,
75  int &jac_cur, Vector &v_temp1,
76  Vector &v_temp2, Vector &v_temp3) = 0;
77  virtual int SolveSystem(void *sundials_mem, Vector &b, const Vector &w,
78  const Vector &y_cur, const Vector &f_cur) = 0;
79  virtual int FreeSystem(void *sundials_mem) = 0;
80  ///@}
81 };
82 
83 
84 /// A base class for the MFEM classes wrapping SUNDIALS' solvers.
85 /** This class defines some common data and functions used by the SUNDIALS
86  solvers, e.g the common @a #sundials_mem pointer and return @a #flag. */
88 {
89 protected:
90  void *sundials_mem; ///< Pointer to the SUNDIALS mem object.
91  mutable int flag; ///< Flag returned by the last call to SUNDIALS.
92 
93  N_Vector y; ///< Auxiliary N_Vector.
94 #ifdef MFEM_USE_MPI
95  bool Parallel() const
96  { return (y->ops->nvgetvectorid != N_VGetVectorID_Serial); }
97 #else
98  bool Parallel() const { return false; }
99 #endif
100 
101  static const double default_rel_tol;
102  static const double default_abs_tol;
103 
104  // Computes the action of a time-dependent operator.
105  /// Callback function used in CVODESolver and ARKODESolver.
106  static int ODEMult(realtype t, const N_Vector y,
107  N_Vector ydot, void *td_oper);
108 
109  /// @name The constructors are protected
110  ///@{
112  SundialsSolver(void *mem) : sundials_mem(mem) { }
113  ///@}
114 
115 public:
116  /// Access the underlying SUNDIALS object.
117  void *SundialsMem() const { return sundials_mem; }
118 
119  /// Return the flag returned by the last call to a SUNDIALS function.
120  int GetFlag() const { return flag; }
121 };
122 
123 /// Wrapper for SUNDIALS' CVODE library -- Multi-step time integration.
124 /**
125  - http://computation.llnl.gov/projects/sundials
126  - http://computation.llnl.gov/sites/default/files/public/cv_guide.pdf
127 
128  @note All methods except Step() can be called before Init().
129  To minimize uncertainty, we advise the user to adhere to the given
130  interface, instead of making similar calls by the CVODE's
131  internal CVodeMem object.
132 */
133 class CVODESolver : public ODESolver, public SundialsSolver
134 {
135 public:
136  /// Construct a serial CVODESolver, a wrapper for SUNDIALS' CVODE solver.
137  /** @param[in] lmm Specifies the linear multistep method, the options are
138  CV_ADAMS (explicit methods) or CV_BDF (implicit
139  methods).
140  @param[in] iter Specifies type of nonlinear solver iteration, the
141  options are CV_FUNCTIONAL (usually with CV_ADAMS) or
142  CV_NEWTON (usually with CV_BDF).
143  For parameter desciption, see the CVodeCreate documentation (cvode.h). */
144  CVODESolver(int lmm, int iter);
145 
146 #ifdef MFEM_USE_MPI
147  /// Construct a parallel CVODESolver, a wrapper for SUNDIALS' CVODE solver.
148  /** @param[in] comm The MPI communicator used to partition the ODE system.
149  @param[in] lmm Specifies the linear multistep method, the options are
150  CV_ADAMS (explicit methods) or CV_BDF (implicit
151  methods).
152  @param[in] iter Specifies type of nonlinear solver iteration, the
153  options are CV_FUNCTIONAL (usually with CV_ADAMS) or
154  CV_NEWTON (usually with CV_BDF).
155  For parameter desciption, see the CVodeCreate documentation (cvode.h). */
156  CVODESolver(MPI_Comm comm, int lmm, int iter);
157 #endif
158 
159  /// Set the scalar relative and scalar absolute tolerances.
160  void SetSStolerances(double reltol, double abstol);
161 
162  /// Set a custom Jacobian system solver for the CV_NEWTON option usually used
163  /// with implicit CV_BDF.
165 
166  /** @brief CVode supports two modes, specified by itask: CV_NORMAL (default)
167  and CV_ONE_STEP. */
168  /** In the CV_NORMAL mode, the solver steps until it reaches or passes
169  tout = t + dt, where t and dt are specified in Step(), and then
170  interpolates to obtain y(tout). In the CV_ONE_STEP mode, it takes one
171  internal step and returns. */
172  void SetStepMode(int itask);
173 
174  /// Set the maximum order of the linear multistep method.
175  /** The default is 12 (CV_ADAMS) or 5 (CV_BDF).
176  CVODE uses adaptive-order integration, based on the local truncation
177  error. Use this if you know a priori that your system is such that
178  higher order integration formulas are unstable.
179  @note @a max_order can't be higher than the current maximum order. */
180  void SetMaxOrder(int max_order);
181 
182  /// Set the maximum time step of the linear multistep method.
183  void SetMaxStep(double dt_max)
184  { flag = CVodeSetMaxStep(sundials_mem, dt_max); }
185 
186  /// Set the ODE right-hand-side operator.
187  /** The start time of CVODE is initialized from the current time of @a f_.
188  @note This method calls CVodeInit(). Some CVODE parameters can be set
189  (using the handle returned by SundialsMem()) only after this call. */
190  virtual void Init(TimeDependentOperator &f_);
191 
192  /// Use CVODE to integrate over [t, t + dt], with the specified step mode.
193  /** Calls CVode(), which is the main driver of the CVODE package.
194  @param[in,out] x Solution vector to advance. On input/output x=x(t)
195  for t corresponding to the input/output value of t,
196  respectively.
197  @param[in,out] t Input: the starting time value. Output: the time value
198  of the solution output, as returned by CVode().
199  @param[in,out] dt Input: desired time step. Output: the last incremental
200  time step used. */
201  virtual void Step(Vector &x, double &t, double &dt);
202 
203  /// Print CVODE statistics.
204  void PrintInfo() const;
205 
206  /// Destroy the associated CVODE memory.
207  virtual ~CVODESolver();
208 };
209 
210 /// Wrapper for SUNDIALS' ARKODE library -- Runge-Kutta time integration.
211 /**
212  - http://computation.llnl.gov/projects/sundials
213  - http://computation.llnl.gov/sites/default/files/public/ark_guide.pdf
214 
215  @note All methods except Step() can be called before Init().
216  To minimize uncertainty, we advise the user to adhere to the given
217  interface, instead of making similar calls by the ARKODE's
218  internal ARKodeMem object.
219 */
220 class ARKODESolver : public ODESolver, public SundialsSolver
221 {
222 protected:
225 
226 public:
227  /// Types of ARKODE solvers.
228  enum Type { EXPLICIT, IMPLICIT };
229 
230  /// Construct a serial ARKODESolver, a wrapper for SUNDIALS' ARKODE solver.
231  /** @param[in] type Specifies the #Type of ARKODE solver to construct. */
232  ARKODESolver(Type type = EXPLICIT);
233 
234 #ifdef MFEM_USE_MPI
235  /// Construct a parallel ARKODESolver, a wrapper for SUNDIALS' ARKODE solver.
236  /** @param[in] comm The MPI communicator used to partition the ODE system.
237  @param[in] type Specifies the #Type of ARKODE solver to construct. */
238  ARKODESolver(MPI_Comm comm, Type type = EXPLICIT);
239 #endif
240 
241  /// Specify the scalar relative and scalar absolute tolerances.
242  void SetSStolerances(double reltol, double abstol);
243 
244  /// Set a custom Jacobian system solver for implicit methods.
246 
247  /** @brief ARKode supports two modes, specified by itask: ARK_NORMAL
248  (default) and ARK_ONE_STEP. */
249  /** In the ARK_NORMAL mode, the solver steps until it reaches or passes
250  tout = t + dt, where t and dt are specified in Step(), and then
251  interpolates to obtain y(tout). In the ARK_ONE_STEP mode, it takes one
252  internal step and returns. */
253  void SetStepMode(int itask);
254 
255  /// Chooses integration order for all explicit / implicit / IMEX methods.
256  /** The default is 4, and the allowed ranges are: [2, 8] for explicit; [2, 5]
257  for implicit; [3, 5] for IMEX. */
258  void SetOrder(int order);
259 
260  /// Choose a specific Butcher table for implicit RK method.
261  /** See the documentation for all possible options, stability regions, etc.
262  For example, table_num = ARK548L2SA_DIRK_8_4_5 is 8-stage 5th order. */
263  void SetIRKTableNum(int table_num);
264  /// Choose a specific Butcher table for explicit RK method.
265  /** See the documentation for all possible options, stability regions, etc.*/
266  void SetERKTableNum(int table_num);
267 
268  /** @brief Use a fixed time step size, instead of performing any form of
269  temporal adaptivity. */
270  /** Use of this function is not recommended, since there is no assurance of
271  the validity of the computed solutions. It is primarily provided for
272  code-to-code verification testing purposes. */
273  void SetFixedStep(double dt);
274 
275  /// Set the maximum time step of the Runge-Kutta method.
276  void SetMaxStep(double dt_max)
277  { flag = ARKodeSetMaxStep(sundials_mem, dt_max); }
278 
279  /// Set the ODE right-hand-side operator.
280  /** The start time of ARKODE is initialized from the current time of @a f_.
281  @note This method calls ARKodeInit(). Some ARKODE parameters can be set
282  (using the handle returned by SundialsMem()) only after this call. */
283  virtual void Init(TimeDependentOperator &f_);
284 
285  /// Use ARKODE to integrate over [t, t + dt], with the specified step mode.
286  /** Calls ARKode(), which is the main driver of the ARKODE package.
287  @param[in,out] x Solution vector to advance. On input/output x=x(t)
288  for t corresponding to the input/output value of t,
289  respectively.
290  @param[in,out] t Input: the starting time value. Output: the time value
291  of the solution output, as returned by CVode().
292  @param[in,out] dt Input: desired time step. Output: the last incremental
293  time step used. */
294  virtual void Step(Vector &x, double &t, double &dt);
295 
296  /// Print ARKODE statistics.
297  void PrintInfo() const;
298 
299  /// Destroy the associated ARKODE memory.
300  virtual ~ARKODESolver();
301 };
302 
303 /// Wrapper for SUNDIALS' KINSOL library -- Nonlinear solvers.
304 /**
305  - http://computation.llnl.gov/projects/sundials
306  - http://computation.llnl.gov/sites/default/files/public/kin_guide.pdf
307 
308  @note To minimize uncertainty, we advise the user to adhere to the given
309  interface, instead of making similar calls by the KINSOL's
310  internal KINMem object.
311 */
312 class KinSolver : public NewtonSolver, public SundialsSolver
313 {
314 protected:
316  mutable N_Vector y_scale, f_scale;
317  const Operator *jacobian; // stores the result of oper->GetGradient()
318 
319  /// @name Auxiliary callback functions.
320  ///@{
321  // Computes the non-linear operator action F(u).
322  // The real type of user_data is pointer to KinSolver.
323  static int Mult(const N_Vector u, N_Vector fu, void *user_data);
324 
325  // Computes J(u)v. The real type of user_data is pointer to KinSolver.
326  static int GradientMult(N_Vector v, N_Vector Jv, N_Vector u,
327  booleantype *new_u, void *user_data);
328 
329  static int LinSysSetup(KINMemRec *kin_mem);
330 
331  static int LinSysSolve(KINMemRec *kin_mem, N_Vector x, N_Vector b,
332  realtype *sJpnorm, realtype *sFdotJp);
333  ///@}
334 
335 public:
336  /// Construct a serial KinSolver, a wrapper for SUNDIALS' KINSOL solver.
337  /** @param[in] strategy Specifies the nonlinear solver strategy:
338  KIN_NONE / KIN_LINESEARCH / KIN_PICARD / KIN_FP.
339  @param[in] oper_grad Specifies whether the solver should use its
340  Operator's GetGradient() method to compute the
341  Jacobian of the system. */
342  KinSolver(int strategy, bool oper_grad = true);
343 
344 #ifdef MFEM_USE_MPI
345  /// Construct a parallel KinSolver, a wrapper for SUNDIALS' KINSOL solver.
346  /** @param[in] comm The MPI communicator used to partition the system.
347  @param[in] strategy Specifies the nonlinear solver strategy:
348  KIN_NONE / KIN_LINESEARCH / KIN_PICARD / KIN_FP.
349  @param[in] oper_grad Specifies whether the solver should use its
350  Operator's GetGradient() method to compute the
351  Jacobian of the system. */
352  KinSolver(MPI_Comm comm, int strategy, bool oper_grad = true);
353 #endif
354 
355  /// Destroy the associated KINSOL memory.
356  virtual ~KinSolver();
357 
358  /// Set the nonlinear Operator of the system. This method calls KINInit().
359  virtual void SetOperator(const Operator &op);
360 
361  /// Set the linear solver for inverting the Jacobian.
362  /** @note This function assumes that Operator::GetGradient(const Vector &)
363  is implemented by the Operator specified by
364  SetOperator(const Operator &). */
365  virtual void SetSolver(Solver &solver);
366  /// Equivalent to SetSolver(Solver).
367  virtual void SetPreconditioner(Solver &solver) { SetSolver(solver); }
368 
369  /// Set KINSOL's scaled step tolerance.
370  /** The default tolerance is U^(2/3), where U = machine unit roundoff. */
371  void SetScaledStepTol(double sstol);
372  /// Set KINSOL's functional norm tolerance.
373  /** The default tolerance is U^(1/3), where U = machine unit roundoff.
374  @note This function is equivalent to SetAbsTol(double). */
375  void SetFuncNormTol(double ftol) { abs_tol = ftol; }
376 
377  /// Set maximum number of nonlinear iterations without a Jacobian update.
378  /** The default is 10. */
379  void SetMaxSetupCalls(int max_calls);
380 
381  /// Solve the nonlinear system F(x) = 0.
382  /** Calls the other Mult(Vector&, Vector&, Vector&) const method with
383  `x_scale = 1`. The values of 'fx_scale' are determined by comparing
384  the chosen relative and functional norm (i.e. absolute) tolerances.
385  @param[in] b Not used, KINSol always assumes zero RHS.
386  @param[in,out] x On input, initial guess, if @a #iterative_mode = true,
387  otherwise the initial guess is zero; on output, the
388  solution. */
389  virtual void Mult(const Vector &b, Vector &x) const;
390 
391  /// Solve the nonlinear system F(x) = 0.
392  /** Calls KINSol() to solve the nonlinear system. Before calling KINSol(),
393  this functions uses the data members inherited from class IterativeSolver
394  to set corresponding KINSOL options.
395  @param[in,out] x On input, initial guess, if @a #iterative_mode =
396  true, otherwise the initial guess is zero; on
397  output, the solution.
398  @param[in] x_scale Elements of a diagonal scaling matrix D, s.t.
399  D*x has all elements roughly the same when
400  x is close to a solution.
401  @param[in] fx_scale Elements of a diagonal scaling matrix E, s.t.
402  D*F(x) has all elements roughly the same when
403  x is not too close to a solution. */
404  void Mult(Vector &x, const Vector &x_scale, const Vector &fx_scale) const;
405 };
406 
407 } // namespace mfem
408 
409 #endif // MFEM_USE_SUNDIALS
410 
411 #endif // MFEM_SUNDIALS
void SetFixedStep(double dt)
Use a fixed time step size, instead of performing any form of temporal adaptivity.
Definition: sundials.cpp:534
virtual void Init(TimeDependentOperator &f_)
Set the ODE right-hand-side operator.
Definition: sundials.cpp:292
virtual int FreeSystem(void *sundials_mem)=0
virtual int SolveSystem(void *sundials_mem, Vector &b, const Vector &w, const Vector &y_cur, const Vector &f_cur)=0
static const double default_abs_tol
Definition: sundials.hpp:102
virtual void Init(TimeDependentOperator &f_)
Set the ODE right-hand-side operator.
Definition: sundials.cpp:562
void SetSStolerances(double reltol, double abstol)
Set the scalar relative and scalar absolute tolerances.
Definition: sundials.cpp:224
void SetMaxSetupCalls(int max_calls)
Set maximum number of nonlinear iterations without a Jacobian update.
Definition: sundials.cpp:980
static int Mult(const N_Vector u, N_Vector fu, void *user_data)
Definition: sundials.cpp:720
Base abstract class for time dependent operators.
Definition: operator.hpp:142
virtual void Step(Vector &x, double &t, double &dt)
Use CVODE to integrate over [t, t + dt], with the specified step mode.
Definition: sundials.cpp:356
static int ODEMult(realtype t, const N_Vector y, N_Vector ydot, void *td_oper)
Callback function used in CVODESolver and ARKODESolver.
Definition: sundials.cpp:157
virtual ~KinSolver()
Destroy the associated KINSOL memory.
Definition: sundials.cpp:1074
void SetStepMode(int itask)
ARKode supports two modes, specified by itask: ARK_NORMAL (default) and ARK_ONE_STEP.
Definition: sundials.cpp:509
virtual ~CVODESolver()
Destroy the associated CVODE memory.
Definition: sundials.cpp:417
Abstract class for solving systems of ODEs: dx/dt = f(x,t)
Definition: ode.hpp:22
int GetFlag() const
Return the flag returned by the last call to a SUNDIALS function.
Definition: sundials.hpp:120
void SetLinearSolver(SundialsODELinearSolver &ls_spec)
Definition: sundials.cpp:233
void * sundials_mem
Pointer to the SUNDIALS mem object.
Definition: sundials.hpp:90
TimeDependentOperator * GetTimeDependentOperator(void *sundials_mem)
Get the TimeDependentOperator associated with sundials_mem.
Definition: sundials.cpp:79
Type
Types of ARKODE solvers.
Definition: sundials.hpp:228
void SetSStolerances(double reltol, double abstol)
Specify the scalar relative and scalar absolute tolerances.
Definition: sundials.cpp:477
void SetERKTableNum(int table_num)
Choose a specific Butcher table for explicit RK method.
Definition: sundials.cpp:528
virtual int InitSystem(void *sundials_mem)=0
virtual int SetupSystem(void *sundials_mem, int conv_fail, const Vector &y_pred, const Vector &f_pred, int &jac_cur, Vector &v_temp1, Vector &v_temp2, Vector &v_temp3)=0
ARKODESolver(Type type=EXPLICIT)
Construct a serial ARKODESolver, a wrapper for SUNDIALS&#39; ARKODE solver.
Definition: sundials.cpp:428
enum mfem::SundialsODELinearSolver::@0 type
Is CVODE or ARKODE using this object?
void * SundialsMem() const
Access the underlying SUNDIALS object.
Definition: sundials.hpp:117
Wrapper for SUNDIALS&#39; KINSOL library – Nonlinear solvers.
Definition: sundials.hpp:312
bool Parallel() const
Definition: sundials.hpp:95
Wrapper for SUNDIALS&#39; CVODE library – Multi-step time integration.
Definition: sundials.hpp:133
static int GradientMult(N_Vector v, N_Vector Jv, N_Vector u, booleantype *new_u, void *user_data)
Definition: sundials.cpp:731
void SetMaxStep(double dt_max)
Set the maximum time step of the linear multistep method.
Definition: sundials.hpp:183
Newton&#39;s method for solving F(x)=b for a given operator F.
Definition: solvers.hpp:258
N_Vector y_scale
Definition: sundials.hpp:316
virtual void SetOperator(const Operator &op)
Set the nonlinear Operator of the system. This method calls KINInit().
Definition: sundials.cpp:863
Wrapper for SUNDIALS&#39; ARKODE library – Runge-Kutta time integration.
Definition: sundials.hpp:220
void SetLinearSolver(SundialsODELinearSolver &ls_spec)
Set a custom Jacobian system solver for implicit methods.
Definition: sundials.cpp:486
void SetIRKTableNum(int table_num)
Choose a specific Butcher table for implicit RK method.
Definition: sundials.cpp:522
const Operator * jacobian
Definition: sundials.hpp:317
A base class for the MFEM classes wrapping SUNDIALS&#39; solvers.
Definition: sundials.hpp:87
static int LinSysSolve(KINMemRec *kin_mem, N_Vector x, N_Vector b, realtype *sJpnorm, realtype *sFdotJp)
Definition: sundials.cpp:761
SundialsSolver(void *mem)
Definition: sundials.hpp:112
N_Vector f_scale
Definition: sundials.hpp:316
void SetFuncNormTol(double ftol)
Set KINSOL&#39;s functional norm tolerance.
Definition: sundials.hpp:375
void SetOrder(int order)
Chooses integration order for all explicit / implicit / IMEX methods.
Definition: sundials.cpp:514
Abstract base class, wrapping the custom linear solvers interface in SUNDIALS&#39; CVODE and ARKODE solve...
Definition: sundials.hpp:47
virtual ~ARKODESolver()
Destroy the associated ARKODE memory.
Definition: sundials.cpp:707
virtual void SetSolver(Solver &solver)
Set the linear solver for inverting the Jacobian.
Definition: sundials.cpp:958
virtual void SetPreconditioner(Solver &solver)
Equivalent to SetSolver(Solver).
Definition: sundials.hpp:367
double GetTimeStep(void *sundials_mem)
Get the current scaled time step, gamma, from sundials_mem.
Definition: sundials.cpp:71
int flag
Flag returned by the last call to SUNDIALS.
Definition: sundials.hpp:91
CVODESolver(int lmm, int iter)
Construct a serial CVODESolver, a wrapper for SUNDIALS&#39; CVODE solver.
Definition: sundials.cpp:175
Vector data type.
Definition: vector.hpp:41
void SetScaledStepTol(double sstol)
Set KINSOL&#39;s scaled step tolerance.
Definition: sundials.cpp:975
void PrintInfo() const
Print CVODE statistics.
Definition: sundials.cpp:400
void SetMaxOrder(int max_order)
Set the maximum order of the linear multistep method.
Definition: sundials.cpp:259
Base class for solvers.
Definition: operator.hpp:259
N_Vector y
Auxiliary N_Vector.
Definition: sundials.hpp:93
KinSolver(int strategy, bool oper_grad=true)
Construct a serial KinSolver, a wrapper for SUNDIALS&#39; KINSOL solver.
Definition: sundials.cpp:788
void SetMaxStep(double dt_max)
Set the maximum time step of the Runge-Kutta method.
Definition: sundials.hpp:276
Abstract operator.
Definition: operator.hpp:21
static int LinSysSetup(KINMemRec *kin_mem)
Definition: sundials.cpp:748
void PrintInfo() const
Print ARKODE statistics.
Definition: sundials.cpp:691
static const double default_rel_tol
Definition: sundials.hpp:101
virtual void Step(Vector &x, double &t, double &dt)
Use ARKODE to integrate over [t, t + dt], with the specified step mode.
Definition: sundials.cpp:645
void SetStepMode(int itask)
CVode supports two modes, specified by itask: CV_NORMAL (default) and CV_ONE_STEP.
Definition: sundials.cpp:254