Skip to content

Commit 5782255

Browse files
committed
minor changes
1 parent fb830fa commit 5782255

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/WarpPreconditioner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class WarpPreconditioner : public sofa::component::linearsolver::MatrixLinearSol
6666

6767
void invert(Matrix& M) override;
6868

69-
void solve(Matrix& M, Vector& solution, Vector& rhs) override;
69+
void solve(Matrix& R, Vector& solution, Vector& rhs) override;
7070

7171
bool addJMInvJt(linearalgebra::BaseMatrix* result, linearalgebra::BaseMatrix* J, SReal fact) override;
7272

Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/WarpPreconditioner.inl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,25 +119,25 @@ void WarpPreconditioner<TMatrix, TVector, ThreadManager>::checkLinearSystem()
119119
}
120120

121121
template<class TMatrix, class TVector,class ThreadManager>
122-
void WarpPreconditioner<TMatrix,TVector,ThreadManager >::solve(Matrix& M, Vector& solution, Vector& rhs)
122+
void WarpPreconditioner<TMatrix,TVector,ThreadManager >::solve(Matrix& R, Vector& solution, Vector& rhs)
123123
{
124124
// The matrix A in l_linearSolver is rotated such as R * A * R^T
125125
// The new linear system to solve is then R * A * R^T * x = b
126126
// This is solved in 3 steps:
127127

128128
// Step 1:
129129
// R * A * R^T * x = b <=> A * R^T * x = R^T * b
130-
// R^T * b is computed:
131-
M.opMulTV(l_linearSolver->getLinearSystem()->getSystemRHSBaseVector(), &rhs);
130+
// R^T * b is computed in this step:
131+
R.opMulTV(l_linearSolver->getLinearSystem()->getSystemRHSBaseVector(), &rhs);
132132

133133
// Step 2:
134-
// Solve A * R^T * x = R^T * b using the linear solver. The solution stored in the linear
135-
// solver is then y = R^T * x
134+
// Let's define y = R^T * x, then the linear system is A * y = R^T * b.
135+
// This step solves A * y = R^T * b using the linear solver where y is the unknown.
136136
l_linearSolver->solveSystem();
137137

138138
// Step 3:
139-
// y = R^T * x <=> x = R * y
140-
M.opMulV(&solution, l_linearSolver->getLinearSystem()->getSystemSolutionBaseVector());
139+
// Since y = R^T * x, x is deduced: x = R * y
140+
R.opMulV(&solution, l_linearSolver->getLinearSystem()->getSystemSolutionBaseVector());
141141
}
142142

143143
/// Solve the system as constructed using the previous methods

0 commit comments

Comments
 (0)