hypre_obj_SelectSolver Subroutine

private impure subroutine hypre_obj_SelectSolver(this, name, MaxTol, MaxIt, RelaxType)

Selects one of the preconfigured solvers and get solver-specific parameters.

Type Bound

hypre_obj

Arguments

Type IntentOptional 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


Called by

proc~~hypre_obj_selectsolver~~CalledByGraph proc~hypre_obj_selectsolver hypre_obj%hypre_obj_SelectSolver proc~cdifs_obj_preparesolveroperators cdifs_obj_PrepareSolverOperators proc~cdifs_obj_preparesolveroperators->proc~hypre_obj_selectsolver proc~grans_obj_preparesolveroperators grans_obj_PrepareSolverOperators proc~grans_obj_preparesolveroperators->proc~hypre_obj_selectsolver proc~marker_set_computesolidvolfrac marker_set%marker_set_ComputeSolidVolFrac proc~marker_set_computesolidvolfrac->proc~hypre_obj_selectsolver proc~cdifs_obj_preparesolver cdifs_obj_PrepareSolver proc~cdifs_obj_preparesolver->proc~cdifs_obj_preparesolveroperators proc~grans_obj_preparesolver grans_obj_PrepareSolver proc~grans_obj_preparesolver->proc~grans_obj_preparesolveroperators interface~cdifs_obj_preparesolver cdifs_obj%cdifs_obj_PrepareSolver interface~cdifs_obj_preparesolver->proc~cdifs_obj_preparesolver interface~grans_obj_preparesolver grans_obj%grans_obj_PrepareSolver interface~grans_obj_preparesolver->proc~grans_obj_preparesolver

Source Code

    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