Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/notebooks/06-pde-constrained-optimisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,13 @@
print("Jhat(g) = %.8g\nJhat(g_opt) = %.8g" % (Jhat(g), Jhat(g_opt)))

# %% [markdown]
# To see the optimised flow field, we solve the same problem again, only with the new (optimised) value for the boundary data on $\Gamma_\text{circ}$. This time we're not interested in annotating the solve, so we tell `firedrake-adjoint` to ignore it by passing `annotate=False`.
# To see the optimised flow field, we solve the same problem again, only with the new (optimised) value for the boundary data on $\Gamma_\text{circ}$. This time we're not interested in annotating the solve, so we tell `firedrake-adjoint` to ignore it by running it in a `stop_annotating()` context.

# %%
g.assign(g_opt)
w_opt = Function(W)
solve(a == L, w_opt, bcs=bcs, annotate=False)
with stop_annotating():
solve(a == L, w_opt, bcs=bcs)

# %% tags=["nbval-ignore-output"]
u_opt, p_opt = w_opt.subfunctions
Expand Down
2 changes: 1 addition & 1 deletion firedrake/adjoint_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from firedrake.adjoint_utils.variational_solver import ( # noqa F401
NonlinearVariationalProblemMixin, NonlinearVariationalSolverMixin
)
from firedrake.adjoint_utils.solving import annotate_solve, get_solve_blocks # noqa F401
from firedrake.adjoint_utils.solving import get_solve_blocks # noqa F401
from firedrake.adjoint_utils.mesh import MeshGeometryMixin # noqa F401
from firedrake.adjoint_utils.checkpointing import ( # noqa F401
enable_disk_checkpointing, disk_checkpointing,
Expand Down
4 changes: 2 additions & 2 deletions firedrake/adjoint_utils/blocks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from firedrake.adjoint_utils.blocks.assembly import AssembleBlock # noqa F401
from firedrake.adjoint_utils.blocks.solving import ( # noqa F401
GenericSolveBlock, SolveLinearSystemBlock, ProjectBlock,
SupermeshProjectBlock, SolveVarFormBlock,
CachedSolverBlock, GenericSolveBlock,
ProjectBlock, SupermeshProjectBlock, SolveVarFormBlock,
NonlinearVariationalSolveBlock
)
from firedrake.adjoint_utils.blocks.function import ( # noqa F401
Expand Down
Loading
Loading