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

Use autodiff in find_local_coordinate #876

Closed

Conversation

KnutAM
Copy link
Member

@KnutAM KnutAM commented Jan 23, 2024

PR towards #820

A way to avoid introducing calculate_mapping_and_spatial_coordinate, but without MixedTensors, it is not as nice as it could be

@KnutAM
Copy link
Member Author

KnutAM commented Jan 23, 2024

As pointed out by @termi-official on slack and by CI failure - requires MixedTensors for the autodiff to work as intended for embedded elements....

@KnutAM KnutAM closed this Jan 23, 2024
@KnutAM KnutAM reopened this Jan 23, 2024
@KnutAM
Copy link
Member Author

KnutAM commented Jan 23, 2024

Added ForwardDiff as dep to make it work.

Timings show faster for regular but slower for embedded. Probably since the workaround requires double evaluation of shape functions.

@btime PointEvalHandler($mesh, $points); 
# Standard elements from test_pe_scalar_field in test_pointevaluation.jl
PR876:  78.600 μs (423 allocations: 59.38 KiB)
PR820:  89.000 μs (423 allocations: 59.38 KiB)
# Embedded elements from test_pe_embedded in test_pointevaluation.jl
PR876: 903.100 μs (4319 allocations: 988.27 KiB)
PR820: 857.400 μs (4319 allocations: 988.27 KiB)

Edit: Closing this again but have it as a reference for the discussion in #820, I think it would be nice to reuse the spatial_coordinate function introduced there with the local coordinate \xi as input for defining the residual equation to solve for.

@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (dde8aac) 93.05% compared to head (0a6ff00) 92.86%.
Report is 2 commits behind head on do/fix-pointeval-geovalues.

Files Patch % Lines
src/FEValues/common_values.jl 66.66% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                      Coverage Diff                       @@
##           do/fix-pointeval-geovalues     #876      +/-   ##
==============================================================
- Coverage                       93.05%   92.86%   -0.20%     
==============================================================
  Files                              36       36              
  Lines                            5288     5300      +12     
==============================================================
+ Hits                             4921     4922       +1     
- Misses                            367      378      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KnutAM KnutAM closed this Jan 25, 2024
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.

2 participants