Skip to content

Don't pass restricted BCs into assemble - #5285

Draft
leo-collins wants to merge 1 commit into
mainfrom
leo/restricted-bcs
Draft

Don't pass restricted BCs into assemble#5285
leo-collins wants to merge 1 commit into
mainfrom
leo/restricted-bcs

Conversation

@leo-collins

@leo-collins leo-collins commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Don't pass the restricted BCs in to assembly. When restrict=True, the boundary DoFs are removed in the restricted function space so passing in these BCs does nothing. This lets us use restrict=True for residuals containing things we cannot apply BCs to (e.g. cross-mesh interpolation currently) in the traditional way.

@pbrubeck

Copy link
Copy Markdown
Contributor

We still needs the BCs for a RestrictedFunctionSpace, as they are used to set the value of u_restrict at the beginning of the solve. Does your change preserve that?

@pbrubeck

Copy link
Copy Markdown
Contributor

Why is this change required? Please add a description and or tests.

@leo-collins

leo-collins commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

We still needs the BCs for a RestrictedFunctionSpace, as they are used to set the value of u_restrict at the beginning of the solve. Does your change preserve that?

I only change the BCs passed to the residual and Jacobian assembly. problem.bcs is unchanged.

Why is this change required?

Because we don't need to pass these BCs in to assembly. In particular I would like this for my cross-mesh stuff, since BCs for cross-mesh interpolation has not been implemented yet. I will add a description and tests.

@connorjward

Copy link
Copy Markdown
Contributor

I hit this with pyop3. It was quite annoying to have the debug why imposing boundary conditions on a restricted space failed to be a no-op.

More generally I don't understand why it is valid to create a DirichletBC object on a restricted function space. I think it just leads to confusing corner cases. For instance what if the boundary_set between the BC and function space differ?

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.

3 participants