Skip to content

Tabulate Ciarlet generically#115

Merged
dham merged 5 commits intomasterfrom
pbrubeck/fix/point-evaluation
Nov 22, 2023
Merged

Tabulate Ciarlet generically#115
dham merged 5 commits intomasterfrom
pbrubeck/fix/point-evaluation

Conversation

@pbrubeck
Copy link
Copy Markdown
Collaborator

@pbrubeck pbrubeck commented Nov 21, 2023

It seems that we did not really need a special case for point evaluation of Ciarlet elements.
Instead of directly tabulating an element on a sympy Variable, we were evaluating the expansion set and manipulating the expansion coefficients trying to simplify tabulations that result in constants, e. g. second derivatives of Lagrange(2). Operating at the expansion coefficient level will only simplify constants when the constant function is a member of the expansion set, which is not true for a LagrangeLineExpansionSet.

It turns out that a special case for Ciarlet is not necessary, as gem.ListTensor has constant folding.
https://github.com/firedrakeproject/tsfc/blob/5515b2ae3c19e41bf80f347e7259fe9f5d86a9a2/gem/gem.py#L724

Tests that were failing are passing with this PR and firedrakeproject/fiat#54

fixes #114 while keeping the LagrangeLineExpansionSet

@pbrubeck pbrubeck marked this pull request as draft November 21, 2023 18:50
@pbrubeck pbrubeck marked this pull request as ready for review November 21, 2023 19:05


@singledispatch
def point_evaluation(fiat_element, order, refcoords, entity):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You could just push this implementation into the body of the point_evaluation method now if you think it would be worth it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I like how this PR is entirely deleting code at the moment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The best kind

@dham dham merged commit e2805c4 into master Nov 22, 2023
@dham dham deleted the pbrubeck/fix/point-evaluation branch November 22, 2023 16:51
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.

CI failing due to FIAT changes

3 participants