Skip to content

Commit

Permalink
fix for constant transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed May 1, 2017
1 parent d48aa88 commit 095ecbf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
julia 0.5
DiffEqBase 1.0.0
DiffEqBase 1.1.0
Parameters 0.5.0
ForwardDiff 0.2.4
GenericSVD 0.0.2
Expand Down
2 changes: 2 additions & 0 deletions src/OrdinaryDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module OrdinaryDiffEq

import DiffEqBase: solve, solve!, init, step!, build_solution, initialize!

import DiffEqBase: ODE_DEFAULT_NORM, ODE_DEFAULT_ISOUTOFDOMAIN, ODE_DEFAULT_PROG_MESSAGE, ODE_DEFAULT_UNSTABLE_CHECK

using Parameters, GenericSVD, ForwardDiff, InplaceOps, RecursiveArrayTools,
NLsolve, Juno, Calculus, Roots, DataStructures, Iterators

Expand Down
10 changes: 0 additions & 10 deletions src/constants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,3 @@ ODE_DEFAULT_TABLEAU
Sets the default tableau for the ODE solver. Currently Dormand-Prince 4/5.
"""
const ODE_DEFAULT_TABLEAU = constructDormandPrince()

@inline UNITLESS_ABS2(x) = abs2(x)/(typeof(x)(one(x))*typeof(x)(one(x)))
@inline ODE_DEFAULT_NORM(u::AbstractArray) = sqrt(sum(UNITLESS_ABS2,u) / length(u))
@inline ODE_DEFAULT_NORM(u) = norm(u)
@inline ODE_DEFAULT_ISOUTOFDOMAIN(t,u) = false
@inline ODE_DEFAULT_PROG_MESSAGE(dt,t,u) = "dt="*string(dt)*"\nt="*string(t)*"\nmax u="*string(maximum(abs.(u)))
@inline ODE_DEFAULT_UNSTABLE_CHECK(dt,t,u) = false
(p::typeof(ODE_DEFAULT_UNSTABLE_CHECK))(dt,t,u::AbstractFloat) = isnan(u)
(p::typeof(ODE_DEFAULT_UNSTABLE_CHECK)){T<:AbstractFloat}(dt,t,u::AbstractArray{T}) = any(isnan,u)
(p::typeof(ODE_DEFAULT_UNSTABLE_CHECK))(dt,t,u::ArrayPartition) = any(isnan,chain(u.x...))
3 changes: 2 additions & 1 deletion src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function init{algType<:OrdinaryDiffEqAlgorithm,recompile_flag}(

order = alg_order(alg)

if typeof(u) <: AbstractArray
if typeof(u) <: Union{Number,AbstractArray,ArrayPartition}
uEltypeNoUnits = typeof(recursive_one(u))
tTypeNoUnits = typeof(recursive_one(t))
else
Expand Down Expand Up @@ -296,6 +296,7 @@ function init{algType<:OrdinaryDiffEqAlgorithm,recompile_flag}(
initialize!(integrator,integrator.cache)
initialize!(callbacks_internal,t,u,integrator)
end

integrator
end

Expand Down

0 comments on commit 095ecbf

Please sign in to comment.