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

Unify MixedElement with the new UFL interface #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

angus-g
Copy link

@angus-g angus-g commented Dec 13, 2024

This is an attempt to fix #105, which is still breaking G-ADOPT, because we almost always call is_continuous on a MixedElement (https://github.com/g-adopt/g-adopt/blob/03ea2a086b325a61263b66d3415612a1c5a8d289/gadopt/utility.py#L154-L168) and hit this shortcoming.

Unfortunately, I'm not fully integrated into how all of these components interact (i.e. fiat, finat, ufl), so this is quite a surface-level fix. It looks to me as though MixedElement has to deviate from FiniteElementBase in a few places:

If a component is specified in either is_cellwise_constant() or degree(), a domain must also be provided so the component can be extracted using extract_component(). I've put this in as an optional keyword-only argument, but I don't think this is the best approach.

Closes #105.

Unfortunately this isn't quite there, as MixedElement has to deviate
from FiniteElementBase in a few places:
If a component is specified in either is_cellwise_constant() or
degree(), a domain must also be provided so the component can be
extracted using extract_component(). I've put this in as an optional
keyword-only argument, but I don't think this is the best approach.
@pbrubeck
Copy link

This seems a bit risky for meshes where tdim != gdim. If the main issue was that g-adopt wanted to determine continuity of vector-valued elements, couldn't that information be inferred from the FunctionSpace (either the Sobolev space or the form degree)? Checking individual Cartesian components of FiniteElements does not seem to be a robust approach.

Comment on lines 144 to -146
def _check_component(self, domain, i):
"""Check that component index i is valid."""
sh = self.value_shape(domain.geometric_dimension())

Choose a reason for hiding this comment

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

Should this function still depend on the domain, or could it just be renamed to _check_reference_component?

@@ -87,7 +87,7 @@ def reconstruct_from_elements(self, *elements):
return self
return MixedElement(*elements)

def symmetry(self, domain):

Choose a reason for hiding this comment

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

I agree with this change. The symmetry should only be imposed on the reference components

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.

MixedElement broken by recent UFL changes
2 participants