Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class CholeskySolver : public sofa::component::linearsolver::MatrixLinearSolver<
typedef typename Vector::Real Real;
typedef sofa::component::linearsolver::MatrixLinearSolver<TMatrix,TVector> Inherit;

SOFA_ATTRIBUTE_DEPRECATED__MATRIXDUMP()
Data<bool> f_verbose; ///< Dump system state at each iteration

CholeskySolver();
Expand All @@ -56,6 +57,8 @@ class CholeskySolver : public sofa::component::linearsolver::MatrixLinearSolver<
/// Factors the matrix. Must be done before solving
void invert(Matrix& M) override;

void parse(core::objectmodel::BaseObjectDescription *arg) override;

private :
linearalgebra::FullMatrix<typename Vector::Real> L;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ namespace sofa::component::linearsolver::direct

template<class TMatrix, class TVector>
CholeskySolver<TMatrix,TVector>::CholeskySolver()
: f_verbose( initData(&f_verbose,false,"verbose","Dump system state at each iteration") )
{
}

Expand Down Expand Up @@ -109,4 +108,15 @@ void CholeskySolver<TMatrix,TVector>::invert(Matrix& M)
}
}

template <class TMatrix, class TVector>
void CholeskySolver<TMatrix, TVector>::parse(core::objectmodel::BaseObjectDescription* arg)
{
if (arg->getAttribute("verbose"))
{
msg_warning() << "Attribute 'verbose' has no use in this component. "
"To disable this warning, remove the attribute from the scene.";
}

Inherit::parse(arg);
}
} //namespace sofa::component::linearsolver::direct
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ class PrecomputedLinearSolver : public sofa::component::linearsolver::MatrixLine
typedef typename PrecomputedLinearSolverInternalData<TMatrix,TVector>::TBaseMatrix TBaseMatrix;

Data<bool> jmjt_twostep; ///< Use two step algorithm to compute JMinvJt
Data<bool> f_verbose; ///< Dump system state at each iteration
Data<bool> use_file; ///< Dump system matrix in a file
Data<double> init_Tolerance;

SOFA_ATTRIBUTE_DEPRECATED__MATRIXDUMP()
Data<bool> f_verbose; ///< Dump system state at each iteration

PrecomputedLinearSolver();
void solve (TMatrix& M, TVector& x, TVector& b) override;
void invert(TMatrix& M) override;
Expand All @@ -108,6 +110,8 @@ class PrecomputedLinearSolver : public sofa::component::linearsolver::MatrixLine
return &internalData.Minv;
}

void parse(core::objectmodel::BaseObjectDescription *arg) override;

protected :
template<class JMatrix>
void ComputeResult(linearalgebra::BaseMatrix * result,JMatrix& J, SReal fact);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ namespace sofa::component::linearsolver::direct
template<class TMatrix,class TVector>
PrecomputedLinearSolver<TMatrix,TVector>::PrecomputedLinearSolver()
: jmjt_twostep( initData(&jmjt_twostep,true,"jmjt_twostep","Use two step algorithm to compute JMinvJt") )
, f_verbose( initData(&f_verbose,false,"verbose","Dump system state at each iteration") )
, use_file( initData(&use_file,true,"use_file","Dump system matrix in a file") )
{
first = true;
Expand Down Expand Up @@ -220,6 +219,18 @@ bool PrecomputedLinearSolver<TMatrix,TVector>::addJMInvJt(linearalgebra::BaseMat
return true;
}

template <class TMatrix, class TVector>
void PrecomputedLinearSolver<TMatrix, TVector>::parse(core::objectmodel::BaseObjectDescription* arg)
{
if (arg->getAttribute("verbose"))
{
msg_warning() << "Attribute 'verbose' has no use in this component. "
"To disable this warning, remove the attribute from the scene.";
}

Inherit::parse(arg);
}

template<class TMatrix,class TVector> template<class JMatrix>
void PrecomputedLinearSolver<TMatrix,TVector>::ComputeResult(linearalgebra::BaseMatrix * result,JMatrix& J, SReal fact)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ class SparseCholeskySolver : public sofa::component::linearsolver::MatrixLinearS
void solve (Matrix& M, Vector& x, Vector& b) override;
void invert(Matrix& M) override;

void parse(core::objectmodel::BaseObjectDescription *arg) override;

protected:

SOFA_ATTRIBUTE_DEPRECATED__MATRIXDUMP()
Data<bool> f_verbose; ///< Dump system state at each iteration

cs A;
cs* permuted_A;
css *S;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,10 @@ namespace sofa::component::linearsolver::direct

template<class TMatrix, class TVector>
SparseCholeskySolver<TMatrix,TVector>::SparseCholeskySolver()
: f_verbose( initData(&f_verbose,false,"verbose","Dump system state at each iteration") )
, S(nullptr), N(nullptr)
, d_typePermutation(initData(&d_typePermutation, "permutation", "Type of fill reducing permutation"))
{
sofa::helper::OptionsGroup d_typePermutationOptions{"None", "SuiteSparse", "METIS"};
d_typePermutationOptions.setSelectedItem(0); // default None
d_typePermutation.setValue(d_typePermutationOptions);
}
: S(nullptr), N(nullptr)
, d_typePermutation(initData(&d_typePermutation, {"None", "SuiteSparse", "METIS"},
"permutation", "Type of fill reducing permutation"))
{}

template<class TMatrix, class TVector>
SparseCholeskySolver<TMatrix,TVector>::~SparseCholeskySolver()
Expand Down Expand Up @@ -170,6 +166,18 @@ void SparseCholeskySolver<TMatrix,TVector>::invert(Matrix& M)

}

template <class TMatrix, class TVector>
void SparseCholeskySolver<TMatrix, TVector>::parse(core::objectmodel::BaseObjectDescription* arg)
{
if (arg->getAttribute("verbose"))
{
msg_warning() << "Attribute 'verbose' has no use in this component. "
"To disable this warning, remove the attribute from the scene.";
}

Inherit1::parse(arg);
}

template <class TMatrix, class TVector>
void SparseCholeskySolver<TMatrix, TVector>::suiteSparseFactorization(bool applyPermutation)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ class SparseLUSolver : public sofa::component::linearsolver::MatrixLinearSolver<

typedef sofa::component::linearsolver::MatrixLinearSolver<TMatrix,TVector,TThreadManager> Inherit;

SOFA_ATTRIBUTE_DEPRECATED__MATRIXDUMP()
Data<bool> f_verbose; ///< Dump system state at each iteration

Data<double> f_tol; ///< tolerance of factorization

void solve (Matrix& M, Vector& x, Vector& b) override;
Expand All @@ -81,6 +83,8 @@ class SparseLUSolver : public sofa::component::linearsolver::MatrixLinearSolver<

bool supportNonSymmetricSystem() const override { return true; }

void parse(core::objectmodel::BaseObjectDescription *arg) override;

protected :

Data<sofa::helper::OptionsGroup> d_typePermutation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ using std::endl;

template<class TMatrix, class TVector,class TThreadManager>
SparseLUSolver<TMatrix,TVector,TThreadManager>::SparseLUSolver()
: f_verbose( initData(&f_verbose,false,"verbose","Dump system state at each iteration") )
, f_tol( initData(&f_tol,0.001,"tolerance","tolerance of factorization") )
: f_tol( initData(&f_tol,0.001,"tolerance","tolerance of factorization") )
, d_typePermutation(initData(&d_typePermutation , "permutation", "Type of fill reducing permutation"))
, d_L_nnz(initData(&d_L_nnz, 0, "L_nnz", "Number of non-zero values in the lower triangular matrix of the factorization. The lower, the faster the system is solved.", true, true))
{
Expand All @@ -48,6 +47,19 @@ SparseLUSolver<TMatrix,TVector,TThreadManager>::SparseLUSolver()
d_typePermutation.setValue(d_typePermutationOptions);
}

template <class TMatrix, class TVector, class TThreadManager>
void SparseLUSolver<TMatrix, TVector, TThreadManager>::parse(
core::objectmodel::BaseObjectDescription* arg)
{
if (arg->getAttribute("verbose"))
{
msg_warning() << "Attribute 'verbose' has no use in this component. "
"To disable this warning, remove the attribute from the scene.";
}

Inherit::parse(arg);
}


template<class TMatrix, class TVector,class TThreadManager>
void SparseLUSolver<TMatrix,TVector,TThreadManager>::solve (Matrix& M, Vector& x, Vector& b)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ class MinResLinearSolver : public sofa::component::linearsolver::MatrixLinearSol
typedef sofa::component::linearsolver::MatrixLinearSolver<TMatrix,TVector> Inherit;
Data<unsigned> f_maxIter; ///< maximum number of iterations of the Conjugate Gradient solution
Data<double> f_tolerance; ///< desired precision of the Conjugate Gradient Solution (ratio of current residual norm over initial residual norm)

SOFA_ATTRIBUTE_DEPRECATED__MATRIXDUMP()
Data<bool> f_verbose; ///< Dump system state at each iteration

Data<std::map < std::string, sofa::type::vector<SReal> > > f_graph; ///< Graph of residuals at each iteration

protected:
Expand All @@ -57,6 +60,8 @@ class MinResLinearSolver : public sofa::component::linearsolver::MatrixLinearSol

/// Solve Mx=b
void solve (Matrix& M, Vector& x, Vector& b) override;

void parse(core::objectmodel::BaseObjectDescription *arg) override;
};

#if !defined(SOFA_COMPONENT_LINEARSOLVER_MINRESLINEARSOLVER_CPP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ template<class TMatrix, class TVector>
MinResLinearSolver<TMatrix,TVector>::MinResLinearSolver()
: f_maxIter( initData(&f_maxIter,(unsigned)25,"iterations","maximum number of iterations of the Conjugate Gradient solution") )
, f_tolerance( initData(&f_tolerance,1e-5,"tolerance","desired precision of the Conjugate Gradient Solution (ratio of current residual norm over initial residual norm)") )
, f_verbose( initData(&f_verbose,false,"verbose","Dump system state at each iteration") )
, f_graph( initData(&f_graph,"graph","Graph of residuals at each iteration") )
{
f_graph.setWidget("graph");
Expand Down Expand Up @@ -257,5 +256,16 @@ void MinResLinearSolver<TMatrix,TVector>::solve(Matrix& A, Vector& x, Vector& b)
vtmp.deleteTempVector(&v);
}

template <class TMatrix, class TVector>
void MinResLinearSolver<TMatrix, TVector>::parse(core::objectmodel::BaseObjectDescription* arg)
{
if (arg->getAttribute("verbose"))
{
msg_warning() << "Attribute 'verbose' has no use in this component. "
"To disable this warning, remove the attribute from the scene.";
}

Inherit::parse(arg);
}

} //namespace sofa::component::linearsolver::iterative
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ namespace sofa::component::linearsolver::iterative
SOFA_ATTRIBUTE_DEPRECATED( \
"v22.12 (#3155)", "v23.06", "String data of the ShewchukPCGLinearSolver were replaced by an explicit link")
#endif // SOFA_BUILD_SOFA_COMPONENT_LINEARSOLVER_ITERATIVE

#define SOFA_ATTRIBUTE_DEPRECATED__MATRIXDUMP() \
SOFA_ATTRIBUTE_DEPRECATED( \
"v23.12", "v24.06", "This Data is no longer used")
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ class BlockJacobiPreconditioner : public sofa::component::linearsolver::MatrixLi
typedef sofa::component::linearsolver::MatrixLinearSolver<TMatrix,TVector> Inherit;
typedef typename TMatrix::Block SubMatrix;

SOFA_ATTRIBUTE_DEPRECATED__MATRIXDUMP()
Data<bool> f_verbose; ///< Dump system state at each iteration

protected:
BlockJacobiPreconditioner();
public:
Expand All @@ -69,6 +71,7 @@ class BlockJacobiPreconditioner : public sofa::component::linearsolver::MatrixLi
return TVector::Name();
}

void parse(core::objectmodel::BaseObjectDescription *arg) override;
};

#if !defined(SOFA_COMPONENT_LINEARSOLVER_PRECONDITIONER_BLOCKJACOBIPRECONDITIONER_CPP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,17 @@ void BlockJacobiPreconditioner<TMatrix,TVector>::invert(Matrix& M)
msg_info() << M;
}

template <class TMatrix, class TVector>
void BlockJacobiPreconditioner<TMatrix, TVector>::parse(
core::objectmodel::BaseObjectDescription* arg)
{
if (arg->getAttribute("verbose"))
{
msg_warning() << "Attribute 'verbose' has no use in this component. "
"To disable this warning, remove the attribute from the scene.";
}

Inherit::parse(arg);
}

} // namespace sofa::component::linearsolver::preconditioner
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ class JacobiPreconditioner : public sofa::component::linearsolver::MatrixLinearS
typedef TMatrix Matrix;
typedef TVector Vector;
typedef sofa::component::linearsolver::MatrixLinearSolver<TMatrix,TVector> Inherit;

SOFA_ATTRIBUTE_DEPRECATED__MATRIXDUMP()
Data<bool> f_verbose; ///< Dump system state at each iteration

protected:
JacobiPreconditioner();
public:
Expand All @@ -58,6 +61,8 @@ class JacobiPreconditioner : public sofa::component::linearsolver::MatrixLinearS
return TMatrix::Name();
}

void parse(core::objectmodel::BaseObjectDescription *arg) override;

};

#if !defined(SOFA_COMPONENT_LINEARSOLVER_PRECONDITIONER_JACOBIPRECONDITIONER_CPP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace sofa::component::linearsolver::preconditioner

template<class TMatrix, class TVector>
JacobiPreconditioner<TMatrix,TVector>::JacobiPreconditioner()
: f_verbose( initData(&f_verbose,false,"verbose","Dump system state at each iteration") )
{
}

Expand All @@ -61,4 +60,16 @@ void JacobiPreconditioner<TMatrix,TVector>::invert(Matrix& M)
M.invert();
}

template <class TMatrix, class TVector>
void JacobiPreconditioner<TMatrix, TVector>::parse(core::objectmodel::BaseObjectDescription* arg)
{
if (arg->getAttribute("verbose"))
{
msg_warning() << "Attribute 'verbose' has no use in this component. "
"To disable this warning, remove the attribute from the scene.";
}

Inherit::parse(arg);
}

} // namespace sofa::component::linearsolver::preconditioner
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ class PrecomputedWarpPreconditioner : public sofa::component::linearsolver::Matr
typedef sofa::type::MatNoInit<3, 3, Real> Transformation;

Data<bool> jmjt_twostep; ///< Use two step algorithm to compute JMinvJt

SOFA_ATTRIBUTE_DEPRECATED__MATRIXDUMP()
Data<bool> f_verbose; ///< Dump system state at each iteration

Data<bool> use_file; ///< Dump system matrix in a file
Data<bool> share_matrix; ///< Share the compliance matrix in memory if they are related to the same file (WARNING: might require to reload Sofa when opening a new scene...)
SingleLink<PrecomputedWarpPreconditioner, sofa::core::behavior::LinearSolver, BaseLink::FLAG_STOREPATH | BaseLink::FLAG_STRONGLINK> l_linearSolver; ///< Link towards the linear solver used to precompute the first matrix
Expand All @@ -123,6 +126,11 @@ class PrecomputedWarpPreconditioner : public sofa::component::linearsolver::Matr
{
msg_warning() << "String data \"solverName\" is now replaced by explicit data link: \"linearSolver\" (PR #3155)";
}
if (arg->getAttribute("verbose"))
{
msg_warning() << "Attribute 'verbose' has no use in this component. "
"To disable this warning, remove the attribute from the scene.";
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ namespace sofa::component::linearsolver::preconditioner
template<class TDataTypes>
PrecomputedWarpPreconditioner<TDataTypes>::PrecomputedWarpPreconditioner()
: jmjt_twostep( initData(&jmjt_twostep,true,"jmjt_twostep","Use two step algorithm to compute JMinvJt") )
, f_verbose( initData(&f_verbose,false,"verbose","Dump system state at each iteration") )
, use_file( initData(&use_file,true,"use_file","Dump system matrix in a file") )
, share_matrix( initData(&share_matrix,true,"share_matrix","Share the compliance matrix in memory if they are related to the same file (WARNING: might require to reload Sofa when opening a new scene...)") )
, l_linearSolver(initLink("linearSolver", "Link towards the linear solver used to precompute the first matrix"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ class SSORPreconditioner : public sofa::component::linearsolver::MatrixLinearSol
typedef SReal Real;
typedef sofa::component::linearsolver::MatrixLinearSolver<TMatrix,TVector,TThreadManager> Inherit;

SOFA_ATTRIBUTE_DEPRECATED__MATRIXDUMP()
Data<bool> f_verbose; ///< Dump system state at each iteration

Data<double> f_omega; ///< Omega coefficient
protected:
SSORPreconditioner();
Expand All @@ -64,6 +66,8 @@ class SSORPreconditioner : public sofa::component::linearsolver::MatrixLinearSol
return new SSORPreconditionerInvertData();
}

void parse(core::objectmodel::BaseObjectDescription *arg) override;

protected :

class SSORPreconditionerInvertData : public MatrixInvertData
Expand Down
Loading