Subroutine to factorize the matrix of the system
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(MAT_SOLV), | intent(inout) | :: | mat |
high level system type |
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