Solver.poisson support pre-integrated vfuncs#115
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #115 +/- ##
==========================================
- Coverage 50.04% 50.01% -0.04%
==========================================
Files 15 15
Lines 3153 3151 -2
Branches 414 415 +1
==========================================
- Hits 1578 1576 -2
Misses 1426 1426
Partials 149 149
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds an option to Solver.poisson to skip mass-matrix integration when the RHS is already pre-integrated, and updates differential-geometry helpers to use that option instead of mutating Solver.mass.
Changes:
- Add
integrate: bool = TruetoSolver.poissonto optionally bypassB*hintegration. - Update
diffgeo.compute_geodesic_f,tria_compute_geodesic_f, andtria_compute_rotated_fto callpoisson(..., integrate=False)instead of replacingfem.masswith the identity. - Document the new flag in the
poissondocstring.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
lapy/solver.py |
Introduces integrate flag and conditional mass-matrix application when building the RHS. |
lapy/diffgeo.py |
Switches geodesic/rotated-function routines to use integrate=False rather than altering solver state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @magnesium2400 thanks for this PR. I like to integrate it, but first the comments above need to be resolved. Fixing the doc-string to numpy format should also fix the doc build CI error. |
|
ok thanks @m-reuter , i will only have time in a few weeks but will do it then. and sorry, I couldnt find the tests anywhere (I could only see the notebooks) -- where/how should i write the tests (can I use pytest)? cheers. |
|
Hi, tests are under lapy/utils/tests ( we will move them at some point into the project root, but currently you can add things there, if you find a similar tests already, if not, don't worry too much about the test). The other comments are more important. |
|
thanks @m-reuter , i think i did all the changes that were brought up earlier. they were just small changes to the comments/docstrings. I added a simple test. |
|
Thanks for your contribution! |
Solver.poissonalways multiplies the input vfunchbyself.massto generate an integrated mapdiffgeo.compute_geodesic_fetc.Test_TriaMesh_Geodesics.ipynbstill look good whenvf = fem.poisson(Bi * divx)is replaced byvf = fem.poisson(divx, integrate=False)