Skip to content

Ksagiyam/rename sub elements#4354

Merged
ksagiyam merged 1 commit intomasterfrom
ksagiyam/rename_sub_elements
Jun 10, 2025
Merged

Ksagiyam/rename sub elements#4354
ksagiyam merged 1 commit intomasterfrom
ksagiyam/rename_sub_elements

Conversation

@ksagiyam
Copy link
Contributor

@ksagiyam ksagiyam commented Jun 5, 2025

return "interpolate"
elif isinstance(element, finat.ufl.TensorProductElement):
methods = [get_embedding_method_for_checkpointing(elem) for elem in element.sub_elements]
methods = [get_embedding_method_for_checkpointing(elem) for elem in element.tensor_product_components]
Copy link
Contributor

Choose a reason for hiding this comment

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

Just bikeshedding: element.component_elements? One could argue that it is important to say 'elements' in the attribute name.

Copy link
Contributor

Choose a reason for hiding this comment

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

These are the factors of the tensor product

Copy link
Contributor Author

Choose a reason for hiding this comment

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

factor_elements that Pablo suggested here firedrakeproject/fiat#148 looks good to me.

@ksagiyam ksagiyam force-pushed the ksagiyam/rename_sub_elements branch 3 times, most recently from 3c1f061 to c21fda1 Compare June 10, 2025 15:05
@ksagiyam ksagiyam marked this pull request as ready for review June 10, 2025 15:07
@ksagiyam ksagiyam requested a review from connorjward June 10, 2025 15:07
if ufl_scalar_element.num_sub_elements and not isinstance(
ufl_scalar_element, finat.ufl.TensorProductElement
):
if ufl_scalar_element.num_sub_elements:
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a bit of a strange condition. Is num_sub_elements zero for non-mixed elements? It seems like it would be better for num_sub_elements to only be an attribute on mixed elements as it's otherwise kind of oddly defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is strange. I would expect num_sub_elements = 1 for non-mixed elements, but we are not changing that in this PR. I can probably directly check type here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

@ksagiyam ksagiyam force-pushed the ksagiyam/rename_sub_elements branch from c21fda1 to 427d96e Compare June 10, 2025 15:52
connorjward
connorjward previously approved these changes Jun 10, 2025
Copy link
Contributor

@connorjward connorjward left a comment

Choose a reason for hiding this comment

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

LGTM

@ksagiyam ksagiyam force-pushed the ksagiyam/rename_sub_elements branch 2 times, most recently from 23e7aeb to d13be73 Compare June 10, 2025 21:44
@ksagiyam ksagiyam merged commit 45bbc14 into master Jun 10, 2025
2 of 4 checks passed
@ksagiyam ksagiyam deleted the ksagiyam/rename_sub_elements branch June 10, 2025 21:45
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