-
Notifications
You must be signed in to change notification settings - Fork 9
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
Dualspace update #25
Dualspace update #25
Conversation
…FEniCS#71) * allow variant hints to be passed into VectorElement and TensorElement * get variant from sub element (for when VectorElement family input is a FiniteElement with a variant) * get variant of sub element properly
…unction traversal
ufl/algorithms/map_integrands.py
Outdated
elif isinstance(form, FormSum): | ||
mapped_components = [map_integrands(function, component, only_integral_type) | ||
for component in form.components()] | ||
nonzero_components = [(component, 1) for component in mapped_components | ||
# Catch ufl.Zero and zeros of dual objects | ||
# Workaround while the role of `__eq__`/`equals` for BaseForms is clarified ? | ||
if not component == 0] | ||
return FormSum(*nonzero_components) | ||
elif isinstance(form, Adjoint): | ||
# Zeros are caught inside `Adjoint.__new__` | ||
return Adjoint(map_integrands(function, form._form, only_integral_type)) | ||
elif isinstance(form, Action): | ||
left = map_integrands(function, form._left, only_integral_type) | ||
right = map_integrands(function, form._right, only_integral_type) | ||
# Zeros are caught inside `Action.__new__` | ||
return Action(left, right) | ||
elif isinstance(form, (Expr, BaseForm)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wence- @dham : Following our discussion regarding the fact that the derivative expansion was manually pushed through in expand_derivatives
. I have made some cleanup and added handlers here to address the issue raised but also to extend this behaviour to other MultiFunction objects that could eventually be fed with dual objects (cf. this commit 2fdd180)
@wence- @dham Following our discussion, the |
…EniCS#76) * Add method for getting the facet cell * Don't use cellname2facetname * Remove num_facet_edges * Make suggested changes
* Remove cellname2facetname * Flake8
* added value_shape for WithMapping element * raise ValueError instead of error * Pass kwargs when reconstructing a TensorProductElement * forget the original kwargs Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>
Update the dual space branch #21, mainly by fixing few things and extending it to cover
BaseForm
differentiation.More precisely:
ufl/algorithms/analysis.py
UFLType
BaseForm
differentiation