ParGeMSLR
gemslr.hpp
Go to the documentation of this file.
1 #ifndef PARGEMSLR_GEMSLR_H
2 #define PARGEMSLR_GEMSLR_H
3 
8 #include <iostream>
9 
10 #include "../utils/utils.hpp"
11 #include "../utils/structs.hpp"
12 #include "../vectors/int_vector.hpp"
13 #include "../vectors/sequential_vector.hpp"
14 #include "../matrices/csr_matrix.hpp"
15 #include "../solvers/solver.hpp"
16 #include "../solvers/fgmres.hpp"
17 #include "ilu.hpp"
18 
19 #ifdef PARGEMSLR_CUDA
20 #include "cusparse.h"
21 #endif
22 
23 namespace pargemslr
24 {
25 
31  {
32  kGemslrLowrankNoRestart,
33  kGemslrLowrankThickRestart,
34  kGemslrLowrankSubspaceIteration
35  };
36 
42  {
43  kGemslrPartitionND,
44  kGemslrPartitionRKway
45  };
46 
52  {
53  kGemslrReorderingNoExtra,
54  kGemslrReorderingIO,
55  kGemslrReorderingDDPQ
56  };
57 
63  {
64  kGemslrBSolveILUT,
65  kGemslrBSolveILUK,
66  kGemslrBSolveGemslr
67  };
68 
74  {
75  kGemslrBSmoothBMILU,
76  kGemslrBSmoothBILU,
77  kGemslrBSmoothAMILU,
78  kGemslrBSmoothAILU
79  };
80 
86  {
87  kGemslrSmoothingBilu,
88  kGemslrSmoothingAbj,
89  kGemslrSmoothingL1Jacobi
90  };
91 
97  {
98  kGemslrCSolveILUT,
99  kGemslrCSolveILUK,
100  kGemslrCSolveBJILUT,
101  kGemslrCSolveBJILUK,
102  kGemslrCSolveBJILUT2,
103  kGemslrCSolveBJILUK2,
104  kGemslrCSolveDirect
105  };
106 
112  {
113  kGemslrPhaseSolve,
114  kGemslrPhaseSetup
115  };
116 
123  {
124  kGemslrLUSolve,
125  kGemslrUSolve,
126  kGemslrMulSolve,
127  kGemslrMmulSolve
128  };
129 
135  {
136  kGemslrGlobalPrecondBJ,
137  kGemslrGlobalPrecondESMSLR,
138  kGemslrGlobalPrecondGeMSLR,
139  kGemslrGlobalPrecondPSLR,
140  kGemslrGlobalPrecondPCLR,
141  kGemslrGlobalPrecondA // This is a special option, (I-X)^{-1}M^{-1}A = I => X = I - M^{-1}A
142  };
143 
148  template <class MatrixType, class VectorType, typename DataType>
150  {
151  private:
152 
153  /* variables */
154 
159  int _level;
160 
166 
167  public:
168 
173  VectorType _temp_v;
174 
180 
185  virtual ~GemslrEBFCMatrixClass();
186 
192 
198 
204 
210 
219 
226  int SetupVectorPtrStr(VectorType &v);
227 
233  int Clear();
234 
240  int GetNumRowsLocal();
241 
247  int GetNumColsLocal();
248 
259  int MatVec( char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y);
260 
269  int GetMpiInfo(int &np, int &myid, MPI_Comm &comm) const
270  {
271  comm = *parallel_log::_lcomm;
272  np = 1;
273  myid = 0;
274  return PARGEMSLR_SUCCESS;
275  }
276 
282  MPI_Comm GetComm() const
283  {
284  return *parallel_log::_lcomm;
285  }
286 
292  int GetDataLocation() const
293  {
294  if(this->_gemslr)
295  {
296  return this->_gemslr->GetMatrix()->GetDataLocation();
297  }
298  return kMemoryHost;
299  }
300 
301  };
302 
303  typedef GemslrEBFCMatrixClass<CsrMatrixClass<float>, SequentialVectorClass<float>, float> precond_gemslrebfc_csr_seq_float;
304  typedef GemslrEBFCMatrixClass<CsrMatrixClass<double>, SequentialVectorClass<double>, double> precond_gemslrebfc_csr_seq_double;
305  typedef GemslrEBFCMatrixClass<CsrMatrixClass<complexs>, SequentialVectorClass<complexs>, complexs> precond_gemslrebfc_csr_seq_complexs;
306  typedef GemslrEBFCMatrixClass<CsrMatrixClass<complexd>, SequentialVectorClass<complexd>, complexd> precond_gemslrebfc_csr_seq_complexd;
307 
312  template <class MatrixType, class VectorType, typename DataType>
314  {
315  private:
316 
317  /* variables */
318 
323  int _level;
324 
330 
331  public:
332 
337  VectorType _temp_v;
338 
344 
349  virtual ~GemslrSchurMatrixClass();
350 
356 
362 
368 
374 
383 
390  int SetupVectorPtrStr(VectorType &v);
391 
397  int Clear();
398 
409  int MatVec( char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y);
410 
418  int Solve( VectorType &x, VectorType &rhs);
419 
428  int GetMpiInfo(int &np, int &myid, MPI_Comm &comm) const
429  {
430  comm = *parallel_log::_lcomm;
431  np = 1;
432  myid = 0;
433  return PARGEMSLR_SUCCESS;
434  }
435 
441  MPI_Comm GetComm() const
442  {
443  return *parallel_log::_lcomm;
444  }
445 
446  };
447 
448  typedef GemslrSchurMatrixClass<CsrMatrixClass<float>, SequentialVectorClass<float>, float> precond_gemslr_schur_seq_float;
449  typedef GemslrSchurMatrixClass<CsrMatrixClass<double>, SequentialVectorClass<double>, double> precond_gemslr_schur_seq_double;
450  typedef GemslrSchurMatrixClass<CsrMatrixClass<complexs>, SequentialVectorClass<complexs>, complexs> precond_gemslr_schur_seq_complexs;
451  typedef GemslrSchurMatrixClass<CsrMatrixClass<complexd>, SequentialVectorClass<complexd>, complexd> precond_gemslr_schur_seq_complexd;
452 
457  template <class MatrixType, class VectorType, typename DataType>
458  class GemslrSchurSolveClass: public SolverClass<MatrixType, VectorType, DataType>
459  {
460  public:
461 
466  GemslrSchurSolveClass() : SolverClass<MatrixType, VectorType, DataType>(){}
467 
472  GemslrSchurSolveClass(const GemslrSchurSolveClass<MatrixType, VectorType, DataType> &precond) : SolverClass<MatrixType, VectorType, DataType>(precond)
473  {
474  this->Clear();
475  }
476 
481  GemslrSchurSolveClass(GemslrSchurSolveClass<MatrixType, VectorType, DataType> &&precond) : SolverClass<MatrixType, VectorType, DataType>(std::move(precond))
482  {
483  this->Clear();
484  }
485 
491  {
492  this->Clear();
494  return *this;
495  }
496 
502  {
503  this->Clear();
505  return *this;
506  }
507 
513  virtual int Clear(){SolverClass<MatrixType, VectorType, DataType>::Clear();return PARGEMSLR_SUCCESS;}
514 
519  virtual ~GemslrSchurSolveClass(){this->Clear();}
520 
528  virtual int Setup( VectorType &x, VectorType &rhs)
529  {
530  if(this->_ready)
531  {
532  return PARGEMSLR_SUCCESS;
533  }
534 
535  if(!this->_matrix)
536  {
537  PARGEMSLR_ERROR("Setup without matrix.");
538  return PARGEMSLR_ERROR_INVALED_PARAM;
539  }
540 
541  this->_ready = true;
542 
543  return PARGEMSLR_SUCCESS;
544 
545  }
546 
554  virtual int Solve( VectorType &x, VectorType &rhs)
555  {
556 
557  if(!(this->_ready))
558  {
559  PARGEMSLR_ERROR("Solve without setup.");
560  return PARGEMSLR_ERROR_FUNCTION_CALL_ERR;
561  }
562 
563  this->_matrix->Solve(x, rhs);
564 
565  return PARGEMSLR_SUCCESS;
566 
567  }
568 
574  virtual long int GetNumNonzeros(){return 0;};
575 
582  virtual int SetSolveLocation( const int &location){return PARGEMSLR_SUCCESS;};
583 
590  virtual int MoveData( const int &location){return PARGEMSLR_SUCCESS;};
591 
592  /* ------- SETS and GETS ------- */
593 
600  virtual int SetWithParameterArray(double *params)
601  {
602  this->_print_option = params[PARGEMSLR_IO_GENERAL_PRINT_LEVEL];
603  return PARGEMSLR_SUCCESS;
604  }
605 
606  };
607 
608  typedef GemslrSchurMatrixClass<precond_gemslr_schur_seq_float, SequentialVectorClass<float>, float> precond_gemslr_schursolve_seq_float;
609  typedef GemslrSchurMatrixClass<precond_gemslr_schur_seq_double, SequentialVectorClass<double>, double> precond_gemslr_schursolve_seq_double;
610  typedef GemslrSchurMatrixClass<precond_gemslr_schur_seq_complexs, SequentialVectorClass<complexs>, complexs> precond_gemslr_schursolve_seq_complexs;
611  typedef GemslrSchurMatrixClass<precond_gemslr_schur_seq_complexd, SequentialVectorClass<complexd>, complexd> precond_gemslr_schursolve_seq_complexd;
612 
617  template <typename DataType>
619  {
620  public:
621  /* Options */
622 
623  /* option for this solver */
624 
630 
636 
642 
648 
653  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
654  double,
656 
661  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
662  double,
664 
669  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
670  double,
672 
678 
684 
690 
695  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
696  double,
698 
703  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
704  double,
706 
711  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
712  double,
714 
720 
726 
732 
737  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
738  double,
739  float>::type _lr_tr_factor_setup;
740 
746  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
747  double,
748  float>::type _lr_tol_eig1_setup;
749 
755  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
756  double,
757  float>::type _lr_tol_eig2_setup;
758 
764  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
765  double,
766  float>::type _lr_tol_eigA_setup;
767 
773 
779 
785 
791 
797 
803 
809 
815 
820  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
821  double,
822  float>::type _B_ilu_tol_setup;
823 
828  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
829  double,
830  float>::type _C_ilu_tol_setup;
831 
836  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
837  double,
838  float>::type _S_ilu_tol_setup;
839 
844  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
845  double,
846  float>::type _EF_ilu_tol_setup;
847 
853 
859 
865 
871 
877 
883 
884  /* option for B solve */
885 
891 
897 
903 
908  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
909  double,
911 
916  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
917  double,
919 
925 
931 
936  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
937  double,
939 
944  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
945  double,
947 
953 
959 
964  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
965  double,
966  float>::type _lr_tr_factor_B_setup;
967 
974  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
975  double,
976  float>::type _lr_tol_eig1_B_setup;
977 
984  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
985  double,
986  float>::type _lr_tol_eig2_B_setup;
987 
993 
999 
1005 
1011 
1016  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
1017  double,
1018  float>::type _B_ilu_tol_B_setup;
1019 
1024  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
1025  double,
1026  float>::type _C_ilu_tol_B_setup;
1027 
1033 
1039 
1045 
1051 
1057 
1063 
1068  void SetDefault();
1069 
1075 
1081 
1087 
1093 
1094  };
1095 
1101  template <class MatrixType, class VectorType, typename DataType>
1103  {
1104  public:
1105  /* Variables */
1106 
1111  int _lrc;
1112 
1117  int _ncomps;
1118 
1123  std::vector<MatrixType > _B_mat_v;
1124 
1129  MatrixType _E_mat;
1130 
1135  MatrixType _F_mat;
1136 
1141  MatrixType _C_mat;
1142 
1147  MatrixType _D_mat;
1148 
1154 
1160 
1166 
1172 
1178 
1183  VectorType _y_temp;
1184 
1189  VectorType _z_temp;
1190 
1195  VectorType _v_temp;
1196 
1201  VectorType _w_temp;
1202 
1207  VectorType _xlr_temp;
1208 
1213  VectorType _xlr1_temp;
1214 
1219  VectorType _xlr2_temp;
1220 
1226  int Clear();
1227 
1232  GemslrLevelClass();
1233 
1239 
1245 
1251 
1257 
1263 
1272  int GetNumNonzeros(long int &nnz_bsolver, long int &nnz_lr);
1273 
1274  };
1275 
1276 
1281 
1286  template <typename DataType>
1288  {
1289  public:
1290 
1291  /* Options */
1292 
1298 
1304 
1305  /* option for the main GeMSLR */
1306 
1313 
1321 
1327 
1333 
1339 
1347 
1353 
1359 
1360  /* option for the B solve GeMSLR */
1361 
1367 
1373 
1379 
1385 
1391 
1399 
1405 
1406  /* other solve options */
1407 
1413 
1419 
1426 
1433 
1438  typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
1439  double,
1441 
1447 
1453 
1459 
1465 
1470  void SetDefault();
1471 
1477 
1483 
1489 
1495 
1496  };
1497 
1503  template <class MatrixType, class VectorType, typename DataType>
1504  class GemslrClass: public SolverClass<MatrixType, VectorType, DataType>
1505  {
1506  private:
1507 
1512  int _n;
1513 
1518  GemslrSetupStruct<DataType> _gemslr_setups;
1519 
1525 
1531  VectorType, DataType> _inner_iters_precond;
1532 
1538  VectorType, DataType> _inner_iters_solver;
1539 
1545  int _nlev_max;
1546 
1551  int _nlev_used;
1552 
1557  IntVectorClass<int> _lev_ptr_v;
1558 
1563  std::vector<IntVectorClass<int> > _dom_ptr_v2;
1564 
1569  IntVectorClass<int> _pperm;
1570 
1576  IntVectorClass<int> _qperm;
1577 
1582  int _location;
1583 
1588  VectorType _x_temp;
1589 
1594  VectorType _rhs_temp;
1595 
1602  template <typename T1, typename T2>
1603  static T1 ComputeDistance(T2 val);
1604 
1614  template <typename RealDataType>
1615  int OrdLowRank(int m, int &rank, DenseMatrixClass<RealDataType> &R, DenseMatrixClass<RealDataType> &Q);
1616 
1626  template <typename RealDataType>
1628 
1629  /* ------ Setup permutation ------ */
1630 
1636  int SetupPermutation();
1637 
1646  int SetupPermutationRKway( int &nlev_max, int &nlev_used, vector_int &map_v, vector_int &mapptr_v);
1647 
1653  int SetupPermutationND( int &nlev_max, int &nlev_used, vector_int &map_v, vector_int &mapptr_v);
1654 
1655  /* ------ Build multilevel structure ------ */
1656 
1662  int SetupPermutationBuildLevelStructure( vector_int &map_v, vector_int &mapptr_v);
1663 
1664  /* ------ Setup B solve ------ */
1665 
1673  int SetupBSolve( VectorType &x, VectorType &rhs);
1674 
1683  int SetupBSolveILUT( VectorType &x, VectorType &rhs, int level);
1684 
1693  int SetupBSolveILUK( VectorType &x, VectorType &rhs, int level);
1694 
1703  int SetupBSolveGemslr( VectorType &x, VectorType &rhs, int level);
1704 
1705  /* ------ Construct Low-rank correction ------ */
1706 
1714  int SetupLowRank( VectorType &x, VectorType &rhs);
1715 
1724  int SetupLowRankSubspaceIteration( VectorType &x, VectorType &rhs, int level);
1725 
1734  int SetupLowRankNoRestart( VectorType &x, VectorType &rhs, int level);
1735 
1744  int SetupLowRankThickRestart( VectorType &x, VectorType &rhs, int level);
1745 
1754  int SetupLowRankThickRestartNoLock( SequentialVectorClass<DataType> &x, SequentialVectorClass<DataType> &rhs, int level);
1755 
1764  template <typename RealDataType>
1765  int SetupLowRankThickRestartStandard( SequentialVectorClass<RealDataType> &x, SequentialVectorClass<RealDataType> &rhs, int level);
1766 
1775  template <typename RealDataType>
1776  int SetupLowRankThickRestartStandard( SequentialVectorClass<ComplexValueClass<RealDataType> > &x, SequentialVectorClass<ComplexValueClass<RealDataType> > &rhs, int level);
1777 
1790  int SetupLowRankBuildLowRank( VectorType &x, VectorType &rhs, DenseMatrixClass<DataType> &V, DenseMatrixClass<DataType> &H, int m, int rank, int level);
1791 
1806  int SetupLowRankBuildLowRank( VectorType &x, VectorType &rhs, DenseMatrixClass<DataType> &V, DenseMatrixClass<DataType> &H, DenseMatrixClass<DataType> &Q, vector_int &select, int m, int rank, int level);
1807 
1808  public:
1809 
1816  std::vector< GemslrLevelClass< MatrixType, VectorType, DataType> > _levs_v;
1817 
1822  GemslrClass();
1823 
1829  virtual int Clear();
1830 
1835  virtual ~GemslrClass();
1836 
1842 
1848 
1854 
1860 
1861  /* ------ Wrapper setup function ------ */
1862 
1870  virtual int Setup( VectorType &x, VectorType &rhs);
1871 
1872  /* ------ Wrapper of solve phase ------ */
1873 
1881  virtual int Solve( VectorType &x, VectorType &rhs);
1882 
1883  /* ------ Solve helper functions ------ */
1884 
1893  int SolveLevel( VectorType &x, VectorType &rhs, int level);
1894 
1903  int SolveB( VectorType &x, VectorType &rhs, int level);
1904 
1913  int SolveApplyLowRankLevel( VectorType &x, VectorType &rhs, int level);
1914 
1915  /* ------ Matvec for Arnoldi ------ */
1916 
1922  int GetNumRows(int level);
1923 
1936  int EBFCMatVec( int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y);
1937 
1950  int SchurMatVec( int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y);
1951 
1964  int CMatVec( int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y);
1965 
1966  /* ------ Get Solver Info ------ */
1967 
1973  int GetSize();
1974 
1980  virtual long int GetNumNonzeros();
1981 
1987  long int GetNumNonzeros(long int &nnz_bsolver, long int &nnz_lr);
1988 
1989  /* ------ Sets and Gets ------ */
1990 
1998  {
1999 
2000  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("Gemslr_SetLocalGemslr."));
2001 
2002  /* general setup */
2003 
2004  /* mute the sub-gemslr print */
2005  gemslr.SetPrintOption(0);
2006 
2007  /* gemslr_setup */
2008 
2009  gemslr.SetPartitionOption(this->_gemslr_setups._partition_option_B_setup);
2010  gemslr.SetPermutationOption(this->_gemslr_setups._perm_option_B_setup);
2011  gemslr.SetNumLevels(this->_gemslr_setups._nlev_B_setup);
2012  gemslr.SetNumSubdomains(this->_gemslr_setups._ncomp_B_setup);
2013  gemslr.SetMinimalNumberSubdomains(this->_gemslr_setups._kmin_B_setup);
2014  gemslr.SetNumberSubdomainsReduceFactor(this->_gemslr_setups._kfactor_B_setup);
2015  gemslr.SetSeperatorOption(this->_gemslr_setups._vertexsep_B_setup);
2016 
2017  /* turn off local inner iteration for now. Arnoldi reauires fix operation */
2018  gemslr.SetInnerIterationOption(false);
2019  gemslr.SetSolveOption(kGemslrLUSolve);
2020 
2021  /* level_setup */
2022 
2023  gemslr.SetLowRankOptionTopLevel(this->_gemslr_setups._level_setups._lr_option1_B_setup);
2024  gemslr.SetLowRankOptionOtherLevels(this->_gemslr_setups._level_setups._lr_option2_B_setup);
2025  gemslr.SetLowRankRandomInitGuess(this->_gemslr_setups._level_setups._lr_rand_init_B_setup);
2026  gemslr.SetLowRankFactorTopLevel(this->_gemslr_setups._level_setups._lr_rank_factor1_B_setup);
2027  gemslr.SetLowRankFactorOtherLevels(this->_gemslr_setups._level_setups._lr_rank_factor2_B_setup);
2028  gemslr.SetLowRankRanksTopLevel(this->_gemslr_setups._level_setups._lr_rank1_B_setup);
2029  gemslr.SetLowRankRanksOtherLevels(this->_gemslr_setups._level_setups._lr_rank2_B_setup);
2030  gemslr.SetLowRankArnoldiFactorTopLevel(this->_gemslr_setups._level_setups._lr_arnoldi_factor1_B_setup);
2031  gemslr.SetLowRankArnoldiFactorOtherLevels(this->_gemslr_setups._level_setups._lr_arnoldi_factor2_B_setup);
2032  gemslr.SetLowRankMaxNumberIterationsTopLevel(this->_gemslr_setups._level_setups._lr_maxits1_B_setup);
2033  gemslr.SetLowRankMaxNumberIterationsOtherLevels(this->_gemslr_setups._level_setups._lr_maxits2_B_setup);
2034  gemslr.SetLowRankThresholdTopLevel(this->_gemslr_setups._level_setups._lr_tol_eig1_B_setup);
2035  gemslr.SetLowRankThresholdOtherLevels(this->_gemslr_setups._level_setups._lr_tol_eig2_B_setup);
2036 
2037  /* currently the inner solve is ILUT only */
2038  gemslr.SetPreconditionerOptionB(kGemslrBSolveILUT);
2039  gemslr.SetPreconditionerOptionC(kGemslrCSolveILUT);
2040 
2041  /* set ilu options */
2042  gemslr.SetIluResidualIters(this->_gemslr_setups._level_setups._ilu_residual_iters);
2043  gemslr.SetIluComplexShift(this->_gemslr_setups._level_setups._ilu_complex_shift);
2044  gemslr.SetIluDropTolB(this->_gemslr_setups._level_setups._B_ilu_tol_B_setup);
2045  gemslr.SetIluDropTolC(this->_gemslr_setups._level_setups._C_ilu_tol_B_setup);
2046  gemslr.SetIluMaxRowNnzB(this->_gemslr_setups._level_setups._B_ilu_max_row_nnz_B_setup);
2047  gemslr.SetIluMaxRowNnzC(this->_gemslr_setups._level_setups._C_ilu_max_row_nnz_B_setup);
2048  gemslr.SetIluFillLevelB(this->_gemslr_setups._level_setups._B_ilu_fill_level_B_setup);
2049  gemslr.SetIluFillLevelC(this->_gemslr_setups._level_setups._C_ilu_fill_level_B_setup);
2050  gemslr.SetPolyOrder(this->_gemslr_setups._level_setups._B_poly_order_B);
2051 
2052  return PARGEMSLR_SUCCESS;
2053  }
2054 
2061  virtual int SetWithParameterArray(double *params)
2062  {
2063 
2064  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("Gemslr_SetWithParameterArray."));
2065 
2066  /* general setup */
2067 
2068  //pargemslr_global::_metis_refine = params[PARGEMSLR_IO_PREPOSS_METIS_REFINE];
2069  this->_print_option = params[PARGEMSLR_IO_GENERAL_PRINT_LEVEL];
2070 
2071  /* gemslr_setup */
2072 
2073  this->_gemslr_setups._partition_option_setup = params[PARGEMSLR_IO_PREPOSS_PARTITION_GLOBAL];
2074  this->_gemslr_setups._partition_option_B_setup = params[PARGEMSLR_IO_PREPOSS_PARTITION_LOCAL];
2075  this->_gemslr_setups._perm_option_setup = params[PARGEMSLR_IO_ILU_PERM_OPTION_GLOBAL];
2076  this->_gemslr_setups._perm_option_B_setup = params[PARGEMSLR_IO_ILU_PERM_OPTION_LOCAL];
2077  this->_gemslr_setups._nlev_setup = params[PARGEMSLR_IO_PREPOSS_NLEV_GLOBAL];
2078  this->_gemslr_setups._nlev_B_setup = params[PARGEMSLR_IO_PREPOSS_NLEV_LOCAL];
2079  this->_gemslr_setups._ncomp_setup = params[PARGEMSLR_IO_PREPOSS_NCOMP_GLOBAL];
2080  this->_gemslr_setups._ncomp_B_setup = params[PARGEMSLR_IO_PREPOSS_NCOMP_LOCAL];
2081  this->_gemslr_setups._kmin_setup = params[PARGEMSLR_IO_PREPOSS_KMIN_GLOBAL];
2082  this->_gemslr_setups._kmin_B_setup = params[PARGEMSLR_IO_PREPOSS_KMIN_LOCAL];
2083  this->_gemslr_setups._kfactor_setup = params[PARGEMSLR_IO_PREPOSS_KFACTOR_GLOBAL];
2084  this->_gemslr_setups._kfactor_B_setup = params[PARGEMSLR_IO_PREPOSS_KFACTOR_LOCAL];
2085  this->_gemslr_setups._vertexsep_setup = params[PARGEMSLR_IO_PREPOSS_VTXSEP_GLOBAL] != 0;
2086  this->_gemslr_setups._vertexsep_B_setup = params[PARGEMSLR_IO_PREPOSS_VTXSEP_LOCAL] != 0;
2087 
2088  this->_gemslr_setups._enable_inner_iters_setup = params[PARGEMSLR_IO_SCHUR_ENABLE] != 0;
2089  this->_gemslr_setups._inner_iters_tol_setup = params[PARGEMSLR_IO_SCHUR_ITER_TOL];
2090  this->_gemslr_setups._inner_iters_maxits_setup = params[PARGEMSLR_IO_SCHUR_MAXITS];
2091  this->_gemslr_setups._solve_option_setup = params[PARGEMSLR_IO_ADVANCED_GLOBAL_SOLVE];
2092 
2093  /* level_setup */
2094 
2095  this->_gemslr_setups._level_setups._lr_option1_setup = params[PARGEMSLR_IO_LR_ARNOLDI_OPTION1_GLOBAL];
2096  this->_gemslr_setups._level_setups._lr_option2_setup = params[PARGEMSLR_IO_LR_ARNOLDI_OPTION2_GLOBAL];
2097  this->_gemslr_setups._level_setups._lr_rand_init_setup = params[PARGEMSLR_IO_LR_RAND_INIT_GUESS] != 0.0;
2098  this->_gemslr_setups._level_setups._lr_rank_factor1_setup = params[PARGEMSLR_IO_LR_RANK_FACTOR1_GLOBAL];
2099  this->_gemslr_setups._level_setups._lr_rank_factor2_setup = params[PARGEMSLR_IO_LR_RANK_FACTOR2_GLOBAL];
2100  this->_gemslr_setups._level_setups._lr_rank1_setup = params[PARGEMSLR_IO_LR_RANK1_GLOBAL];
2101  this->_gemslr_setups._level_setups._lr_rank2_setup = params[PARGEMSLR_IO_LR_RANK2_GLOBAL];
2102  this->_gemslr_setups._level_setups._lr_arnoldi_factor1_setup = params[PARGEMSLR_IO_LR_ARNOLDI_FACTOR1_GLOBAL];
2103  this->_gemslr_setups._level_setups._lr_arnoldi_factor2_setup = params[PARGEMSLR_IO_LR_ARNOLDI_FACTOR2_GLOBAL];
2104  this->_gemslr_setups._level_setups._lr_maxits1_setup = params[PARGEMSLR_IO_LR_MAXITS1_GLOBAL];
2105  this->_gemslr_setups._level_setups._lr_maxits2_setup = params[PARGEMSLR_IO_LR_MAXITS2_GLOBAL];
2106  this->_gemslr_setups._level_setups._lr_tol_eig1_setup = params[PARGEMSLR_IO_LR_TOL_EIG1_GLOBAL];
2107  this->_gemslr_setups._level_setups._lr_tol_eig2_setup = params[PARGEMSLR_IO_LR_TOL_EIG2_GLOBAL];
2108 
2109  this->_gemslr_setups._level_setups._B_solve_option1 = params[PARGEMSLR_IO_PRECOND_LOCAL_REPCOND1];
2110  this->_gemslr_setups._level_setups._B_solve_option1_levels = params[PARGEMSLR_IO_PRECOND_LOCAL_REPCOND1_LEVEL];
2111  this->_gemslr_setups._level_setups._B_solve_option2 = params[PARGEMSLR_IO_PRECOND_LOCAL_REPCOND2];
2112  this->_gemslr_setups._level_setups._C_solve_option = params[PARGEMSLR_IO_PRECOND_LOCAL_REPCOND3];
2113  this->_gemslr_setups._level_setups._B_smooth_option1 = params[PARGEMSLR_IO_PRECOND_LOCAL_SMOOTHER1];
2114 
2115  this->_gemslr_setups._level_setups._B_ilu_tol_setup = params[PARGEMSLR_IO_ILU_DROPTOL_B_GLOBAL];
2116  this->_gemslr_setups._level_setups._C_ilu_tol_setup = params[PARGEMSLR_IO_ILU_DROPTOL_C_GLOBAL];
2117  this->_gemslr_setups._level_setups._S_ilu_tol_setup = params[PARGEMSLR_IO_ILU_DROPTOL_S_GLOBAL];
2118  this->_gemslr_setups._level_setups._B_ilu_max_row_nnz_setup = params[PARGEMSLR_IO_ILU_ROWNNZ_B_GLOBAL];
2119  this->_gemslr_setups._level_setups._C_ilu_max_row_nnz_setup = params[PARGEMSLR_IO_ILU_ROWNNZ_C_GLOBAL];
2120  this->_gemslr_setups._level_setups._S_ilu_max_row_nnz_setup = params[PARGEMSLR_IO_ILU_ROWNNZ_S_GLOBAL];
2121  this->_gemslr_setups._level_setups._B_ilu_fill_level_setup = params[PARGEMSLR_IO_ILU_LFIL_B_GLOBAL];
2122  this->_gemslr_setups._level_setups._C_ilu_fill_level_setup = params[PARGEMSLR_IO_ILU_LFIL_C_GLOBAL];
2123  this->_gemslr_setups._level_setups._B_poly_order = params[PARGEMSLR_IO_POLY_ORDER];
2124 
2125  this->_gemslr_setups._level_setups._ilu_complex_shift = params[PARGEMSLR_IO_ADVANCED_USE_COMPLEX_SHIFT] != 0.0;
2126  this->_gemslr_setups._level_setups._ilu_residual_iters = params[PARGEMSLR_IO_ADVANCED_RESIDUAL_ITERS];
2127 
2128  pargemslr_global::_gram_schmidt = params[PARGEMSLR_IO_ADVANCED_GRAM_SCHMIDT];
2129 
2130  this->_gemslr_setups._level_setups._lr_option1_B_setup = params[PARGEMSLR_IO_LR_ARNOLDI_OPTION1_LOCAL];
2131  this->_gemslr_setups._level_setups._lr_option2_B_setup = params[PARGEMSLR_IO_LR_ARNOLDI_OPTION2_LOCAL];
2132  this->_gemslr_setups._level_setups._lr_rand_init_B_setup = params[PARGEMSLR_IO_LR_RAND_INIT_GUESS] != 0.0;
2133  this->_gemslr_setups._level_setups._lr_rank_factor1_B_setup = params[PARGEMSLR_IO_LR_RANK_FACTOR1_LOCAL];
2134  this->_gemslr_setups._level_setups._lr_rank_factor2_B_setup = params[PARGEMSLR_IO_LR_RANK_FACTOR2_LOCAL];
2135  this->_gemslr_setups._level_setups._lr_rank1_B_setup = params[PARGEMSLR_IO_LR_RANK1_LOCAL];
2136  this->_gemslr_setups._level_setups._lr_rank2_B_setup = params[PARGEMSLR_IO_LR_RANK2_LOCAL];
2137  this->_gemslr_setups._level_setups._lr_arnoldi_factor1_B_setup = params[PARGEMSLR_IO_LR_ARNOLDI_FACTOR1_LOCAL];
2138  this->_gemslr_setups._level_setups._lr_arnoldi_factor2_B_setup = params[PARGEMSLR_IO_LR_ARNOLDI_FACTOR2_LOCAL];
2139  this->_gemslr_setups._level_setups._lr_maxits1_B_setup = params[PARGEMSLR_IO_LR_MAXITS1_LOCAL];
2140  this->_gemslr_setups._level_setups._lr_maxits2_B_setup = params[PARGEMSLR_IO_LR_MAXITS2_LOCAL];
2141  this->_gemslr_setups._level_setups._lr_tol_eig1_B_setup = params[PARGEMSLR_IO_LR_TOL_EIG1_LOCAL];
2142  this->_gemslr_setups._level_setups._lr_tol_eig2_B_setup = params[PARGEMSLR_IO_LR_TOL_EIG2_LOCAL];
2143 
2144  this->_gemslr_setups._level_setups._B_ilu_tol_B_setup = params[PARGEMSLR_IO_ILU_DROPTOL_B_LOCAL];
2145  this->_gemslr_setups._level_setups._C_ilu_tol_B_setup = params[PARGEMSLR_IO_ILU_DROPTOL_C_LOCAL];
2146  this->_gemslr_setups._level_setups._B_ilu_max_row_nnz_B_setup = params[PARGEMSLR_IO_ILU_ROWNNZ_B_LOCAL];
2147  this->_gemslr_setups._level_setups._C_ilu_max_row_nnz_B_setup = params[PARGEMSLR_IO_ILU_ROWNNZ_C_LOCAL];
2148  this->_gemslr_setups._level_setups._B_ilu_fill_level_B_setup = params[PARGEMSLR_IO_ILU_LFIL_B_LOCAL];
2149  this->_gemslr_setups._level_setups._C_ilu_fill_level_B_setup = params[PARGEMSLR_IO_ILU_LFIL_C_LOCAL];
2150  this->_gemslr_setups._level_setups._B_poly_order_B = params[PARGEMSLR_IO_POLY_ORDER];
2151 
2152  return PARGEMSLR_SUCCESS;
2153  }
2154 
2161  int SetPartitionOption(int option)
2162  {
2163  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2164  PARGEMSLR_FIRM_CHKERR(option < 0);
2165  PARGEMSLR_FIRM_CHKERR(option > 1);
2166  this->_gemslr_setups._partition_option_setup = option;
2167  return PARGEMSLR_SUCCESS;
2168  }
2169 
2176  int SetBPartitionOption(int option)
2177  {
2178  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2179  PARGEMSLR_FIRM_CHKERR(option < 0);
2180  PARGEMSLR_FIRM_CHKERR(option > 1);
2181  this->_gemslr_setups._partition_option_B_setup = option;
2182  return PARGEMSLR_SUCCESS;
2183  }
2184 
2191  int SetPermutationOption(int option)
2192  {
2193  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2194  PARGEMSLR_FIRM_CHKERR(option < 0);
2195  PARGEMSLR_FIRM_CHKERR(option > 2);
2196  this->_gemslr_setups._perm_option_setup = option;
2197  return PARGEMSLR_SUCCESS;
2198  }
2199 
2206  int SetBPermutationOption(int option)
2207  {
2208  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2209  PARGEMSLR_FIRM_CHKERR(option < 0);
2210  PARGEMSLR_FIRM_CHKERR(option > 2);
2211  this->_gemslr_setups._perm_option_B_setup = option;
2212  return PARGEMSLR_SUCCESS;
2213  }
2214 
2221  int SetNumLevels(int option)
2222  {
2223  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2224  PARGEMSLR_FIRM_CHKERR(option < 1);
2225  this->_gemslr_setups._nlev_setup = option;
2226  return PARGEMSLR_SUCCESS;
2227  }
2228 
2235  int SetBNumLevels(int option)
2236  {
2237  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2238  PARGEMSLR_FIRM_CHKERR(option < 1);
2239  this->_gemslr_setups._nlev_B_setup = option;
2240  return PARGEMSLR_SUCCESS;
2241  }
2242 
2249  int SetNumSubdomains(int option)
2250  {
2251  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2252  PARGEMSLR_FIRM_CHKERR(option < 1);
2253  this->_gemslr_setups._ncomp_setup = option;
2254  return PARGEMSLR_SUCCESS;
2255  }
2256 
2263  int SetBNumSubdomains(int option)
2264  {
2265  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2266  PARGEMSLR_FIRM_CHKERR(option < 1);
2267  this->_gemslr_setups._ncomp_B_setup = option;
2268  return PARGEMSLR_SUCCESS;
2269  }
2270 
2278  {
2279  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2280  PARGEMSLR_FIRM_CHKERR(option < 1);
2281  this->_gemslr_setups._kmin_setup = option;
2282  return PARGEMSLR_SUCCESS;
2283  }
2284 
2292  {
2293  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2294  PARGEMSLR_FIRM_CHKERR(option < 1);
2295  this->_gemslr_setups._kmin_B_setup = option;
2296  return PARGEMSLR_SUCCESS;
2297  }
2298 
2306  {
2307  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2308  PARGEMSLR_FIRM_CHKERR(option < 1);
2309  this->_gemslr_setups._kfactor_setup = option;
2310  return PARGEMSLR_SUCCESS;
2311  }
2312 
2320  {
2321  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2322  PARGEMSLR_FIRM_CHKERR(option < 1);
2323  this->_gemslr_setups._kfactor_B_setup = option;
2324  return PARGEMSLR_SUCCESS;
2325  }
2326 
2333  int SetSeperatorOption(bool option)
2334  {
2335  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2336  this->_gemslr_setups._vertexsep_setup = option;
2337  return PARGEMSLR_SUCCESS;
2338  }
2339 
2346  int SetBSeperatorOption(bool option)
2347  {
2348  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2349  this->_gemslr_setups._vertexsep_B_setup = option;
2350  return PARGEMSLR_SUCCESS;
2351  }
2352 
2359  int SetInnerIterationOption(bool option)
2360  {
2361  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2362  this->_gemslr_setups._enable_inner_iters_setup = option;
2363  return PARGEMSLR_SUCCESS;
2364  }
2365 
2372  template <typename T>
2374  {
2375  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2376  this->_gemslr_setups._inner_iters_tol_setup = option;
2377  return PARGEMSLR_SUCCESS;
2378  }
2379 
2387  {
2388  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2389  PARGEMSLR_FIRM_CHKERR(option < 1);
2390  this->_gemslr_setups._inner_iters_maxits_setup = option;
2391  return PARGEMSLR_SUCCESS;
2392  }
2393 
2400  int SetSolveOption(int option)
2401  {
2402  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2403  PARGEMSLR_FIRM_CHKERR(option < 0);
2404  PARGEMSLR_FIRM_CHKERR(option > 2);
2405  this->_gemslr_setups._solve_option_setup = option;
2406  return PARGEMSLR_SUCCESS;
2407  }
2408 
2416  {
2417  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2418  PARGEMSLR_FIRM_CHKERR(option < 0);
2419  PARGEMSLR_FIRM_CHKERR(option > 2);
2420  this->_gemslr_setups._level_setups._lr_option1_setup = option;
2421  return PARGEMSLR_SUCCESS;
2422  }
2423 
2431  {
2432  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2433  PARGEMSLR_FIRM_CHKERR(option < 0);
2434  PARGEMSLR_FIRM_CHKERR(option > 2);
2435  this->_gemslr_setups._level_setups._lr_option2_setup = option;
2436  return PARGEMSLR_SUCCESS;
2437  }
2438 
2446  {
2447  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2448  PARGEMSLR_FIRM_CHKERR(option < 0);
2449  PARGEMSLR_FIRM_CHKERR(option > 2);
2450  this->_gemslr_setups._level_setups._lr_option1_B_setup = option;
2451  return PARGEMSLR_SUCCESS;
2452  }
2453 
2461  {
2462  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2463  PARGEMSLR_FIRM_CHKERR(option < 0);
2464  PARGEMSLR_FIRM_CHKERR(option > 2);
2465  this->_gemslr_setups._level_setups._lr_option2_B_setup = option;
2466  return PARGEMSLR_SUCCESS;
2467  }
2468 
2475  int SetLowRankRandomInitGuess(bool option)
2476  {
2477  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2478  this->_gemslr_setups._level_setups._lr_rand_init_setup = option;
2479  return PARGEMSLR_SUCCESS;
2480  }
2481 
2489  {
2490  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2491  this->_gemslr_setups._level_setups._lr_rand_init_B_setup = option;
2492  return PARGEMSLR_SUCCESS;
2493  }
2494 
2501  template <typename T>
2503  {
2504  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2505  PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2506  this->_gemslr_setups._level_setups._lr_rank_factor1_setup = option;
2507  return PARGEMSLR_SUCCESS;
2508  }
2509 
2516  template <typename T>
2518  {
2519  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2520  PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2521  this->_gemslr_setups._level_setups._lr_rank_factor2_setup = option;
2522  return PARGEMSLR_SUCCESS;
2523  }
2524 
2531  template <typename T>
2533  {
2534  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2535  PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2536  this->_gemslr_setups._level_setups._lr_rank_factor1_B_setup = option;
2537  return PARGEMSLR_SUCCESS;
2538  }
2539 
2546  template <typename T>
2548  {
2549  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2550  PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2551  this->_gemslr_setups._level_setups._lr_rank_factor2_B_setup = option;
2552  return PARGEMSLR_SUCCESS;
2553  }
2554 
2561  template <typename T>
2563  {
2564  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2565  PARGEMSLR_FIRM_CHKERR(option < 0);
2566  this->_gemslr_setups._level_setups._lr_rank1_setup = option;
2567  return PARGEMSLR_SUCCESS;
2568  }
2569 
2576  template <typename T>
2578  {
2579  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2580  PARGEMSLR_FIRM_CHKERR(option < 0);
2581  this->_gemslr_setups._level_setups._lr_rank2_setup = option;
2582  return PARGEMSLR_SUCCESS;
2583  }
2584 
2591  template <typename T>
2593  {
2594  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2595  PARGEMSLR_FIRM_CHKERR(option < 0);
2596  this->_gemslr_setups._level_setups._lr_rank1_B_setup = option;
2597  return PARGEMSLR_SUCCESS;
2598  }
2599 
2606  template <typename T>
2608  {
2609  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2610  PARGEMSLR_FIRM_CHKERR(option < 0);
2611  this->_gemslr_setups._level_setups._lr_rank2_B_setup = option;
2612  return PARGEMSLR_SUCCESS;
2613  }
2614 
2621  template <typename T>
2623  {
2624  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2625  PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2626  this->_gemslr_setups._level_setups._lr_arnoldi_factor1_setup = option;
2627  return PARGEMSLR_SUCCESS;
2628  }
2629 
2636  template <typename T>
2638  {
2639  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2640  PARGEMSLR_FIRM_CHKERR(option < 0);
2641  this->_gemslr_setups._level_setups._lr_arnoldi_factor2_setup = option;
2642  return PARGEMSLR_SUCCESS;
2643  }
2644 
2651  template <typename T>
2653  {
2654  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2655  PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2656  this->_gemslr_setups._level_setups._lr_arnoldi_factor1_B_setup = option;
2657  return PARGEMSLR_SUCCESS;
2658  }
2659 
2666  template <typename T>
2668  {
2669  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2670  PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2671  this->_gemslr_setups._level_setups._lr_arnoldi_factor2_B_setup = option;
2672  return PARGEMSLR_SUCCESS;
2673  }
2674 
2682  {
2683  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2684  PARGEMSLR_FIRM_CHKERR(option < 0);
2685  this->_gemslr_setups._level_setups._lr_maxits1_setup = option;
2686  return PARGEMSLR_SUCCESS;
2687  }
2688 
2696  {
2697  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2698  PARGEMSLR_FIRM_CHKERR(option < 0);
2699  this->_gemslr_setups._level_setups._lr_maxits2_setup = option;
2700  return PARGEMSLR_SUCCESS;
2701  }
2702 
2710  {
2711  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2712  PARGEMSLR_FIRM_CHKERR(option < 0);
2713  this->_gemslr_setups._level_setups._lr_maxits1_B_setup = option;
2714  return PARGEMSLR_SUCCESS;
2715  }
2716 
2724  {
2725  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2726  PARGEMSLR_FIRM_CHKERR(option < 0);
2727  this->_gemslr_setups._level_setups._lr_maxits2_B_setup = option;
2728  return PARGEMSLR_SUCCESS;
2729  }
2730 
2737  template <typename T>
2739  {
2740  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2741  this->_gemslr_setups._level_setups._lr_tol_eig1_setup = option;
2742  return PARGEMSLR_SUCCESS;
2743  }
2744 
2751  template <typename T>
2753  {
2754  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2755  this->_gemslr_setups._level_setups._lr_tol_eig2_setup = option;
2756  return PARGEMSLR_SUCCESS;
2757  }
2758 
2765  template <typename T>
2767  {
2768  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2769  this->_gemslr_setups._level_setups._lr_tol_eig1_B_setup = option;
2770  return PARGEMSLR_SUCCESS;
2771  }
2772 
2779  template <typename T>
2781  {
2782  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2783  this->_gemslr_setups._level_setups._lr_tol_eig2_B_setup = option;
2784  return PARGEMSLR_SUCCESS;
2785  }
2786 
2793  template <typename T>
2794  int SetIluDropTolB(T option)
2795  {
2796  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2797  this->_gemslr_setups._level_setups._B_ilu_tol_setup = option;
2798  return PARGEMSLR_SUCCESS;
2799  }
2800 
2807  template <typename T>
2808  int SetIluDropTolC(T option)
2809  {
2810  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2811  this->_gemslr_setups._level_setups._C_ilu_tol_setup = option;
2812  return PARGEMSLR_SUCCESS;
2813  }
2814 
2821  template <typename T>
2822  int SetIluDropTolS(T option)
2823  {
2824  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("ParallelGemslrSets"));
2825  this->_gemslr_setups._level_setups._S_ilu_tol_setup = option;
2826  return PARGEMSLR_SUCCESS;
2827  }
2828 
2835  template <typename T>
2836  int SetIluDropTolEF(T option)
2837  {
2838  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("ParallelGemslrSets"));
2839  this->_gemslr_setups._level_setups._EF_ilu_tol_setup = option;
2840  return PARGEMSLR_SUCCESS;
2841  }
2842 
2849  template <typename T>
2850  int SetBIluDropTolB(T option)
2851  {
2852  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2853  this->_gemslr_setups._level_setups._B_ilu_tol_B_setup = option;
2854  return PARGEMSLR_SUCCESS;
2855  }
2856 
2863  template <typename T>
2864  int SetBIluDropTolC(T option)
2865  {
2866  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2867  this->_gemslr_setups._level_setups._C_ilu_tol_B_setup = option;
2868  return PARGEMSLR_SUCCESS;
2869  }
2870 
2877  int SetIluMaxRowNnzB(int option)
2878  {
2879  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2880  PARGEMSLR_FIRM_CHKERR(option < 0);
2881  this->_gemslr_setups._level_setups._B_ilu_max_row_nnz_setup = option;
2882  return PARGEMSLR_SUCCESS;
2883  }
2884 
2891  int SetIluMaxRowNnzC(int option)
2892  {
2893  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2894  PARGEMSLR_FIRM_CHKERR(option < 0);
2895  this->_gemslr_setups._level_setups._C_ilu_max_row_nnz_setup = option;
2896  return PARGEMSLR_SUCCESS;
2897  }
2898 
2905  int SetIluMaxRowNnzS(int option)
2906  {
2907  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2908  PARGEMSLR_FIRM_CHKERR(option < 0);
2909  this->_gemslr_setups._level_setups._S_ilu_max_row_nnz_setup = option;
2910  return PARGEMSLR_SUCCESS;
2911  }
2912 
2919  int SetIluFillLevelB(int option)
2920  {
2921  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2922  PARGEMSLR_FIRM_CHKERR(option < 0);
2923  this->_gemslr_setups._level_setups._B_ilu_fill_level_setup = option;
2924  return PARGEMSLR_SUCCESS;
2925  }
2926 
2933  int SetIluFillLevelC(int option)
2934  {
2935  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2936  PARGEMSLR_FIRM_CHKERR(option < 0);
2937  this->_gemslr_setups._level_setups._C_ilu_fill_level_setup = option;
2938  return PARGEMSLR_SUCCESS;
2939  }
2940 
2947  int SetBIluFillLevelB(int option)
2948  {
2949  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2950  PARGEMSLR_FIRM_CHKERR(option < 0);
2951  this->_gemslr_setups._level_setups._B_ilu_fill_level_B_setup = option;
2952  return PARGEMSLR_SUCCESS;
2953  }
2954 
2961  int SetBIluFillLevelC(int option)
2962  {
2963  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2964  PARGEMSLR_FIRM_CHKERR(option < 0);
2965  this->_gemslr_setups._level_setups._C_ilu_fill_level_B_setup = option;
2966  return PARGEMSLR_SUCCESS;
2967  }
2968 
2975  int SetBIluMaxRowNnzB(int option)
2976  {
2977  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2978  PARGEMSLR_FIRM_CHKERR(option < 0);
2979  this->_gemslr_setups._level_setups._B_ilu_max_row_nnz_B_setup = option;
2980  return PARGEMSLR_SUCCESS;
2981  }
2982 
2989  int SetBIluMaxRowNnzC(int option)
2990  {
2991  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
2992  PARGEMSLR_FIRM_CHKERR(option < 0);
2993  this->_gemslr_setups._level_setups._C_ilu_max_row_nnz_B_setup = option;
2994  return PARGEMSLR_SUCCESS;
2995  }
2996 
3003  int SetPolyOrder(int option)
3004  {
3005  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
3006  PARGEMSLR_FIRM_CHKERR(option < 1);
3007  this->_gemslr_setups._level_setups._B_poly_order = option;
3008  return PARGEMSLR_SUCCESS;
3009  }
3010 
3017  int SetBPolyOrder(int option)
3018  {
3019  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
3020  PARGEMSLR_FIRM_CHKERR(option < 1);
3021  this->_gemslr_setups._level_setups._B_poly_order_B = option;
3022  return PARGEMSLR_SUCCESS;
3023  }
3024 
3033  {
3034  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
3035  PARGEMSLR_FIRM_CHKERR(option < 0);
3036  PARGEMSLR_FIRM_CHKERR(option > 2);
3037  this->_gemslr_setups._level_setups._B_solve_option1 = option;
3038  return PARGEMSLR_SUCCESS;
3039  }
3040 
3049  {
3050  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
3051  this->_gemslr_setups._level_setups._B_solve_option1_levels = option;
3052  return PARGEMSLR_SUCCESS;
3053  }
3054 
3063  {
3064  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
3065  PARGEMSLR_FIRM_CHKERR(option < 0);
3066  PARGEMSLR_FIRM_CHKERR(option > 2);
3067  this->_gemslr_setups._level_setups._B_solve_option2 = option;
3068  return PARGEMSLR_SUCCESS;
3069  }
3070 
3079  {
3080  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
3081  PARGEMSLR_FIRM_CHKERR(option < 0);
3082  PARGEMSLR_FIRM_CHKERR(option > 2);
3083  this->_gemslr_setups._level_setups._B_solve_option1 = option;
3084  this->_gemslr_setups._level_setups._B_solve_option1_levels = 0;
3085  this->_gemslr_setups._level_setups._B_solve_option2 = option;
3086  return PARGEMSLR_SUCCESS;
3087  }
3088 
3095  int SetSmoothOptionB(int option)
3096  {
3097  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
3098  PARGEMSLR_FIRM_CHKERR(option < 0);
3099  PARGEMSLR_FIRM_CHKERR(option > 1);
3100  this->_gemslr_setups._level_setups._B_smooth_option1 = option;
3101  return PARGEMSLR_SUCCESS;
3102  }
3103 
3112  {
3113  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
3114  PARGEMSLR_FIRM_CHKERR(option < 0);
3115  PARGEMSLR_FIRM_CHKERR(option > 1);
3116  this->_gemslr_setups._level_setups._C_solve_option = option;
3117  return PARGEMSLR_SUCCESS;
3118  }
3119 
3126  int SetIluResidualIters(int residual_iters)
3127  {
3128  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
3129  this->_gemslr_setups._level_setups._ilu_residual_iters = residual_iters;
3130  return PARGEMSLR_SUCCESS;
3131  }
3132 
3139  int SetIluComplexShift(bool complex_shift)
3140  {
3141  PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups("GemslrSets"));
3142  this->_gemslr_setups._level_setups._ilu_complex_shift = complex_shift;
3143  return PARGEMSLR_SUCCESS;
3144  }
3145 
3146  /* general preconditioner options */
3147 
3154  virtual int SetSolveLocation( const int &location);
3155 
3162  int SetCUDAOption(bool cuda_lowrank_only);
3163 
3170  virtual int MoveData( const int &location);
3171 
3178  {
3179  return this->_gemslr_setups._solve_phase_setup;
3180  }
3181 
3182  };
3183 
3184  typedef GemslrClass<CsrMatrixClass<float>, SequentialVectorClass<float>, float> precond_gemslr_csr_seq_float;
3185  typedef GemslrClass<CsrMatrixClass<double>, SequentialVectorClass<double>, double> precond_gemslr_csr_seq_double;
3186  typedef GemslrClass<CsrMatrixClass<complexs>, SequentialVectorClass<complexs>, complexs> precond_gemslr_csr_seq_complexs;
3187  typedef GemslrClass<CsrMatrixClass<complexd>, SequentialVectorClass<complexd>, complexd> precond_gemslr_csr_seq_complexd;
3188 
3189 }
3190 
3191 #endif
pargemslr::GemslrLevelSetupStruct::_C_ilu_fill_level_setup
int _C_ilu_fill_level_setup
The global level of fill for ILUK on the last level.
Definition: gemslr.hpp:876
pargemslr::GemslrClass::SchurMatVec
int SchurMatVec(int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
The matvec function y = alpha*S*x+beta*y where S = Ci - Ei*(UBi(LBi(Fi*x).
Definition: gemslr.cpp:3769
pargemslr::GemslrLevelSetupStruct::_lr_tr_factor_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_tr_factor_setup
The thick-restart factor. Portion of thick-resratr length comparing to the entire width.
Definition: gemslr.hpp:739
pargemslr::GemslrClass::SetLowRankMaxNumberIterationsOtherLevels
int SetLowRankMaxNumberIterationsOtherLevels(int option)
Set max restarts of thick-restart Arnoldi on other levels.
Definition: gemslr.hpp:2695
pargemslr::GemslrClass::SetLowRankThresholdOtherLevels
int SetLowRankThresholdOtherLevels(T option)
Set max restarts of thick-restart Arnoldi on other levels.
Definition: gemslr.hpp:2752
pargemslr::GemslrLevelClass::_lrc
int _lrc
The size of low-rank correction on this level.
Definition: gemslr.hpp:1111
pargemslr::GemslrSchurSolveClass::Solve
virtual int Solve(VectorType &x, VectorType &rhs)
Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is u...
Definition: gemslr.hpp:554
pargemslr::GemslrSetupStruct::_kfactor_setup
int _kfactor_setup
In the recursive Kway partition, from the second level, each time the number of terget subdomains is ...
Definition: gemslr.hpp:1346
pargemslr::GemslrClass::SetNumLevels
int SetNumLevels(int option)
Set the global target number of levels of GeMSLR.
Definition: gemslr.hpp:2221
pargemslr::GemslrLevelSetupStruct::_lr_tol_eigA_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_tol_eigA_setup
The tolorance for eigenvalues on A. Eigenvalues with Schur vector smaller than it will be kept.
Definition: gemslr.hpp:766
pargemslr::GemslrSetupStruct::operator=
GemslrSetupStruct< DataType > & operator=(const GemslrSetupStruct< DataType > &str)
The operator=.
Definition: gemslr.cpp:1316
pargemslr::GemslrClass::SetBLowRankArnoldiFactorOtherLevels
int SetBLowRankArnoldiFactorOtherLevels(T option)
Set the B part Arnoldi factor on other levels. m steps for arnoldi is rank * rank_factor * arnoldi_fa...
Definition: gemslr.hpp:2667
pargemslr::GemslrClass::SetBIluDropTolB
int SetBIluDropTolB(T option)
Set the recursive GeMSLR B part threshold for ILUT of the global B part.
Definition: gemslr.hpp:2850
pargemslr::GemslrClass::SetBSeperatorOption
int SetBSeperatorOption(bool option)
Set the B part separator option of GeMSLR.
Definition: gemslr.hpp:2346
pargemslr::GemslrEBFCMatrixClass::Clear
int Clear()
Free the current matrix.
Definition: gemslr.cpp:94
pargemslr::GemslrLevelSetupStruct::_lr_maxits2_B_setup
int _lr_maxits2_B_setup
Set the maximum number of restart if thick-restart Arnoldi is used on other levels.
Definition: gemslr.hpp:958
pargemslr::GemslrClass::SetBLowRankThresholdOtherLevels
int SetBLowRankThresholdOtherLevels(T option)
Set B part max restarts of thick-restart Arnoldi on other levels.
Definition: gemslr.hpp:2780
pargemslr::GemslrLevelClass::_ncomps
int _ncomps
Number of subdomains on this level.
Definition: gemslr.hpp:1117
pargemslr::GemslrClass::SetIluResidualIters
int SetIluResidualIters(int residual_iters)
Set the number of residual iterations of B solves in the setup phase. Set to <= 1 to turn off.
Definition: gemslr.hpp:3126
pargemslr::GemslrSetupStruct::_inner_iters_maxits_setup
int _inner_iters_maxits_setup
The level of inner iteration. Solve Sx = b with preconditioned GMRES where GeMSLR is used as a precon...
Definition: gemslr.hpp:1432
pargemslr::GemslrLevelSetupStruct::_lr_tol_eig1_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_tol_eig1_setup
The tolorance for eigenvalues on the top level. Eigenvalues with Schur vector smaller than it will be...
Definition: gemslr.hpp:748
pargemslr::GemslrSetupStruct::_nlev_B_setup
int _nlev_B_setup
The total number of levels user wants to have in the B part if GeMSLR is used.
Definition: gemslr.hpp:1378
pargemslr::GemslrSetupStruct::_smoothing_option_setup
int _smoothing_option_setup
The GEMSLR B smoothing options.
Definition: gemslr.hpp:1452
pargemslr::GemslrClass::SetPreconditionerOption1Levels
int SetPreconditionerOption1Levels(int option)
Set top level preconditioner apply levels.
Definition: gemslr.hpp:3048
pargemslr::GemslrEBFCMatrixClass::GetDataLocation
int GetDataLocation() const
Get the data location of the matrix.
Definition: gemslr.hpp:292
pargemslr::GemslrClass::Solve
virtual int Solve(VectorType &x, VectorType &rhs)
Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is u...
Definition: gemslr.cpp:3412
pargemslr::GemslrLevelSetupStruct::_B_solve_option1
int _B_solve_option1
Choose the B solve option on the first several levels.
Definition: gemslr.hpp:772
pargemslr::GemslrLevelSetupStruct::_lr_arnoldi_factor1_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_arnoldi_factor1_setup
Set the maximum steps of the Arnoldi iteration on the top level.
Definition: gemslr.hpp:697
pargemslr::GemslrSetupStruct::SetDefault
void SetDefault()
Set the default values.
Definition: gemslr.cpp:1216
pargemslr::DenseMatrixClass< DataType >
pargemslr::GemslrSchurMatrixClass::GetMpiInfo
int GetMpiInfo(int &np, int &myid, MPI_Comm &comm) const
Get comm, np, and myid. Get the global one.
Definition: gemslr.hpp:428
pargemslr::GemslrLevelSetupStruct::_ilu_complex_shift
bool _ilu_complex_shift
Should we turn on complex shift?
Definition: gemslr.hpp:814
pargemslr::GemslrClass::SetIluComplexShift
int SetIluComplexShift(bool complex_shift)
Set if we turn on the complex shift or not (complex version only).
Definition: gemslr.hpp:3139
pargemslr::GemslrEBFCMatrixClass
Class of matvec EB^{-1}FC^{-1}.
Definition: gemslr.hpp:150
pargemslr::GemslrLevelSetupStruct::_B_solve_option1_B
int _B_solve_option1_B
Choose the B solve option on the first several levels.
Definition: gemslr.hpp:992
pargemslr::GemslrClass::SetIluFillLevelC
int SetIluFillLevelC(int option)
Set the fill level for ILUK of the last level.
Definition: gemslr.hpp:2933
pargemslr::GemslrClass
The local real ilu preconditioner, only work for sequential CSR matrix.
Definition: structs.hpp:20
pargemslr::GemslrClass::SetBLowRankFactorTopLevel
int SetBLowRankFactorTopLevel(T option)
Set the B part low-rank factor on the top level. The actuall computed number of low-rank terms is ran...
Definition: gemslr.hpp:2532
pargemslr::GemslrLevelSetupStruct::_ilu_residual_iters
int _ilu_residual_iters
Should we apply residual iteration in the setup phase?
Definition: gemslr.hpp:808
pargemslr::GemslrSetupStruct::_location
int _location
Set the solve location.
Definition: gemslr.hpp:1303
pargemslr::GemslrSetupStruct
The GEMSLR options.
Definition: gemslr.hpp:1288
pargemslr::GemslrClass::GetSize
int GetSize()
Get the size of the problem.
Definition: gemslr.cpp:4095
pargemslr::GemslrClass::SetBLowRankRandomInitGuess
int SetBLowRankRandomInitGuess(bool option)
Set if we use random initial guess for Arnoldi in the B part. Otherwise we use 1 as initial guess.
Definition: gemslr.hpp:2488
pargemslr::GemslrLevelSetupStruct::_C_ilu_tol_B_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _C_ilu_tol_B_setup
The droptol for ILUT on the last level.
Definition: gemslr.hpp:1026
pargemslr::GemslrLevelSetupStruct::_lr_arnoldi_factor2_B_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_arnoldi_factor2_B_setup
Set the maximum steps of the Arnoldi iteration on other levels.
Definition: gemslr.hpp:946
pargemslr::GemslrLevelSetupStruct::_lr_rank2_B_setup
int _lr_rank2_B_setup
Set the target number of low-rank terms we keep on other levels.
Definition: gemslr.hpp:930
pargemslr::GemslrClass::SetIluFillLevelB
int SetIluFillLevelB(int option)
Set the fill level for ILUK of the B part.
Definition: gemslr.hpp:2919
pargemslr::GemslrSchurMatrixClass::Solve
int Solve(VectorType &x, VectorType &rhs)
Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is u...
Definition: gemslr.cpp:294
pargemslr::GemslrEBFCMatrixClass::GemslrEBFCMatrixClass
GemslrEBFCMatrixClass()
The constructor of GemslrEBFCMatrixClass.
Definition: gemslr.cpp:19
pargemslr::GemslrClass::operator=
GemslrClass< MatrixType, VectorType, DataType > & operator=(const GemslrClass< MatrixType, VectorType, DataType > &precond)
The operator = of GemslrClass.
Definition: gemslr.cpp:1472
pargemslr::GemslrClass::SetBIluFillLevelB
int SetBIluFillLevelB(int option)
Set the fill level for ILUK of the B part.
Definition: gemslr.hpp:2947
pargemslr::GemslrClass::SetBNumSubdomains
int SetBNumSubdomains(int option)
Set the B part target number of subdomains on each level of GeMSLR.
Definition: gemslr.hpp:2263
pargemslr::GemslrSetupStruct::_level_setups
GemslrLevelSetupStruct< DataType > _level_setups
The global setup of low-rank correction on this level.
Definition: gemslr.hpp:1297
pargemslr::GemslrLevelSetupStruct
The GEMSLR options on each level.
Definition: gemslr.hpp:619
pargemslr::GemslrLevelSetupStruct::_C_lr_pslr
bool _C_lr_pslr
Use power low-rank?
Definition: gemslr.hpp:796
pargemslr::GemslrClass::EBFCMatVec
int EBFCMatVec(int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
The matvec function y = G*x = Ei*(UBi(LBi(Fi*(Ci\x)). Note that alpha and beta are untouched.
Definition: gemslr.cpp:3715
pargemslr::GemslrLevelSetupStruct::_lr_option1_B_setup
int _lr_option1_B_setup
Set the Arnoldi iteration option for building the low-rank correction on the top level.
Definition: gemslr.hpp:890
pargemslr::GemslrClass::SetNumSubdomains
int SetNumSubdomains(int option)
Set the global target number of subdomains on each level of GeMSLR.
Definition: gemslr.hpp:2249
pargemslr::GemslrClass::SetLowRankArnoldiFactorTopLevel
int SetLowRankArnoldiFactorTopLevel(T option)
Set the Arnoldi factor on the top level. m steps for arnoldi is rank * rank_factor * arnoldi_factor.
Definition: gemslr.hpp:2622
pargemslr::GemslrClass::SetPreconditionerOption2
int SetPreconditionerOption2(int option)
Set mid level preconditioner.
Definition: gemslr.hpp:3062
pargemslr::GemslrSetupStruct::_perm_option_setup
int _perm_option_setup
Set the local B reordering option.
Definition: gemslr.hpp:1320
pargemslr::GemslrClass::SetBLowRankFactorOtherLevels
int SetBLowRankFactorOtherLevels(T option)
Set the B part low-rank factor on the other levels. The actuall computed number of low-rank terms is ...
Definition: gemslr.hpp:2547
pargemslr::GemslrLevelClass::_B_precond
SolverClass< MatrixType, VectorType, DataType > ** _B_precond
The preconditioners for B matrix.
Definition: gemslr.hpp:1159
pargemslr::GemslrSchurMatrixClass::~GemslrSchurMatrixClass
virtual ~GemslrSchurMatrixClass()
The destructor of GemslrEBFCMatrixClass.
Definition: gemslr.cpp:178
pargemslr::GemslrClass::SetLowRankOptionTopLevel
int SetLowRankOptionTopLevel(int option)
Set the low-rank option on the top level. 0: Standard. 1: Thick-restart.
Definition: gemslr.hpp:2415
pargemslr::GemslrLevelSetupStruct::_lr_optionA_setup
int _lr_optionA_setup
Set the Arnoldi iteration option for building the low-rank correction on A.
Definition: gemslr.hpp:641
pargemslr::GemslrPartitionOptionEnum
GemslrPartitionOptionEnum
The partition option.
Definition: gemslr.hpp:42
pargemslr::GemslrSchurSolveClass::GetNumNonzeros
virtual long int GetNumNonzeros()
Get the total number of nonzeros the preconditioner.
Definition: gemslr.hpp:574
pargemslr::GemslrLevelSetupStruct::_B_solve_option2_B
int _B_solve_option2_B
Choose the B solve option before the last level.
Definition: gemslr.hpp:1004
pargemslr::GemslrClass::SetPermutationOption
int SetPermutationOption(int option)
Set the global permutation option. 0: No; 1: RCM; 2: AMD.
Definition: gemslr.hpp:2191
pargemslr::GemslrClass::SetBNumberSubdomainsReduceFactor
int SetBNumberSubdomainsReduceFactor(int option)
Set the B part reduce factor of subdomains on each level of GeMSLR.
Definition: gemslr.hpp:2319
pargemslr::GemslrSchurSolveClass::Setup
virtual int Setup(VectorType &x, VectorType &rhs)
Setup the precondioner phase. Will be called by the solver if not called directly.
Definition: gemslr.hpp:528
pargemslr::GemslrLevelClass::_xlr1_temp
VectorType _xlr1_temp
Temp vector.
Definition: gemslr.hpp:1213
pargemslr::GemslrLevelSetupStruct::_lr_rand_init_setup
bool _lr_rand_init_setup
Set to true to use random initial guess, otherwise use the unit vector.
Definition: gemslr.hpp:647
pargemslr::GemslrClass::GetNumNonzeros
virtual long int GetNumNonzeros()
Get the total number of nonzeros the ILU.
Definition: gemslr.cpp:4105
pargemslr::GemslrLevelSetupStruct::_S_ilu_max_row_nnz_setup
int _S_ilu_max_row_nnz_setup
The global MaxFil for ILUT on the S part.
Definition: gemslr.hpp:864
pargemslr::GemslrClass::SetPreconditionerOption1
int SetPreconditionerOption1(int option)
Set top level preconditioner.
Definition: gemslr.hpp:3032
pargemslr::GemslrGlobalPrecondOptionEnum
GemslrGlobalPrecondOptionEnum
The schur complement option.
Definition: gemslr.hpp:135
pargemslr::GemslrClass::SetSmoothOptionB
int SetSmoothOptionB(int option)
Set all top levels smoother.
Definition: gemslr.hpp:3095
pargemslr::GemslrClass::SetCUDAOption
int SetCUDAOption(bool cuda_lowrank_only)
Set to true to only move the low-rank part to device (the triangular solve on GPU might be slow for s...
pargemslr::GemslrLevelSetupStruct::_lr_maxits2_setup
int _lr_maxits2_setup
Set the maximum number of restart if thick-restart Arnoldi is used on other levels.
Definition: gemslr.hpp:725
pargemslr::GemslrEBFCMatrixClass::operator=
GemslrEBFCMatrixClass< MatrixType, VectorType, DataType > & operator=(const GemslrEBFCMatrixClass< MatrixType, VectorType, DataType > &precond)
The operator = of GemslrEBFCMatrixClass.
Definition: gemslr.cpp:66
pargemslr::GemslrClass::SetSolveOption
int SetSolveOption(int option)
Set the solve option. 0: additive LU solve; 1: additive L solve; 2: multi-solve.
Definition: gemslr.hpp:2400
pargemslr::FlexGmresClass
The real flexgmres solver class.
Definition: fgmres.hpp:29
pargemslr::GemslrSetupStruct::_vertexsep_setup
bool _vertexsep_setup
Set to true to use vertex seperator. Note that k must be power of 2 for vertex seperator.
Definition: gemslr.hpp:1352
pargemslr::GemslrClass::SetIluDropTolS
int SetIluDropTolS(T option)
Set the threshold for ILUT of the S part.
Definition: gemslr.hpp:2822
pargemslr::GemslrSolvePhaseEnum
GemslrSolvePhaseEnum
The solve phase.
Definition: gemslr.hpp:112
pargemslr::GemslrLevelSetupStruct::_C_solve_option
int _C_solve_option
Choose the C solve option for the last level.
Definition: gemslr.hpp:802
pargemslr::GemslrClass::SetLowRankFactorOtherLevels
int SetLowRankFactorOtherLevels(T option)
Set the low-rank factor on the other levels. The actuall computed number of low-rank terms is rank * ...
Definition: gemslr.hpp:2517
pargemslr::GemslrClass::SetBLowRankRanksTopLevel
int SetBLowRankRanksTopLevel(T option)
Set the B part target number of low-rank terms on the top level.
Definition: gemslr.hpp:2592
pargemslr::GemslrSchurSolveClass::Clear
virtual int Clear()
Free the current precondioner.
Definition: gemslr.hpp:513
pargemslr::GemslrClass::SetIluMaxRowNnzS
int SetIluMaxRowNnzS(int option)
Set the maxinum number of nonzeros ILUT of the S part.
Definition: gemslr.hpp:2905
pargemslr::GemslrLevelSetupStruct::_B_ilu_fill_level_B_setup
int _B_ilu_fill_level_B_setup
The global level of fill for ILUK.
Definition: gemslr.hpp:1044
pargemslr::GemslrClass::SetLowRankArnoldiFactorOtherLevels
int SetLowRankArnoldiFactorOtherLevels(T option)
Set the Arnoldi factor on other levels. m steps for arnoldi is rank * rank_factor * arnoldi_factor.
Definition: gemslr.hpp:2637
pargemslr::GemslrLevelSetupStruct::_lr_tol_eig2_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_tol_eig2_setup
The tolorance for eigenvalues on other levels. Eigenvalues with Schur vector smaller than it will be ...
Definition: gemslr.hpp:757
pargemslr::GemslrClass::Setup
virtual int Setup(VectorType &x, VectorType &rhs)
Setup the precondioner phase. Will be called by the solver if not called directly.
Definition: gemslr.cpp:1597
pargemslr::GemslrLevelClass::GemslrLevelClass
GemslrLevelClass()
The constructor of GemslrLevelClass, set everything to 0.
Definition: gemslr.cpp:732
pargemslr::GemslrLevelSetupStruct::_lr_rank_factor2_B_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_rank_factor2_B_setup
The factor for extra low-rank terms on other levels.
Definition: gemslr.hpp:918
pargemslr::GemslrSchurMatrixClass::GemslrSchurMatrixClass
GemslrSchurMatrixClass()
The constructor of GemslrEBFCMatrixClass.
Definition: gemslr.cpp:167
pargemslr::GemslrClass::SetBIluDropTolC
int SetBIluDropTolC(T option)
Set the recursive GeMSLR last level threshold for ILUT of the global B part.
Definition: gemslr.hpp:2864
pargemslr::GemslrClass::SetBIluMaxRowNnzC
int SetBIluMaxRowNnzC(int option)
Set the recursive GeMSLR last level maxinum number of nonzeros ILUT.
Definition: gemslr.hpp:2989
pargemslr::GemslrLevelSetupStruct::_lr_maxitsA_setup
int _lr_maxitsA_setup
Set the maximum number of restart if thick-restart Arnoldi is used on A.
Definition: gemslr.hpp:731
pargemslr::GemslrEBFCMatrixClass::~GemslrEBFCMatrixClass
virtual ~GemslrEBFCMatrixClass()
The destructor of GemslrEBFCMatrixClass.
Definition: gemslr.cpp:30
pargemslr::GemslrLevelSetupStruct::_C_ilu_tol_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _C_ilu_tol_setup
The droptol for ILUT on the last level.
Definition: gemslr.hpp:830
pargemslr::GemslrClass::SetNumberSubdomainsReduceFactor
int SetNumberSubdomainsReduceFactor(int option)
Set the global reduce factor of subdomains on each level of GeMSLR.
Definition: gemslr.hpp:2305
pargemslr::GemslrClass::MoveData
virtual int MoveData(const int &location)
Move the preconditioner to another location. Only can be called after Setup.
Definition: gemslr.cpp:4158
pargemslr::GemslrClass::SetLowRankRandomInitGuess
int SetLowRankRandomInitGuess(bool option)
Set if we use random initial guess for Arnoldi. Otherwise we use 1 as initial guess.
Definition: gemslr.hpp:2475
pargemslr::GemslrSetupStruct::_perm_option_B_setup
int _perm_option_B_setup
Set the local B reordering option. For B part is GeMSLR is used.
Definition: gemslr.hpp:1372
pargemslr::GemslrEBFCMatrixClass::GetNumColsLocal
int GetNumColsLocal()
Get the local number of columns of the matrix.
Definition: gemslr.cpp:145
pargemslr::GemslrClass::_levs_v
std::vector< GemslrLevelClass< MatrixType, VectorType, DataType > > _levs_v
Vector holding the level struct for all levels starting from the second level. The size of this vecto...
Definition: gemslr.hpp:1816
pargemslr::GemslrClass::SetInnerIterationMaxNumberIterations
int SetInnerIterationMaxNumberIterations(int option)
Set the max number of iterations of inner iteration of GeMSLR.
Definition: gemslr.hpp:2386
ilu.hpp
ILU preconditioner.
pargemslr::GemslrLevelSetupStruct::SetDefault
void SetDefault()
Set to default value.
Definition: gemslr.cpp:333
pargemslr::GemslrLevelSetupStruct::_B_ilu_fill_level_setup
int _B_ilu_fill_level_setup
The global level of fill for ILUK.
Definition: gemslr.hpp:870
pargemslr::GemslrLevelSetupStruct::_lr_option2_B_setup
int _lr_option2_B_setup
Set the Arnoldi iteration option for building the low-rank correction on other levels.
Definition: gemslr.hpp:896
pargemslr::SequentialVectorClass
The class of sequential real/complex vector.
Definition: structs.hpp:12
pargemslr::GemslrSetupStruct::_inner_iters_tol_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _inner_iters_tol_setup
The default convergence_tolorance to lock the eigenvalue.
Definition: gemslr.hpp:1440
pargemslr::GemslrLevelSetupStruct::_EF_ilu_tol_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _EF_ilu_tol_setup
The droptol for ILUT on the EF part.
Definition: gemslr.hpp:846
pargemslr::GemslrClass::SolveLevel
int SolveLevel(VectorType &x, VectorType &rhs, int level)
Solve starting from a certain level.
Definition: gemslr.cpp:3455
pargemslr::GemslrBSolveOptionEnum
GemslrBSolveOptionEnum
The B Solve option.
Definition: gemslr.hpp:63
pargemslr::GemslrLevelSetupStruct::_lr_rank1_B_setup
int _lr_rank1_B_setup
Set the target number of low-rank terms we keep on the top level.
Definition: gemslr.hpp:924
pargemslr::GemslrClass::SetBIluFillLevelC
int SetBIluFillLevelC(int option)
Set the fill level for ILUK of the last level.
Definition: gemslr.hpp:2961
pargemslr::GemslrLevelSetupStruct::_lr_rank_factorA_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_rank_factorA_setup
The factor for extra low-rank terms on A.
Definition: gemslr.hpp:671
pargemslr::GemslrClass::SetLowRankThresholdTopLevel
int SetLowRankThresholdTopLevel(T option)
Set max restarts of thick-restart Arnoldi on the top level.
Definition: gemslr.hpp:2738
pargemslr::GemslrSetupStruct::_vertexsep_B_setup
bool _vertexsep_B_setup
Set to true to use vertex seperator. Note that k must be power of 2 for vertex seperator....
Definition: gemslr.hpp:1404
pargemslr::GemslrBSmoothOptionEnum
GemslrBSmoothOptionEnum
The B Smoothing option.
Definition: gemslr.hpp:74
pargemslr::GemslrCSolveOptionEnum
GemslrCSolveOptionEnum
The C Solve option.
Definition: gemslr.hpp:97
pargemslr::GemslrLevelClass::GetNumNonzeros
int GetNumNonzeros(long int &nnz_bsolver, long int &nnz_lr)
Get the number of nonzeros in the low-rank correction and the ILU factorization on this level.
Definition: gemslr.cpp:1153
pargemslr::GemslrLevelClass::operator=
GemslrLevelClass< MatrixType, VectorType, DataType > & operator=(const GemslrLevelClass< MatrixType, VectorType, DataType > &str)
The operator= of GemslrLevelClass.
Definition: gemslr.cpp:923
pargemslr::GemslrLowRankOptionEnum
GemslrLowRankOptionEnum
The low-rank option.
Definition: gemslr.hpp:31
pargemslr::GemslrClass::SetLowRankRanksOtherLevels
int SetLowRankRanksOtherLevels(T option)
Set the target number of low-rank terms on the other levels.
Definition: gemslr.hpp:2577
pargemslr::GemslrLevelSetupStruct::_B_ilu_max_row_nnz_B_setup
int _B_ilu_max_row_nnz_B_setup
The global MaxFil for ILUT.
Definition: gemslr.hpp:1032
pargemslr::GemslrLevelClass::_xlr_temp
VectorType _xlr_temp
Temp vector.
Definition: gemslr.hpp:1207
pargemslr::GemslrSchurSolveClass::MoveData
virtual int MoveData(const int &location)
Move the preconditioner to another location. Only can be called after Setup.
Definition: gemslr.hpp:590
pargemslr::GemslrClass::SetPolyOrder
int SetPolyOrder(int option)
Set poly order for Poly solve of the B part.
Definition: gemslr.hpp:3003
pargemslr::GemslrSetupStruct::_ncomp_B_setup
int _ncomp_B_setup
The target number of subdomians on each level in the B part if GeMSLR is used.
Definition: gemslr.hpp:1384
pargemslr::GemslrLevelSetupStruct::_lr_rank_factor2_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_rank_factor2_setup
The factor for extra low-rank terms on other levels.
Definition: gemslr.hpp:663
pargemslr::GemslrLevelClass::_z_temp
VectorType _z_temp
Temp vector.
Definition: gemslr.hpp:1189
pargemslr::GemslrLevelClass::_B_solver
SolverClass< MatrixType, VectorType, DataType > ** _B_solver
The solvers for B matrix.
Definition: gemslr.hpp:1165
pargemslr::GemslrLevelSetupStruct::_B_smooth_option1
int _B_smooth_option1
Choose the B smooth option before the last level.
Definition: gemslr.hpp:790
pargemslr::GemslrLevelClass::_Wk
DenseMatrixClass< DataType > _Wk
The W matrix for the low-rank correction W*H*W' on this level.
Definition: gemslr.hpp:1177
pargemslr::SolverClass::_ready
bool _ready
If the solver is ready.
Definition: solver.hpp:108
pargemslr::GemslrLevelSetupStruct::_lr_tr_factor_B_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_tr_factor_B_setup
The thick-restart factor. Portion of thick-resratr length comparing to the entire width.
Definition: gemslr.hpp:966
pargemslr::SolverClass
The base solver class.
Definition: solver.hpp:47
pargemslr::GemslrLevelClass::_C_mat
MatrixType _C_mat
The C matrix on this level.
Definition: gemslr.hpp:1141
pargemslr::ComplexValueClass
The template class complex.
Definition: complex.hpp:24
pargemslr::GemslrLevelSetupStruct::_lr_tol_eig2_B_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_tol_eig2_B_setup
The tolorance for eigenvalues on other levels. Eigenvalues with Schur vector smaller than it will be ...
Definition: gemslr.hpp:986
pargemslr::GemslrLevelClass::_w_temp
VectorType _w_temp
Temp vector.
Definition: gemslr.hpp:1201
pargemslr::IntVectorClass< int >
pargemslr::GemslrClass::SetIluDropTolC
int SetIluDropTolC(T option)
Set the threshold for ILUT of the last level.
Definition: gemslr.hpp:2808
pargemslr::GemslrLevelSetupStruct::_B_solve_option2
int _B_solve_option2
Choose the B solve option before the last level.
Definition: gemslr.hpp:784
pargemslr::GemslrLevelSetupStruct::_lr_maxits1_B_setup
int _lr_maxits1_B_setup
Set the maximum number of restart if thick-restart Arnoldi is used on the top level.
Definition: gemslr.hpp:952
pargemslr::GemslrClass::SetBPartitionOption
int SetBPartitionOption(int option)
Set the B part partition option. 0: ND; 1: RKway.
Definition: gemslr.hpp:2176
pargemslr::GemslrClass::GetNumRows
int GetNumRows(int level)
Get the local number of rows on certain level for the low-rank part.
Definition: gemslr.cpp:3704
pargemslr::GemslrClass::SetLocalGemslr
virtual int SetLocalGemslr(GemslrClass< MatrixType, VectorType, DataType > &gemslr)
Setup with parameter array. This is the helper function to set the local gemslr for B solve.
Definition: gemslr.hpp:1997
pargemslr::GemslrClass::SetIluDropTolEF
int SetIluDropTolEF(T option)
Set the threshold for ILUT of the EF part.
Definition: gemslr.hpp:2836
pargemslr::GemslrLevelSetupStruct::_B_ilu_tol_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _B_ilu_tol_setup
The global droptol for ILUT.
Definition: gemslr.hpp:822
pargemslr::GemslrSchurMatrixClass::Setup
int Setup(int level, GemslrClass< MatrixType, VectorType, DataType > &gemslr)
Set the current matrix to a certain GEMSLR level.
Definition: gemslr.cpp:255
pargemslr::GemslrLevelClass::_E_mat
MatrixType _E_mat
The E matrix on this level.
Definition: gemslr.hpp:1129
pargemslr::GemslrSetupStruct::_solve_option_setup
int _solve_option_setup
The GEMSLR options.
Definition: gemslr.hpp:1446
pargemslr::GemslrSetupStruct::_solve_phase_setup
int _solve_phase_setup
Set the solve phase of the preconditioner.
Definition: gemslr.hpp:1412
pargemslr::GemslrLevelSetupStruct::_lr_rank_factor1_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_rank_factor1_setup
The factor for extra low-rank terms on the top level.
Definition: gemslr.hpp:655
pargemslr::GemslrSchurMatrixClass::_temp_v
VectorType _temp_v
Temp vector for the Arnoldi.
Definition: gemslr.hpp:337
pargemslr::GemslrLevelSetupStruct::_lr_rankA_setup
int _lr_rankA_setup
Set the target number of low-rank terms we keep for the A.
Definition: gemslr.hpp:689
pargemslr::GemslrClass::SetBIluMaxRowNnzB
int SetBIluMaxRowNnzB(int option)
Set the recursive GeMSLR B part maxinum number of nonzeros ILUT.
Definition: gemslr.hpp:2975
pargemslr::GemslrSchurSolveClass::GemslrSchurSolveClass
GemslrSchurSolveClass(GemslrSchurSolveClass< MatrixType, VectorType, DataType > &&precond)
The move constructor of GemslrSchurSolveClass class.
Definition: gemslr.hpp:481
pargemslr::GemslrClass::SetBNumLevels
int SetBNumLevels(int option)
Set the B part target number of levels of GeMSLR.
Definition: gemslr.hpp:2235
pargemslr::GemslrSmoothingOptionEnum
GemslrSmoothingOptionEnum
The Smoothing option for the multiplicative solve.
Definition: gemslr.hpp:86
pargemslr::GemslrClass::Clear
virtual int Clear()
Free the current precondioner.
Definition: gemslr.cpp:1558
pargemslr::GemslrSchurMatrixClass::Clear
int Clear()
Free the current matrix.
Definition: gemslr.cpp:242
pargemslr::GemslrClass::SetBMinimalNumberSubdomains
int SetBMinimalNumberSubdomains(int option)
Set the B part minimal number of subdomains on each level of GeMSLR.
Definition: gemslr.hpp:2291
pargemslr::GemslrLevelSetupStruct::_lr_option1_setup
int _lr_option1_setup
Set the Arnoldi iteration option for building the low-rank correction on the top level.
Definition: gemslr.hpp:629
pargemslr::SolverClass::_print_option
int _print_option
The print option.
Definition: solver.hpp:114
pargemslr::GemslrLevelSetupStruct::operator=
GemslrLevelSetupStruct< DataType > & operator=(const GemslrLevelSetupStruct< DataType > &str)
The operator =.
Definition: gemslr.cpp:594
pargemslr::GemslrClass::~GemslrClass
virtual ~GemslrClass()
The destructor of precondioner class.
Definition: gemslr.cpp:1548
pargemslr::GemslrClass::SetInnerIterationOption
int SetInnerIterationOption(bool option)
Set the inner iteration option of GeMSLR.
Definition: gemslr.hpp:2359
pargemslr::GemslrClass::SetBLowRankOptionOtherLevels
int SetBLowRankOptionOtherLevels(int option)
Set the B part low-rank option on other levels. 0: Standard. 1: Thick-restart.
Definition: gemslr.hpp:2460
pargemslr::GemslrLevelClass::Clear
int Clear()
Free the current level structure, set everything to 0.
Definition: gemslr.cpp:1098
pargemslr::GemslrClass::SetPartitionOption
int SetPartitionOption(int option)
Set the global partition option. 0: ND; 1: RKway.
Definition: gemslr.hpp:2161
pargemslr::GemslrClass::SetLowRankMaxNumberIterationsTopLevel
int SetLowRankMaxNumberIterationsTopLevel(int option)
Set max restarts of thick-restart Arnoldi on the top level.
Definition: gemslr.hpp:2681
pargemslr::GemslrEBFCMatrixClass::GetComm
MPI_Comm GetComm() const
Get the MPI_comm.
Definition: gemslr.hpp:282
pargemslr::GemslrLevelClass::_F_mat
MatrixType _F_mat
The F matrix on this level.
Definition: gemslr.hpp:1135
pargemslr::GemslrLevelSetupStruct::_B_poly_order
int _B_poly_order
The order for poly for the B blocks.
Definition: gemslr.hpp:882
pargemslr::GemslrLevelClass::_v_temp
VectorType _v_temp
Temp vector.
Definition: gemslr.hpp:1195
pargemslr::GemslrClass::SetLowRankOptionOtherLevels
int SetLowRankOptionOtherLevels(int option)
Set the low-rank option on other levels. 0: Standard. 1: Thick-restart.
Definition: gemslr.hpp:2430
pargemslr::GemslrSetupStruct::_enable_inner_iters_setup
bool _enable_inner_iters_setup
The level of inner iteration. Solve Sx = b with preconditioned GMRES where GeMSLR is used as a precon...
Definition: gemslr.hpp:1425
pargemslr::GemslrLevelSetupStruct::_C_ilu_max_row_nnz_B_setup
int _C_ilu_max_row_nnz_B_setup
The global MaxFil for ILUT on the last level.
Definition: gemslr.hpp:1038
pargemslr::GemslrSchurMatrixClass
Class of matvec EB^{-1}FC^{-1}.
Definition: gemslr.hpp:314
pargemslr::GemslrLevelClass
The GEMSLR information on each level, contains the solver for B and the low-rank information for S.
Definition: gemslr.hpp:1103
pargemslr::GemslrClass::SetLowRankFactorTopLevel
int SetLowRankFactorTopLevel(T option)
Set the low-rank factor on the top level. The actuall computed number of low-rank terms is rank * fac...
Definition: gemslr.hpp:2502
pargemslr::GemslrSchurMatrixClass::operator=
GemslrSchurMatrixClass< MatrixType, VectorType, DataType > & operator=(const GemslrSchurMatrixClass< MatrixType, VectorType, DataType > &precond)
The operator = of GemslrSchurMatrixClass.
Definition: gemslr.cpp:214
pargemslr::GemslrLevelClass::_y_temp
VectorType _y_temp
Temp vector.
Definition: gemslr.hpp:1183
pargemslr::GemslrClass::CMatVec
int CMatVec(int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
The matvec function y = alpha*Ci*x+beta*y.
Definition: gemslr.cpp:3932
pargemslr::GemslrEBFCMatrixClass::MatVec
int MatVec(char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
In place csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
Definition: gemslr.cpp:156
pargemslr::GemslrSolveOptionEnum
GemslrSolveOptionEnum
The solve option.
Definition: gemslr.hpp:123
pargemslr::GemslrClass::SetIluMaxRowNnzC
int SetIluMaxRowNnzC(int option)
Set the maxinum number of nonzeros ILUT of the last level.
Definition: gemslr.hpp:2891
pargemslr::GemslrSchurMatrixClass::SetupVectorPtrStr
int SetupVectorPtrStr(VectorType &v)
Set the structure of a vector pointer that has same row partition as this matrix.
Definition: gemslr.cpp:270
pargemslr::GemslrClass::SetBPermutationOption
int SetBPermutationOption(int option)
Set the B part permutation option. 0: No; 1: RCM; 2: AMD.
Definition: gemslr.hpp:2206
pargemslr::GemslrSchurSolveClass::operator=
GemslrSchurSolveClass< MatrixType, VectorType, DataType > & operator=(GemslrSchurSolveClass< MatrixType, VectorType, DataType > &&precond)
The operator = of GemslrSchurSolveClass class.
Definition: gemslr.hpp:501
pargemslr::GemslrClass::SolveB
int SolveB(VectorType &x, VectorType &rhs, int level)
Solve with B on a certain level.
Definition: gemslr.cpp:3613
pargemslr::GemslrClass::SetBPolyOrder
int SetBPolyOrder(int option)
Set poly order for Poly solve of the B part of the recursive GeMSLR.
Definition: gemslr.hpp:3017
pargemslr::GemslrClass::SetIluMaxRowNnzB
int SetIluMaxRowNnzB(int option)
Set the maxinum number of nonzeros for ILUT of the B part.
Definition: gemslr.hpp:2877
pargemslr::GemslrLevelSetupStruct::_C_ilu_fill_level_B_setup
int _C_ilu_fill_level_B_setup
The global level of fill for ILUK on the last level.
Definition: gemslr.hpp:1050
pargemslr::GemslrSetupStruct::_partition_option_B_setup
int _partition_option_B_setup
Set the partition option. For B part is GeMSLR is used.
Definition: gemslr.hpp:1366
pargemslr::GemslrSchurMatrixClass::MatVec
int MatVec(char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
In place csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
Definition: gemslr.cpp:282
pargemslr::GemslrEBFCMatrixClass::Setup
int Setup(int level, GemslrClass< MatrixType, VectorType, DataType > &gemslr)
Set the current matrix to a certain GEMSLR level.
Definition: gemslr.cpp:107
pargemslr::GemslrEBFCMatrixClass::GetMpiInfo
int GetMpiInfo(int &np, int &myid, MPI_Comm &comm) const
Get comm, np, and myid. Get the global one.
Definition: gemslr.hpp:269
pargemslr::GemslrLevelClass::_xlr2_temp
VectorType _xlr2_temp
Temp vector.
Definition: gemslr.hpp:1219
pargemslr::GemslrLevelSetupStruct::_lr_arnoldi_factorA_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_arnoldi_factorA_setup
Set the maximum steps of the Arnoldi iteration on A.
Definition: gemslr.hpp:713
pargemslr::GemslrLevelClass::_B_mat_v
std::vector< MatrixType > _B_mat_v
The B matrix on this level. C matrix if this is the last level.
Definition: gemslr.hpp:1123
pargemslr::GemslrLevelSetupStruct::_C_solve_option_B
int _C_solve_option_B
Choose the C solve option for the last level.
Definition: gemslr.hpp:1010
pargemslr::GemslrSetupStruct::_cuda_lowrank_only
bool _cuda_lowrank_only
Are we only going to put the low-rank part on the device?
Definition: gemslr.hpp:1418
pargemslr::GemslrClass::SetSeperatorOption
int SetSeperatorOption(bool option)
Set the global separator option of GeMSLR.
Definition: gemslr.hpp:2333
pargemslr::GemslrClass::SetBLowRankOptionTopLevel
int SetBLowRankOptionTopLevel(int option)
Set the B part low-rank option on the top level. 0: Standard. 1: Thick-restart.
Definition: gemslr.hpp:2445
pargemslr::GemslrSetupStruct::_nlev_setup
int _nlev_setup
The total number of levels user wants to have.
Definition: gemslr.hpp:1326
pargemslr::GemslrSetupStruct::_kmin_B_setup
int _kmin_B_setup
The minimal number of subdomains user wants on each level in the recursive Kway partition in the B pa...
Definition: gemslr.hpp:1390
pargemslr::GemslrSetupStruct::_diag_shift_milu
DataType _diag_shift_milu
The diagonal shift for the modified ILU.
Definition: gemslr.hpp:1458
pargemslr::SolverClass::_matrix
MatrixType * _matrix
The matrix.
Definition: solver.hpp:72
pargemslr::GemslrClass::SetBLowRankRanksOtherLevels
int SetBLowRankRanksOtherLevels(T option)
Set the B part target number of low-rank terms on the other levels.
Definition: gemslr.hpp:2607
pargemslr::GemslrLevelSetupStruct::_lr_maxits1_setup
int _lr_maxits1_setup
Set the maximum number of restart if thick-restart Arnoldi is used on the top level.
Definition: gemslr.hpp:719
pargemslr::GemslrClass::SetBLowRankMaxNumberIterationsOtherLevels
int SetBLowRankMaxNumberIterationsOtherLevels(int option)
Set B part max restarts of thick-restart Arnoldi on other levels.
Definition: gemslr.hpp:2723
pargemslr::GemslrClass::SetWithParameterArray
virtual int SetWithParameterArray(double *params)
Setup with parameter array.
Definition: gemslr.hpp:2061
pargemslr::GemslrClass::GetSolvePhase
int GetSolvePhase()
Get the solve phase.
Definition: gemslr.hpp:3177
pargemslr::GemslrLevelClass::_EBFC
GemslrEBFCMatrixClass< MatrixType, VectorType, DataType > _EBFC
The EBFC matrix on this level.
Definition: gemslr.hpp:1153
pargemslr::GemslrLevelSetupStruct::_lr_rand_init_B_setup
bool _lr_rand_init_B_setup
Set to true to use random initial guess, otherwise use the unit vector.
Definition: gemslr.hpp:902
pargemslr::GemslrLevelSetupStruct::_lr_tol_eig1_B_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_tol_eig1_B_setup
The tolorance for eigenvalues on the top level. Eigenvalues with Schur vector smaller than it will be...
Definition: gemslr.hpp:976
pargemslr::GemslrClass::SetMinimalNumberSubdomains
int SetMinimalNumberSubdomains(int option)
Set the global minimal number of subdomains on each level of GeMSLR.
Definition: gemslr.hpp:2277
pargemslr::GemslrSchurSolveClass::~GemslrSchurSolveClass
virtual ~GemslrSchurSolveClass()
The destructor of precondioner class.
Definition: gemslr.hpp:519
pargemslr::GemslrSetupStruct::_kmin_setup
int _kmin_setup
The minimal number of subdomains user wants on each level in the recursive Kway partition.
Definition: gemslr.hpp:1338
pargemslr::GemslrClass::SetIluDropTolB
int SetIluDropTolB(T option)
Set the threshold for ILUT of the B part.
Definition: gemslr.hpp:2794
pargemslr::GemslrSchurSolveClass::GemslrSchurSolveClass
GemslrSchurSolveClass(const GemslrSchurSolveClass< MatrixType, VectorType, DataType > &precond)
The copy constructor of GemslrSchurSolveClass class.
Definition: gemslr.hpp:472
pargemslr::GemslrClass::SetPreconditionerOptionB
int SetPreconditionerOptionB(int option)
Set all top levels preconditioner.
Definition: gemslr.hpp:3078
pargemslr::GemslrSetupStruct::_global_partition_setup
bool _global_partition_setup
Set to true to use vertex seperator. Note that k must be power of 2 for vertex seperator.
Definition: gemslr.hpp:1358
pargemslr::GemslrEBFCMatrixClass::_temp_v
VectorType _temp_v
Temp vector for the Arnoldi.
Definition: gemslr.hpp:173
pargemslr::GemslrLevelClass::~GemslrLevelClass
~GemslrLevelClass()
The destructor of GemslrLevelClass.
Definition: gemslr.cpp:745
pargemslr::GemslrLevelSetupStruct::_lr_arnoldi_factor1_B_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_arnoldi_factor1_B_setup
Set the maximum steps of the Arnoldi iteration on the top level.
Definition: gemslr.hpp:938
pargemslr::GemslrLevelSetupStruct::GemslrLevelSetupStruct
GemslrLevelSetupStruct()
The constructor, set the default values.
Definition: gemslr.cpp:392
pargemslr::GemslrSetupStruct::_kfactor_B_setup
int _kfactor_B_setup
In the recursive Kway partition, from the second level, each time the number of terget subdomains is ...
Definition: gemslr.hpp:1398
pargemslr::GemslrClass::SetBLowRankMaxNumberIterationsTopLevel
int SetBLowRankMaxNumberIterationsTopLevel(int option)
Set B part max restarts of thick-restart Arnoldi on the top level.
Definition: gemslr.hpp:2709
pargemslr::GemslrReorderingOptionEnum
GemslrReorderingOptionEnum
The reordering option.
Definition: gemslr.hpp:52
pargemslr::GemslrLevelSetupStruct::_lr_arnoldi_factor2_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_arnoldi_factor2_setup
Set the maximum steps of the Arnoldi iteration on other levels.
Definition: gemslr.hpp:705
pargemslr::GemslrLevelSetupStruct::_C_ilu_max_row_nnz_setup
int _C_ilu_max_row_nnz_setup
The global MaxFil for ILUT on the last level.
Definition: gemslr.hpp:858
pargemslr::GemslrSetupStruct::_partition_option_setup
int _partition_option_setup
Set the partition option.
Definition: gemslr.hpp:1312
pargemslr::GemslrLevelClass::_Hk
DenseMatrixClass< DataType > _Hk
The H matrix for the low-rank correction W*H*W' on this level.
Definition: gemslr.hpp:1171
pargemslr::GemslrClass::SetBLowRankArnoldiFactorTopLevel
int SetBLowRankArnoldiFactorTopLevel(T option)
Set the B part Arnoldi factor on the top level. m steps for arnoldi is rank * rank_factor * arnoldi_f...
Definition: gemslr.hpp:2652
pargemslr::GemslrLevelSetupStruct::_B_ilu_max_row_nnz_setup
int _B_ilu_max_row_nnz_setup
The global MaxFil for ILUT.
Definition: gemslr.hpp:852
pargemslr::GemslrClass::SetInnerIterationThreshold
int SetInnerIterationThreshold(T option)
Set the stop threshold of inner iteration of GeMSLR.
Definition: gemslr.hpp:2373
pargemslr::GemslrSchurSolveClass
Class of matvec EB^{-1}FC^{-1}.
Definition: gemslr.hpp:459
pargemslr::GemslrClass::SetSolveLocation
virtual int SetSolveLocation(const int &location)
Set the data location that the preconditioner apply to.
Definition: gemslr.cpp:4140
pargemslr::GemslrSchurSolveClass::operator=
GemslrSchurSolveClass< MatrixType, VectorType, DataType > & operator=(const GemslrSchurSolveClass< MatrixType, VectorType, DataType > &precond)
The operator = of GemslrSchurSolveClass class.
Definition: gemslr.hpp:490
pargemslr::GemslrEBFCMatrixClass::SetupVectorPtrStr
int SetupVectorPtrStr(VectorType &v)
Set the structure of a vector pointer that has same row partition as this matrix.
Definition: gemslr.cpp:122
pargemslr::GemslrLevelSetupStruct::_B_poly_order_B
int _B_poly_order_B
The order for poly for the B blocks.
Definition: gemslr.hpp:1056
pargemslr::GemslrSchurSolveClass::SetSolveLocation
virtual int SetSolveLocation(const int &location)
Set the data location that the preconditioner apply to.
Definition: gemslr.hpp:582
pargemslr::GemslrSchurSolveClass::GemslrSchurSolveClass
GemslrSchurSolveClass()
The constructor of precondioner class.
Definition: gemslr.hpp:466
pargemslr::GemslrClass::SetBLowRankThresholdTopLevel
int SetBLowRankThresholdTopLevel(T option)
Set B part max restarts of thick-restart Arnoldi on the top level.
Definition: gemslr.hpp:2766
pargemslr::GemslrClass::SetLowRankRanksTopLevel
int SetLowRankRanksTopLevel(T option)
Set the target number of low-rank terms on the top level.
Definition: gemslr.hpp:2562
pargemslr::GemslrSetupStruct::GemslrSetupStruct
GemslrSetupStruct()
The constructor, set the default values.
Definition: gemslr.cpp:1185
pargemslr::GemslrSetupStruct::_ncomp_setup
int _ncomp_setup
The target number of subdomians on each level.
Definition: gemslr.hpp:1332
pargemslr::GemslrClass::GemslrClass
GemslrClass()
The constructor of precondioner class.
Definition: gemslr.cpp:1388
pargemslr::SolverClass::operator=
SolverClass< MatrixType, VectorType, DataType > & operator=(const SolverClass< MatrixType, VectorType, DataType > &solver)
The = operator of solver class.
Definition: solver.hpp:210
pargemslr::GemslrSchurMatrixClass::GetComm
MPI_Comm GetComm() const
Get the MPI_comm.
Definition: gemslr.hpp:441
pargemslr::GemslrClass::SolveApplyLowRankLevel
int SolveApplyLowRankLevel(VectorType &x, VectorType &rhs, int level)
Apply the low-rank update on a certain level.
Definition: gemslr.cpp:3662
pargemslr::GemslrLevelSetupStruct::_S_ilu_tol_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _S_ilu_tol_setup
The droptol for ILUT on the S part.
Definition: gemslr.hpp:838
pargemslr::GemslrLevelClass::_D_mat
MatrixType _D_mat
The D matrix on this level.
Definition: gemslr.hpp:1147
pargemslr::GemslrSchurSolveClass::SetWithParameterArray
virtual int SetWithParameterArray(double *params)
Setup with parameter array.
Definition: gemslr.hpp:600
pargemslr::GemslrLevelSetupStruct::_lr_rank2_setup
int _lr_rank2_setup
Set the target number of low-rank terms we keep on other levels.
Definition: gemslr.hpp:683
pargemslr::GemslrLevelSetupStruct::_B_solve_option1_levels_B
int _B_solve_option1_levels_B
From level 0 to this level (exclude) we apply B_solve option 1.
Definition: gemslr.hpp:998
pargemslr::GemslrLevelSetupStruct::_lr_rank1_setup
int _lr_rank1_setup
Set the target number of low-rank terms we keep on the top level.
Definition: gemslr.hpp:677
pargemslr::GemslrLevelSetupStruct::_B_ilu_tol_B_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _B_ilu_tol_B_setup
The global droptol for ILUT.
Definition: gemslr.hpp:1018
pargemslr::GemslrLevelSetupStruct::_lr_rank_factor1_B_setup
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _lr_rank_factor1_B_setup
The factor for extra low-rank terms on the top level.
Definition: gemslr.hpp:910
pargemslr::GemslrEBFCMatrixClass::GetNumRowsLocal
int GetNumRowsLocal()
Get the local number of rows of the matrix.
Definition: gemslr.cpp:134
pargemslr::GemslrLevelSetupStruct::_lr_option2_setup
int _lr_option2_setup
Set the Arnoldi iteration option for building the low-rank correction on other levels.
Definition: gemslr.hpp:635
pargemslr::SolverClass::Clear
virtual int Clear()
Free the current solver.
Definition: solver.hpp:264
pargemslr::GemslrClass::SetPreconditionerOptionC
int SetPreconditionerOptionC(int option)
Set last level preconditioner.
Definition: gemslr.hpp:3111
pargemslr::GemslrLevelSetupStruct::_B_solve_option1_levels
int _B_solve_option1_levels
From level 0 to this level (exclude) we apply B_solve option 1.
Definition: gemslr.hpp:778