Commit 60d44cf
authored
[LinearSolver] Untangle linear solver and linear system (#5648)
* Start removing assembly function from linear solvers
* move internal functions to protected
* cache factorization + cache invalidation
* remove more "assembly" functions
* fix AsyncSparseLDLSolver
* add missing templates to the factory
* CompositeLinearSystem can support multiple types of linear systems
* introduce preconditioned systems
* a bit of cleaning
* convert double to Real
* add an error if wrong type
* Restoration of the parameter controlling the assembly rate of the preconditioned matrix. It was the Data 'update_step' in PCGLinearSolver, but now it's the Data 'assemblingRate' in PreconditionedMatrixFreeSystem.
Benchmark of examples\Component\LinearSolver\Preconditioner\FEMBAR_PCG_JacobiPreconditioner.scn on 1000 time steps with variation of `assemblingRate`:
1: 700.128 FPS
2: 968.381 FPS
3: 1074.87 FPS
4: 1156.56 FPS
10: 1383.11 FPS
20: 1478.05 FPS
30: 1561.64 FPS
60: 1563.85 FPS
* restore removed Data with a deprecation layer
* restore initial parameter for regression tests
* fix PrecomputedLinearSolver
* mark WarpPreconditioner destructor as `override`
* minor cleaning
* simplify `checkLinearSystem` in WarpPreconditioner implementation
* add license header to RotationMatrixSystem header file
* fix typo in registration description of RotationMatrixSystem
* modernize code style
* add missing `RotationMatrixSystem.inl` to CMakeLists.txt
* replace `addSlave` with `addObject` in MatrixLinearSolver
This is to allow the added object to be initialized. Slaves are not initialized because visitors don't visit them. They are owned by their master, then it's up to their master to initialize them or not. There is no reason for a linear system to be a slave.
* add SOFA class macros for proper class hierarchy
* Missing space
* proper initialization of systems and solvers
* validate `l_linearSystem` type in `PCGLinearSolver`
* fix typo in error message of `PCGLinearSolver`
* validate `l_mainAssembledSystem` and handle missing or invalid linear systems in `RotationMatrixSystem`
* validate `l_linearSystem` type and ensure compatibility with `RotationMatrixSystem` in `WarpPreconditioner`
* don't link to itself
* refactor `RotationMatrixSystem` and `WarpPreconditioner` for clearer logic and enhanced matrix handling
* some comments
* proper deprecation
* update scene
* minor changes
* add `template` keyword to `get` and `getObjects` calls in `RotationMatrixSystem` for proper type resolution
* invert includes order to allow object factory to find the component module
* apply changes
* deprecation
* forgot a file
* simplify `checkLinearSystem` logic using `doCheckLinearSystem`
* add components that are created implicitly in the scene
* add a description to a class member
* see if regression test is happy
* rename `d_authorizeAssembly` to `d_enableAssembly`
* rename Data name
* fix call to MechanicalMultiVectorPeqBaseVectorVisitor but actually it is not called1 parent cd41845 commit 60d44cf
File tree
67 files changed
+1142
-985
lines changed- Sofa
- Component
- Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction
- LinearSolver
- Direct/src/sofa/component/linearsolver/direct
- Iterative
- src/sofa/component/linearsolver/iterative
- Preconditioner
- src/sofa/component/linearsolver/preconditioner
- LinearSystem/src/sofa/component/linearsystem
- ODESolver
- Backward/src/sofa/component/odesolver/backward
- Forward/src/sofa/component/odesolver/forward
- SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic
- framework
- Core/src/sofa/core
- behavior
- Simulation/Core/src/sofa/simulation
- mechanicalvisitor
- examples/Component
- LinearSolver
- Iterative
- Preconditioner
- ODESolver/Backward
- SolidMechanics/FEM
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
67 files changed
+1142
-985
lines changedLines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
251 | | - | |
| 250 | + | |
| 251 | + | |
252 | 252 | | |
| 253 | + | |
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
| |||
373 | 374 | | |
374 | 375 | | |
375 | 376 | | |
376 | | - | |
377 | | - | |
| 377 | + | |
| 378 | + | |
378 | 379 | | |
| 380 | + | |
379 | 381 | | |
380 | 382 | | |
381 | 383 | | |
| |||
541 | 543 | | |
542 | 544 | | |
543 | 545 | | |
544 | | - | |
545 | | - | |
| 546 | + | |
| 547 | + | |
546 | 548 | | |
547 | 549 | | |
548 | | - | |
549 | | - | |
550 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
551 | 553 | | |
552 | 554 | | |
553 | 555 | | |
| |||
Lines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | 358 | | |
362 | 359 | | |
363 | 360 | | |
| |||
374 | 371 | | |
375 | 372 | | |
376 | 373 | | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | 374 | | |
382 | 375 | | |
383 | 376 | | |
| |||
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | | - | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 72 | + | |
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
78 | 76 | | |
79 | | - | |
| 77 | + | |
80 | 78 | | |
81 | 79 | | |
82 | 80 | | |
| |||
99 | 97 | | |
100 | 98 | | |
101 | 99 | | |
102 | | - | |
| 100 | + | |
103 | 101 | | |
104 | 102 | | |
105 | 103 | | |
| |||
Sofa/Component/LinearSolver/Direct/src/sofa/component/linearsolver/direct/AsyncSparseLDLSolver.inl
Lines changed: 40 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
41 | | - | |
| 38 | + | |
42 | 39 | | |
43 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
44 | 43 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
51 | 62 | | |
52 | 63 | | |
53 | 64 | | |
54 | | - | |
| 65 | + | |
55 | 66 | | |
56 | 67 | | |
57 | 68 | | |
58 | 69 | | |
59 | 70 | | |
60 | 71 | | |
61 | | - | |
| 72 | + | |
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
65 | | - | |
| 76 | + | |
66 | 77 | | |
67 | 78 | | |
68 | 79 | | |
69 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
70 | 84 | | |
71 | 85 | | |
72 | 86 | | |
| |||
81 | 95 | | |
82 | 96 | | |
83 | 97 | | |
84 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
85 | 101 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 102 | + | |
93 | 103 | | |
94 | 104 | | |
95 | 105 | | |
| |||
107 | 117 | | |
108 | 118 | | |
109 | 119 | | |
110 | | - | |
111 | | - | |
| 120 | + | |
| 121 | + | |
112 | 122 | | |
113 | 123 | | |
114 | 124 | | |
| |||
119 | 129 | | |
120 | 130 | | |
121 | 131 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | 132 | | |
135 | 133 | | |
136 | 134 | | |
| |||
154 | 152 | | |
155 | 153 | | |
156 | 154 | | |
| 155 | + | |
| 156 | + | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
| |||
Lines changed: 12 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
| 397 | + | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
| 422 | + | |
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
459 | | - | |
| 459 | + | |
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
477 | | - | |
| 477 | + | |
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
| |||
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
503 | | - | |
| 503 | + | |
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
543 | | - | |
| 543 | + | |
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
559 | | - | |
| 559 | + | |
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| |||
584 | 584 | | |
585 | 585 | | |
586 | 586 | | |
587 | | - | |
| 587 | + | |
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
593 | | - | |
| 593 | + | |
594 | 594 | | |
595 | 595 | | |
596 | 596 | | |
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
671 | | - | |
| 671 | + | |
672 | 672 | | |
673 | | - | |
| 673 | + | |
674 | 674 | | |
675 | 675 | | |
676 | | - | |
| 676 | + | |
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
| |||
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | | - | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| |||
120 | 119 | | |
121 | 120 | | |
122 | 121 | | |
123 | | - | |
124 | | - | |
| 122 | + | |
| 123 | + | |
125 | 124 | | |
126 | 125 | | |
127 | 126 | | |
| |||
0 commit comments