Skip to content
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

Merged
merged 4 commits into from
Apr 24, 2023

Conversation

gbruer15
Copy link
Collaborator

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.

@gbruer15 gbruer15 requested a review from ziyiyin97 April 18, 2023 15:25
@mloubout
Copy link
Member

Remove Manifest.toml it has local dev paths breaking build/test

@gbruer15 gbruer15 mentioned this pull request Apr 18, 2023
@@ -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)
Copy link
Member

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

Copy link
Collaborator Author

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.

Copy link
Member

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 ...

@gbruer15 gbruer15 marked this pull request as ready for review April 21, 2023 14:40
Copy link
Member

@ziyiyin97 ziyiyin97 left a 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 Show resolved Hide resolved
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)
Copy link
Member

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

Copy link
Collaborator Author

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, .

@ziyiyin97 ziyiyin97 self-requested a review April 24, 2023 19:31
@gbruer15 gbruer15 force-pushed the gbruer/jutul0-2-5 branch from f01bead to ef20f52 Compare April 24, 2023 19:58
@gbruer15 gbruer15 merged commit 1b1366a into slimgroup:main Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants