Skip to content
Discussion options

You must be logged in to vote

i added the necessary patches to allow the problem to almost execute up until the error, but the error seems to be inherent to how JutulDarcy seems to set their Dual numbers. a more minimal reproducer:

using ForwardDiff: ForwardDiff, Dual
using Jutul
z = [Dual{Cells()}(1.0,0.0,1.0), Dual{Cells()}(0.0,-0.0,-1.0)]
f(x,z) = 0.5*sum(z)/x
ForwardDiff.derivative(_x -> f(_x,z),2.0) #fails with the same error

@moyner is it possible to change how Jutul creates its duals, from ForwardDiff.Dual{<: JutulEntity} to ForwardDiff.Dual{::Type{Tag{<:JutulEntity}} ? when calling ForwardDiff.Tag(f,R), ForwardDiff registers an unique tag count that is used for tag ordering:

https://github.com/JuliaDiff/Forwa…

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
6 replies
@golghanddashtih
Comment options

@longemen3000
Comment options

@golghanddashtih
Comment options

@moyner
Comment options

@golghanddashtih
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@longemen3000
Comment options

@longemen3000
Comment options

@moyner
Comment options

Answer selected by golghanddashtih
@moyner
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants