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

splitting TensorProductElements does not work after UFL PR #122 #33

Open
JHopeCollins opened this issue Feb 6, 2023 · 4 comments
Open

Comments

@JHopeCollins
Copy link

UFL PR #122 changed the logic of how objects are handled in split.

It used to be that the original object was returned if it was not from a MixedFunctionSpace, but now it is only returned if ufl_element().num_sub_elements == 0. This is not the case for TensorProductElements (where num_sub_elements is the number of elements in the product) so the original object is not returned and it fails a test further down.

MFE in firedrake with an extruded mesh:

import firedrake as fd

mesh2D = fd.UnitSquareMesh(4, 4, quadrilateral=True)

mesh1D = fd.UnitIntervalMesh(4)
meshEx = fd.ExtrudedMesh(mesh1D, 4, layer_height=0.25)

V = fd.FunctionSpace(mesh2D, "CG", 1)
Ve = fd.FunctionSpace(meshEx, "CG", 1)

v = fd.Function(V)
ve = fd.Function(Ve)

fd.split(v)   # works                                                                                                                                                                                                                                         
fd.split(ve)  # breaks

Both the split calls work if FEniCS#122 is reverted.

@dham
Copy link
Member

dham commented Feb 6, 2023

Sounds like TensorProductElement is abusing .num_sub_elements. That attribute probably needs to be split into .num_sub_elements and .num_factor_elements.

@JHopeCollins
Copy link
Author

Ok. It's breaking some of the CI tests for asQ, would you suggest any workarounds until that is changed? Other than reverting the UFL commit on the CI or just waiting.

@dham
Copy link
Member

dham commented Feb 6, 2023

I don't have an immediate suggestion. I also don't know when this will get fixed or by whom.

@JHopeCollins
Copy link
Author

Ok. We have other tests that use ExtrudedMesh that still pass, so we can just xfail the failing ones for now.

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

No branches or pull requests

2 participants