factorize_solver Subroutine

private subroutine factorize_solver(mat)

Subroutine to factorize the matrix of the system

Arguments

Type IntentOptional Attributes Name
type(MAT_SOLV), intent(inout) :: mat

high level system type


Calls

proc~~factorize_solver~~CallsGraph proc~factorize_solver factorize_solver dmumps dmumps proc~factorize_solver->dmumps ma48_factorize ma48_factorize proc~factorize_solver->ma48_factorize proc~fact_superlu fact_superlu proc~factorize_solver->proc~fact_superlu proc~s_umfpack_di_numeric s_umfpack_di_numeric proc~factorize_solver->proc~s_umfpack_di_numeric proc~umfpack_di_free_numeric umfpack_di_free_numeric proc~factorize_solver->proc~umfpack_di_free_numeric interface~dgssvx dgssvx proc~fact_superlu->interface~dgssvx interface~statfree StatFree proc~fact_superlu->interface~statfree interface~statinit StatInit proc~fact_superlu->interface~statinit interface~statprint StatPrint proc~fact_superlu->interface~statprint proc~umfpack_di_numeric umfpack_di_numeric proc~s_umfpack_di_numeric->proc~umfpack_di_numeric interface~c_umfpack_di_free_numeric c_umfpack_di_free_numeric proc~umfpack_di_free_numeric->interface~c_umfpack_di_free_numeric interface~c_umfpack_di_numeric c_umfpack_di_numeric proc~umfpack_di_numeric->interface~c_umfpack_di_numeric

Called by

proc~~factorize_solver~~CalledByGraph proc~factorize_solver factorize_solver proc~solve_syst solve_syst proc~solve_syst->proc~factorize_solver proc~solution_solver solution_solver proc~solve_syst->proc~solution_solver proc~solution_solver->proc~solve_syst program~test_solvers test_solvers program~test_solvers->proc~solve_syst

Source Code

   subroutine factorize_solver(mat)
   !! Subroutine to factorize the matrix of the system
   implicit none
   type(MAT_SOLV), intent(inout) :: mat   !! *high level system type*

      !if ( mat%fac ) call freefact_solver(mat)
      select case(mat%slv_t)

         case(MA48)
#if WITH_MA48
            call ma48_factorize( matrix  = mat%matma48%zmat, &
                                 factors = mat%matma48%fact, &
                                 control = mat%matma48%ctrl, &
                                 finfo   = mat%matma48%finf, &
                                 fast    = mat%matma48%fast)
            if (mat%matma48%finf%flag < 0) then
               write(OPU,*) 'Failure of ma48_factorize with finfo%flag = ', mat%matma48%finf%flag
               stop
            endif
#else
   stop 'MA48_LIB not defined'
#endif

         case(MUMP)
            mat%matmump%job = 2
            call dmumps(mat%matmump)

         case(SULU)
            ! Just factorize once, in the case that the matrix doesn't change much
            if (mat%matsulu%first) call fact_superlu( sulu    = mat%matsulu, &
                                                      verbose = (mat%matsulu%options%PrintStat==1))

         case(UMFP)
            call umfpack_di_free_numeric(Numeric = mat%matumfp%c_numeric) ! first release memory
            call s_umfpack_di_numeric(Ap       = mat%jptr,                 &
                                      Ai       = mat%irow,                 &
                                      Ax       = mat%a_elt,                &
                                      Symbolic = mat%matumfp%c_symbolic,   &
                                      Numeric  = mat%matumfp%c_numeric,    &
                                      Control  = mat%matumfp%c_control,    &
                                      Info     = mat%matumfp%c_info)

         case default
            stop 'Unknown solver type, FACTORIZE_SOLVER'

      endselect

   return
   endsubroutine factorize_solver