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

Allow variant hints to be passed into VectorElement and TensorElement #71

Merged
merged 3 commits into from
Oct 28, 2021

Conversation

mscroggs
Copy link
Member

This change allows the user to pass a variant into VectorElement and TensorElement. The value of this is then passed to the FiniteElement that is created as the sub element.

Copy link
Collaborator

@wence- wence- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine, though I also think it indicates that this is a part of UFL that really should be redone.

I don't know how basix represents Vector/TensorElement, but for us, we represent them as Vector(ScalarElement(...)) so the scalar element has the variant information.

I think that a redesign of UFL elements has an algebra such that a UFL element is either a concrete (non-reducible) element (such as RT or Lagrange), or some modifier of a (list of) elements.

That way we don't end up glomming so much information into the FiniteElementBase thing (and having to break the inheritance patterns).

@garth-wells garth-wells merged commit a4b7ab0 into main Oct 28, 2021
@garth-wells garth-wells deleted the mscroggs/variant branch October 28, 2021 18:13
@mscroggs
Copy link
Member Author

I think that a redesign of UFL elements has an algebra such that a UFL element is either a concrete (non-reducible) element (such as RT or Lagrange), or some modifier of a (list of) elements.

This is pretty much exactly how we treat elements in DOLFINx and FFCx now. I totally agree that this needs refactoring at some point.

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.

None yet

3 participants