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 |
impure subroutine hypre_obj_SelectSolver(this,name,MaxTol,MaxIt,RelaxType) !> 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 ! 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 case (HYPRE_SOL_IJ_PCG_AMG) this%interface = HYPRE_INT_IJ 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 if (present(RelaxType)) then ! 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 = RelaxType end if case default call this%parallel%Stop("HYPRE: Unknown solver") end select return end subroutine hypre_obj_SelectSolver