Skip to content

Make shape_symmetric_gradient work for PointValues#1325

Merged
KnutAM merged 6 commits intoFerrite-FEM:masterfrom
henrij22:he/fix_shape_symmetric_gradient
Apr 29, 2026
Merged

Make shape_symmetric_gradient work for PointValues#1325
KnutAM merged 6 commits intoFerrite-FEM:masterfrom
henrij22:he/fix_shape_symmetric_gradient

Conversation

@henrij22
Copy link
Copy Markdown
Contributor

The function shape_symmetric_gradient did not work for me for PointValues.

Now the following code works:

using Ferrite

ne = 2
grid = generate_grid(Quadrilateral, (ne, ne), Vec(0.0, 0.0), Vec((1.0, 1.0)))
cc = CellCache(grid)
reinit!(cc, 1)

ip = Lagrange{RefQuadrilateral, 1}()^2

qr = QuadratureRule{RefQuadrilateral}(2)
cv = CellValues(qr, ip)
pv = PointValues(cv)

reinit!(cv, cc)
reinit!(pv, cc.coords, Vec((0.5, 0.5)))
shape_symmetric_gradient(cv, 1, 1)
shape_symmetric_gradient(pv, 1, 1)

Also added test for shape_symmetric_gradient and symmetric_gradient

@henrij22 henrij22 changed the title Make shape_symmetric_gradient for PointValues Make shape_symmetric_gradient work for PointValues Apr 28, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.46%. Comparing base (efa551d) to head (087d4a0).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1325      +/-   ##
==========================================
+ Coverage   94.40%   94.46%   +0.05%     
==========================================
  Files          40       40              
  Lines        6846     6843       -3     
==========================================
+ Hits         6463     6464       +1     
+ Misses        383      379       -4     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KnutAM
Copy link
Copy Markdown
Member

KnutAM commented Apr 28, 2026

Nice, seems like this has been missed!

However, feels like we could/should define

shape_symmetric_gradient(fev::AbstractValues, qp::Integer, i::Integer) = symmetric(shape_gradient(fev, qp, i))

in common_values.jl, instead of the current symmetric occurring that the FunctionValues level? Similar as is done for shape_divergence and shape_curl.

@henrij22
Copy link
Copy Markdown
Contributor Author

Good point, I've put the evlauation in common_values.jl and removed it from point- and cellvalues

I think there is a pre-commit check fail, that is not related to this PR?

Copy link
Copy Markdown
Member

@KnutAM KnutAM left a comment

Choose a reason for hiding this comment

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

I think there is a pre-commit check fail, that is not related to this PR?

Should not be related, not sure what's going on here - seemed to pass on @fredrikekre's last pr which updated the runic checks?

Comment thread src/FEValues/common_values.jl Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can add the default implementation here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And remove from

@propagate_inbounds shape_symmetric_gradient(fv::FacetValues, q_point::Int, i::Int) = shape_symmetric_gradient(get_fun_values(fv), q_point, i)

@propagate_inbounds shape_symmetric_gradient(cv::CellValues, q_point::Int, i::Int) = shape_symmetric_gradient(cv.fun_values, q_point, i)

?

@fredrikekre
Copy link
Copy Markdown
Member

I guess this

should be SKIP: runic,runic-md now but it is weird that it fails.

@KnutAM
Copy link
Copy Markdown
Member

KnutAM commented Apr 29, 2026

but it is weird that it fails.

I deleted the cache: "pre-commit-3||6cd8084397da75e58f6d6387e234fe470a36bdbe740bae6dd0cce921aee96fb8", and then it work since it forces re-install of Runic.

I think this errors surfaces because of the update in #1314, as julia-actions/cache v3 now don't delete the cache on failed jobs, so earlier rerunning the job would make this re-install.

Could it be that there really should be an instantiate or smth similar added to the pre-commit workflow @fredrikekre ?

@KnutAM KnutAM merged commit a4fdff4 into Ferrite-FEM:master Apr 29, 2026
19 of 20 checks passed
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.

3 participants