Integration of BlockCatamari/MeshFEMSparse - #115
Conversation
…d update all necessary functions.
A typo in `spqr.cmake` prevented the `SuiteSparse::SPQR` from being detected, leading to an unnecessary `find_package(SPQR)` call. This call in turn can bring in a newer system-level SuiteSparse library that conflicts with the older CPM version and breaks the configuration step. We also add `include(suitesparse)` before checking the target in case this was not done previously (i.e., if the other `SuiteSparse` dependencies have been disabled).
… in a PolyFEM-compatible version of Metis in this case. Metis is needed for orderings like cholmod_nested_dissection and cholmod_metis (anything depending on the PARTITION module of CHOLMOD). Newer versions of SuiteSparse package their own customized version of Metis, but until we upgrade we need to bring it in ourselves. Note that PolyFEM includes Metis via `wildmeshing-toolkit` and configures it for 32-bit indices; we bring in the identical git commit and apply matching configuration settings here.
…st-path) and sparsity-update-aware guarded symbolic factorization
…factorization. This prevents strategy switches from causing unnecessary symbolic factorizations and and losing track of adaptive ordering timing statistics. It also requires moving the sparsity pattern ID metadata onto the linear solver object.
… when converting (add shift)
…variant interface to linear solvers.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #115 +/- ##
==========================================
- Coverage 80.73% 79.96% -0.78%
==========================================
Files 51 54 +3
Lines 2118 2286 +168
Branches 280 311 +31
==========================================
+ Hits 1710 1828 +118
- Misses 408 458 +50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| // will both be of size `rows() - nfv`, where `nfv` is the number of | ||
| // unique indices in `fixedVars). This differs from MeshFEMSparse's | ||
| // convention of working with full-space RHS and solution vectors. | ||
| struct BCSCHessianWithFixedVars { |
…n wrapping an externally owned matrix.
| throw std::runtime_error("Dense Hessian not implemented."); | ||
| } | ||
|
|
||
| virtual size_t getSparsityPatternID() const { return -1; } |
There was a problem hiding this comment.
this is an int in the linear part. Also, is it necessary to have it in the linear solver? things seems to be duplicated
There was a problem hiding this comment.
Yes, we can change this to int, with a corresponding change to the PolyFEM PR.
And, yes, tracking pattern IDs in both places is necessary, and there is no actual duplication here. The idea is that the problem reports its current sparsity pattern ID while the linear solver gets tagged with the ID of the sparsity pattern it most recently analyzed. The analysis phase only needs to run when the IDs disagree (i.e., only when the sparsity pattern actually changes).
teseoch
left a comment
There was a problem hiding this comment.
There is a lot of coordination between linear and non-linear; is it necessary?
| MeshFEM::CatamariFactorizer factorizer_; | ||
| Eigen::Index reduced_size_ = -1; | ||
| Eigen::Index full_size_ = -1; | ||
| bool symbolic_factorization_ = false; |
There was a problem hiding this comment.
Thanks, yes, I will fix this; it only affects what stats get collected by get_info.
|
can you add some test using the new matrix representation and the different conversions back and forth? |
|
Regarding your question about excessive coordination--could you be more specific about the concern? And yes, I can add unit tests for those conversions. There is some of this within the |
Integrate BlockCatamari solver and add support for BlockCSCHessian. Also support sharing linear solvers across descent strategies to avoid unnecessary symbolic factorization work.
The various supported symmetric matrix types are managed by the new
Hessianvariant class, which facilitates the conversions needed when theProblemandSolverwork in different formats.