Skip to content

Commit 52a8957

Browse files
committed
Merge branch 'dham/abstract_reduced_functional' of github.com:firedrakeproject/firedrake into dham/abstract_reduced_functional
2 parents 3740a20 + ce61e92 commit 52a8957

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

demos/full_waveform_inversion/full_waveform_inversion.py.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,12 @@ built over the ``my_ensemble.comm`` (spatial) communicator.
109109
dt = 0.03 # time step in seconds
110110
final_time = 0.6 # final time in seconds
111111
nx, ny = 15, 15
112+
ftol = 0.9 # optimisation tolerance
112113
else:
113114
dt = 0.002 # time step in seconds
114115
final_time = 1.0 # final time in seconds
115116
nx, ny = 80, 80
117+
ftol = 1e-2 # optimisation tolerance
116118

117119
mesh = UnitSquareMesh(nx, ny, comm=my_ensemble.comm)
118120

@@ -296,10 +298,10 @@ we have a custom ``ReducedFunctional``, we need to do this ourselves::
296298
from pyadjoint.reduced_functional_numpy import ReducedFunctionalNumPy
297299
Jnumpy = ReducedFunctionalNumPy(J_hat)
298300

299-
c_optimised = minimize(Jnumpy, method="L-BFGS-B", options={"disp": True, "maxiter": 3, "ftol": 0.9},
301+
c_optimised = minimize(Jnumpy, method="L-BFGS-B", options={"disp": True, "ftol": ftol},
300302
bounds=(1.5, 2.0))
301303

302-
The ``minimize`` function executes the optimisation algorithm until the stopping criterion (``maxiter``) is met.
304+
The ``minimize`` function executes the optimisation algorithm until the stopping criterion (``ftol``) is met.
303305
For 20 iterations, the predicted velocity model is shown in the following figure.
304306

305307
.. image:: c_predicted.png

0 commit comments

Comments
 (0)