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

Better sum factorisation for coefficients #81

Merged
merged 18 commits into from
Nov 30, 2016
Merged

Better sum factorisation for coefficients #81

merged 18 commits into from
Nov 30, 2016

Conversation

miklos1
Copy link
Member

@miklos1 miklos1 commented Nov 25, 2016

This hopefully does right what #80 did not. Summary of changes:

  • Improved constant folding
  • Multi-index IndexSum nodes
  • Workaround for Loop merger embarrassed by empty loops  coneoproject/COFFEE#98
  • Sum factorisation and delta elimination for coefficients, with a new sum factorisation algorithm
  • Revised coefficient evaluation (and marginally argument evaluation)
  • Code snippet generation for fast Jacobian evaluation on affine cells.

Ticks three boxes in #75, and closes coneoproject/COFFEE#97.

@miklos1 miklos1 added the finat label Nov 25, 2016
tensor = numpy.empty(expression.shape, dtype=object)
for alpha in numpy.ndindex(expression.shape):
tensor[alpha] = Indexed(expression, alpha)
expression = ListTensor(tensor)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a redundant line.

Copy link
Member Author

Choose a reason for hiding this comment

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

This converts a numpy array to a GEM object.

for alpha in numpy.ndindex(expression.shape):
tensor[alpha] = Indexed(expression, alpha)
expression = ListTensor(tensor)
expression, = remove_componenttensors((ListTensor(tensor),))
Copy link
Contributor

Choose a reason for hiding this comment

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

This converts a numpy array to a GEM object.

As well as this line...

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I see...

@miklos1 miklos1 merged commit 0098235 into finat Nov 30, 2016
@miklos1 miklos1 deleted the finat-sum-revised branch November 30, 2016 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants