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

Adjoint variational solver #3723

Merged
merged 61 commits into from
Nov 6, 2024
Merged

Adjoint variational solver #3723

merged 61 commits into from
Nov 6, 2024

Conversation

Ig-dolci
Copy link
Contributor

@Ig-dolci Ig-dolci commented Aug 4, 2024

Description

This PR updates the adjoint solver by introducing a Linear Variational Solver to handle adjoint equations. It also addresses an issue arising when the Jacobian is constant and the tape recomputation is required after updating an equation parameter (a common scenario in optimisation solvers).

I have executed tests to compare computation time and memory usage between the master branch and this current branch. The tests consider three time-dependent cases:

  1. Nonlinear: Navier-Stokes and Burger's equations (5 subsequent functional recomputation and gradient calculation)

  2. Linear: FWI optimisation (5 iteration) and Heat equation (5 subsequent functional recomputation and gradient calculation)

The test scripts are available here, and the plots comparing this branch with the master branch are shown below.

Feel free to add your review to anyone interested in this PR.

burger
ns
fwi
heat_eq

@Ig-dolci Ig-dolci changed the title Adjoint linear variational solver Adjoint variational solver Aug 4, 2024
@Ig-dolci Ig-dolci marked this pull request as ready for review August 6, 2024 13:54
@Ig-dolci
Copy link
Contributor Author

This PR is linked with pyadjoint PR #172.

@Ig-dolci Ig-dolci marked this pull request as ready for review October 14, 2024 18:12
firedrake/adjoint_utils/variational_solver.py Outdated Show resolved Hide resolved
firedrake/adjoint_utils/variational_solver.py Outdated Show resolved Hide resolved
firedrake/adjoint_utils/variational_solver.py Outdated Show resolved Hide resolved
firedrake/adjoint_utils/variational_solver.py Outdated Show resolved Hide resolved
tests/regression/test_adjoint_operators.py Outdated Show resolved Hide resolved
tests/regression/test_adjoint_operators.py Outdated Show resolved Hide resolved
@dham dham merged commit 35ba765 into master Nov 6, 2024
8 of 9 checks passed
@dham dham deleted the dolci/adjoint_solver branch November 6, 2024 16:43
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.

2 participants