-
Notifications
You must be signed in to change notification settings - Fork 7
Ksagiyam/introduce mixed map mixed cell #183
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
Conversation
fb007d7 to
2bd2a36
Compare
0b79221 to
cf696fe
Compare
cf696fe to
e76d172
Compare
finat/ufl/mixedelement.py
Outdated
| cells = tuple(sorted(set(element.cell for element in elements) - set([None]))) | ||
| self._cells = cells | ||
| cells = tuple(e.cell for e in elements) | ||
| if cells: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if cells: | |
| if all(cell is not None for cell in cells): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we are always in the True branch, we could potentially delete the False branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turned out elements can be () when doing something with VertexOnlyMesh.
finat/ufl/mixedelement.py
Outdated
| __slots__ = ("_sub_elements", "_cells") | ||
|
|
||
| def __init__(self, *elements, **kwargs): | ||
| def __init__(self, *elements, make_cell_sequence=True, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any good reason to introduce this kwarg? Could we not always create a CellSequence when the elements are on different cells?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We make CellSequence for proper MixedElements, but not for VectorElement or TensorElement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we had:
elem = MixedElement(...)
elem.cells # always gives a CellSequence
elem.cell # crashes if elem.cells are not all the same cell, otherwise returns the unique cellThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely better.
b1b64df to
fdc993a
Compare
fdc993a to
752703e
Compare
|
Merging as all discussions have been resolved. |
Please try to get an approving review before merging. |
Depends on:
ufl: FEniCS/ufl#429
Required for:
Firedrake: firedrakeproject/firedrake#4430
Use
CellSequenceinMixedElement.