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

Fieldsplit: replace empty Forms with ZeroBaseForm #3947

Merged
merged 42 commits into from
Jan 15, 2025

Conversation

pbrubeck
Copy link
Contributor

@pbrubeck pbrubeck commented Dec 30, 2024

Description

This PR addresses the consequences of FEniCS/ufl#336, which introduces more agressive simplifications that cause empty forms to be returned when extracting a subblock that is supposed to be zero (e.g. the pressure block in Stokes).

Here empty Jacobians are replaced with ZeroBaseForm, as we require two Arguments in order for the adjoint to make sense.

The simplifications should also speed up code generation and even reduce flop counts in some cases.

Description update after merge:

This PR also includes updates from #3922. That PR changes the default behaviour of assemble when dealing with boundary conditions, and may also throw errors when trying to restore the old defaults. The description of that PR is:

Description

This PR enables solve(a == assemble(L), u, bcs, restrict={False|True}) without requiring users to set the boundary nodes to zero when they provide a Cofunction RHS. Here we also solved a few other issues:

  1. V and V.dual() do no longer compare to the same thing.
  2. assemble(form, bcs, zero_bc_nodes=True) is the new default, and for the False case we throw an error because we will try to apply primal inhomogenous data on a dual Cofunction.

Depends on firedrakeproject/ufl#53

Fixes #3203, #3498, and #3130

Supersedes #3214, #3754

Copy link

github-actions bot commented Dec 30, 2024

TestsPassed ✅Skipped ⏭️Failed ❌
Firedrake real8155 ran7480 passed675 skipped0 failed

Copy link

github-actions bot commented Dec 30, 2024

TestsPassed ✅Skipped ⏭️Failed ❌
Firedrake complex8149 ran6675 passed1474 skipped0 failed

@pbrubeck pbrubeck force-pushed the pbrubeck/simplify-indexed branch from cf743a1 to be6a7b4 Compare January 2, 2025 00:43
@pbrubeck pbrubeck changed the title DO NOT MERGE Fieldsplit: replace empty Forms with ZeroBaseForm Jan 2, 2025
@pbrubeck pbrubeck marked this pull request as ready for review January 2, 2025 01:07
@pbrubeck pbrubeck force-pushed the pbrubeck/simplify-indexed branch 2 times, most recently from e0c7ba1 to 00b80e4 Compare January 2, 2025 02:07
@pbrubeck pbrubeck force-pushed the pbrubeck/simplify-indexed branch from 00b80e4 to bb04bb0 Compare January 2, 2025 05:41
firedrake/formmanipulation.py Outdated Show resolved Hide resolved
firedrake/adjoint_utils/variational_solver.py Show resolved Hide resolved
firedrake/formmanipulation.py Show resolved Hide resolved
firedrake/formmanipulation.py Show resolved Hide resolved
firedrake/matrix_free/operators.py Show resolved Hide resolved
firedrake/slate/slate.py Outdated Show resolved Hide resolved
@pbrubeck pbrubeck force-pushed the pbrubeck/simplify-indexed branch from d46a06e to 2eb6a56 Compare January 9, 2025 14:47
firedrake/functionspaceimpl.py Outdated Show resolved Hide resolved
firedrake/functionspaceimpl.py Outdated Show resolved Hide resolved
firedrake/functionspaceimpl.py Outdated Show resolved Hide resolved
@pbrubeck pbrubeck force-pushed the pbrubeck/simplify-indexed branch from 2eb6a56 to 934ff6f Compare January 9, 2025 17:48
@pbrubeck pbrubeck force-pushed the pbrubeck/simplify-indexed branch from 1461270 to 7c2354e Compare January 15, 2025 13:09
.github/workflows/build.yml Outdated Show resolved Hide resolved
@pbrubeck pbrubeck enabled auto-merge (squash) January 15, 2025 20:44
@pbrubeck pbrubeck dismissed stale reviews from JHopeCollins and ksagiyam January 15, 2025 20:45

done

@pbrubeck pbrubeck requested a review from ksagiyam January 15, 2025 20:48
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.

BUG: LinearSolver.solve fails when passed two Functions.
4 participants