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

weak_local_grad: Computes rst derivatives too many times #141

Closed
inducer opened this issue Jul 5, 2021 · 1 comment
Closed

weak_local_grad: Computes rst derivatives too many times #141

inducer opened this issue Jul 5, 2021 · 1 comment

Comments

@inducer
Copy link
Owner

inducer commented Jul 5, 2021

This code:

grudge/grudge/op.py

Lines 354 to 359 in 1c44c4b

return make_obj_array(
[_apply_stiffness_transpose_operator(dcoll,
dof_desc.DD_VOLUME,
dd, vec, xyz_axis)
for xyz_axis in range(dcoll.dim)]
)

computes the r,s,t (i.e. reference) derivatives once per dimension. We can compute them once and reuse them. In 3D, that saves a factor of 3 in work.

This is something I should have caught during review of #74.

cc @thomasgibson @lukeolson

@inducer
Copy link
Owner Author

inducer commented Sep 5, 2021

I think I was mistaken here. For general curvilinear elements, the redundant computation can't be avoided, as the inverse metric derivatives can vary. The optimization I talk about here is only possible in the affine setting, cf. #161.

@inducer inducer closed this as completed Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant