ERROR: LoadError: TypeError: in typeassert, expected Float64, got a value of type ForwardDiff.Dual{Nothing, Float64, 12}
Stacktrace:
[1] setindex!(A::Vector{Float64}, x::ForwardDiff.Dual{Nothing, Float64, 12}, i1::Int64)
@ Base .\array.jl:839
[2] _unsafe_copyto!(dest::Vector{Float64}, doffs::Int64, src::Vector{ForwardDiff.Dual{Nothing, Float64, 12}}, soffs::Int64, n::Int64)
@ Base .\array.jl:235
[3] unsafe_copyto!
@ .\array.jl:289 [inlined]
[4] _copyto_impl!
@ .\array.jl:313 [inlined]
[5] copyto!
@ .\array.jl:299 [inlined]
[6] copyto!
@ .\array.jl:325 [inlined]
[7] copyto!
@ .\broadcast.jl:977 [inlined]
[8] copyto!
@ .\broadcast.jl:936 [inlined]
[9] materialize!
@ .\broadcast.jl:894 [inlined]
[10] materialize!
@ .\broadcast.jl:891 [inlined]
[11] macro expansion
@ ~\Dropbox (MIT)\code_ws_dropbox\TO_ws\TopOpt.jl\src\Functions\compliance.jl:58 [inlined]
[12] macro expansion
@ ~\.julia\packages\TimerOutputs\4QAIk\src\TimerOutput.jl:190 [inlined]
[13] (::Compliance{Float64, NewPointLoadCantilever{3, Float64, 8, 6, RectilinearGrid{3, Float64, 8, 6, Grid{3, Hexahedron, Float64}, Grid{3, Hexahedron, Float64}, Tuple{Int64, Int64, Int64}, Tuple{Float64, Float64, Float64}, Tuple{Vec{3, Float64}, Vec{3, Float64}}, BitVector, BitVector, BitVector}, Float64, Float64, ConstraintHandler{DofHandler{3, Hexahedron, Float64}, Float64}, Dict{Int64, Vector{Float64}}, BitVector, BitVector, Vector{Int64}, Metadata{Matrix{Int64}, RaggedArray{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, RaggedArray{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, Matrix{Int64}}}, DirectDisplacementSolver{Float64, 3, PowerPenalty{Float64}, NewPointLoadCantilever{3, Float64, 8, 6, RectilinearGrid{3, Float64, 8, 6, Grid{3, Hexahedron, Float64}, Grid{3, Hexahedron, Float64}, Tuple{Int64, Int64, Int64}, Tuple{Float64, Float64, Float64}, Tuple{Vec{3, Float64}, Vec{3, Float64}}, BitVector, BitVector, BitVector}, Float64, Float64, ConstraintHandler{DofHandler{3, Hexahedron, Float64}, Float64}, Dict{Int64, Vector{Float64}}, BitVector, BitVector, Vector{Int64}, Metadata{Matrix{Int64}, RaggedArray{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, RaggedArray{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, Matrix{Int64}}}, GlobalFEAInfo{Float64, Symmetric{Float64, SparseArrays.SparseMatrixCSC{Float64, Int64}}, Vector{Float64}, SuiteSparse.CHOLMOD.Factor{Float64}, SuiteSparse.SPQR.QRSparse{Float64, Int64}}, ElementFEAInfo{3, Float64, Vector{Symmetric{Float64, ElementMatrix{Float64, StaticArrays.SMatrix{24, 24, Float64, 576}, StaticArrays.SMatrix{24, 24, Float64, 576}, StaticArrays.SVector{24, Bool}, Float64}}}, Vector{StaticArrays.SVector{24, Float64}}, Vector{Float64}, Vector{Float64}, CellScalarValues{3, 3, Float64, RefCube}, FaceScalarValues{3, 3, Float64, RefCube}, Metadata{Matrix{Int64}, RaggedArray{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, RaggedArray{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, Matrix{Int64}}, BitVector, BitVector, Vector{Int64}, Vector{Hexahedron}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, PowerPenalty{Float64}, PowerPenalty{Float64}, Float64, Bool}, Float64, Vector{Float64}, Vector{Float64}, Bool, TopOptTrace{Float64, Int64, Vector{Float64}, Vector{Float64}, Vector{Vector{Float64}}, Vector{Int64}, Vector{Int64}}, Bool, Int64, Bool, Int64})(x::Vector{ForwardDiff.Dual{Nothing, Float64, 12}}, grad::Vector{Float64})
@ TopOpt.Functions ~\Dropbox (MIT)\code_ws_dropbox\TO_ws\TopOpt.jl\src\Functions\compliance.jl:45
[14] rrule
@ ~\Dropbox (MIT)\code_ws_dropbox\TO_ws\TopOpt.jl\src\Functions\compliance.jl:96 [inlined]
[15] chain_rrule
@ ~\.julia\packages\Zygote\CgsVi\src\compiler\chainrules.jl:89 [inlined]
[16] macro expansion
@ ~\.julia\packages\Zygote\CgsVi\src\compiler\interface2.jl:0 [inlined]
[17] _pullback(ctx::Zygote.Context, f::Compliance{Float64, NewPointLoadCantilever{3, Float64, 8, 6, RectilinearGrid{3, Float64, 8, 6, Grid{3, Hexahedron, Float64}, Grid{3, Hexahedron, Float64}, Tuple{Int64, Int64, Int64}, Tuple{Float64, Float64, Float64}, Tuple{Vec{3, Float64}, Vec{3, Float64}}, BitVector, BitVector, BitVector}, Float64, Float64, ConstraintHandler{DofHandler{3, Hexahedron, Float64}, Float64}, Dict{Int64, Vector{Float64}}, BitVector, BitVector, Vector{Int64}, Metadata{Matrix{Int64}, RaggedArray{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, RaggedArray{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, Matrix{Int64}}}, DirectDisplacementSolver{Float64, 3, PowerPenalty{Float64}, NewPointLoadCantilever{3, Float64, 8, 6, RectilinearGrid{3, Float64, 8, 6, Grid{3, Hexahedron, Float64}, Grid{3, Hexahedron, Float64}, Tuple{Int64, Int64, Int64}, Tuple{Float64, Float64, Float64}, Tuple{Vec{3, Float64}, Vec{3, Float64}}, BitVector, BitVector, BitVector}, Float64, Float64, ConstraintHandler{DofHandler{3, Hexahedron, Float64}, Float64}, Dict{Int64, Vector{Float64}}, BitVector, BitVector, Vector{Int64}, Metadata{Matrix{Int64}, RaggedArray{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, RaggedArray{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, Matrix{Int64}}}, GlobalFEAInfo{Float64, Symmetric{Float64, SparseArrays.SparseMatrixCSC{Float64, Int64}}, Vector{Float64}, SuiteSparse.CHOLMOD.Factor{Float64}, SuiteSparse.SPQR.QRSparse{Float64, Int64}}, ElementFEAInfo{3, Float64, Vector{Symmetric{Float64, ElementMatrix{Float64, StaticArrays.SMatrix{24, 24, Float64, 576}, StaticArrays.SMatrix{24, 24, Float64, 576}, StaticArrays.SVector{24, Bool}, Float64}}}, Vector{StaticArrays.SVector{24, Float64}}, Vector{Float64}, Vector{Float64}, CellScalarValues{3, 3, Float64, RefCube}, FaceScalarValues{3, 3, Float64, RefCube}, Metadata{Matrix{Int64}, RaggedArray{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, RaggedArray{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, Matrix{Int64}}, BitVector, BitVector, Vector{Int64}, Vector{Hexahedron}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, PowerPenalty{Float64}, PowerPenalty{Float64}, Float64, Bool}, Float64, Vector{Float64}, Vector{Float64}, Bool, TopOptTrace{Float64, Int64, Vector{Float64}, Vector{Float64}, Vector{Vector{Float64}}, Vector{Int64}, Vector{Int64}}, Bool, Int64, Bool, Int64}, args::Vector{ForwardDiff.Dual{Nothing, Float64, 12}})
@ Zygote ~\.julia\packages\Zygote\CgsVi\src\compiler\interface2.jl:9
[18] _pullback
@ ~\Dropbox (MIT)\code_ws_dropbox\TO_ws\TopOpt.jl\examples\benchmark\compare_top3d.jl:40 [inlined]
[19] _pullback(ctx::Zygote.Context, f::var"#13#14", args::Vector{ForwardDiff.Dual{Nothing, Float64, 12}})
@ Zygote ~\.julia\packages\Zygote\CgsVi\src\compiler\interface2.jl:0
[20] adjoint
@ ~\.julia\packages\Zygote\CgsVi\src\lib\lib.jl:188 [inlined]
[21] adjoint(__context__::Zygote.Context, 450::typeof(Core._apply_iterate),
451::typeof(iterate), f::Function, args::Tuple{Vector{ForwardDiff.Dual{Nothing, Float64, 12}}})
@ Zygote .\none:0
[22] _pullback
@ ~\.julia\packages\ZygoteRules\OjfTt\src\adjoint.jl:57 [inlined]
[23] _pullback
@ ~\Dropbox (MIT)\code_ws_dropbox\TO_ws\TopOpt.jl\src\Functions\Functions.jl:84 [inlined]
[24] _pullback(ctx::Zygote.Context, f::Objective{Float64, var"#13#14"}, args::Vector{ForwardDiff.Dual{Nothing, Float64, 12}})
@ Zygote ~\.julia\packages\Zygote\CgsVi\src\compiler\interface2.jl:0
[25] adjoint
@ ~\.julia\packages\Zygote\CgsVi\src\lib\lib.jl:188 [inlined]
[26] _pullback
@ ~\.julia\packages\ZygoteRules\OjfTt\src\adjoint.jl:57 [inlined]
[27] _pullback
@ ~\.julia\packages\Nonconvex\FgWVe\src\functions\functions.jl:156 [inlined]
[28] _pullback(::Zygote.Context, ::Nonconvex.var"##_#7", ::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::Nonconvex.Objective{Objective{Float64, var"#13#14"}, Base.RefValue{Float64}}, ::Vector{ForwardDiff.Dual{Nothing, Float64, 12}})
@ Zygote ~\.julia\packages\Zygote\CgsVi\src\compiler\interface2.jl:0
in expression starting at C:\Users\harry\Dropbox (MIT)\code_ws_dropbox\TO_ws\TopOpt.jl\examples\benchmark\compare_top3d.jl:64