Skip to content

Commit

Permalink
Merge pull request #133 from ScottPJones/spj/checkjac
Browse files Browse the repository at this point in the history
Add checks for passing explicit t-gradient to stiff solver
  • Loading branch information
ChrisRackauckas committed May 13, 2017
2 parents 9255935 + b99ea61 commit 40ed567
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ODE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using Polynomials
using Compat
using DiffEqBase

import DiffEqBase: solve, check_keywords
import DiffEqBase: solve

const warnkeywords =
(:save_idxs, :d_discontinuities, :unstable_check,
Expand Down
18 changes: 15 additions & 3 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,31 @@ function solve{uType,tType,isinplace,AlgType<:ODEjlAlgorithm}(
alg::AlgType,
timeseries=[], ts=[], ks=[];

dense=false,
verbose=true,
save_timeseries=nothing,
saveat=tType[], reltol = 1e-5, abstol = 1e-8,
save_everystep=isempty(saveat),
save_everystep=isempty(saveat), dense=save_everystep,
save_start=true, callback=nothing,
dtmin = abs(prob.tspan[2]-prob.tspan[1])/1e-9,
dtmax = abs(prob.tspan[2]-prob.tspan[1])/2.5,
timeseries_errors=true, dense_errors=false,
dt = 0.0, norm = Base.vecnorm,
kwargs...)

verbose && !isempty(kwargs) && check_keywords(alg, kwargs, warnlist)
if verbose
warned = !isempty(kwargs) && check_keywords(alg, kwargs, warnlist)
if !(typeof(prob.f) <: AbstractParameterizedFunction) && typeof(alg) <: ode23s
if has_tgrad(prob.f)
warn("Explicit t-gradient given to this stiff solver is ignored.")
warned = true
end
if has_jac(prob.f)
warn("Explicit Jacobian given to this stiff solver is ignored.")
warned = true
end
end
warned && warn_compat()
end

if save_timeseries != nothing
verbose && warn("save_timeseries is deprecated. Use save_everystep instead")
Expand Down

0 comments on commit 40ed567

Please sign in to comment.