Skip to content

Commit 60d44cf

Browse files
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 called
1 parent cd41845 commit 60d44cf

File tree

67 files changed

+1142
-985
lines changed

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 changed

Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.inl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ void LinearSolverConstraintCorrection<DataTypes>::addComplianceInConstraintSpace
203203
}
204204

205205
// use the Linear solver to compute J*A^-1*J^T, where A is the mechanical linear system matrix
206-
l_linearSolver->setSystemLHVector(sofa::core::MultiVecDerivId::null());
206+
l_linearSolver->getLinearSystem()->setSystemSolution(sofa::core::MultiVecDerivId::null());
207207
l_linearSolver->addJMInvJt(W, &m_constraintJacobian, factor);
208208

209209
addRegularization(W);
@@ -247,9 +247,10 @@ void LinearSolverConstraintCorrection< DataTypes >::computeMotionCorrection(cons
247247
{
248248
if (mstate && l_linearSolver.get())
249249
{
250-
l_linearSolver->setSystemRHVector(f);
251-
l_linearSolver->setSystemLHVector(dx);
250+
l_linearSolver->getLinearSystem()->setRHS(f);
251+
l_linearSolver->getLinearSystem()->setSystemSolution(dx);
252252
l_linearSolver->solveSystem();
253+
l_linearSolver->getLinearSystem()->dispatchSystemSolution(dx);
253254
}
254255
}
255256

@@ -373,9 +374,10 @@ void LinearSolverConstraintCorrection<DataTypes>::applyContactForce(const linear
373374
}
374375
}
375376
}
376-
l_linearSolver->setSystemRHVector(forceID);
377-
l_linearSolver->setSystemLHVector(dxID);
377+
l_linearSolver->getLinearSystem()->setRHS(forceID);
378+
l_linearSolver->getLinearSystem()->setSystemSolution(dxID);
378379
l_linearSolver->solveSystem();
380+
l_linearSolver->getLinearSystem()->dispatchSystemSolution(dxID);
379381

380382
//TODO: tell the solver not to recompute the matrix
381383

@@ -541,13 +543,13 @@ void LinearSolverConstraintCorrection<DataTypes>::resetForUnbuiltResolution(SRea
541543
core::VecDerivId forceID(core::VecDerivId::V_FIRST_DYNAMIC_INDEX);
542544
core::VecDerivId dxID = core::vec_id::write_access::dx;
543545

544-
l_linearSolver->setSystemRHVector(forceID);
545-
l_linearSolver->setSystemLHVector(dxID);
546+
l_linearSolver->getLinearSystem()->setRHS(forceID);
547+
l_linearSolver->getLinearSystem()->setSystemSolution(dxID);
546548

547549

548-
systemMatrix_buf = l_linearSolver->getSystemBaseMatrix();
549-
systemRHVector_buf = l_linearSolver->getSystemRHBaseVector();
550-
systemLHVector_buf = l_linearSolver->getSystemLHBaseVector();
550+
systemMatrix_buf = l_linearSolver->getLinearSystem()->getSystemBaseMatrix();
551+
systemRHVector_buf = l_linearSolver->getLinearSystem()->getSystemRHSBaseVector();
552+
systemLHVector_buf = l_linearSolver->getLinearSystem()->getSystemSolutionBaseVector();
551553
systemLHVector_buf_fullvector = dynamic_cast<linearalgebra::FullVector<Real>*>(systemLHVector_buf); // Cast checking whether the LH vector is a FullVector to improve performances
552554

553555
constexpr const auto derivDim = Deriv::total_size;

Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/PrecomputedConstraintCorrection.inl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,6 @@ void PrecomputedConstraintCorrection<DataTypes>::bwdInit()
355355
fact *= eulerSolver->getPositionIntegrationFactor(); // here, we compute a compliance
356356

357357
eulerSolver->solve(core::execparams::defaultInstance(), dt, core::vec_id::write_access::position, core::vec_id::write_access::velocity);
358-
359-
if (linearSolver)
360-
linearSolver->freezeSystemMatrix(); // do not recompute the matrix for the rest of the precomputation
361358
}
362359

363360
for (unsigned int v = 0; v < nbNodes; v++)
@@ -374,10 +371,6 @@ void PrecomputedConstraintCorrection<DataTypes>::bwdInit()
374371
msg_info() << tmpStr.str();
375372
}
376373

377-
// Do not recompute the matrix for the rest of the precomputation
378-
if (linearSolver)
379-
linearSolver->freezeSystemMatrix();
380-
381374
saveCompliance(invName);
382375

383376
// Restore gravity

Sofa/Component/LinearSolver/Direct/src/sofa/component/linearsolver/direct/AsyncSparseLDLSolver.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,19 @@ class AsyncSparseLDLSolver : public SparseLDLSolver<TMatrix, TVector, TThreadMan
6262
bool isAsyncSolver() override { return true; }
6363

6464
void init() override;
65+
void reset() override;
6566

66-
void setSystemMBKMatrix(const core::MechanicalParams* mparams) override;
6767
void solveSystem() override;
6868
void solve (Matrix& M, Vector& x, Vector& b) override;
6969
void invert(TMatrix& M) override;
7070
bool addJMInvJtLocal(TMatrix * M, ResMatrixType * result,const JMatrixType * J, SReal fact) override;
7171

72-
bool hasUpdatedMatrix() override;
73-
void updateSystemMatrix() override;
74-
72+
AsyncSparseLDLSolver();
7573
~AsyncSparseLDLSolver() override;
7674

7775
protected:
7876

79-
/// A second instantiation is needed to differentiate the one which is computed asynchronously, and the one which
77+
/// A second instantiation is needed to differentiate the one that is computed asynchronously and the one that
8078
/// is used to solve the system in the main thread
8179
InvertData m_secondInvertData;
8280

@@ -99,7 +97,7 @@ class AsyncSparseLDLSolver : public SparseLDLSolver<TMatrix, TVector, TThreadMan
9997

10098
std::atomic<bool> newInvertDataReady { false };
10199

102-
bool m_hasUpdatedMatrix { false };
100+
Data< bool > d_enableAssembly;
103101
};
104102

105103
#if !defined(SOFA_COMPONENT_LINEARSOLVER_ASYNCSPARSELDLSOLVER_CPP)

Sofa/Component/LinearSolver/Direct/src/sofa/component/linearsolver/direct/AsyncSparseLDLSolver.inl

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -29,44 +29,58 @@ namespace sofa::component::linearsolver::direct
2929
{
3030

3131
template <class TMatrix, class TVector, class TThreadManager>
32-
void AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::init()
32+
AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::AsyncSparseLDLSolver()
33+
: d_enableAssembly(initData(&d_enableAssembly, true, "enableAssembly", "Allow assembly of the linear system"))
3334
{
34-
Inherit1::init();
35-
waitForAsyncTask = true;
36-
m_asyncThreadInvertData = &m_secondInvertData;
37-
m_mainThreadInvertData = static_cast<InvertData*>(this->invertData.get());
3835
}
3936

4037
template <class TMatrix, class TVector, class TThreadManager>
41-
void AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::setSystemMBKMatrix(const core::MechanicalParams* mparams)
38+
void AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::init()
4239
{
43-
if (isAsyncFactorizationFinished() || !m_asyncResult.valid())
40+
Inherit1::init();
41+
42+
if (!this->isComponentStateInvalid())
4443
{
45-
SCOPED_TIMER_VARNAME(setSystemMBKMatrixTimer, "setSystemMBKMatrix");
46-
Inherit1::setSystemMBKMatrix(mparams);
47-
m_hasUpdatedMatrix = true;
44+
if (this->l_linearSystem)
45+
{
46+
this->l_linearSystem->d_enableAssembly.setParent(&d_enableAssembly);
47+
}
48+
49+
waitForAsyncTask = true;
50+
m_asyncThreadInvertData = &m_secondInvertData;
51+
m_mainThreadInvertData = static_cast<InvertData*>(this->invertData.get());
4852
}
4953
}
5054

55+
template <class TMatrix, class TVector, class TThreadManager>
56+
void AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::reset()
57+
{
58+
d_enableAssembly.setValue(true);
59+
waitForAsyncTask = true;
60+
}
61+
5162
template <class TMatrix, class TVector, class TThreadManager>
5263
void AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::solveSystem()
5364
{
54-
SCOPED_TIMER_VARNAME(invertDataCopyTimer, "AsyncSolve");
65+
SCOPED_TIMER_VARNAME(invertDataCopyTimer, "solveSystem");
5566

5667
if (newInvertDataReady)
5768
{
5869
swapInvertData();
5970
}
6071

61-
if (this->linearSystem.needInvert)
72+
if (this->d_factorizationInvalidation.getValue())
6273
{
6374
if (this->invertData == nullptr)
6475
{
65-
this->getMatrixInvertData(this->getSystemMatrix());
76+
this->getMatrixInvertData(this->l_linearSystem->getSystemMatrix());
6677
m_mainThreadInvertData = static_cast<InvertData*>(this->invertData.get());
6778
}
6879
launchAsyncFactorization();
69-
this->linearSystem.needInvert = false;
80+
this->d_factorizationInvalidation.setValue(false);
81+
82+
//matrix assembly is temporarily stopped until the next factorization
83+
d_enableAssembly.setValue(false);
7084
}
7185

7286
if (waitForAsyncTask)
@@ -81,15 +95,11 @@ void AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::solveSystem()
8195
swapInvertData();
8296
}
8397

84-
this->solve(*this->getSystemMatrix(), *this->getSystemLHVector(), *this->getSystemRHVector());
98+
auto* A = this->l_linearSystem->getSystemMatrix();
99+
auto* b = this->l_linearSystem->getRHSVector();
100+
auto* x = this->l_linearSystem->getSolutionVector();
85101

86-
if (!this->linearSystem.solutionVecId.isNull())
87-
{
88-
if (this->l_linearSystem)
89-
{
90-
this->l_linearSystem->dispatchSystemSolution(this->linearSystem.solutionVecId);
91-
}
92-
}
102+
this->solve(*A, *x, *b);
93103
}
94104

95105
template <class TMatrix, class TVector, class TThreadManager>
@@ -107,8 +117,8 @@ void AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::invert(TMatrix& M)
107117
}
108118

109119
template <class TMatrix, class TVector, class TThreadManager>
110-
bool AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::addJMInvJtLocal(TMatrix* M, ResMatrixType* result,
111-
const JMatrixType* J, SReal fact)
120+
bool AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::addJMInvJtLocal(
121+
TMatrix* M, ResMatrixType* result, const JMatrixType* J, SReal fact)
112122
{
113123
SOFA_UNUSED(M);
114124

@@ -119,18 +129,6 @@ bool AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::addJMInvJtLocal(TMa
119129
return Inherit1::doAddJMInvJtLocal(result, J, fact, m_mainThreadInvertData);
120130
}
121131

122-
template <class TMatrix, class TVector, class TThreadManager>
123-
bool AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::hasUpdatedMatrix()
124-
{
125-
return m_hasUpdatedMatrix;
126-
}
127-
128-
template <class TMatrix, class TVector, class TThreadManager>
129-
void AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::updateSystemMatrix()
130-
{
131-
m_hasUpdatedMatrix = false;
132-
}
133-
134132
template <class TMatrix, class TVector, class TThreadManager>
135133
AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::~AsyncSparseLDLSolver()
136134
{
@@ -154,9 +152,14 @@ void AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::launchAsyncFactoriz
154152
template <class TMatrix, class TVector, class TThreadManager>
155153
void AsyncSparseLDLSolver<TMatrix, TVector, TThreadManager>::asyncFactorization()
156154
{
155+
SCOPED_TIMER_TR("asyncFactorization");
156+
157157
newInvertDataReady = false;
158-
this->invert(*this->getSystemMatrix());
158+
this->invert(*this->l_linearSystem->getSystemMatrix());
159159
newInvertDataReady = true;
160+
161+
//factorization is finished: matrix assembly is authorized once again
162+
d_enableAssembly.setValue(true);
160163
}
161164

162165
template <class TMatrix, class TVector, class TThreadManager>

Sofa/Component/LinearSolver/Direct/src/sofa/component/linearsolver/direct/BTDLinearSolver.inl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ void BTDLinearSolver<Matrix,Vector>::init_partial_solve()
394394
{
395395

396396
constexpr Index bsize = Matrix::getSubMatrixDim();
397-
const Index nb = this->getSystemRHVector()->size() / bsize;
397+
const Index nb = this->l_linearSystem->getRHSVector()->size() / bsize;
398398

399399
//TODO => optimisation ??
400400
bwdContributionOnLH.clear();
@@ -419,7 +419,7 @@ void BTDLinearSolver<Matrix,Vector>::init_partial_solve()
419419
{
420420
Vec_dRH[i]=0;
421421
Vec_dRH[i].resize(bsize);
422-
_rh_buf.asub(i,bsize) = this->getSystemRHVector()->asub(i,bsize) ;
422+
_rh_buf.asub(i,bsize) = this->l_linearSystem->getRHSVector()->asub(i,bsize) ;
423423

424424
}
425425

@@ -456,7 +456,7 @@ void BTDLinearSolver<Matrix,Vector>::bwdAccumulateRHinBloc(Index indMaxBloc)
456456
{
457457

458458
// evaluate the Right Hand Term for the block b
459-
RHbloc = this->getSystemRHVector()->asub(b,bsize) ;
459+
RHbloc = this->l_linearSystem->getRHSVector()->asub(b,bsize) ;
460460

461461
// compute the contribution on LH created by RH
462462
_acc_lh_bloc += Minv.asub(b,b,bsize,bsize) * RHbloc;
@@ -474,7 +474,7 @@ void BTDLinearSolver<Matrix,Vector>::bwdAccumulateRHinBloc(Index indMaxBloc)
474474

475475
b = current_bloc;
476476
// compute the block which indice is current_bloc
477-
this->getSystemLHVector()->asub(b,bsize) = Minv.asub( b, b ,bsize,bsize) * ( fwdContributionOnRH.asub(b, bsize) + this->getSystemRHVector()->asub(b,bsize) ) +
477+
this->l_linearSystem->getSolutionVector()->asub(b,bsize) = Minv.asub( b, b ,bsize,bsize) * ( fwdContributionOnRH.asub(b, bsize) + this->l_linearSystem->getRHSVector()->asub(b,bsize) ) +
478478
bwdContributionOnLH.asub(b, bsize);
479479

480480
dmsg_info_when(showProblem) << "LH[" << b << "] = Minv[" << b << "][" << b << "] * (fwdRH(" << b << ") + RH(" << b << ")) + bwdLH(" << b << ")";
@@ -500,7 +500,7 @@ void BTDLinearSolver<Matrix,Vector>::bwdAccumulateLHGlobal( )
500500
dmsg_info_when(showProblem) << "bwdLH[" << current_bloc - 1 << "] = H[" << current_bloc - 1 << "][" << current_bloc << "] *( bwdLH[" << current_bloc << "] + Minv[" << current_bloc << "][" << current_bloc << "] * RH[" << current_bloc << "])";
501501

502502
// BwdLH += Minv*RH
503-
_acc_lh_bloc += Minv.asub(current_bloc,current_bloc,bsize,bsize) * this->getSystemRHVector()->asub(current_bloc,bsize) ;
503+
_acc_lh_bloc += Minv.asub(current_bloc,current_bloc,bsize,bsize) * this->l_linearSystem->getRHSVector()->asub(current_bloc,bsize) ;
504504

505505
current_bloc--;
506506
// BwdLH(n-1) = H(n-1)(n)*BwdLH(n)
@@ -540,7 +540,7 @@ void BTDLinearSolver<Matrix,Vector>::fwdAccumulateRHGlobal(Index indMinBloc)
540540
{
541541

542542
// fwdRH(n) += RH(n)
543-
_acc_rh_bloc += this->getSystemRHVector()->asub(current_bloc,bsize);
543+
_acc_rh_bloc += this->l_linearSystem->getRHSVector()->asub(current_bloc,bsize);
544544

545545
// fwdRH(n+1) = H(n+1)(n) * fwdRH(n)
546546
_acc_rh_bloc = -(lambda[current_bloc].t() * _acc_rh_bloc);
@@ -556,7 +556,7 @@ void BTDLinearSolver<Matrix,Vector>::fwdAccumulateRHGlobal(Index indMinBloc)
556556

557557
Index b = current_bloc;
558558
// compute the block which indice is _indMaxFwdLHComputed
559-
this->getSystemLHVector()->asub(b,bsize) = Minv.asub( b, b ,bsize,bsize) * ( fwdContributionOnRH.asub(b, bsize) + this->getSystemRHVector()->asub(b,bsize) ) +
559+
this->l_linearSystem->getSolutionVector()->asub(b,bsize) = Minv.asub( b, b ,bsize,bsize) * ( fwdContributionOnRH.asub(b, bsize) + this->l_linearSystem->getRHSVector()->asub(b,bsize) ) +
560560
bwdContributionOnLH.asub(b, bsize);
561561

562562
dmsg_info_when(showProblem) << "LH[" << b << "] = Minv[" << b << "][" << b << "] * (fwdRH(" << b << ") + RH(" << b << ")) + bwdLH(" << b << ")";
@@ -584,13 +584,13 @@ void BTDLinearSolver<Matrix,Vector>::fwdComputeLHinBloc(Index indMaxBloc)
584584
{
585585
dmsg_info_when(showProblem) << " fwdRH[" << b + 1 << "] = H[" << b + 1 << "][" << b << "] * (fwdRH(" << b << ") + RH(" << b << "))";
586586
// fwdRH(n+1) = H(n+1)(n) * (fwdRH(n) + RH(n))
587-
fwdContributionOnRH.asub(b+1, bsize) = (-lambda[b].t())* ( fwdContributionOnRH.asub(b, bsize) + this->getSystemRHVector()->asub(b,bsize) ) ;
587+
fwdContributionOnRH.asub(b+1, bsize) = (-lambda[b].t())* ( fwdContributionOnRH.asub(b, bsize) + this->l_linearSystem->getRHSVector()->asub(b,bsize) ) ;
588588
}
589589

590590
_indMaxFwdLHComputed++; b++;
591591

592592
// compute the block which indice is _indMaxFwdLHComputed
593-
this->getSystemLHVector()->asub(b,bsize) = Minv.asub( b, b ,bsize,bsize) * ( fwdContributionOnRH.asub(b, bsize) + this->getSystemRHVector()->asub(b,bsize) ) +
593+
this->l_linearSystem->getSolutionVector()->asub(b,bsize) = Minv.asub( b, b ,bsize,bsize) * ( fwdContributionOnRH.asub(b, bsize) + this->l_linearSystem->getRHSVector()->asub(b,bsize) ) +
594594
bwdContributionOnLH.asub(b, bsize);
595595

596596
dmsg_info_when(showProblem) << "LH["<<b<<"] = Minv["<<b<<"]["<<b<<"] * (fwdRH("<<b<< ") + RH("<<b<<")) + bwdLH("<<b<<")";
@@ -668,12 +668,12 @@ void BTDLinearSolver<Matrix,Vector>::partial_solve(ListIndex& Iout, ListIndex&
668668
{
669669
constexpr Index bsize = Matrix::getSubMatrixDim();
670670
Vector *Result_partial_Solve = new Vector();
671-
(*Result_partial_Solve) = (*this->getSystemLHVector());
671+
(*Result_partial_Solve) = (*this->l_linearSystem->getSolutionVector());
672672

673-
solve(*this->getSystemMatrix(),*this->getSystemLHVector(), *this->getSystemRHVector());
673+
solve(*this->l_linearSystem->getSystemMatrix(),*this->l_linearSystem->getSolutionVector(), *this->l_linearSystem->getRHSVector());
674674

675675
Vector *Result = new Vector();
676-
(*Result) = (*this->getSystemLHVector());
676+
(*Result) = (*this->l_linearSystem->getSolutionVector());
677677

678678
Vector *DR = new Vector();
679679
(*DR) = (*Result);

Sofa/Component/LinearSolver/Direct/src/sofa/component/linearsolver/direct/PrecomputedLinearSolver.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,11 @@ class PrecomputedLinearSolver : public sofa::component::linearsolver::MatrixLine
8282

8383
Data<bool> d_jmjt_twostep; ///< Use two step algorithm to compute JMinvJt
8484
Data<bool> d_use_file; ///< Dump system matrix in a file
85-
Data<double> init_Tolerance;
85+
Data<Real> init_Tolerance;
8686

8787
PrecomputedLinearSolver();
88-
void solve (TMatrix& M, TVector& x, TVector& b) override;
88+
void solve (TMatrix& M, TVector& solution, TVector& rh) override;
8989
void invert(TMatrix& M) override;
90-
void setSystemMBKMatrix(const core::MechanicalParams* mparams) override;
9190
void loadMatrix(TMatrix& M);
9291
void loadMatrixWithCholeskyDecomposition(TMatrix& M);
9392
bool addJMInvJt(linearalgebra::BaseMatrix* result, linearalgebra::BaseMatrix* J, SReal fact) override;
@@ -120,8 +119,8 @@ protected :
120119
private :
121120
bool first;
122121
unsigned systemSize;
123-
double dt;
124-
double factInt;
122+
Real dt;
123+
Real factInt;
125124
std::vector<bool> isActiveDofs;
126125
};
127126

0 commit comments

Comments
 (0)