friedmud / MOOSE.jl

Multiphysics Object Oriented Simulation Environment In Julia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ERROR: Cannot convert type Int64 to `ForwardDiff.Dual{4,Float64,N} where N`

zhang-rite opened this issue · comments

var = Variable{Dual{4, Float64}}(1, "u")

ERROR: MethodError: Cannot `convert` an object of type Int64 to an object of type ForwardDiff.Dual{4,Float64,N} where N
This may have arisen from a call to the constructor ForwardDiff.Dual{4,Float64,N} where N(...),
since type constructors fall back to convert methods.
Stacktrace:
 [1] MOOSE.Variable{ForwardDiff.Dual{4,Float64,N} where N}(::Int64, ::String) at ~/.julia/v0.6/MOOSE/src/systems/Variable.jl:38

Resolved! It seems due to a format change in ForwardDiff.Dual function from ForwardDiff.jl version 0.4.2.

Oh wow - crazy. Can you post a pull-request?

I solved the problem by installing ForwardDiff.jl v. 0.4.2, but not the updated version.

Oh wow - are people still using this? Is it actually still useful? I haven't touched Julia in a couple of years - and I just assumed that all of my code would be VERY out of date.

Yes, recently I want to use MOOSE for performing inverse modeling. I think MOOSE.jl can be quite useful for it seems easy-structured to be called by Julia or Python's optimization packages. Hope there will be more kernels.