@@ -62,6 +62,12 @@ vector<double> GEMM_Profile_MaxTime; /*!< \brief Maximum time spent for thi
6262// #pragma omp threadprivate(Profile_Function_tp, Profile_Time_tp, Profile_ID_tp, Profile_Map_tp)
6363
6464
65+ /* --- Map from config string to inner solver enum --- */
66+ std::map<std::string, ENUM_LINEAR_SOLVER_INNER> Inner_Linear_Solver_Map = {
67+ {" NONE" , INNER_SOLVER_NONE},
68+ {" BCGSTAB" , INNER_SOLVER_BCGSTAB}
69+ };
70+
6571CConfig::CConfig (char case_filename[MAX_STRING_SIZE], SU2_COMPONENT val_software, bool verb_high) {
6672
6773 /* --- Set the case name to the base config file name without extension ---*/
@@ -1906,6 +1912,20 @@ void CConfig::SetConfig_Options() {
19061912 addEnumOption (" DISCADJ_LIN_PREC" , Kind_DiscAdj_Linear_Prec, Linear_Solver_Prec_Map, ILU);
19071913 /* DESCRIPTION: Linear solver for the discete adjoint systems */
19081914
1915+ /* !\brief LINEAR_SOLVER_NESTED
1916+ * \n DESCRIPTION: Enable nested Krylov linear solver (e.g. FGMRES with inner solver).
1917+ * \n OPTIONS: YES, NO \ingroup Config */
1918+ addBoolOption (" LINEAR_SOLVER_NESTED" , Nested_Linear_Solver, false );
1919+
1920+ /* !\brief LINEAR_SOLVER_INNER
1921+ * \n DESCRIPTION: Inner linear solver used when LINEAR_SOLVER_NESTED = YES.
1922+ * \n OPTIONS: see \link Inner_Linear_Solver_Map \endlink
1923+ * \n DEFAULT: BCGSTAB \ingroup Config */
1924+ addEnumOption (" LINEAR_SOLVER_INNER" ,
1925+ Kind_Linear_Solver_Inner,
1926+ Inner_Linear_Solver_Map,
1927+ INNER_SOLVER_BCGSTAB);
1928+
19091929 /* DESCRIPTION: Maximum update ratio value for flow density and energy variables */
19101930 addDoubleOption (" MAX_UPDATE_FLOW" , MaxUpdateFlow, 0.2 );
19111931 /* DESCRIPTION: Maximum update ratio value for SA turbulence variable nu_tilde */
@@ -7255,15 +7275,19 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
72557275 SU2_MPI::Error (" Implicit time scheme is not yet implemented with Mutation++. Use EULER_EXPLICIT." , CURRENT_FUNCTION);
72567276 switch (Kind_Linear_Solver) {
72577277 case BCGSTAB:
7258- case FGMRESandBCGSTAB2:
72597278 case FGMRES:
72607279 case RESTARTED_FGMRES:
7261- if (Kind_Linear_Solver == BCGSTAB)
7280+ if (Kind_Linear_Solver == BCGSTAB){
72627281 cout << " BCGSTAB is used for solving the linear system." << endl;
7263- else if (Kind_Linear_Solver == FGMRESandBCGSTAB2)
7264- cout << " FGMRES and BCGSTAB is used for solving the linear system." << endl;
7265- else
7266- cout << " FGMRES is used for solving the linear system." << endl;
7282+ }
7283+ else {
7284+ if (GetNested_Linear_Solver ()){
7285+ cout << " Nested FGMRES (FGMRES with inner BiCGSTAB) is used for solving the linear system." << endl;
7286+ }
7287+ else {
7288+ cout << " FGMRES is used for solving the linear system." << endl;
7289+ }
7290+ }
72677291 switch (Kind_Linear_Solver_Prec) {
72687292 case ILU: cout << " Using a ILU(" << Linear_Solver_ILU_n <<" ) preconditioning." << endl; break ;
72697293 case LINELET: cout << " Using a linelet preconditioning." << endl; break ;
@@ -7316,12 +7340,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
73167340 cout << " Convergence criteria of the linear solver: " << Linear_Solver_Error <<" ." << endl;
73177341 cout << " Max number of iterations: " << Linear_Solver_Iter <<" ." << endl;
73187342 break ;
7319- case FGMRESandBCGSTAB2:
7320- cout << " FGMRES and BCGSTAB is used for solving the linear system." << endl;
7321- cout << " Convergence criteria of the linear solver: " << Linear_Solver_Error <<" ." << endl;
7322- cout << " Max number of iterations: " << Linear_Solver_Iter <<" ." << endl;
7323- break ;
7324-
73257343 }
73267344 break ;
73277345 }
0 commit comments