java.lang.Object
de.grogra.numeric.CVodeAdapter
- All Implemented Interfaces:
Solver
Wrapper to CVODE2 library.
It implements the Solver interface and delegates computation
to the CVODE2 library, which is part of SUNDIALS.
requires 2 libraries ::> sundials_covde.dll + sundials_nvecserial.dll
based on CVodeAdapterOriginal.java by Reinhard Hemmerling
extended by Jonas Coussement 2016
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
double
void
Integrate ode from t0 to t1.void
setAbsTolDefault
(double value) void
setMonitor
(int n, Monitor monitor) Set monitor functions.void
setOptions
(Map options) Set additional options for the integration process.void
setRelTolDefault
(double value) void
setTolerances
(double[] absTol, double[] relTol) Set element-specific absolute and relative tolerance values.
-
Constructor Details
-
CVodeAdapter
public CVodeAdapter()
-
-
Method Details
-
setMonitor
Description copied from interface:Solver
Set monitor functions. A previously set monitor will be replaced by this one. A monitor can be disabled by passing zero for parameter n. The parameter monitor may be null in this case.- Specified by:
setMonitor
in interfaceSolver
- Throws:
NumericException
-
integrate
public void integrate(ODE ode, double t0, double[] y0, double t1, double[] y1) throws NumericException Description copied from interface:Solver
Integrate ode from t0 to t1. Initial state is passed in y0. Final state is stored in memory provided by y1 (can be the same as y0).- Specified by:
integrate
in interfaceSolver
- Parameters:
ode
- equationst0
- initial timey0
- initial statet1
- final timey1
- memory to return state at t1, may refer to same object as y0- Throws:
NumericException
-
setOptions
Description copied from interface:Solver
Set additional options for the integration process. Options are provided as mapping from keys to values. Note that supported keys and the data format of associated values depends on the implementation of the solver.- Specified by:
setOptions
in interfaceSolver
-
setTolerances
public void setTolerances(double[] absTol, double[] relTol) Description copied from interface:Solver
Set element-specific absolute and relative tolerance values. A value of null for either array indicates that element-specific tolerances should be disabled for this tolerance type. An value of zero in any of the arrays indicates that the integrator should provide a default tolerance value instead. Note that if any of the specified are really used is up to the implementation of the integrator.- Specified by:
setTolerances
in interfaceSolver
- Parameters:
absTol
- element-specific absolute tolerance values, or nullrelTol
- element-specific relative tolerance values, or null
-
getAbsTolDefault
public double getAbsTolDefault() -
getRelTolDefault
public double getRelTolDefault() -
setAbsTolDefault
public void setAbsTolDefault(double value) -
setRelTolDefault
public void setRelTolDefault(double value)
-