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
Higher order gradients in CellValues #891
Conversation
Merging with master and using the same concept for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't checked all the details yet, but very nice to include this!
I think it would be nice to include the used formulas here, and also short derivation in a collapsed block as for the non-identity mappings.
src/FEValues/FunctionValues.jl
Outdated
Jinv = calculate_Jinv(getjacobian(mapping_values)) | ||
H = gethessian(mapping_values) | ||
@inbounds for j in 1:getnbasefunctions(funvals) | ||
dNdx = dothelper(funvals.dNdξ[j, q_point], Jinv) | ||
|
||
is_vector_valued = first(funvals.Nx) isa Vec | ||
if is_vector_valued #TODO - combine with helper function ? | ||
d2Ndx2 = (funvals.d2Ndξ2[j, q_point] - dNdx⋅H) ⊡ otimesu(Jinv,Jinv) | ||
else | ||
d2Ndx2 = Jinv'⋅(funvals.d2Ndξ2[j, q_point] - dNdx⋅H)⋅Jinv | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jinv = calculate_Jinv(getjacobian(mapping_values)) | |
H = gethessian(mapping_values) | |
@inbounds for j in 1:getnbasefunctions(funvals) | |
dNdx = dothelper(funvals.dNdξ[j, q_point], Jinv) | |
is_vector_valued = first(funvals.Nx) isa Vec | |
if is_vector_valued #TODO - combine with helper function ? | |
d2Ndx2 = (funvals.d2Ndξ2[j, q_point] - dNdx⋅H) ⊡ otimesu(Jinv,Jinv) | |
else | |
d2Ndx2 = Jinv'⋅(funvals.d2Ndξ2[j, q_point] - dNdx⋅H)⋅Jinv | |
end | |
Jinv = calculate_Jinv(getjacobian(mapping_values)) | |
H = gethessian(mapping_values) | |
is_vector_valued = first(funvals.Nx) isa Vec | |
Jinv_otimesu_Jinv = is_vector_valued ? otimesu(Jinv, Jinv) : nothing | |
@inbounds for j in 1:getnbasefunctions(funvals) | |
dNdx = dothelper(funvals.dNdξ[j, q_point], Jinv) | |
if is_vector_valued #TODO - combine with helper function ? | |
d2Ndx2 = (funvals.d2Ndξ2[j, q_point] - dNdx⋅H) ⊡ Jinv_otimesu_Jinv | |
else | |
d2Ndx2 = Jinv'⋅(funvals.d2Ndξ2[j, q_point] - dNdx⋅H)⋅Jinv | |
end |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #891 +/- ##
==========================================
- Coverage 93.30% 93.12% -0.18%
==========================================
Files 36 36
Lines 5257 5384 +127
==========================================
+ Hits 4905 5014 +109
- Misses 352 370 +18 ☔ View full report in Codecov by Sentry. |
Implementation of higher order gradients in CellValues. This was quite easy to do thanks to Knuts new FunctionValues and GeometryMapping.