30 type (hecmwST_matrix),
target :: hecMAT
31 type (hecmwST_local_mesh) :: hecMESH
33 integer(kind=kint) :: error
34 integer(kind=kint) :: ITER, METHOD, PRECOND, NSET, METHOD2
35 integer(kind=kint) :: iterPREmax
36 integer(kind=kint) :: ITERlog, TIMElog
37 real(kind=
kreal) :: resid, sigma_diag, thresh, filter, resid2
38 real(kind=
kreal) :: time_setup, time_comm, time_sol, tr
39 real(kind=
kreal) :: time_ax, time_precond
41 integer(kind=kint) :: NREST
42 real(kind=
kreal) :: sigma
44 integer(kind=kint) :: totalmpc, MPC_METHOD
45 integer(kind=kint) :: auto_sigma_diag
65 if (sigma_diag.lt.0.d0)
then
76 totalmpc = hecmesh%mpc%n_mpc
79 if (totalmpc > 0 .and. mpc_method == 2)
then
104 hecmat%symmetric = .true.
105 call hecmw_solve_cg( hecmesh, hecmat, iter, resid, error, time_setup, time_sol, time_comm )
107 hecmat%symmetric = .false.
110 hecmat%symmetric = .false.
111 call hecmw_solve_gmres( hecmesh,hecmat, iter, resid, error, time_setup, time_sol, time_comm )
113 hecmat%symmetric = .false.
114 call hecmw_solve_gpbicg( hecmesh,hecmat, iter, resid, error, time_setup, time_sol, time_comm )
123 if ((precond>=10 .and. precond<20) .and. auto_sigma_diag==1 .and. sigma_diag<2.d0)
then
124 sigma_diag = sigma_diag + 0.1
125 if (hecmesh%my_rank.eq.0)
write(*,*)
'Increasing SIGMA_DIAG to', sigma_diag
127 elseif (method==1 .and. method2>1)
then
128 if (auto_sigma_diag.eq.1) sigma_diag = 1.0
143 if (hecmesh%my_rank.eq.0 .and. (iterlog.eq.1 .or. timelog.ge.1))
then
144 write(*,
"(a,1pe12.5)")
'### Relative residual =', resid2
152 if (totalmpc > 0 .and. mpc_method == 2)
then
159 if (hecmesh%my_rank.eq.0 .and. timelog.ge.1)
then
160 tr= (time_sol-time_comm)/(time_sol+1.d-24)*100.d0
161 write (*,
'(/a)')
'### summary of linear solver'
162 write (*,
'(i10,a, 1pe16.6)') iter,
' iterations ', resid
163 write (*,
'(a, 1pe16.6 )')
' set-up time : ', time_setup
164 write (*,
'(a, 1pe16.6 )')
' solver time : ', time_sol
165 write (*,
'(a, 1pe16.6 )')
' solver/comm time : ', time_comm
166 write (*,
'(a, 1pe16.6 )')
' solver/matvec : ', time_ax
167 write (*,
'(a, 1pe16.6 )')
' solver/precond : ', time_precond
169 write (*,
'(a, 1pe16.6 )')
' solver/1 iter : ', time_sol / iter
170 write (*,
'(a, 1pe16.6/)')
' work ratio (%) : ', tr
181 type (hecmwST_local_mesh) :: hecMESH
182 type (hecmwST_matrix),
target :: hecMAT
183 integer (kind=kint)::PRECOND,iterPREmax,i,j,error
190 do j = 1, hecmat%NDOF
191 if (dabs(hecmat%D(hecmat%NDOF*hecmat%NDOF*(i-1)+(j-1)*(hecmat%NDOF+1)+1)).eq.0.d0)
then
198 if (error.ne.0 .and. (precond.lt.10 .and. iterpremax.gt.0))
then
212 real(kind=
kreal),
dimension(1) :: rhs
213 integer (kind=kint)::precond,iterpremax,i,j,error
225 do j = 1, hecmat%NDOF
226 rhs(1)=rhs(1) + hecmat%B(hecmat%NDOF*(i-1)+j)**2
229 if (hecmesh%mpc%n_mpc > 0)
then
230 do i= 1, hecmesh%mpc%n_mpc
231 rhs(1)= rhs(1) + hecmesh%mpc%mpc_const(i)**2
236 if (rhs(1).eq.0.d0)
then
251 type (hecmwST_local_mesh) :: hecMESH
252 type (hecmwST_matrix),
target :: hecMAT
253 integer(kind=kint) :: METHOD
254 integer(kind=kint) :: ITER, PRECOND, NSET, iterPREmax, NREST
255 integer(kind=kint) :: ITERlog, TIMElog
257 character(len=30) :: msg_precond
258 character(len=30) :: msg_method
273 msg_method=
"BiCGSTAB"
279 msg_method=
"Unlabeled"
289 msg_precond=
"DirectMUMPS"
291 write(msg_precond,
"(a,i0,a)")
"ILU(",precond-10,
")"
297 msg_precond=
"Unlabeled"
299 if (hecmesh%my_rank.eq.0 .and. (iterlog.eq.1 .or. timelog.ge.1))
then
300 write (*,
'(a,i0,a,i0,a,a,a,a,a,i0)')
'### ',hecmat%NDOF,
'x',hecmat%NDOF,
' BLOCK ', &
301 & trim(msg_method),
", ",trim(msg_precond),
", ", iterpremax
subroutine, public hecmw_mat_dump(hecmat, hecmesh)
subroutine, public hecmw_mat_dump_solution(hecmat)
integer(kind=kint) function, public hecmw_mat_get_iterpremax(hecmat)
integer(kind=kint) function, public hecmw_mat_get_nrest(hecmat)
integer(kind=kint) function, public hecmw_mat_get_method2(hecmat)
integer(kind=kint) function, public hecmw_mat_get_method(hecmat)
subroutine, public hecmw_mat_set_sigma_diag(hecmat, sigma_diag)
subroutine, public hecmw_mat_recycle_precond_setting(hecmat)
integer(kind=kint) function, public hecmw_mat_get_timelog(hecmat)
real(kind=kreal) function, public hecmw_mat_get_resid(hecmat)
subroutine, public hecmw_mat_set_flag_converged(hecmat, flag_converged)
integer(kind=kint) function, public hecmw_mat_get_iter(hecmat)
subroutine, public hecmw_mat_set_flag_mpcmatvec(hecmat, flag_mpcmatvec)
real(kind=kreal) function, public hecmw_mat_get_sigma(hecmat)
integer(kind=kint) function, public hecmw_mat_get_mpc_method(hecmat)
real(kind=kreal) function, public hecmw_mat_get_thresh(hecmat)
subroutine, public hecmw_mat_set_flag_diverged(hecmat, flag_diverged)
integer(kind=kint) function, public hecmw_mat_get_precond(hecmat)
integer(kind=kint) function, public hecmw_mat_get_nset(hecmat)
real(kind=kreal) function, public hecmw_mat_get_filter(hecmat)
integer(kind=kint) function, public hecmw_mat_get_iterlog(hecmat)
real(kind=kreal) function, public hecmw_mat_get_sigma_diag(hecmat)
subroutine, public hecmw_precond_clear_timer
real(kind=kreal) function, public hecmw_precond_get_timer()
subroutine hecmw_solve_bicgstab(hecmesh, hecmat, iter, resid, error, tset, tsol, tcomm)
subroutine, public hecmw_solve_cg(hecmesh, hecmat, iter, resid, error, tset, tsol, tcomm)
subroutine, public hecmw_solve_gmres(hecmesh, hecmat, iter, resid, error, tset, tsol, tcomm)
subroutine, public hecmw_solve_gpbicg(hecmesh, hecmat, iter, resid, error, tset, tsol, tcomm)
subroutine hecmw_solve_check_zerodiag(hecmesh, hecmat)
logical function hecmw_solve_check_zerorhs(hecmesh, hecmat)
subroutine hecmw_solve_iterative_printmsg(hecmesh, hecmat, method)
subroutine hecmw_solve_iterative(hecmesh, hecmat)
subroutine, public hecmw_matvec_clear_timer
real(kind=kreal) function, public hecmw_rel_resid_l2(hecmesh, hecmat, commtime)
subroutine, public hecmw_matvec_set_async(hecmat)
real(kind=kreal) function, public hecmw_matvec_get_timer()
subroutine, public hecmw_matvec_unset_async
integer(kind=kint), parameter hecmw_sum
integer(kind=kint), parameter hecmw_max
integer(kind=4), parameter kreal
subroutine hecmw_allreduce_r(hecmesh, val, n, ntag)
subroutine hecmw_allreduce_i1(hecmesh, s, ntag)
integer(kind=kint), parameter hecmw_solver_error_diverge_pc
integer(kind=kint), parameter hecmw_solver_error_diverge_nan
integer(kind=kint), parameter hecmw_solver_error_incons_pc
integer(kind=kint), parameter hecmw_solver_error_zero_diag
subroutine hecmw_solve_error(hecmesh, iflag)
integer(kind=kint), parameter hecmw_solver_error_zero_rhs
integer(kind=kint), parameter hecmw_solver_error_diverge_mat