Skip to content

Commit 5329ed6

Browse files
author
oscarddssmith
committed
add _rate_prototype function for getting the type of du from the type of u and t
1 parent 0532345 commit 5329ed6

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

ext/DiffEqBaseUnitfulExt.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ end
3030
real(abs2(x) / oneunit(x) * oneunit(x))
3131
end
3232

33+
_rate_prototype(u, t, onet) = u / unit(t)
3334
end

src/utils.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@ function default_logger(logger)
6161

6262
LoggingExtras.TeeLogger(logger1, logger2)
6363
end
64+
65+
_rate_prototype(u, t::T, onet::T) where {T} = u / oneunit(t)

0 commit comments

Comments
 (0)