MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
LinearSolverFactory.F90
Go to the documentation of this file.
2  use simmodule, only: ustop
7 
9 #if defined(__WITH_PETSC__)
11 #endif
12 
13  implicit none
14  private
15 
16  public :: create_linear_solver
17 
18 contains
19 
20  !> @brief Factory method to create the linear solver object
21  !<
22  function create_linear_solver(solver_mode, sln_name) result(solver)
23  character(len=*) :: solver_mode
24  character(len=*) :: sln_name
25  class(linearsolverbasetype), pointer :: solver
26 
27  solver => null()
28 
29  if (solver_mode == 'IMS') then
30  solver => create_ims_solver(sln_name)
31  return
32 #if defined(__WITH_PETSC__)
33  else if (solver_mode == 'PETSC') then
34  solver => create_petsc_solver(sln_name)
35 #endif
36  else
37  call ustop('Unsupported solver mode: '//trim(solver_mode))
38  end if
39 
40  end function create_linear_solver
41 
42 end module linearsolverfactory
class(linearsolverbasetype) function, pointer, public create_ims_solver(sln_name)
class(linearsolverbasetype) function, pointer, public create_linear_solver(solver_mode, sln_name)
Factory method to create the linear solver object.
class(linearsolverbasetype) function, pointer, public create_petsc_solver(sln_name)
Create a PETSc solver object.
Definition: PetscSolver.F90:60
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public ustop(stopmess, ioutlocal)
Stop the simulation.
Definition: Sim.f90:312