Skip to content

Commit 085fb35

Browse files
committed
CVODE: Comment out settings "Make CVODE step size increase less aggressive"
These settings are only available in sundials-6.2, which is not yet supported by Sundials.jl (see SciML/Sundials.jl#415).
1 parent 2bc0ddb commit 085fb35

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

src/cvode_time_solver.jl

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,27 @@ function cvode_solve!(f::Function,
4444
# Passing -1 disables the test for maximum number of steps. This is 'not recommended'
4545
# according to the CVODE manual.
4646
flag = Sundials.@checkflag Sundials.CVodeSetMaxNumSteps(mem, -1) true
47-
# Make CVODE increase the timestep less agressively
48-
flag = Sundials.@checkflag Sundials.CVodeSetFixedStepBounds(mem, 0.0, 1.1) true # Default was (0,0, 1.5), which means minimum increase of step size is a factor 1.5. Decrease this to 1.1.
49-
flag = Sundials.@checkflag Sundials.CVodeSetEtaMax(mem, 1.2) true # Default was 10, which means increase in step size can be up to factor 10. Limit this to 1.2.
50-
51-
# Set linear solver
52-
LS = Sundials.SUNLinSol_SPGMR(y0nv, Sundials.PREC_NONE, -1)
53-
flag = Sundials.@checkflag Sundials.CVodeSetLinearSolver(mem, LS, C_NULL) true
47+
## The following needs sundials-6.2, which is not supported yet by Sundials.jl (see
48+
## https://github.com/SciML/Sundials.jl/pull/415)
49+
###################################################################################
50+
## Make CVODE increase the timestep less agressively
51+
##flag = Sundials.@checkflag Sundials.CVodeSetEtaFixedStepBounds(mem, 0.0, 1.1) true # Default was (0,0, 1.5), which means minimum increase of step size is a factor 1.5. Decrease this to 1.1.
52+
##flag = Sundials.@checkflag Sundials.CVodeSetEtaMax(mem, 1.2) true # Default was 10, which means increase in step size can be up to factor 10. Limit this to 1.2.
53+
#etastepbound_lower = 0.0
54+
#etastepbound_upper = 1.1
55+
#flag = Sundials.@checkflag ccall((:CVodeSetEtaFixedStepBounds,
56+
# Sundials.libsundials_cvodes), Cint,
57+
# (Sundials.CVODEMemPtr, Sundials.realtype,
58+
# Sundials.realtype), mem, etastepbound_lower,
59+
# etastepbound_upper)
60+
#etamax = 1.2
61+
#flag = Sundials.@checkflag ccall((:CVodeSetEtaMax, Sundials.libsundials_cvodes), Cint,
62+
# (Sundials.CVODEMemPtr, Sundials.realtype), mem,
63+
# etamax)
64+
65+
## Set linear solver
66+
#LS = Sundials.SUNLinSol_SPGMR(y0nv, Sundials.PREC_NONE, -1)
67+
#flag = Sundials.@checkflag Sundials.CVodeSetLinearSolver(mem, LS, C_NULL) true
5468

5569
ynv = Sundials.NVector(copy(y0))
5670
tout = [0.0]

0 commit comments

Comments
 (0)