Selects one of the preconfigured solvers and get solver-specific parameters.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(hypre_obj), | intent(inout) | :: | this |
Hypre machinery |
||
| character(len=*), | intent(in) | :: | name |
Name of solver to be used |
||
| real(kind=wp), | intent(in), | optional | :: | MaxTol |
Maximum relative tolerance |
|
| integer, | intent(in), | optional | :: | MaxIt |
Maximum number of subiterations |
|
| integer, | intent(in), | optional | :: | RelaxType |
Relaxation type |
|
| integer, | intent(in), | optional | :: | CoarsenType |
Coarsening type |
impure subroutine hypre_obj_SelectSolver(this,name,MaxTol,MaxIt,RelaxType,CoarsenType) !> Selects one of the preconfigured solvers and ! get solver-specific parameters. implicit none class(hypre_obj), intent(inout) :: this !! Hypre machinery character(len=*), intent(in) :: name !! Name of solver to be used real(wp), intent(in), & optional :: MaxTol !! Maximum relative tolerance integer, intent(in), & optional :: MaxIt !! Maximum number of subiterations integer, intent(in), & optional :: RelaxType !! Relaxation type integer, intent(in), & optional :: CoarsenType !! Coarsening type ! Assign name this%solver_name = trim(adjustl(name)) ! Read remaining parameters if (present(MaxTol)) this%MaxTol = MaxTol if (present(MaxIt)) this%MaxIt = MaxIt ! Check against known solvers and get solver specific parameters select case (this%solver_name) case (HYPRE_SOL_IJ_AMG_NONE) this%interface = HYPRE_INT_IJ ! SMOOTHER (see HYPRE manual): ! 0: Jacobi ! 1: Gauss-Seidel, sequential (very slow!) ! 2: Gauss-Seidel, interior points in parallel, boundary sequential (slow!) ! 3: hybrid Gauss-Seidel or SOR, forward solve ! 4: hybrid Gauss-Seidel or SOR, backward solve ! 5: hybrid chaotic Gauss-Seidel (works only with OpenMP) ! 6: hybrid symmetric Gauss-Seidel or SSOR ! 8: l1 -scaled hybrid symmetric Gauss-Seidel ! 9: Gaussian elimination (only on coarsest level) ! 15: CG (warning - not a fixed smoother - may require FGMRES) ! 16: Chebyshev ! 17: FCF-Jacobi ! 18: l1 -scaled jacobi ! 21: The same as 8 except forcing serialization on CPU (#OMP-thread = 1) ! 29: Direct solve: use Gaussian elimination & BLAS (with pivoting) (old version) ! 30: Kaczmarz ! 88: The same methods as 8 with a convergent l1-term ! 89: Symmetric l1-hybrid Gauss-Seidel (i.e., 13 followed by 14) ! 98: LU with pivoting ! 99: LU with pivoting -199 : Matvec with the inverse #ifdef USE_GPU this%RelaxType = 11 #else this%RelaxType = 6 #endif ! COARSENING ALGORITHM (see HYPRE manual): ! 0: CLJP-coarsening (a parallel coarsening algorithm using independent sets. ! 1: classical Ruge-Stueben coarsening on each processor, no boundary treatment (not recommended!) ! 3: classical Ruge-Stueben coarsening on each processor, followed by a third pass, which adds coarse points on the boundaries ! 6: Falgout coarsening (uses 1 first, followed by CLJP using the interior coarse points generated by 1 as its first independent set) ! 7: CLJP-coarsening (using a fixed random vector, for debugging purposes only) ! 8: PMIS-coarsening (a parallel coarsening algorithm using independent sets, generating lower complexities than CLJP, might also lead to slower convergence) ! 9: PMIS-coarsening (using a fixed random vector, for debugging purposes only) ! 10: HMIS-coarsening (uses one pass Ruge-Stueben on each processor independently, followed by PMIS using the interior C-points generated as its first independent set) ! 11: one-pass Ruge-Stueben coarsening on each processor, no boundary treatment (not recommended!) ! 21: CGC coarsening by M. Griebel, B. Metsch and A. Schweitzer ! 22: CGC-E coarsening by M. Griebel, B. Metsch and A.Schweitzer #ifdef USE_GPU this%CoarsenType = 8 #else this%CoarsenType = 6 #endif case (HYPRE_SOL_IJ_PCG_AMG) this%interface = HYPRE_INT_IJ ! SMOOTHER (see HYPRE manual): ! 0: Jacobi ! 1: Gauss-Seidel, sequential (very slow!) ! 2: Gauss-Seidel, interior points in parallel, boundary sequential (slow!) ! 3: hybrid Gauss-Seidel or SOR, forward solve ! 4: hybrid Gauss-Seidel or SOR, backward solve ! 5: hybrid chaotic Gauss-Seidel (works only with OpenMP) ! 6: hybrid symmetric Gauss-Seidel or SSOR ! 8: l1 -scaled hybrid symmetric Gauss-Seidel ! 9: Gaussian elimination (only on coarsest level) ! 15: CG (warning - not a fixed smoother - may require FGMRES) ! 16: Chebyshev ! 17: FCF-Jacobi ! 18: l1 -scaled jacobi this%RelaxType = 6 ! COARSENING ALGORITHM (see HYPRE manual): ! 0: CLJP-coarsening (a parallel coarsening algorithm using independent sets. ! 1: classical Ruge-Stueben coarsening on each processor, no boundary treatment (not recommended!) ! 3: classical Ruge-Stueben coarsening on each processor, followed by a third pass, which adds coarse points on the boundaries ! 6: Falgout coarsening (uses 1 first, followed by CLJP using the interior coarse points generated by 1 as its first independent set) ! 7: CLJP-coarsening (using a fixed random vector, for debugging purposes only) ! 8: PMIS-coarsening (a parallel coarsening algorithm using independent sets, generating lower complexities than CLJP, might also lead to slower convergence) ! 9: PMIS-coarsening (using a fixed random vector, for debugging purposes only) ! 10: HMIS-coarsening (uses one pass Ruge-Stueben on each processor independently, followed by PMIS using the interior C-points generated as its first independent set) ! 11: one-pass Ruge-Stueben coarsening on each processor, no boundary treatment (not recommended!) ! 21: CGC coarsening by M. Griebel, B. Metsch and A. Schweitzer ! 22: CGC-E coarsening by M. Griebel, B. Metsch and A.Schweitzer this%CoarsenType = 8 case (HYPRE_SOL_IJ_PCG_DS) this%interface = HYPRE_INT_IJ case (HYPRE_SOL_S_PCG_NONE) this%interface = HYPRE_INT_Struct case (HYPRE_SOL_S_SMG_NONE) this%interface = HYPRE_INT_Struct case (HYPRE_SOL_S_PFMG_NONE) this%interface = HYPRE_INT_Struct ! SMOOTHER (see HYPRE manual): ! 0: Jacobi ! 1: Weighted Jacobi (default) ! 2: Red/Black Gauss-Seidel (symmetric: RB pre-relaxation, BR post-relaxation) ! 3: Red/Black Gauss-Seidel (nonsymmetric: RB pre-relaxation and post-relaxation) this%RelaxType = 1 case default call this%parallel%Stop("HYPRE: Unknown solver") end select if (present(RelaxType)) this%RelaxType = RelaxType if (present(CoarsenType)) this%CoarsenType = CoarsenType return end subroutine hypre_obj_SelectSolver