Repository navigation
Conversation
pbrubeck
commented
Jul 22, 2026
pbrubeck
commented
Jul 24, 2026
pbrubeck
commented
Jul 24, 2026
pbrubeck
commented
Jul 28, 2026
pbrubeck
commented
Jul 31, 2026
pbrubeck
commented
Jul 31, 2026
pbrubeck
commented
Jul 31, 2026
pbrubeck
commented
Jul 31, 2026
pbrubeck
commented
Jul 31, 2026
pbrubeck
commented
Jul 31, 2026
pbrubeck
commented
Jul 31, 2026
| @pytest.mark.parametrize( | ||
| ("adapt_option", "criterion"), | ||
| (("snes_adapt_sequence", "refine"), | ||
| ("snes_adapt_multigrid", "none")), |
Contributor
Author
There was a problem hiding this comment.
This requires https://gitlab.com/petsc/petsc/-/merge_requests/9447
Suggested change
| ("snes_adapt_multigrid", "none")), | |
| # ("snes_adapt_multigrid", "none")), |
pbrubeck
force-pushed
the
pbrubeck/goal-adaptive-callback
branch
from
July 31, 2026 16:49
145b3a8 to
feae504
Compare
pbrubeck
commented
Jul 31, 2026
pbrubeck
commented
Jul 31, 2026
pbrubeck
force-pushed
the
pbrubeck/goal-adaptive-callback
branch
2 times, most recently
from
July 31, 2026 17:44
9abb66d to
0ca2b28
Compare
pbrubeck
commented
Jul 31, 2026
pbrubeck
commented
Jul 31, 2026
pbrubeck
commented
Jul 31, 2026
pbrubeck
commented
Jul 31, 2026
pbrubeck
commented
Aug 1, 2026
pbrubeck
commented
Aug 1, 2026
pbrubeck
commented
Aug 1, 2026
pbrubeck
commented
Aug 3, 2026
pbrubeck
commented
Aug 3, 2026
pbrubeck
commented
Aug 3, 2026
pbrubeck
commented
Aug 3, 2026
pbrubeck
commented
Aug 3, 2026
pbrubeck
commented
Aug 3, 2026
JHopeCollins
reviewed
Oct 6, 2026
JHopeCollins
reviewed
Oct 6, 2026
JHopeCollins
reviewed
Oct 6, 2026
JHopeCollins
reviewed
Oct 6, 2026
dham
requested changes
Oct 6, 2026
| nullspace = None if ctx._nullspace is None else ctx._nullspace.rediscretise(high_space) | ||
| transpose_nullspace = None if ctx._nullspace_T is None else ctx._nullspace_T.rediscretise(high_space) | ||
| near_nullspace = None if ctx._near_nullspace is None else ctx._near_nullspace.rediscretise(high_space) | ||
| parameters = get_default_options(DefaultOptionSet(prefix, ("dwr_",))) |
Member
There was a problem hiding this comment.
Josh and Pablo to work out what this means.
JHopeCollins
reviewed
Oct 6, 2026
Comment on lines
+298
to
+302
| parameters = get_default_options(DefaultOptionSet(prefix, ("dwr_",))) | ||
| parameters.pop("snes_adapt_sequence", None) | ||
| primal_solver = NonlinearVariationalSolver( | ||
| high_problem, | ||
| options_prefix=prefix + "dwr_enriched_", |
Member
There was a problem hiding this comment.
The prefixes between the default options set and the specific solver should be consistent.
Either:
Suggested change
| parameters = get_default_options(DefaultOptionSet(prefix, ("dwr_",))) | |
| parameters.pop("snes_adapt_sequence", None) | |
| primal_solver = NonlinearVariationalSolver( | |
| high_problem, | |
| options_prefix=prefix + "dwr_enriched_", | |
| parameters = get_default_options(DefaultOptionSet(prefix, ("dwr_enriched_",))) | |
| parameters.pop("snes_adapt_sequence", None) | |
| primal_solver = NonlinearVariationalSolver( | |
| high_problem, | |
| options_prefix=prefix + "dwr_enriched_", |
or
Suggested change
| parameters = get_default_options(DefaultOptionSet(prefix, ("dwr_",))) | |
| parameters.pop("snes_adapt_sequence", None) | |
| primal_solver = NonlinearVariationalSolver( | |
| high_problem, | |
| options_prefix=prefix + "dwr_enriched_", | |
| parameters = get_default_options(DefaultOptionSet(prefix, ("dwr_",))) | |
| parameters.pop("snes_adapt_sequence", None) | |
| primal_solver = NonlinearVariationalSolver( | |
| high_problem, | |
| options_prefix=prefix + "dwr_", |
Contributor
Author
There was a problem hiding this comment.
I changed the common prefix to goal_ because DWR is too obscure (now the PR does not mention DWR).
There are a couple other solvers (goal_cell_ and goal_facet_, projectors) under this common prefix. Therefore, I cannot take your suggestion.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The marker is now a single object that every refined solver context shares. On each call it moves its goal functional and exact solution to the current mesh through the coefficient mapping of the refined context, and it appends a GoalEstimate to its estimates history. Each estimate records the number of degrees of freedom, the goal, the discretisation and solver errors, and the true error and effectivity index when the exact solution is known. The marker reads its options from the prefix of the shared SNES, so it holds no options prefix of its own. This removes the GoalOrientedMarker.reconstruct method, its _reconstruct hook in mg/ufl_utils.py, and NonlinearVariationalSolver.get_marking_callback. Move the solve_jacobian tests to test_solving_interface.py, and define forms and keyword argument values on separate lines in the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pbrubeck
force-pushed
the
pbrubeck/snes-weakref
branch
from
October 9, 2026 09:55
255fc03 to
0c52bdc
Compare
# Conflicts: # firedrake/solving_utils.py # tests/firedrake/multigrid/test_snes_adapt.py
The adjoint of a NonlinearVariationalSolveBlock is solved as a linear system, with keyword arguments copied from the forward solver. The linear solve rejects the callbacks of the forward solver, so the Hessian of a functional failed with "Illegal keyword argument" for a solver with a marking_callback or a pre/post Jacobian or function callback. These callbacks are now removed together with the appctx. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Remove goal_test_derivative_order, goal_enriched_family and the biharmonic test. The DWR indicators use one cell solve and one facet solve. - Mark cells with eta_K >= fraction * max eta, without sorting, as in the adaptive multigrid demo. - Use snes.getSolution() as the work vector, as in #5498. This requires PETSc !9704. - check_convergence raises when the SNES fails and its KSP converged. - Revert the transform type guard: inserted_options with an empty prefix already keeps a value that the user set. - Rewrite the docstrings, comments and goal-oriented tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
!9704 is based on the PETSc release branch, so it also includes !9672 and !9673. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pbrubeck
force-pushed
the
pbrubeck/goal-adaptive-callback
branch
from
October 15, 2026 08:30
d478d4b to
4d41c8f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Automates dual-weighted residual goal-oriented adaptive mesh refinement.
dwr_marking_callback(goal_functional)API.PETSc.Options()keys._SNESContext.solve_jacobian_transpose(), residual localization, and Dörfler marking.solve(..., marking_callback=...)forwarding.