Go to the documentation of this file. 1 #ifndef PARGEMSLR_GEMSLR_H
2 #define PARGEMSLR_GEMSLR_H
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"
32 kGemslrLowrankNoRestart,
33 kGemslrLowrankThickRestart,
34 kGemslrLowrankSubspaceIteration
53 kGemslrReorderingNoExtra,
89 kGemslrSmoothingL1Jacobi
102 kGemslrCSolveBJILUT2,
103 kGemslrCSolveBJILUK2,
136 kGemslrGlobalPrecondBJ,
137 kGemslrGlobalPrecondESMSLR,
138 kGemslrGlobalPrecondGeMSLR,
139 kGemslrGlobalPrecondPSLR,
140 kGemslrGlobalPrecondPCLR,
141 kGemslrGlobalPrecondA
148 template <
class MatrixType,
class VectorType,
typename DataType>
259 int MatVec(
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
271 comm = *parallel_log::_lcomm;
274 return PARGEMSLR_SUCCESS;
284 return *parallel_log::_lcomm;
296 return this->_gemslr->GetMatrix()->GetDataLocation();
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;
312 template <
class MatrixType,
class VectorType,
typename DataType>
409 int MatVec(
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
418 int Solve( VectorType &x, VectorType &rhs);
430 comm = *parallel_log::_lcomm;
433 return PARGEMSLR_SUCCESS;
443 return *parallel_log::_lcomm;
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;
457 template <
class MatrixType,
class VectorType,
typename DataType>
528 virtual int Setup( VectorType &x, VectorType &rhs)
532 return PARGEMSLR_SUCCESS;
537 PARGEMSLR_ERROR(
"Setup without matrix.");
538 return PARGEMSLR_ERROR_INVALED_PARAM;
543 return PARGEMSLR_SUCCESS;
554 virtual int Solve( VectorType &x, VectorType &rhs)
559 PARGEMSLR_ERROR(
"Solve without setup.");
560 return PARGEMSLR_ERROR_FUNCTION_CALL_ERR;
565 return PARGEMSLR_SUCCESS;
590 virtual int MoveData(
const int &location){
return PARGEMSLR_SUCCESS;};
602 this->
_print_option = params[PARGEMSLR_IO_GENERAL_PRINT_LEVEL];
603 return PARGEMSLR_SUCCESS;
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;
617 template <
typename DataType>
653 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
661 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
669 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
695 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
703 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
711 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
737 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
746 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
755 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
764 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
820 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
828 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
836 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
844 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
908 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
916 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
936 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
944 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
964 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
974 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
984 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
1016 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
1024 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
1101 template <
class MatrixType,
class VectorType,
typename DataType>
1286 template <
typename DataType>
1438 typename std::conditional<PargemslrIsDoublePrecision<DataType>::value,
1503 template <
class MatrixType,
class VectorType,
typename DataType>
1531 VectorType, DataType> _inner_iters_precond;
1538 VectorType, DataType> _inner_iters_solver;
1563 std::vector<IntVectorClass<int> > _dom_ptr_v2;
1594 VectorType _rhs_temp;
1602 template <
typename T1,
typename T2>
1603 static T1 ComputeDistance(T2 val);
1614 template <
typename RealDataType>
1626 template <
typename RealDataType>
1636 int SetupPermutation();
1646 int SetupPermutationRKway(
int &nlev_max,
int &nlev_used,
vector_int &map_v,
vector_int &mapptr_v);
1653 int SetupPermutationND(
int &nlev_max,
int &nlev_used,
vector_int &map_v,
vector_int &mapptr_v);
1673 int SetupBSolve( VectorType &x, VectorType &rhs);
1683 int SetupBSolveILUT( VectorType &x, VectorType &rhs,
int level);
1693 int SetupBSolveILUK( VectorType &x, VectorType &rhs,
int level);
1703 int SetupBSolveGemslr( VectorType &x, VectorType &rhs,
int level);
1714 int SetupLowRank( VectorType &x, VectorType &rhs);
1724 int SetupLowRankSubspaceIteration( VectorType &x, VectorType &rhs,
int level);
1734 int SetupLowRankNoRestart( VectorType &x, VectorType &rhs,
int level);
1744 int SetupLowRankThickRestart( VectorType &x, VectorType &rhs,
int level);
1764 template <
typename RealDataType>
1775 template <
typename RealDataType>
1816 std::vector< GemslrLevelClass< MatrixType, VectorType, DataType> >
_levs_v;
1829 virtual int Clear();
1870 virtual int Setup( VectorType &x, VectorType &rhs);
1881 virtual int Solve( VectorType &x, VectorType &rhs);
1893 int SolveLevel( VectorType &x, VectorType &rhs,
int level);
1903 int SolveB( VectorType &x, VectorType &rhs,
int level);
1936 int EBFCMatVec(
int level,
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
1950 int SchurMatVec(
int level,
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
1964 int CMatVec(
int level,
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
1987 long int GetNumNonzeros(
long int &nnz_bsolver,
long int &nnz_lr);
2000 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"Gemslr_SetLocalGemslr."));
2005 gemslr.SetPrintOption(0);
2052 return PARGEMSLR_SUCCESS;
2064 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"Gemslr_SetWithParameterArray."));
2069 this->_print_option = params[PARGEMSLR_IO_GENERAL_PRINT_LEVEL];
2075 this->_gemslr_setups.
_perm_option_setup = params[PARGEMSLR_IO_ILU_PERM_OPTION_GLOBAL];
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;
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];
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];
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];
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];
2128 pargemslr_global::_gram_schmidt = params[PARGEMSLR_IO_ADVANCED_GRAM_SCHMIDT];
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];
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];
2152 return PARGEMSLR_SUCCESS;
2163 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2164 PARGEMSLR_FIRM_CHKERR(option < 0);
2165 PARGEMSLR_FIRM_CHKERR(option > 1);
2167 return PARGEMSLR_SUCCESS;
2178 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2179 PARGEMSLR_FIRM_CHKERR(option < 0);
2180 PARGEMSLR_FIRM_CHKERR(option > 1);
2182 return PARGEMSLR_SUCCESS;
2193 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2194 PARGEMSLR_FIRM_CHKERR(option < 0);
2195 PARGEMSLR_FIRM_CHKERR(option > 2);
2197 return PARGEMSLR_SUCCESS;
2208 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2209 PARGEMSLR_FIRM_CHKERR(option < 0);
2210 PARGEMSLR_FIRM_CHKERR(option > 2);
2212 return PARGEMSLR_SUCCESS;
2223 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2224 PARGEMSLR_FIRM_CHKERR(option < 1);
2226 return PARGEMSLR_SUCCESS;
2237 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2238 PARGEMSLR_FIRM_CHKERR(option < 1);
2240 return PARGEMSLR_SUCCESS;
2251 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2252 PARGEMSLR_FIRM_CHKERR(option < 1);
2254 return PARGEMSLR_SUCCESS;
2265 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2266 PARGEMSLR_FIRM_CHKERR(option < 1);
2268 return PARGEMSLR_SUCCESS;
2279 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2280 PARGEMSLR_FIRM_CHKERR(option < 1);
2282 return PARGEMSLR_SUCCESS;
2293 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2294 PARGEMSLR_FIRM_CHKERR(option < 1);
2296 return PARGEMSLR_SUCCESS;
2307 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2308 PARGEMSLR_FIRM_CHKERR(option < 1);
2310 return PARGEMSLR_SUCCESS;
2321 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2322 PARGEMSLR_FIRM_CHKERR(option < 1);
2324 return PARGEMSLR_SUCCESS;
2335 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2337 return PARGEMSLR_SUCCESS;
2348 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2350 return PARGEMSLR_SUCCESS;
2361 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2363 return PARGEMSLR_SUCCESS;
2372 template <
typename T>
2375 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2377 return PARGEMSLR_SUCCESS;
2388 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2389 PARGEMSLR_FIRM_CHKERR(option < 1);
2391 return PARGEMSLR_SUCCESS;
2402 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2403 PARGEMSLR_FIRM_CHKERR(option < 0);
2404 PARGEMSLR_FIRM_CHKERR(option > 2);
2406 return PARGEMSLR_SUCCESS;
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;
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;
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;
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;
2477 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2478 this->_gemslr_setups.
_level_setups._lr_rand_init_setup = option;
2479 return PARGEMSLR_SUCCESS;
2490 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2491 this->_gemslr_setups.
_level_setups._lr_rand_init_B_setup = option;
2492 return PARGEMSLR_SUCCESS;
2501 template <
typename T>
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;
2516 template <
typename T>
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;
2531 template <
typename T>
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;
2546 template <
typename T>
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;
2561 template <
typename T>
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;
2576 template <
typename T>
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;
2591 template <
typename T>
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;
2606 template <
typename T>
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;
2621 template <
typename T>
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;
2636 template <
typename T>
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;
2651 template <
typename T>
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;
2666 template <
typename T>
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;
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;
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;
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;
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;
2737 template <
typename T>
2740 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2741 this->_gemslr_setups.
_level_setups._lr_tol_eig1_setup = option;
2742 return PARGEMSLR_SUCCESS;
2751 template <
typename T>
2754 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2755 this->_gemslr_setups.
_level_setups._lr_tol_eig2_setup = option;
2756 return PARGEMSLR_SUCCESS;
2765 template <
typename T>
2768 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2769 this->_gemslr_setups.
_level_setups._lr_tol_eig1_B_setup = option;
2770 return PARGEMSLR_SUCCESS;
2779 template <
typename T>
2782 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2783 this->_gemslr_setups.
_level_setups._lr_tol_eig2_B_setup = option;
2784 return PARGEMSLR_SUCCESS;
2793 template <
typename T>
2796 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2797 this->_gemslr_setups.
_level_setups._B_ilu_tol_setup = option;
2798 return PARGEMSLR_SUCCESS;
2807 template <
typename T>
2810 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2811 this->_gemslr_setups.
_level_setups._C_ilu_tol_setup = option;
2812 return PARGEMSLR_SUCCESS;
2821 template <
typename T>
2824 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2825 this->_gemslr_setups.
_level_setups._S_ilu_tol_setup = option;
2826 return PARGEMSLR_SUCCESS;
2835 template <
typename T>
2838 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2839 this->_gemslr_setups.
_level_setups._EF_ilu_tol_setup = option;
2840 return PARGEMSLR_SUCCESS;
2849 template <
typename T>
2852 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2853 this->_gemslr_setups.
_level_setups._B_ilu_tol_B_setup = option;
2854 return PARGEMSLR_SUCCESS;
2863 template <
typename T>
2866 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2867 this->_gemslr_setups.
_level_setups._C_ilu_tol_B_setup = option;
2868 return PARGEMSLR_SUCCESS;
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;
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;
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;
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;
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;
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;
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;
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;
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;
3005 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
3006 PARGEMSLR_FIRM_CHKERR(option < 1);
3008 return PARGEMSLR_SUCCESS;
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;
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;
3050 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
3051 this->_gemslr_setups.
_level_setups._B_solve_option1_levels = option;
3052 return PARGEMSLR_SUCCESS;
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;
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;
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;
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;
3128 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
3129 this->_gemslr_setups.
_level_setups._ilu_residual_iters = residual_iters;
3130 return PARGEMSLR_SUCCESS;
3141 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
3142 this->_gemslr_setups.
_level_setups._ilu_complex_shift = complex_shift;
3143 return PARGEMSLR_SUCCESS;
3170 virtual int MoveData(
const int &location);
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;
int _C_ilu_fill_level_setup
The global level of fill for ILUK on the last level.
Definition: gemslr.hpp:876
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
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
int SetLowRankMaxNumberIterationsOtherLevels(int option)
Set max restarts of thick-restart Arnoldi on other levels.
Definition: gemslr.hpp:2695
int SetLowRankThresholdOtherLevels(T option)
Set max restarts of thick-restart Arnoldi on other levels.
Definition: gemslr.hpp:2752
int _lrc
The size of low-rank correction on this level.
Definition: gemslr.hpp:1111
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
int _kfactor_setup
In the recursive Kway partition, from the second level, each time the number of terget subdomains is ...
Definition: gemslr.hpp:1346
int SetNumLevels(int option)
Set the global target number of levels of GeMSLR.
Definition: gemslr.hpp:2221
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
GemslrSetupStruct< DataType > & operator=(const GemslrSetupStruct< DataType > &str)
The operator=.
Definition: gemslr.cpp:1316
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
int SetBIluDropTolB(T option)
Set the recursive GeMSLR B part threshold for ILUT of the global B part.
Definition: gemslr.hpp:2850
int SetBSeperatorOption(bool option)
Set the B part separator option of GeMSLR.
Definition: gemslr.hpp:2346
int Clear()
Free the current matrix.
Definition: gemslr.cpp:94
int _lr_maxits2_B_setup
Set the maximum number of restart if thick-restart Arnoldi is used on other levels.
Definition: gemslr.hpp:958
int SetBLowRankThresholdOtherLevels(T option)
Set B part max restarts of thick-restart Arnoldi on other levels.
Definition: gemslr.hpp:2780
int _ncomps
Number of subdomains on this level.
Definition: gemslr.hpp:1117
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
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
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
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
int _smoothing_option_setup
The GEMSLR B smoothing options.
Definition: gemslr.hpp:1452
int SetPreconditionerOption1Levels(int option)
Set top level preconditioner apply levels.
Definition: gemslr.hpp:3048
int GetDataLocation() const
Get the data location of the matrix.
Definition: gemslr.hpp:292
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
int _B_solve_option1
Choose the B solve option on the first several levels.
Definition: gemslr.hpp:772
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
void SetDefault()
Set the default values.
Definition: gemslr.cpp:1216
int GetMpiInfo(int &np, int &myid, MPI_Comm &comm) const
Get comm, np, and myid. Get the global one.
Definition: gemslr.hpp:428
bool _ilu_complex_shift
Should we turn on complex shift?
Definition: gemslr.hpp:814
int SetIluComplexShift(bool complex_shift)
Set if we turn on the complex shift or not (complex version only).
Definition: gemslr.hpp:3139
Class of matvec EB^{-1}FC^{-1}.
Definition: gemslr.hpp:150
int _B_solve_option1_B
Choose the B solve option on the first several levels.
Definition: gemslr.hpp:992
int SetIluFillLevelC(int option)
Set the fill level for ILUK of the last level.
Definition: gemslr.hpp:2933
The local real ilu preconditioner, only work for sequential CSR matrix.
Definition: structs.hpp:20
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
int _ilu_residual_iters
Should we apply residual iteration in the setup phase?
Definition: gemslr.hpp:808
int _location
Set the solve location.
Definition: gemslr.hpp:1303
The GEMSLR options.
Definition: gemslr.hpp:1288
int GetSize()
Get the size of the problem.
Definition: gemslr.cpp:4095
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
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
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
int _lr_rank2_B_setup
Set the target number of low-rank terms we keep on other levels.
Definition: gemslr.hpp:930
int SetIluFillLevelB(int option)
Set the fill level for ILUK of the B part.
Definition: gemslr.hpp:2919
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
GemslrEBFCMatrixClass()
The constructor of GemslrEBFCMatrixClass.
Definition: gemslr.cpp:19
GemslrClass< MatrixType, VectorType, DataType > & operator=(const GemslrClass< MatrixType, VectorType, DataType > &precond)
The operator = of GemslrClass.
Definition: gemslr.cpp:1472
int SetBIluFillLevelB(int option)
Set the fill level for ILUK of the B part.
Definition: gemslr.hpp:2947
int SetBNumSubdomains(int option)
Set the B part target number of subdomains on each level of GeMSLR.
Definition: gemslr.hpp:2263
GemslrLevelSetupStruct< DataType > _level_setups
The global setup of low-rank correction on this level.
Definition: gemslr.hpp:1297
The GEMSLR options on each level.
Definition: gemslr.hpp:619
bool _C_lr_pslr
Use power low-rank?
Definition: gemslr.hpp:796
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
int _lr_option1_B_setup
Set the Arnoldi iteration option for building the low-rank correction on the top level.
Definition: gemslr.hpp:890
int SetNumSubdomains(int option)
Set the global target number of subdomains on each level of GeMSLR.
Definition: gemslr.hpp:2249
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
int SetPreconditionerOption2(int option)
Set mid level preconditioner.
Definition: gemslr.hpp:3062
int _perm_option_setup
Set the local B reordering option.
Definition: gemslr.hpp:1320
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
SolverClass< MatrixType, VectorType, DataType > ** _B_precond
The preconditioners for B matrix.
Definition: gemslr.hpp:1159
virtual ~GemslrSchurMatrixClass()
The destructor of GemslrEBFCMatrixClass.
Definition: gemslr.cpp:178
int SetLowRankOptionTopLevel(int option)
Set the low-rank option on the top level. 0: Standard. 1: Thick-restart.
Definition: gemslr.hpp:2415
int _lr_optionA_setup
Set the Arnoldi iteration option for building the low-rank correction on A.
Definition: gemslr.hpp:641
GemslrPartitionOptionEnum
The partition option.
Definition: gemslr.hpp:42
virtual long int GetNumNonzeros()
Get the total number of nonzeros the preconditioner.
Definition: gemslr.hpp:574
int _B_solve_option2_B
Choose the B solve option before the last level.
Definition: gemslr.hpp:1004
int SetPermutationOption(int option)
Set the global permutation option. 0: No; 1: RCM; 2: AMD.
Definition: gemslr.hpp:2191
int SetBNumberSubdomainsReduceFactor(int option)
Set the B part reduce factor of subdomains on each level of GeMSLR.
Definition: gemslr.hpp:2319
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
VectorType _xlr1_temp
Temp vector.
Definition: gemslr.hpp:1213
bool _lr_rand_init_setup
Set to true to use random initial guess, otherwise use the unit vector.
Definition: gemslr.hpp:647
virtual long int GetNumNonzeros()
Get the total number of nonzeros the ILU.
Definition: gemslr.cpp:4105
int _S_ilu_max_row_nnz_setup
The global MaxFil for ILUT on the S part.
Definition: gemslr.hpp:864
int SetPreconditionerOption1(int option)
Set top level preconditioner.
Definition: gemslr.hpp:3032
GemslrGlobalPrecondOptionEnum
The schur complement option.
Definition: gemslr.hpp:135
int SetSmoothOptionB(int option)
Set all top levels smoother.
Definition: gemslr.hpp:3095
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...
int _lr_maxits2_setup
Set the maximum number of restart if thick-restart Arnoldi is used on other levels.
Definition: gemslr.hpp:725
GemslrEBFCMatrixClass< MatrixType, VectorType, DataType > & operator=(const GemslrEBFCMatrixClass< MatrixType, VectorType, DataType > &precond)
The operator = of GemslrEBFCMatrixClass.
Definition: gemslr.cpp:66
int SetSolveOption(int option)
Set the solve option. 0: additive LU solve; 1: additive L solve; 2: multi-solve.
Definition: gemslr.hpp:2400
The real flexgmres solver class.
Definition: fgmres.hpp:29
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
int SetIluDropTolS(T option)
Set the threshold for ILUT of the S part.
Definition: gemslr.hpp:2822
GemslrSolvePhaseEnum
The solve phase.
Definition: gemslr.hpp:112
int _C_solve_option
Choose the C solve option for the last level.
Definition: gemslr.hpp:802
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
int SetBLowRankRanksTopLevel(T option)
Set the B part target number of low-rank terms on the top level.
Definition: gemslr.hpp:2592
virtual int Clear()
Free the current precondioner.
Definition: gemslr.hpp:513
int SetIluMaxRowNnzS(int option)
Set the maxinum number of nonzeros ILUT of the S part.
Definition: gemslr.hpp:2905
int _B_ilu_fill_level_B_setup
The global level of fill for ILUK.
Definition: gemslr.hpp:1044
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
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
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
GemslrLevelClass()
The constructor of GemslrLevelClass, set everything to 0.
Definition: gemslr.cpp:732
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
GemslrSchurMatrixClass()
The constructor of GemslrEBFCMatrixClass.
Definition: gemslr.cpp:167
int SetBIluDropTolC(T option)
Set the recursive GeMSLR last level threshold for ILUT of the global B part.
Definition: gemslr.hpp:2864
int SetBIluMaxRowNnzC(int option)
Set the recursive GeMSLR last level maxinum number of nonzeros ILUT.
Definition: gemslr.hpp:2989
int _lr_maxitsA_setup
Set the maximum number of restart if thick-restart Arnoldi is used on A.
Definition: gemslr.hpp:731
virtual ~GemslrEBFCMatrixClass()
The destructor of GemslrEBFCMatrixClass.
Definition: gemslr.cpp:30
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _C_ilu_tol_setup
The droptol for ILUT on the last level.
Definition: gemslr.hpp:830
int SetNumberSubdomainsReduceFactor(int option)
Set the global reduce factor of subdomains on each level of GeMSLR.
Definition: gemslr.hpp:2305
virtual int MoveData(const int &location)
Move the preconditioner to another location. Only can be called after Setup.
Definition: gemslr.cpp:4158
int SetLowRankRandomInitGuess(bool option)
Set if we use random initial guess for Arnoldi. Otherwise we use 1 as initial guess.
Definition: gemslr.hpp:2475
int _perm_option_B_setup
Set the local B reordering option. For B part is GeMSLR is used.
Definition: gemslr.hpp:1372
int GetNumColsLocal()
Get the local number of columns of the matrix.
Definition: gemslr.cpp:145
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
int SetInnerIterationMaxNumberIterations(int option)
Set the max number of iterations of inner iteration of GeMSLR.
Definition: gemslr.hpp:2386
void SetDefault()
Set to default value.
Definition: gemslr.cpp:333
int _B_ilu_fill_level_setup
The global level of fill for ILUK.
Definition: gemslr.hpp:870
int _lr_option2_B_setup
Set the Arnoldi iteration option for building the low-rank correction on other levels.
Definition: gemslr.hpp:896
The class of sequential real/complex vector.
Definition: structs.hpp:12
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _inner_iters_tol_setup
The default convergence_tolorance to lock the eigenvalue.
Definition: gemslr.hpp:1440
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _EF_ilu_tol_setup
The droptol for ILUT on the EF part.
Definition: gemslr.hpp:846
int SolveLevel(VectorType &x, VectorType &rhs, int level)
Solve starting from a certain level.
Definition: gemslr.cpp:3455
GemslrBSolveOptionEnum
The B Solve option.
Definition: gemslr.hpp:63
int _lr_rank1_B_setup
Set the target number of low-rank terms we keep on the top level.
Definition: gemslr.hpp:924
int SetBIluFillLevelC(int option)
Set the fill level for ILUK of the last level.
Definition: gemslr.hpp:2961
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
int SetLowRankThresholdTopLevel(T option)
Set max restarts of thick-restart Arnoldi on the top level.
Definition: gemslr.hpp:2738
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
GemslrBSmoothOptionEnum
The B Smoothing option.
Definition: gemslr.hpp:74
GemslrCSolveOptionEnum
The C Solve option.
Definition: gemslr.hpp:97
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
GemslrLevelClass< MatrixType, VectorType, DataType > & operator=(const GemslrLevelClass< MatrixType, VectorType, DataType > &str)
The operator= of GemslrLevelClass.
Definition: gemslr.cpp:923
GemslrLowRankOptionEnum
The low-rank option.
Definition: gemslr.hpp:31
int SetLowRankRanksOtherLevels(T option)
Set the target number of low-rank terms on the other levels.
Definition: gemslr.hpp:2577
int _B_ilu_max_row_nnz_B_setup
The global MaxFil for ILUT.
Definition: gemslr.hpp:1032
VectorType _xlr_temp
Temp vector.
Definition: gemslr.hpp:1207
virtual int MoveData(const int &location)
Move the preconditioner to another location. Only can be called after Setup.
Definition: gemslr.hpp:590
int SetPolyOrder(int option)
Set poly order for Poly solve of the B part.
Definition: gemslr.hpp:3003
int _ncomp_B_setup
The target number of subdomians on each level in the B part if GeMSLR is used.
Definition: gemslr.hpp:1384
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
VectorType _z_temp
Temp vector.
Definition: gemslr.hpp:1189
SolverClass< MatrixType, VectorType, DataType > ** _B_solver
The solvers for B matrix.
Definition: gemslr.hpp:1165
int _B_smooth_option1
Choose the B smooth option before the last level.
Definition: gemslr.hpp:790
DenseMatrixClass< DataType > _Wk
The W matrix for the low-rank correction W*H*W' on this level.
Definition: gemslr.hpp:1177
bool _ready
If the solver is ready.
Definition: solver.hpp:108
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
The base solver class.
Definition: solver.hpp:47
MatrixType _C_mat
The C matrix on this level.
Definition: gemslr.hpp:1141
The template class complex.
Definition: complex.hpp:24
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
VectorType _w_temp
Temp vector.
Definition: gemslr.hpp:1201
int SetIluDropTolC(T option)
Set the threshold for ILUT of the last level.
Definition: gemslr.hpp:2808
int _B_solve_option2
Choose the B solve option before the last level.
Definition: gemslr.hpp:784
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
int SetBPartitionOption(int option)
Set the B part partition option. 0: ND; 1: RKway.
Definition: gemslr.hpp:2176
int GetNumRows(int level)
Get the local number of rows on certain level for the low-rank part.
Definition: gemslr.cpp:3704
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
int SetIluDropTolEF(T option)
Set the threshold for ILUT of the EF part.
Definition: gemslr.hpp:2836
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _B_ilu_tol_setup
The global droptol for ILUT.
Definition: gemslr.hpp:822
int Setup(int level, GemslrClass< MatrixType, VectorType, DataType > &gemslr)
Set the current matrix to a certain GEMSLR level.
Definition: gemslr.cpp:255
MatrixType _E_mat
The E matrix on this level.
Definition: gemslr.hpp:1129
int _solve_option_setup
The GEMSLR options.
Definition: gemslr.hpp:1446
int _solve_phase_setup
Set the solve phase of the preconditioner.
Definition: gemslr.hpp:1412
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
VectorType _temp_v
Temp vector for the Arnoldi.
Definition: gemslr.hpp:337
int _lr_rankA_setup
Set the target number of low-rank terms we keep for the A.
Definition: gemslr.hpp:689
int SetBIluMaxRowNnzB(int option)
Set the recursive GeMSLR B part maxinum number of nonzeros ILUT.
Definition: gemslr.hpp:2975
GemslrSchurSolveClass(GemslrSchurSolveClass< MatrixType, VectorType, DataType > &&precond)
The move constructor of GemslrSchurSolveClass class.
Definition: gemslr.hpp:481
int SetBNumLevels(int option)
Set the B part target number of levels of GeMSLR.
Definition: gemslr.hpp:2235
GemslrSmoothingOptionEnum
The Smoothing option for the multiplicative solve.
Definition: gemslr.hpp:86
virtual int Clear()
Free the current precondioner.
Definition: gemslr.cpp:1558
int Clear()
Free the current matrix.
Definition: gemslr.cpp:242
int SetBMinimalNumberSubdomains(int option)
Set the B part minimal number of subdomains on each level of GeMSLR.
Definition: gemslr.hpp:2291
int _lr_option1_setup
Set the Arnoldi iteration option for building the low-rank correction on the top level.
Definition: gemslr.hpp:629
int _print_option
The print option.
Definition: solver.hpp:114
GemslrLevelSetupStruct< DataType > & operator=(const GemslrLevelSetupStruct< DataType > &str)
The operator =.
Definition: gemslr.cpp:594
virtual ~GemslrClass()
The destructor of precondioner class.
Definition: gemslr.cpp:1548
int SetInnerIterationOption(bool option)
Set the inner iteration option of GeMSLR.
Definition: gemslr.hpp:2359
int SetBLowRankOptionOtherLevels(int option)
Set the B part low-rank option on other levels. 0: Standard. 1: Thick-restart.
Definition: gemslr.hpp:2460
int Clear()
Free the current level structure, set everything to 0.
Definition: gemslr.cpp:1098
int SetPartitionOption(int option)
Set the global partition option. 0: ND; 1: RKway.
Definition: gemslr.hpp:2161
int SetLowRankMaxNumberIterationsTopLevel(int option)
Set max restarts of thick-restart Arnoldi on the top level.
Definition: gemslr.hpp:2681
MPI_Comm GetComm() const
Get the MPI_comm.
Definition: gemslr.hpp:282
MatrixType _F_mat
The F matrix on this level.
Definition: gemslr.hpp:1135
int _B_poly_order
The order for poly for the B blocks.
Definition: gemslr.hpp:882
VectorType _v_temp
Temp vector.
Definition: gemslr.hpp:1195
int SetLowRankOptionOtherLevels(int option)
Set the low-rank option on other levels. 0: Standard. 1: Thick-restart.
Definition: gemslr.hpp:2430
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
int _C_ilu_max_row_nnz_B_setup
The global MaxFil for ILUT on the last level.
Definition: gemslr.hpp:1038
Class of matvec EB^{-1}FC^{-1}.
Definition: gemslr.hpp:314
The GEMSLR information on each level, contains the solver for B and the low-rank information for S.
Definition: gemslr.hpp:1103
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
GemslrSchurMatrixClass< MatrixType, VectorType, DataType > & operator=(const GemslrSchurMatrixClass< MatrixType, VectorType, DataType > &precond)
The operator = of GemslrSchurMatrixClass.
Definition: gemslr.cpp:214
VectorType _y_temp
Temp vector.
Definition: gemslr.hpp:1183
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
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
GemslrSolveOptionEnum
The solve option.
Definition: gemslr.hpp:123
int SetIluMaxRowNnzC(int option)
Set the maxinum number of nonzeros ILUT of the last level.
Definition: gemslr.hpp:2891
int SetupVectorPtrStr(VectorType &v)
Set the structure of a vector pointer that has same row partition as this matrix.
Definition: gemslr.cpp:270
int SetBPermutationOption(int option)
Set the B part permutation option. 0: No; 1: RCM; 2: AMD.
Definition: gemslr.hpp:2206
GemslrSchurSolveClass< MatrixType, VectorType, DataType > & operator=(GemslrSchurSolveClass< MatrixType, VectorType, DataType > &&precond)
The operator = of GemslrSchurSolveClass class.
Definition: gemslr.hpp:501
int SolveB(VectorType &x, VectorType &rhs, int level)
Solve with B on a certain level.
Definition: gemslr.cpp:3613
int SetBPolyOrder(int option)
Set poly order for Poly solve of the B part of the recursive GeMSLR.
Definition: gemslr.hpp:3017
int SetIluMaxRowNnzB(int option)
Set the maxinum number of nonzeros for ILUT of the B part.
Definition: gemslr.hpp:2877
int _C_ilu_fill_level_B_setup
The global level of fill for ILUK on the last level.
Definition: gemslr.hpp:1050
int _partition_option_B_setup
Set the partition option. For B part is GeMSLR is used.
Definition: gemslr.hpp:1366
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
int Setup(int level, GemslrClass< MatrixType, VectorType, DataType > &gemslr)
Set the current matrix to a certain GEMSLR level.
Definition: gemslr.cpp:107
int GetMpiInfo(int &np, int &myid, MPI_Comm &comm) const
Get comm, np, and myid. Get the global one.
Definition: gemslr.hpp:269
VectorType _xlr2_temp
Temp vector.
Definition: gemslr.hpp:1219
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
std::vector< MatrixType > _B_mat_v
The B matrix on this level. C matrix if this is the last level.
Definition: gemslr.hpp:1123
int _C_solve_option_B
Choose the C solve option for the last level.
Definition: gemslr.hpp:1010
bool _cuda_lowrank_only
Are we only going to put the low-rank part on the device?
Definition: gemslr.hpp:1418
int SetSeperatorOption(bool option)
Set the global separator option of GeMSLR.
Definition: gemslr.hpp:2333
int SetBLowRankOptionTopLevel(int option)
Set the B part low-rank option on the top level. 0: Standard. 1: Thick-restart.
Definition: gemslr.hpp:2445
int _nlev_setup
The total number of levels user wants to have.
Definition: gemslr.hpp:1326
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
DataType _diag_shift_milu
The diagonal shift for the modified ILU.
Definition: gemslr.hpp:1458
MatrixType * _matrix
The matrix.
Definition: solver.hpp:72
int SetBLowRankRanksOtherLevels(T option)
Set the B part target number of low-rank terms on the other levels.
Definition: gemslr.hpp:2607
int _lr_maxits1_setup
Set the maximum number of restart if thick-restart Arnoldi is used on the top level.
Definition: gemslr.hpp:719
int SetBLowRankMaxNumberIterationsOtherLevels(int option)
Set B part max restarts of thick-restart Arnoldi on other levels.
Definition: gemslr.hpp:2723
virtual int SetWithParameterArray(double *params)
Setup with parameter array.
Definition: gemslr.hpp:2061
int GetSolvePhase()
Get the solve phase.
Definition: gemslr.hpp:3177
GemslrEBFCMatrixClass< MatrixType, VectorType, DataType > _EBFC
The EBFC matrix on this level.
Definition: gemslr.hpp:1153
bool _lr_rand_init_B_setup
Set to true to use random initial guess, otherwise use the unit vector.
Definition: gemslr.hpp:902
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
int SetMinimalNumberSubdomains(int option)
Set the global minimal number of subdomains on each level of GeMSLR.
Definition: gemslr.hpp:2277
virtual ~GemslrSchurSolveClass()
The destructor of precondioner class.
Definition: gemslr.hpp:519
int _kmin_setup
The minimal number of subdomains user wants on each level in the recursive Kway partition.
Definition: gemslr.hpp:1338
int SetIluDropTolB(T option)
Set the threshold for ILUT of the B part.
Definition: gemslr.hpp:2794
GemslrSchurSolveClass(const GemslrSchurSolveClass< MatrixType, VectorType, DataType > &precond)
The copy constructor of GemslrSchurSolveClass class.
Definition: gemslr.hpp:472
int SetPreconditionerOptionB(int option)
Set all top levels preconditioner.
Definition: gemslr.hpp:3078
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
VectorType _temp_v
Temp vector for the Arnoldi.
Definition: gemslr.hpp:173
~GemslrLevelClass()
The destructor of GemslrLevelClass.
Definition: gemslr.cpp:745
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
GemslrLevelSetupStruct()
The constructor, set the default values.
Definition: gemslr.cpp:392
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
int SetBLowRankMaxNumberIterationsTopLevel(int option)
Set B part max restarts of thick-restart Arnoldi on the top level.
Definition: gemslr.hpp:2709
GemslrReorderingOptionEnum
The reordering option.
Definition: gemslr.hpp:52
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
int _C_ilu_max_row_nnz_setup
The global MaxFil for ILUT on the last level.
Definition: gemslr.hpp:858
int _partition_option_setup
Set the partition option.
Definition: gemslr.hpp:1312
DenseMatrixClass< DataType > _Hk
The H matrix for the low-rank correction W*H*W' on this level.
Definition: gemslr.hpp:1171
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
int _B_ilu_max_row_nnz_setup
The global MaxFil for ILUT.
Definition: gemslr.hpp:852
int SetInnerIterationThreshold(T option)
Set the stop threshold of inner iteration of GeMSLR.
Definition: gemslr.hpp:2373
Class of matvec EB^{-1}FC^{-1}.
Definition: gemslr.hpp:459
virtual int SetSolveLocation(const int &location)
Set the data location that the preconditioner apply to.
Definition: gemslr.cpp:4140
GemslrSchurSolveClass< MatrixType, VectorType, DataType > & operator=(const GemslrSchurSolveClass< MatrixType, VectorType, DataType > &precond)
The operator = of GemslrSchurSolveClass class.
Definition: gemslr.hpp:490
int SetupVectorPtrStr(VectorType &v)
Set the structure of a vector pointer that has same row partition as this matrix.
Definition: gemslr.cpp:122
int _B_poly_order_B
The order for poly for the B blocks.
Definition: gemslr.hpp:1056
virtual int SetSolveLocation(const int &location)
Set the data location that the preconditioner apply to.
Definition: gemslr.hpp:582
GemslrSchurSolveClass()
The constructor of precondioner class.
Definition: gemslr.hpp:466
int SetBLowRankThresholdTopLevel(T option)
Set B part max restarts of thick-restart Arnoldi on the top level.
Definition: gemslr.hpp:2766
int SetLowRankRanksTopLevel(T option)
Set the target number of low-rank terms on the top level.
Definition: gemslr.hpp:2562
GemslrSetupStruct()
The constructor, set the default values.
Definition: gemslr.cpp:1185
int _ncomp_setup
The target number of subdomians on each level.
Definition: gemslr.hpp:1332
GemslrClass()
The constructor of precondioner class.
Definition: gemslr.cpp:1388
SolverClass< MatrixType, VectorType, DataType > & operator=(const SolverClass< MatrixType, VectorType, DataType > &solver)
The = operator of solver class.
Definition: solver.hpp:210
MPI_Comm GetComm() const
Get the MPI_comm.
Definition: gemslr.hpp:441
int SolveApplyLowRankLevel(VectorType &x, VectorType &rhs, int level)
Apply the low-rank update on a certain level.
Definition: gemslr.cpp:3662
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _S_ilu_tol_setup
The droptol for ILUT on the S part.
Definition: gemslr.hpp:838
MatrixType _D_mat
The D matrix on this level.
Definition: gemslr.hpp:1147
virtual int SetWithParameterArray(double *params)
Setup with parameter array.
Definition: gemslr.hpp:600
int _lr_rank2_setup
Set the target number of low-rank terms we keep on other levels.
Definition: gemslr.hpp:683
int _B_solve_option1_levels_B
From level 0 to this level (exclude) we apply B_solve option 1.
Definition: gemslr.hpp:998
int _lr_rank1_setup
Set the target number of low-rank terms we keep on the top level.
Definition: gemslr.hpp:677
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _B_ilu_tol_B_setup
The global droptol for ILUT.
Definition: gemslr.hpp:1018
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
int GetNumRowsLocal()
Get the local number of rows of the matrix.
Definition: gemslr.cpp:134
int _lr_option2_setup
Set the Arnoldi iteration option for building the low-rank correction on other levels.
Definition: gemslr.hpp:635
virtual int Clear()
Free the current solver.
Definition: solver.hpp:264
int SetPreconditionerOptionC(int option)
Set last level preconditioner.
Definition: gemslr.hpp:3111
int _B_solve_option1_levels
From level 0 to this level (exclude) we apply B_solve option 1.
Definition: gemslr.hpp:778