25 type(hecmwst_ebc) :: hecEBC
28 integer(kind=kint) :: N, NP, NDOF, NNDOF, NPNDOF
29 integer(kind=kint) :: iter, maxiter, nget, ierr
30 integer(kind=kint) :: i, j, k, in, jn, kn, ik
31 integer(kind=kint) :: ig, ig0, is0, ie0
32 real(kind=
kreal) :: t1, t2, tolerance
33 real(kind=
kreal) :: alpha, beta, beta0, resid
34 real(kind=
kreal),
allocatable :: s(:), t(:), p(:)
35 integer(kind=kint),
allocatable :: mark(:)
36 character(len=HECMW_MSG_LEN) :: msg(2), noconv
37 logical :: is_converge, unusable
41 real(kind=
kreal),
parameter :: resid_unusable = 1.0d-2
49 allocate(fstreig%filter(npndof))
50 fstreig%filter = 1.0d0
55 if(hecebc%mark(i) == 0) cycle
57 fstreig%filter(i) = 0.0d0
60 if(hecmw_mat_get_mpc_method(hecmat) == 3)
then
61 allocate(mark(npndof))
62 call hecmw_mpc_mark_slave(hecmesh, hecmat, mark)
64 if(mark(i) == 1) fstreig%filter(i) = 0.0d0
69 do ig0 = 1, fstrsolid%SPRING_ngrp_tot
70 ig = fstrsolid%SPRING_ngrp_ID(ig0)
71 is0 = hecmesh%node_group%grp_index(ig-1) + 1
72 ie0 = hecmesh%node_group%grp_index(ig )
78 call hecmw_allreduce_i1(hecmesh, jn,
hecmw_sum)
80 fstreig%is_free = .true.
82 write(*,
"(a,1pe12.4)")
'** free modal analysis: shift factor =', fstreig%sigma
86 call hecmw_update_r(hecmesh, fstreig%filter, np, ndof)
90 if(fstreig%filter(i) == 1.0d0) in = in + 1
92 call hecmw_allreduce_i1(hecmesh, in,
hecmw_sum)
94 fstreig%maxiter = fstreig%maxiter + 1
95 if(in < fstreig%maxiter)
then
97 write(
imsg,*)
'** changed maxiter to system matrix size.'
99 fstreig%maxiter = in + 1
102 if(in < fstreig%nget)
then
106 maxiter = fstreig%maxiter
108 allocate(q(0:maxiter))
109 allocate(q(0)%q(npndof))
110 allocate(q(1)%q(npndof))
111 allocate(fstreig%eigval(maxiter))
112 allocate(fstreig%eigvec(npndof, maxiter))
113 allocate(tri%alpha(maxiter))
114 allocate(tri%beta(maxiter))
119 fstreig%eigval = 0.0d0
120 fstreig%eigvec = 0.0d0
132 hecmat%Iarray(98) = 1
133 hecmat%Iarray(97) = 1
137 write(
imsg,*)
' ***** STAGE Begin Lanczos loop **'
140 do iter = 1, maxiter-1
146 call solve_lineq(hecmesh, hecmat)
150 if(hecmw_mat_get_flag_diverged(hecmat) /=
kno .or. hecmw_mat_get_flag_converged(hecmat) ==
kno)
then
152 unusable = (resid >= resid_unusable .or. resid /= resid)
153 write(noconv,
'(a,i0,a,1pe12.5)')
' the linear solver did not converge at Lanczos iteration ', &
154 & iter,
'; relative residual =', resid
156 msg(1) =
'### ERROR:'//trim(noconv)
157 msg(2) =
' the eigenvalues cannot be computed from it; loosen the residual tolerance given in !SOLVER'
159 msg(1) =
'### WARNING:'//trim(noconv)
160 msg(2) =
' the eigenvalues may carry an error of a comparable order'
163 write(*,
'(a/a)') trim(msg(1)), trim(msg(2))
164 write(
ilog,
'(a/a)') trim(msg(1)), trim(msg(2))
169 allocate(q(iter+1)%q(npndof))
172 t(i) = hecmat%X(i) * fstreig%filter(i)
178 t(i) = t(i) - tri%beta(iter) * q(iter-1)%q(i)
183 alpha = alpha + p(i) * t(i)
185 call hecmw_allreduce_r1(hecmesh, alpha,
hecmw_sum)
186 tri%alpha(iter) = alpha
190 t(i) = t(i) - tri%alpha(iter) * q(iter)%q(i)
197 s(i) = fstreig%mass(i) * t(i)
203 t1 = t1 + q(j)%q(i) * s(i)
205 call hecmw_allreduce_r1(hecmesh, t1,
hecmw_sum)
207 t(i) = t(i) - t1 * q(j)%q(i)
213 s(i) = fstreig%mass(i) * t(i)
218 beta = beta + s(i) * t(i)
220 call hecmw_allreduce_r1(hecmesh, beta,
hecmw_sum)
221 tri%beta(iter+1) = dsqrt(beta)
225 beta = 1.0d0/tri%beta(iter+1)
228 q(iter+1)%q(i) = t(i) * beta
232 if(iter == 1) beta0 = tri%beta(iter+1)
234 call tridiag(hecmesh, hecmat, fstreig, q, tri, iter, is_converge)
240 if(
associated(q(i)%q))
deallocate(q(i)%q)
242 deallocate(tri%alpha)
252 write(
imsg,*)
' * STAGE Output and postprocessing **'
253 write(
idbg,
'(a,f10.2)')
'Lanczos loop (sec) :', t2 - t1
Essential boundary conditions kept as per-DOF marks and values so that they can be imposed on the mat...
real(kind=kreal) function, public hecmw_rel_resid_l2(hecMESH, hecMAT, COMMtime)
integer(kind=kint), parameter hecmw_sum
integer(kind=4), parameter kreal
real(kind=kreal) function hecmw_wtime()
integer(kind=kint), parameter hecmw_exit_noconv
This modules just summarizes all modules used in eigen analysis.
subroutine lanczos_set_initial_value(hecMESH, hecMAT, fstrEIG, eigvec, p, q, beta)
Initialize Lanczos iterations.
Lanczos iteration calculation.
subroutine fstr_solve_lanczos(hecMESH, hecMAT, fstrSOLID, fstrEIG, hecEBC)
SOLVE EIGENVALUE PROBLEM.
This module provides a subroutine to find the eigenvalues and eigenvectors of a symmetric tridiagonal...
subroutine tridiag(hecMESH, hecMAT, fstrEIG, Q, Tri, iter, is_converge)
This module defines common data and basic structures for analysis.
integer(kind=kint) myrank
PARALLEL EXECUTION.
integer(kind=kint), parameter imsg
integer(kind=kint), parameter idbg
subroutine fstr_abort(code)
Terminate the analysis with a classified exit status. MPI_ABORT does not perform the Fortran I/O fina...
integer(kind=kint), parameter ilog
FILE HANDLER.
integer(kind=kint), parameter kno
Package of data used by Lanczos eigenvalue solver.