Skip to content

Commit

Permalink
Merge pull request #645 from JuliaDiffEq/myb/unit
Browse files Browse the repository at this point in the history
Drop units in `eigen_est`, since `internalnorm` drops units
  • Loading branch information
ChrisRackauckas committed Mar 19, 2019
2 parents 18deef4 + 354ea3c commit 01c54e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/perform_step/low_order_rk_perform_step.jl
Original file line number Diff line number Diff line change
Expand Up @@ -809,12 +809,12 @@ end
g6 = tmp
g7 = u
# Hairer II, page 22
ϱu, ϱd = zero(eltype(k7)), zero(eltype(k7))
ϱu, ϱd = zero(eltype(k7))^2, zero(eltype(g7))^2
@inbounds for i in eachindex(k7)
ϱu += (k7[i] - k6[i])^2
ϱd += (g7[i] - g6[i])^2
end
integrator.eigen_est = sqrt(ϱu/ϱd)
integrator.eigen_est = sqrt(ϱu/ϱd)*oneunit(t)
end
if integrator.opts.adaptive
@tight_loop_macros for i in uidx
Expand Down
2 changes: 1 addition & 1 deletion src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ function DiffEqBase.__init(
cacheType = OrdinaryDiffEqCache
end

eigen_est = 1/oneunit(tType) # rate/state = (state/time)/state = 1/t units
eigen_est = 1/one(tType) # rate/state = (state/time)/state = 1/t units, internalnorm drops units
tprev = t
dtcache = tType(dt)
dtpropose = tType(dt)
Expand Down

0 comments on commit 01c54e0

Please sign in to comment.