You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/PhaseState.jl
+51-1Lines changed: 51 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
using Parameters
2
2
using SpecialFunctions
3
3
using LinearAlgebra
4
+
using Tracker
4
5
5
6
@inlinefunctioncalcgibbs(ph::U,T::W) where {U<:IdealPhase,W<:Real}
6
7
returngetGibbs.(getfield.(ph.species,:thermo),T)
@@ -168,7 +169,7 @@ Maintains diffusion limitations if the phase has diffusionlimited=true
168
169
end
169
170
export getkfkrev
170
171
171
-
@inlinefunctiongetkfkrevs(phase::U,T::W1,P::W2,C::W3,N::W4,ns::Q1,Gs::Q2,diffs::Q3,V::W5;kfs::W6=nothing) where {U<:AbstractPhase,W6,W5<:Real,W1<:Real,W2<:Real,W3<:Real,W4<:Real, Q1<:AbstractArray,Q2<:AbstractArray,Q3<:AbstractArray}
172
+
@inlinefunctiongetkfkrevs(phase::U,T::W1,P::W2,C::W3,N::W4,ns::Q1,Gs::Q2,diffs::Q3,V::W5;kfs::W6=nothing) where {U<:AbstractPhase,W6,W5<:Real,W1<:Real,W2<:Real,W3<:Real,W4<:Real, Q1<:AbstractArray,Q2<:Array{Float64,1},Q3<:AbstractArray}
172
173
if!phase.diffusionlimited && kfs ===nothing
173
174
kfs =getkfs(phase,T,P,C,ns,V)
174
175
krev =@fastmath kfs./getKcs(phase,T,Gs)
@@ -190,4 +191,53 @@ export getkfkrev
190
191
end
191
192
return kfs,krev
192
193
end
194
+
195
+
@inlinefunctiongetkfkrevs(phase::U,T::W1,P::W2,C::W3,N::W4,ns::Q1,Gs::Q2,diffs::Q3,V::W5;kfs::W6=nothing) where {U<:AbstractPhase,W6,W5<:Real,W1<:Real,W2<:Real,W3<:Real,W4<:Real, Q1<:AbstractArray,Q2<:Union{ReverseDiff.TrackedArray,Tracker.TrackedArray},Q3<:AbstractArray} #autodiff p
@inlinefunctiongetkfkrevs(phase::U,T::W1,P::W2,C::W3,N::W4,ns::Q1,Gs::Array{Q2,1},diffs::Q3,V::W5;kfs::W6=nothing) where {U<:AbstractPhase,W6,W5<:Real,W1<:Real,W2<:Real,W3<:Real,W4<:Real, Q1<:AbstractArray,Q2<:ForwardDiff.Dual,Q3<:AbstractArray} #autodiff p
0 commit comments