FEniCS backend: assignment and interpolation updates #613
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.
The FEniCS backend previously handled
Function.assign([linear combination of functions])
using theExprInterpolation
class. However this seems fragile in the case of non-continuous functions. This PR removes this case. A better approach for non-variable coefficients is to useLinearCombination
directly, otherwise a customEquation
class will now be needed.The FEniCS backend
interpolate_expression
now always uses point evaluation viaExpr
for primalFunction
interpolation. This is slow, but I'm not aware of a good general solution with legacy FEniCS. This may also change the behavior for DG functions, but interpolation is ambiguous anyway in this case.Firedrake note: The Firedrake backend version of
ExprInterpolation
uses Firedrake's much faster approach for interpolation of general expressions. The FiredrakeExprInterpolation
is still used to transfer functions from restricted to non-restricted spaces, even for non-continuous spaces.Also:
Function.assign([function in a different space])
(not caught by legacy FEniCS).