Skip to content

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

Merged
garth-wells merged 3 commits into
mainfrom
mscroggs/variant
Oct 28, 2021
Merged

garth-wells merged 3 commits into
mainfrom
mscroggs/variant

Conversation

@mscroggs

Copy link
Copy Markdown
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.

@garth-wells
garth-wells requested a review from wence- October 28, 2021 13:24

@wence- wence- left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

3 participants