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())
126 Cerr <<
"Order of the matrix : " << matrice.
ordre() << finl;
131 Cerr <<
"Matrix not defined : " << finl;
132 Cerr <<
"zero value is imposed at point 0" << finl;
141 DoubleVect vecteur(secmem);
161 Cerr <<
"Solv_Cholesky::resoudre_systeme error : ";
162 if(INFO<0) Cerr <<
"F77NAME(DPBTRS) param. " << -INFO <<
" invalid" << finl;
163 if(INFO>0) Cerr <<
"singular matrix ! resolution impossible" << finl;
191 for (
int j=0; j<size_reelle; j++)
201 const double tmpa = mat1(i,j);
221 Cerr <<
"Starting factorisation ..." << finl;
222 F77NAME(DPBTRF)(&UPLO, &N, &KD,
224 Cerr <<
"End factorization." << finl;
238 Cerr <<
"Solv_Cholesky::Fact_Cholesky() error : ";
239 if(INFO<0) Cerr <<
"F77NAME(DPBTRF) param. " << -INFO
240 <<
" invalid" << finl;
241 if(INFO>0) Cerr <<
"submatrix of order " << INFO
242 <<
" not positive definite!" << finl;
245 for (
int i=0; i<INFO; i++)
246 Cerr <<
"A(" <<i<<
","<<i<<
")="<<mat1(i,i)<<finl;
247 Cerr <<
"non-positive definite matrix ="<<finl;
Class defining operators and methods for all reading operation in an input flow (file,...
Classe Matrice_Base Classe de base de la hierarchie des matrices.
int nb_bloc_lignes() const
virtual const Matrice & get_bloc(int i, int j) const
Classe Matrice_Morse_Sym Represente une matrice M (creuse) symetrique stockee au format Morse.
Matrice & matrice_renumerotee()
void renumerote() const
Renumerotation d'une matrice afin de reduire la largeur de bande.
ArrOfInt & permutation_inverse()
Sortie & imprimer_formatte(Sortie &s) const override
Classe Matrice_Morse Represente une matrice M (creuse), non necessairement carree.
int largeur_de_bande() const
Calcule la largeur de bande d'une matrice morse.
int ordre() const override
Renvoie l'ordre de la matrice: - le nombre de lignes si la matrice est carree.
const auto & get_tab1() const
int get_est_definie() const
Une chaine de caractere (Nom) en majuscules.
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
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()
renvoie le nombre de processeurs dans le groupe courant Voir Comm_Group::nproc() et PE_Groups::curren...
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
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
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
bool nouvelle_matrice() const
void fixer_nouvelle_matrice(bool i)
Classe de base des flux de sortie.
_SIZE_ size_totale() const
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")