[Diffusion] Explicit MechanicalObject link#6073
Conversation
ADD: explicit link alternative to mecaObj
fredroy
left a comment
There was a problem hiding this comment.
I see GaetanDesrues:v25.12 -> sofa-framework:v25.12
I think this PR should be merged into master, and might be backported to v25.12 later (or not)
|
Hello, all ForceFields are SingleStateAccessor, which are member called |
Add PCGLinearSolver specialisations for assembled CompressedRowSparseMatrix
systems (CRS<SReal> and CRS<Mat3x3>), so the preconditioned conjugate
gradient can be used with an assembled linear system instead of only the
matrix-free GraphScattered pipeline. This makes it usable with
LinearSolverConstraintCorrection, which requires an assembled matrix.
For each CRS type, override:
* checkLinearSystem() -> create a MatrixLinearSystem<CRS,FV>
instead of the auto-created
PreconditionedMatrixFreeSystem<GraphScattered>.
* ensureRequiredLinearSystemType()-> accept the assembled MatrixLinearSystem.
* bwdInit() -> skip the PreconditionedMatrixFreeSystem linking.
* solve() -> drive the preconditioner directly on the
assembled matrix (precond->invert(M) once,
precond->solve(M, z, r) per iteration),
since a CRS preconditioner (e.g.
SSORPreconditioner) has no GraphScattered
setRHS/solveSystem/dispatch plumbing.
The stopping test is unchanged (preconditioned residual <r, M^-1 r> vs
tolerance * <b, b>), matching the GraphScattered implementation. Both new
templates are registered in the factory and explicitly instantiated.
|
Hi @GaetanDesrues |
|
Hello @hugtalbot, yes PCG commit should not be in that PR, my mistake. I'll recreate both PRs in master. |
|
@GaetanDesrues what Hugo meant, is that |
Adding an explicit link to the MechanicalObject instead of relying on tags
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if