-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated to latest version of Jutul 0.2.5, JutulDarcy 0.2.2 #20
Conversation
Remove |
@@ -21,7 +21,7 @@ dϕ = dϕ/norm(dϕ) * norm(ϕ)/2.75e11 | |||
|
|||
@testset "Taylor-series gradient test of jutulModeling with wells" begin | |||
grad_test(x0->misfit(x0, ϕ, q, states), x0, dx, g[x0]) | |||
grad_test(ϕ->misfit(x0, ϕ, q, states), ϕ, dϕ, g[ϕ]) | |||
grad_test(ϕ->misfit(x0, ϕ, q, states), ϕ, dϕ, g[ϕ], h0=2e1, maxiter=12) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change? Might be why it fails as larger h0 tend to not be asymptotic enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is passing. The vertical wells test later in this file is failing.
I had to increase the step size to get this test to pass. It seemed that the step size was too small for this and the other porosity gradients. But increasing the step size didn't help for the failing vertical wells test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my experience in general, it is very hard for the gradient test to pass ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Also update version from v0.2.4 to v0.2.5 in Project.toml
test/grad_test.jl
Outdated
return log(a / b) | ||
end | ||
|
||
function grad_test(f, x0, dx, dJdx; dJ=nothing, maxiter=6, h0=5e-2, stol=1e-1, hfactor=8e-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have a reference for this test? It looks nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add some document to it, but it's essentially running the same test with some more printouts that I have found useful when I had to debug gradient calculations with Pyadjoint. Nearly all of my experience with gradient computations come from Pyadjoint and my usage of it in CRIKit. Pyadjoint has a good set of mathematical documentation, .
f01bead
to
ef20f52
Compare
This MR updates to the latest version of JutulDarcy. I also added some more parameters to the
grad_test()
function and moved it to its own file.@ziyiyin97 The gradient test for the vertical well is failing. I haven't figured out why yet. The jutulSource and jutulForce tests are passing. I'll keep looking into it, but if you see anything that seems wrong, let me know.