You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The symbolic coarsening is happening because we would like DirichletBC to be refined symbolically in #4893. The symbolic and numeric coarsening are mathematically equivalent when the spaces are nested, but this is not the case for refinement. If we refined BCs numerically we would be appying the coarse BCs throughout the adaptive refinement loop, incurring great errors.
Since the symbolic boundary data might live on different function spaces, we need to add BCBase.coefficients() so that we can attach DM hooks to the function spaces of every coefficient in the problem and be able to extract the correct TransferManager of the problem.
This PR also enables prescribing BC data from a different FunctionSpace. Previously we were not allowing the data to be a pure Function on a different space, e.g. DirichletBC(V1, Function(V2), sub), but we allowed composite expressions with Functions on a different space, e.g. DirichletBC(V1, 2*Function(V2), sub). Here we allow both cases.
pbrubeck
changed the title
Symbolic coarsening of DirichletBC, and bc data interpolation from ot…
Symbolic coarsening of DirichletBC, and interpolate bc data from other spaces
May 19, 2026
Since the symbolic boundary data might live on different function spaces, we need to add BCBase.coefficients() so that we can attach DM hooks to the function spaces of every coefficient in the problem and be able to extract the correct TransferManager of the problem.
Not for this PR but I think that this needs cleaning up. This dmhooks business is getting quite out of hand. I plan on doing this at some point.
This PR also enables prescribing BC data from a different FunctionSpace. Previously we were not allowing the data to be a pure Function on a different space, e.g. DirichletBC(V1, Function(V2), sub), but we allowed composite expressions with Functions on a different space, e.g. DirichletBC(V1, 2*Function(V2), sub). Here we allow both cases.
Seems reasonable. This needs to be written down somewhere though. Both in a docstring and the manual.
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
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
The symbolic coarsening is happening because we would like
DirichletBCto be refined symbolically in #4893. The symbolic and numeric coarsening are mathematically equivalent when the spaces are nested, but this is not the case for refinement. If we refined BCs numerically we would be appying the coarse BCs throughout the adaptive refinement loop, incurring great errors.Since the symbolic boundary data might live on different function spaces, we need to add
BCBase.coefficients()so that we can attach DM hooks to the function spaces of every coefficient in the problem and be able to extract the correctTransferManagerof the problem.This PR also enables prescribing BC data from a different FunctionSpace. Previously we were not allowing the data to be a pure
Functionon a different space, e.g.DirichletBC(V1, Function(V2), sub), but we allowed composite expressions withFunctionson a different space, e.g.DirichletBC(V1, 2*Function(V2), sub). Here we allow both cases.