-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Appears to be an issue calculating the flux when rho is a vector.
julia> data = Nlayer_cylinder(a = 10.0, l = [1.0, 1.0, 1.0, 2.0], z = 5.0, ρ = [1.0, 2.0])
julia> flux_DA_Nlay_cylinder_CW(data)
ERROR: MethodError: no method matching Float64(::ForwardDiff.Dual{ForwardDiff.Tag{LightPropagation.var"#69#71"{Vector{Float64}, Vector{Float64}, Vector{Float64}, Float64, Vector{Float64}, Vector{Float64}, Float64, Vector{Float64}}, Float64}, Float64, 1})
Closest candidates are:
(::Type{T})(::Real, ::RoundingMode) where T<:AbstractFloat at rounding.jl:200
(::Type{T})(::T) where T<:Number at boot.jl:760
(::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number} at char.jl:50
...
Stacktrace:
[1] convert(#unused#::Type{Float64}, x::ForwardDiff.Dual{ForwardDiff.Tag{LightPropagation.var"#69#71"{Vector{Float64}, Vector{Float64}, Vector{Float64}, Float64, Vector{Float64}, Vector{Float64}, Float64, Vector{Float64}}, Float64}, Float64, 1})
@ Base ./number.jl:7
[2] setindex!(A::Vector{Float64}, x::ForwardDiff.Dual{ForwardDiff.Tag{LightPropagation.var"#69#71"{Vector{Float64}, Vector{Float64}, Vector{Float64}, Float64, Vector{Float64}, Vector{Float64}, Float64, Vector{Float64}}, Float64}, Float64, 1}, i1::Int64)
@ Base ./array.jl:839
[3] _kernel_fluence_DA_Nlay_cylinder(ρ::Vector{Float64}, D::Vector{Float64}, μa::Vector{Float64}, a::Float64, zb::Vector{Float64}, z::ForwardDiff.Dual{ForwardDiff.Tag{LightPropagation.var"#69#71"{Vector{Float64}, Vector{Float64}, Vector{Float64}, Float64, Vector{Float64}, Vector{Float64}, Float64, Vector{Float64}}, Float64}, Float64, 1}, z0::Float64, l::Vector{Float64}, n_med::Vector{Float64}, besselroots::Vector{Float64}, green::typeof(LightPropagation._green_Nlaycylin_bottom), N::Int64)
@ LightPropagation ~/.julia/packages/LightPropagation/fzSt3/src/forwardmodels/Diffusion Approximation/DAcylinder_layered.jl:322
[4] fluence_DA_Nlay_cylinder_CW(ρ::Vector{Float64}, μa::Vector{Float64}, μsp::Vector{Float64}, n_ext::Float64, n_med::Vector{Float64}, l::Vector{Float64}, a::Float64, z::ForwardDiff.Dual{ForwardDiff.Tag{LightPropagation.var"#69#71"{Vector{Float64}, Vector{Float64}, Vector{Float64}, Float64, Vector{Float64}, Vector{Float64}, Float64, Vector{Float64}}, Float64}, Float64, 1}, besselroots::Vector{Float64})
@ LightPropagation ~/.julia/packages/LightPropagation/fzSt3/src/forwardmodels/Diffusion Approximation/DAcylinder_layered.jl:63
[5] #69
@ ~/.julia/packages/LightPropagation/fzSt3/src/forwardmodels/Diffusion Approximation/DAcylinder_layered.jl:108 [inlined]
[6] derivative
@ ~/.julia/packages/ForwardDiff/5gUap/src/derivative.jl:14 [inlined]
[7] flux_DA_Nlay_cylinder_CW(ρ::Vector{Float64}, μa::Vector{Float64}, μsp::Vector{Float64}, n_ext::Float64, n_med::Vector{Float64}, l::Vector{Float64}, a::Float64, z::Float64, besselroots::Vector{Float64})
@ LightPropagation ~/.julia/packages/LightPropagation/fzSt3/src/forwardmodels/Diffusion Approximation/DAcylinder_layered.jl:108
[8] flux_DA_Nlay_cylinder_CW(data::Nlayer_cylinder{Float64})
@ LightPropagation ~/.julia/packages/LightPropagation/fzSt3/src/forwardmodels/Diffusion Approximation/DAcylinder_layered.jl:121
[9] top-level scope
@ REPL[8]:1
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working