16#include <Solv_Cholesky.h>
17#include <Matrice_Bloc_Sym.h>
43 Cerr <<
"Cholesky solver not parallelized in TRUST!!!" << finl;
44 Cerr <<
"Change your solver." << finl;
45 Cerr <<
"Try using Petsc Cholesky solver." << finl;
50 param.lire_avec_accolades_depuis(is);
73 const DoubleVect& secmem,
76 Cerr <<
"Warning, Sparskit based Cholesky solver will be deprecated soon. Consider using PETSc Cholesky solver. Contact trust@cea.fr if you can't for some specific reason." << finl;
80 return Cholesky(matrice,secmem,solution);
96 Cerr<<
"Solv_Cholesky : WARNING : Cholesky by blocks cannot be done"<<finl;
101 return Cholesky(MB00,secmem,solution);
105 Cerr<<
"Solv_Cholesky : Warning : one is not able to carry out preconditionning for linear systems based on Matrice_Morse_Sym or Matrice_Bloc type matrixes"<<finl;
113 const DoubleVect& secmem,
114 DoubleVect& solution)
116 auto nzmax = matrice.
get_tab1().size_array();
117 if (nzmax>std::numeric_limits<int>::max())
125 Cerr <<
"Order of the matrix : " << matrice.
ordre() << finl;
130 Cerr <<
"Matrix not defined : " << finl;
131 Cerr <<
"zero value is imposed at point 0" << finl;
140 DoubleVect vecteur(secmem);
160 Cerr <<
"Solv_Cholesky::resoudre_systeme error : ";
161 if(INFO<0) Cerr <<
"F77NAME(DPBTRS) param. " << -INFO <<
" invalid" << finl;
162 if(INFO>0) Cerr <<
"singular matrix ! resolution not possible" << finl;
190 for (
int j=0; j<size_reelle; j++)
200 const double tmpa = mat1(i,j);
220 Cerr <<
"Starting factorisation ..." << finl;
221 F77NAME(DPBTRF)(&UPLO, &N, &KD,
223 Cerr <<
"End factorization." << finl;
237 Cerr <<
"Solv_Cholesky::Fact_Cholesky() error : ";
238 if(INFO<0) Cerr <<
"F77NAME(DPBTRF) param. " << -INFO
239 <<
" invalid" << finl;
240 if(INFO>0) Cerr <<
"submatrix of order " << INFO
241 <<
" not positive definite!" << finl;
244 for (
int i=0; i<INFO; i++)
245 Cerr <<
"A(" <<i<<
","<<i<<
")="<<mat1(i,i)<<finl;
246 Cerr <<
"non-positive definite matrix ="<<finl;
Class defining operators and methods for all reading operation in an input flow (file,...
Matrice_Base class - Base class of the matrix hierarchy.
int nb_bloc_lignes() const
virtual const Matrice & get_bloc(int i, int j) const
Matrice_Morse_Sym class - Represents a sparse symmetric matrix M stored in Morse format.
Matrice & matrice_renumerotee()
void renumerote() const
Renumbers a matrix to reduce its bandwidth.
ArrOfInt & permutation_inverse()
Sortie & imprimer_formatte(Sortie &s) const override
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
int largeur_de_bande() const
Computes the bandwidth of a Morse matrix.
int ordre() const override
Returns the order of the matrix: - the number of rows if the matrix is square.
const auto & get_tab1() const
int get_est_definie() const
A character string (Nom) in uppercase.
const Nom & que_suis_je() const
Returns the string identifying the class.
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Helper class to factorize the readOn method of Objet_U classes.
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
static bool is_parallel()
static int nproc()
Returns the number of processors in the current group. See Comm_Group::nproc() and PE_Groups::current...
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
void set_param(Param ¶m) const override
int resoudre_systeme(const Matrice_Base &, const DoubleVect &, DoubleVect &) override
Matrice_Morse_Sym matrice_de_travail
int Fact_Cholesky(const Matrice_Morse_Sym &, const int)
int Cholesky(const Matrice_Morse_Sym &, const DoubleVect &, DoubleVect &)
ArrOfDouble matrice_bande_factorisee_fortran_
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
bool nouvelle_matrice() const
void fixer_nouvelle_matrice(bool i)
Base class for output streams.
_SIZE_ size_totale() const
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")