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 VectorElement to take a variant argument. #17

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ufl/finiteelement/mixedelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class VectorElement(MixedElement):
"A special case of a mixed finite element where all elements are equal."

def __init__(self, family, cell=None, degree=None, dim=None,
form_degree=None, quad_scheme=None):
form_degree=None, quad_scheme=None, variant=None):
"""
Create vector element (repeated mixed element)

Expand All @@ -263,6 +263,8 @@ def __init__(self, family, cell=None, degree=None, dim=None,
viewed as k-form), ignored if family is a FiniteElement
quad_scheme
The quadrature scheme (optional), ignored if family is a FiniteElement
variant
Copy link
Member

Choose a reason for hiding this comment

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

I think this needs a bit more explanation. I don't understand the docstring.

Copy link
Contributor

Choose a reason for hiding this comment

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

This variant thing was first introduced to distinguish between GL, GLL, and equispaced Langrange elements without a profusion of names: Q, dQ, RTCE, RTCF, NCE, NCF type elements could be built from equispaced Lagrange as well as from spectral ingredients.

Later uses of this include RT and N1curl elements being available with different nodal basis, etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

For further reference, see this UFL issue and this UFL pull request.

Hint for the local basis function variant (optional)
"""

if isinstance(family, FiniteElementBase):
Expand All @@ -274,7 +276,8 @@ def __init__(self, family, cell=None, degree=None, dim=None,
# Create sub element
sub_element = FiniteElement(family, cell, degree,
form_degree=form_degree,
quad_scheme=quad_scheme)
quad_scheme=quad_scheme,
variant=variant)

# Set default size if not specified
if dim is None:
Expand Down