FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
fstr_frequency_analysis.f90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
2 ! Copyright (c) 2019 FrontISTR Commons
3 ! This software is released under the MIT License, see LICENSE.txt
4 !-------------------------------------------------------------------------------
7  use m_fstr
8 
9  implicit none
10 contains
11  subroutine fstr_freq_result_init(hecMESH, numcomp, fstrRESULT)
12  !---- args
13  type(hecmwst_local_mesh), intent(in) :: hecMESH
14  integer(kind=kint), intent(in) :: numcomp
15  type(hecmwst_result_data), intent(inout) :: fstrRESULT
16  !---- vals
17  !---- body
18 
19  call hecmw_nullify_result_data(fstrresult)
20  fstrresult%ng_component = 0
21  fstrresult%nn_component = numcomp
22  fstrresult%ne_component = 0
23  allocate( fstrresult%nn_dof(numcomp) )
24  allocate( fstrresult%node_label(numcomp) )
25  allocate( fstrresult%node_val_item(numcomp*hecmesh%n_dof*hecmesh%n_node)) ! Should we use nn_internal?
26  end subroutine
27 
28  subroutine fstr_freq_result_add(fstrRESULT, hecMESH, comp_index, ndof, label, vect)
29  !---- args
30  type(hecmwst_result_data), intent(inout) :: fstrRESULT
31  type(hecmwst_local_mesh), intent(in) :: hecMESH
32  integer(kind=kint), intent(in) :: comp_index
33  integer(kind=kint), intent(in) :: ndof
34  character(len=HECMW_NAME_LEN), intent(in) :: label
35  real(kind=kreal), intent(in) :: vect(:)
36  !---- vals
37  integer(kind=kint) :: i, k, alldof, offset
38  !---- body
39 
40  fstrresult%nn_dof(comp_index) = ndof
41  fstrresult%node_label(comp_index) = label
42  alldof = fstrresult%nn_component*ndof
43  offset = ndof*(comp_index-1)
44  do i=1, hecmesh%n_node
45  do k=1, ndof
46  fstrresult%node_val_item(alldof*(i-1) + k + offset) = vect(ndof*(i-1) + k)
47  end do
48  end do
49 
50  end subroutine
51 
52 end module
53 
54 
56 
57  use m_fstr
59  use m_fstr_addbc
63 
64  implicit none
65 
66 contains
67 
68  subroutine fstr_solve_frequency_analysis(hecMESH, hecMAT, fstrSOLID, fstrEIG, &
69  fstrDYNAMIC, fstrRESULT, fstrPARAM, &
70  fstrCPL, fstrFREQ, hecLagMAT, restart_step_num)
71  !C
72  !C-- global variable
73  !C
74  type(hecmwst_local_mesh) :: hecMESH
75  type(hecmwst_matrix) :: hecMAT
76  type(fstr_eigen) :: fstrEIG
77  type(fstr_solid) :: fstrSOLID
78  type(hecmwst_result_data) :: fstrRESULT
79  type(fstr_param) :: fstrPARAM
80  type(fstr_dynamic) :: fstrDYNAMIC
81  type(fstr_couple) :: fstrCPL
82  type(fstr_freqanalysis) :: fstrFREQ
83  type(hecmwst_matrix_lagrange) :: hecLagMAT
84  integer(kind=kint) :: restart_step_num
85 
86  !C
87  !C-- local variable
88  !C
89  integer(kind=kint) :: numnode, numelm, startmode, endmode, nummode, ndof, im, in, ntotal, vistype
90  integer(kind=kint) :: numfreq, idnode, numdisp
91  integer(kind=kint) :: freqiout(3)
92  integer(kind=kint) :: ierr
93  integer(kind=kint), parameter :: ilogin = 9056
94  real(kind=kreal), allocatable :: eigenvalue(:), loadvecre(:), loadvecim(:)
95  real(kind=kreal), allocatable :: bjre(:), bjim(:), dvare(:), dvaim(:), disp(:), vel(:), acc(:)
96  real(kind=kreal), allocatable :: dispre(:), dispim(:), velre(:), velim(:), accre(:), accim(:)
97  real(kind=kreal) :: freq, omega, val, dx, dy, dz, f_start, f_end
98  real(kind=kreal) :: t_start, t_end, time, dxi, dyi, dzi
99  type(fstr_freqanalysis_data) :: freqdata
100 
101  numnode = hecmesh%nn_internal
102  numelm = hecmesh%n_elem
103  ndof = hecmesh%n_dof
104  startmode = fstrfreq%start_mode
105  endmode = fstrfreq%end_mode
106  nummode = endmode - startmode +1
107 
108  freqdata%numMode = nummode
109  freqdata%numNodeDOF = numnode*ndof
110  allocate(freqdata%eigOmega(nummode))
111  allocate(freqdata%eigVector(numnode*ndof, nummode))
112 
113  call setupfreqparam(fstrdynamic, f_start, f_end, numfreq, freqdata%rayAlpha, freqdata%rayBeta, idnode, vistype, freqiout)
114  write(*,*) "Rayleigh alpha:", freqdata%rayAlpha
115  write(*,*) "Rayleigh beta:", freqdata%rayBeta
116  write(ilog,*) "Rayleigh alpha:", freqdata%rayAlpha
117  write(ilog,*) "Rayleigh beta:", freqdata%rayBeta
118 
119 
120  allocate(eigenvalue(nummode))
121  allocate(loadvecre(numnode*ndof))
122  allocate(loadvecim(numnode*ndof))
123  allocate(bjre(nummode))
124  allocate(bjim(nummode))
125  allocate(dvare(numnode*ndof))
126  allocate(dvaim(numnode*ndof))
127  allocate(disp(numnode*ndof))
128  allocate(vel(numnode*ndof))
129  allocate(acc(numnode*ndof))
130  allocate(dispre(numnode*ndof))
131  allocate(dispim(numnode*ndof))
132  allocate(velre(numnode*ndof))
133  allocate(velim(numnode*ndof))
134  allocate(accre(numnode*ndof))
135  allocate(accim(numnode*ndof))
136 
137  loadvecre(:) = 0.0d0
138  loadvecim(:) = 0.0d0
139 
140  write(*,*) "--frequency analysis--"
141  write(*, *) "read from=", trim(fstrfreq%eigenlog_filename)
142  write(ilog,*) "read from=", trim(fstrfreq%eigenlog_filename)
143  write(*, *) "start mode=", startmode
144  write(ilog,*) "start mode=", startmode
145  write(*, *) "end mode=", endmode
146  write(ilog,*) "end mode=", endmode
147  open(unit=ilogin, file=trim(fstrfreq%eigenlog_filename), status="OLD", action="READ", iostat=ierr)
148  if( ierr /= 0 ) then
149  write(*,*) "Error: cannot open eigenlog file: ", trim(fstrfreq%eigenlog_filename)
150  call hecmw_abort( hecmw_comm_get_comm() )
151  endif
152  call read_eigen_values(ilogin, startmode, endmode, eigenvalue, freqdata%eigOmega)
153  !call read_eigen_vector(ilogin, startmode, endmode, ndof, numnode, freqData%eigVector)
154  close(ilogin)
155 
156  call read_eigen_vector_res(hecmesh, startmode, endmode, ndof, numnode, freqdata%eigVector)
157 
158  call extract_surf2node(hecmesh, fstrfreq, ndof, loadvecre, loadvecim)
159  call assemble_nodeload(hecmesh, fstrfreq, ndof, loadvecre, loadvecim)
160 
161  write(*,*) "calc mass matrix"
162  call calcmassmatrix(fstrparam, hecmesh, hecmat, fstrsolid, fstreig, heclagmat)
163  write(*,*) "scale eigenvector"
164  call scaleeigenvector(fstreig, ndof*numnode, nummode, freqdata%eigVector)
165 
166  write(*, *) "start frequency:", f_start
167  write(ilog,*) "start frequency:", f_start
168  write(*, *) "end frequency:", f_end
169  write(ilog,*) "end frequency:", f_end
170  write(* ,*) "number of the sampling points", numfreq
171  write(ilog,*) "number of the sampling points", numfreq
172  write(* ,*) "monitor nodeid=", idnode
173  write(ilog,*) "monitor nodeid=", idnode
174 
175  do im=1, numfreq
176  freq = (f_end-f_start)/dble(numfreq)*dble(im) + f_start
177  omega = 2.0d0 * 3.14159265358979d0 * freq
178 
179  call calcfreqcoeff(freqdata, loadvecre, loadvecim, omega, bjre, bjim)
180  call calcdispvector(freqdata, bjre, bjim, dvare, dvaim)
181 
182  dx = sqrt(dvare(3*(idnode-1)+1)**2 + dvaim(3*(idnode-1)+1)**2)
183  dy = sqrt(dvare(3*(idnode-1)+2)**2 + dvaim(3*(idnode-1)+2)**2)
184  dz = sqrt(dvare(3*(idnode-1)+3)**2 + dvaim(3*(idnode-1)+3)**2)
185  val = sqrt(dx**2 + dy**2 + dz**2)
186  write(*, *) freq, "[Hz] : ", val
187  write(ilog, *) freq, "[Hz] : ", val
188  disp(:) = abs(cmplx(dvare(:), dvaim(:)))
189 
190  call calcvelvector(freqdata, omega, bjre, bjim, dvare, dvaim)
191  vel(:) = abs(cmplx(dvare(:), dvaim(:)))
192 
193  call calcaccvector(freqdata, omega, bjre, bjim, dvare, dvaim)
194  acc(:) = abs(cmplx(dvare(:), dvaim(:)))
195 
196  if(iresult==1) then
197  write(*, *) freq, "[Hz] : ", im, ".res"
198  write(ilog,*) freq, "[Hz] : ", im, ".res"
199  call output_resfile(hecmesh, freq, im, disp, vel, acc, freqiout)
200  end if
201  if(ivisual==1 .and. vistype==1) then
202  write(*, *) freq, "[Hz] : ", im, ".vis"
203  write(ilog,*) freq, "[Hz] : ", im, ".vis"
204  call output_visfile(hecmesh, im, disp, vel, acc, freqiout)
205  end if
206  end do
207 
208  call setupdynaparam(fstrdynamic, t_start, t_end, freq, numdisp)
209  write(*, *) "start time:", t_start
210  write(ilog,*) "start time:", t_start
211  write(*, *) "end time:", t_end
212  write(ilog,*) "end time:", t_end
213  write(*, *) "frequency:", freq
214  write(ilog,*) "frequency:", freq
215  write(*, *) "node id:", idnode
216  write(ilog,*) "node id:", idnode
217  write(*, *) "num disp:", numdisp
218  write(ilog,*) "num disp:", numdisp
219 
220  omega = 2.0d0 * 3.14159265358979d0 * freq
221  call calcfreqcoeff(freqdata, loadvecre, loadvecim, omega, bjre, bjim)
222  call calcdispvector(freqdata, bjre, bjim, dvare, dvaim)
223 
224  do im=1, numdisp
225  time = (t_end-t_start)/dble(numdisp)*dble(im-1) + t_start
226  call calcdispvectortime(freqdata, time, omega, bjre, bjim, dvare, dvaim)
227  dx = dvare(3*(idnode-1)+1)
228  dy = dvare(3*(idnode-1)+2)
229  dz = dvare(3*(idnode-1)+3)
230  dxi = dvaim(3*(idnode-1)+1)
231  dyi = dvaim(3*(idnode-1)+2)
232  dzi = dvaim(3*(idnode-1)+3)
233 
234  call calcvelvectortime(freqdata, time, omega, bjre, bjim, velre, velim)
235  call calcaccvectortime(freqdata, time, omega, bjre, bjim, accre, accim)
236  if(iresult==1) then
237  write(*, *) "time=", time, " : ", im, ".res"
238  write(ilog,*) "time=", time, " : ", im, ".res"
239  call outputdyna_resfile(hecmesh, time, im, dvare, dvaim, velre, velim, accre, accim, freqiout)
240  end if
241  if(ivisual==1 .and. vistype==2) then
242  write(*, *) "time=", time, " : ", im, ".vis"
243  write(ilog,*) "time=", time, " : ", im, ".vis"
244  call outputdyna_visfile(hecmesh, im, dvare, dvaim, velre, velim, accre, accim, freqiout)
245  end if
246  end do
247 
248  deallocate(freqdata%eigOmega)
249  deallocate(freqdata%eigVector)
250  deallocate(eigenvalue)
251  deallocate(loadvecre)
252  deallocate(loadvecim)
253  deallocate(bjre)
254  deallocate(bjim)
255  deallocate(dvare)
256  deallocate(dvaim)
257  deallocate(disp)
258  deallocate(vel)
259  deallocate(acc)
260  deallocate(dispre)
261  deallocate(dispim)
262  deallocate(velre)
263  deallocate(velim)
264  deallocate(accre)
265  deallocate(accim)
266 
267  end subroutine
268 
269  subroutine read_eigen_values(logfile, startmode, endmode, eigenvalue, anglfreq)
270  !---- args
271  integer(kind=kint), intent(in) :: logfile
272  integer(kind=kint), intent(in) :: startmode
273  integer(kind=kint), intent(in) :: endmode
274  real(kind=kreal), intent(inout) :: eigenvalue(:) !intend(endmode-startmode+1)
275  real(kind=kreal), intent(inout) :: anglfreq(:)
276  !---- vals
277  integer(kind=kint) :: im, endflag, id
278  character(len=HECMW_MSG_LEN) :: line
279  real(kind=kreal) :: freq
280  !---- body
281 
282  rewind(logfile)
283  endflag = 0
284  !Find eigenvalue header.
285  do
286  read(logfile, '(A80)', err=119) line
287  if(trim(adjustl(line)) == "NO. EIGENVALUE FREQUENCY (HZ) X Y Z X") then
288  endflag = 1
289  exit
290  end if
291  end do
292  read(logfile, '(A80)') line
293  !read eigenvalue
294  do im=1, startmode-1
295  read(logfile, '(A80)') line
296  end do
297  do im=1, (endmode-startmode+1)
298  read(logfile, '(i5,3e12.4,a)', err=119) id, eigenvalue(im), anglfreq(im), freq, line
299  end do
300  return
301 
302  !error handling
303  119 write(*,*) "Error to find eigenvalue information from logfile"
304  write(ilog,*) "Error to find eigenvalue information from logfile"
305  stop
306  end subroutine
307 
308  subroutine read_eigen_vector(logfile, startmode, endmode, numdof, numnode, eigenvector)
309  !---- args
310  integer(kind=kint), intent(in) :: logfile
311  integer(kind=kint), intent(in) :: startmode
312  integer(kind=kint), intent(in) :: endmode
313  integer(kind=kint), intent(in) :: numdof
314  integer(kind=kint), intent(in) :: numnode
315  real(kind=kreal), intent(inout) :: eigenvector(:, :) !intend (numdof*NN,nmode)
316  !---- vals
317  integer(kind=kint) :: im, in, gblid, j, idx
318  real(kind=kreal) :: vec(6)
319  character(len=HECMW_MSG_LEN) :: line
320  !---- body
321 
322  rewind(logfile)
323  !Find first eigenvector header
324  do im=1, startmode-1
325  do
326  read(logfile, '(a80)', err=119, end=119) line
327  if(line(1:9) == " Mode No.") then
328  exit ! goto next mode
329  end if
330  end do
331  end do
332 
333  !read eigenvector
334  do im=1, (endmode-startmode+1)
335  !find header
336  do
337  read(logfile, '(a80)', err=119, end=119) line
338  if(line(1:9) == " Mode No.") then
339  exit !find eigenmode
340  end if
341  end do
342 
343  read(logfile, '(a80)', err=119) line
344  read(logfile, '(a80)', err=119) line
345  read(logfile, '(a80)', err=119) line
346  read(logfile, '(a80)', err=119) line
347  !read eigenvector component
348  do in=1, numnode
349  select case(numdof)
350  case(2)
351  read(logfile, '(i10,2e12.4)', err=119) gblid, (vec(j), j=1,2)
352 
353  case(3)
354  !read(logfile, '(i10,3e12.4)', ERR=119) gblid, (vec(j), j=1,3)
355  read(logfile, '(i10,3e16.8)', err=119) gblid, (vec(j), j=1,3)
356 
357  case(6)
358  read(logfile, '(i10,6e12.4)', err=119) gblid, (vec(j), j=1,6)
359  case default
360  !error
361  goto 119
362  end select
363 
364  do j=1, numdof
365  idx = (in-1)*numdof + j
366  eigenvector(idx,im) = vec(j)
367  end do
368  end do
369  end do
370  return
371 
372  !error handling
373  119 write(*,*) "Error to find eigenvector from logfile"
374  write(ilog,*) "Error to find eigenvector from logfile"
375  stop
376 
377  end subroutine
378 
379  subroutine read_eigen_vector_res(hecMESH, startmode, endmode, numdof, numnode, eigenvector)
380  !---- args
381  type(hecmwst_local_mesh), intent(in) :: hecMESH
382  integer(kind=kint), intent(in) :: startmode
383  integer(kind=kint), intent(in) :: endmode
384  integer(kind=kint), intent(in) :: numdof
385  integer(kind=kint), intent(in) :: numnode
386  real(kind=kreal), intent(inout) :: eigenvector(:, :) !intend (numdof*NN,nmode)
387  !---- vals
388  integer(kind=kint), parameter :: compidx = 1 !Component index of displacement
389  integer(kind=kint) :: imode, idx, ind, a, b, nallcomp, j
390  type(hecmwst_result_data) :: eigenres
391  character(len=HECMW_NAME_LEN) :: name
392  !---- body
393 
394  name = 'result-in'
395  do imode=startmode, endmode
396  call nullify_result_data(eigenres)
397  call hecmw_result_read_by_name(hecmesh, name, imode, eigenres)
398 
399  nallcomp = 0
400  do ind=1,eigenres%nn_component
401  nallcomp = nallcomp + eigenres%nn_dof(ind)
402  end do
403 
404  idx = imode - startmode + 1
405  do ind=1, numnode
406  do j=1, numdof
407  a = (ind-1)*nallcomp + j !src vector index
408  b = (ind-1)*numdof + j
409  eigenvector(b,imode) = eigenres%node_val_item(a)
410  end do
411  end do
412  call free_result_data(eigenres)
413  end do
414 
415  contains
416 
417  subroutine free_result_data(res)
418  !---- args
419  type(hecmwst_result_data) :: res
420  !---- vals
421  !---- body
422  if(associated(res%nn_dof)) deallocate(res%nn_dof)
423  if(associated(res%ne_dof)) deallocate(res%ne_dof)
424  if(associated(res%node_label)) deallocate(res%node_label)
425  if(associated(res%elem_label)) deallocate(res%elem_label)
426  if(associated(res%node_val_item)) deallocate(res%node_val_item)
427  if(associated(res%elem_val_item)) deallocate(res%elem_val_item)
428  end subroutine
429 
430  subroutine nullify_result_data(res)
431  !---- args
432  type(hecmwst_result_data) :: res
433  !---- vals
434  !---- body
435  nullify(res%nn_dof)
436  nullify(res%ne_dof)
437  nullify(res%node_label)
438  nullify(res%elem_label)
439  nullify(res%node_val_item)
440  nullify(res%elem_val_item)
441  end subroutine
442 
443 
444  end subroutine
445 
446  subroutine output_resfile(hecMESH, freq, ifreq, disp, vel, acc, iout)
447  !---- args
448  type(hecmwst_local_mesh), intent(in) :: hecMESH
449  real(kind=kreal), intent(in) :: freq
450  integer(kind=kint), intent(in) :: ifreq
451  real(kind=kreal), intent(in) :: disp(:) !intend (numnodeDOF)
452  real(kind=kreal), intent(in) :: vel(:) !intend (numnodeDOF)
453  real(kind=kreal), intent(in) :: acc(:) !intend (numnodeDOF)
454  integer(kind=kint), intent(in) :: iout(3)
455  !---- vals
456  integer(kind=kint) :: im
457  character(len=HECMW_HEADER_LEN) :: header
458  character(len=HECMW_MSG_LEN) :: comment
459  character(len=HECMW_NAME_LEN) :: label, nameid
460  real(kind=kreal) :: freqval(1)
461  !---- body
462 
463  nameid='fstrRES'
464  header='*fstrresult'
465  comment='frequency_result'
466  call hecmw_result_init(hecmesh, ifreq, header, comment)
467 
468  label = "frequency"
469  freqval(1) = freq
470  call hecmw_result_add(hecmw_result_dtype_global, 1, label, freqval)
471 
472  if(iout(1) == 1) then
473  label='displacement'
474  call hecmw_result_add(hecmw_result_dtype_node, 3, label, disp) !mode=node, ndof=3
475  end if
476  if(iout(2) == 1) then
477  label='velocity'
478  call hecmw_result_add(hecmw_result_dtype_node, 3, label, vel) !mode=node, ndof=3
479  end if
480  if(iout(3) == 1) then
481  label='acceleration'
482  call hecmw_result_add(hecmw_result_dtype_node, 3, label, acc) !mode=node, ndof=3
483  end if
484  call hecmw_result_write_by_name(nameid)
485  call hecmw_result_finalize()
486  return
487  end subroutine
488 
489  subroutine output_visfile(hecMESH, ifreq, disp, vel, acc, iout)
490  !---- args
491  type(hecmwst_local_mesh), intent(in) :: hecmesh
492  integer(kind=kint), intent(in) :: ifreq
493  real(kind=kreal), intent(in) :: disp(:) !intend (numnodeDOF)
494  real(kind=kreal), intent(in) :: vel(:) !intend (numnodeDOF)
495  real(kind=kreal), intent(in) :: acc(:) !intend (numnodeDOF)
496  integer(kind=kint), intent(in) :: iout(3)
497  !---- vals
498  type(hecmwst_result_data) :: fstrRESULT
499  character(len=HECMW_NAME_LEN) :: label
500  integer(kind=kint) :: ncomp, i
501  !---- body
502  ncomp = 0
503  do i=1, 3
504  if(iout(i) == 1) then
505  ncomp = ncomp + 1
506  end if
507  end do
508 
509  call fstr_freq_result_init(hecmesh, ncomp, fstrresult)
510  ncomp=1
511  if(iout(1) == 1) then
512  label = 'displace_abs'
513  call fstr_freq_result_add(fstrresult, hecmesh, ncomp, 3, label, disp)
514  ncomp = ncomp + 1
515  end if
516  if(iout(2) == 1) then
517  label = 'velocity_abs'
518  call fstr_freq_result_add(fstrresult, hecmesh, ncomp, 3, label, vel)
519  ncomp = ncomp + 1
520  end if
521  if(iout(3) == 1) then
522  label = 'acceleration_abs'
523  call fstr_freq_result_add(fstrresult, hecmesh, ncomp, 3, label, acc)
524  ncomp = ncomp + 1
525  end if
526 
527  call fstr2hecmw_mesh_conv(hecmesh)
528  call hecmw_visualize_init
529  call hecmw_visualize( hecmesh, fstrresult, ifreq )
530  call hecmw2fstr_mesh_conv(hecmesh)
531  call hecmw_result_free(fstrresult)
532  end subroutine
533 
534  subroutine extract_surf2node(hecMESH, freqData, numdof, loadvecRe, loadvecIm)
535  !---- args
536  type(hecmwst_local_mesh), intent(in) :: hecMESH
537  type(fstr_freqanalysis), intent(in) :: freqData
538  integer(kind=kint), intent(in) :: numdof
539  real(kind=kreal), intent(inout) :: loadvecre(:) !intend(numnode*ndof)
540  real(kind=kreal), intent(inout) :: loadvecim(:) !intend(numnode*ndof)
541  !---- vals
542  integer(kind=kint), parameter :: MAXNODE = 100
543  integer(kind=kint) :: sgrpID, is, ie, ic, nsurf, ic_type, outtype, node_index(MAXNODE)
544  integer(kind=kint) :: nn, iss, nodeid, dof_index, ndof
545  integer(kind=kint) :: i, j, k, l, m, isn, nsize
546  integer(kind=kint) :: iwk(60), nodLOCAL(20)
547  real(kind=kreal) :: vect(60), xx(20), yy(20), zz(20), forcere(3), forceim(3)
548  !---- body
549 
550  ndof = 3
551  do i=1,freqdata%FLOAD_ngrp_tot
552  if(freqdata%FLOAD_ngrp_TYPE(i) == kfloadtype_surf) then !FLOAD type=surface
553  sgrpid = freqdata%FLOAD_ngrp_ID(i)
554  dof_index = freqdata%FLOAD_ngrp_DOF(i)
555  forcere(:) = 0.0d0
556  forceim(:) = 0.0d0
557  forcere(dof_index) = freqdata%FLOAD_ngrp_valre(i)
558  forceim(dof_index) = freqdata%FLOAD_ngrp_valim(i)
559 
560  is = hecmesh%surf_group%grp_index(sgrpid-1) + 1
561  ie = hecmesh%surf_group%grp_index(sgrpid)
562  do j=is, ie
563  ic = hecmesh%surf_group%grp_item(2*j-1)
564  nsurf = hecmesh%surf_group%grp_item(2*j)
565  ic_type = hecmesh%elem_type(ic)
566  nn = hecmw_get_max_node(ic_type)
567  isn = hecmesh%elem_node_index(ic-1)
568  do k=1, nn
569  nodlocal(k) = hecmesh%elem_node_item(isn+k)
570  xx(k) = hecmesh%node(3*nodlocal(k)-2)
571  yy(k) = hecmesh%node(3*nodlocal(k)-1)
572  zz(k) = hecmesh%node(3*nodlocal(k) )
573  do l=1, ndof
574  iwk(ndof*(k-1)+l) = ndof*(nodlocal(k)-1)+l
575  end do
576  end do
577 
578  call dl_c3_freq(ic_type, nn, xx, yy, zz, nsurf, forcere, vect, nsize)
579  do k=1,nsize
580  loadvecre(iwk(k)) = loadvecre(iwk(k)) + vect(k)
581  end do
582 
583  call dl_c3_freq(ic_type, nn, xx, yy, zz, nsurf, forceim, vect, nsize)
584  do k=1,nsize
585  loadvecim(iwk(k)) = loadvecim(iwk(k)) + vect(k)
586  end do
587  end do
588  end if
589  end do
590 
591  return
592  end subroutine
593 
594  subroutine dl_c3_freq(ETYPE, NN, XX, YY, ZZ, LTYPE, force, VECT, nsize)
595  !---- args
596  integer(kind=kint), intent(in) :: ETYPE !--solid element type
597  integer(kind=kint), intent(in) :: NN !--node num
598  integer(kind=kint), intent(in) :: LTYPE !--solid element face
599  real(kind=kreal), intent(in) :: xx(:) !--node x pos
600  real(kind=kreal), intent(in) :: yy(:) !--node y pos
601  real(kind=kreal), intent(in) :: zz(:) !--node z pos
602  real(kind=kreal), intent(in) :: force(3) !--node surfforce
603  real(kind=kreal), intent(inout) :: vect(:)
604  integer(kind=kint), intent(inout) :: nsize
605  !---- vals
606  integer(kind=kint), parameter :: NDOF = 3
607  real(kind=kreal) :: wg
608  integer(kind=kint) :: NOD(NN)
609  real(kind=kreal) :: elecoord(3, nn), localcoord(3)
610  real(kind=kreal) :: h(nn)
611  integer(kind=kint) :: I, IG2, NSUR, SURTYPE
612  !---- body
613 
614  call getsubface( etype, ltype, surtype, nod )
615  nsur = getnumberofnodes( surtype )
616 
617  do i=1,nsur
618  elecoord(1,i)=xx(nod(i))
619  elecoord(2,i)=yy(nod(i))
620  elecoord(3,i)=zz(nod(i))
621  end do
622  nsize = nn*ndof
623  vect(1:nsize) = 0.0d0
624  do ig2=1,numofquadpoints( surtype )
625  call getquadpoint( surtype, ig2, localcoord(1:2) )
626  call getshapefunc( surtype, localcoord(1:2), h(1:nsur) )
627 
628  wg=getweight( surtype, ig2 )
629  do i=1,nsur
630  vect(3*nod(i)-2)=vect(3*nod(i)-2)+wg*h(i)*force(1)
631  vect(3*nod(i)-1)=vect(3*nod(i)-1)+wg*h(i)*force(2)
632  vect(3*nod(i) )=vect(3*nod(i) )+wg*h(i)*force(3)
633  end do
634  end do
635  end subroutine
636 
637  subroutine assemble_nodeload(hecMESH, freqData, numdof, loadvecRe, loadvecIm)
638  !---- args
639  type(hecmwst_local_mesh), intent(in) :: hecMESH
640  type(fstr_freqanalysis), intent(in) :: freqData
641  integer(kind=kint), intent(in) :: numdof
642  real(kind=kreal), intent(inout) :: loadvecre(:)
643  real(kind=kreal), intent(inout) :: loadvecim(:)
644  !---- vals
645  integer(kind=kint) :: i, vecsize, ig, is, ie, in, nodeid, dof_index
646 
647  !---- body
648 
649  do i=1, freqdata%FLOAD_ngrp_tot
650  if(freqdata%FLOAD_ngrp_TYPE(i) == kfloadtype_node) then
651  ig = freqdata%FLOAD_ngrp_ID(i)
652  is = hecmesh%node_group%grp_index(ig-1) + 1
653  ie = hecmesh%node_group%grp_index(ig)
654  do in=is, ie
655  nodeid = hecmesh%node_group%grp_item(in)
656  dof_index = freqdata%FLOAD_ngrp_DOF(i)
657  loadvecre((nodeid-1)*numdof + dof_index) = loadvecre((nodeid-1)*numdof + dof_index) + freqdata%FLOAD_ngrp_valre(i)
658  loadvecim((nodeid-1)*numdof + dof_index) = loadvecim((nodeid-1)*numdof + dof_index) + freqdata%FLOAD_ngrp_valim(i)
659  end do
660  end if
661  end do
662  return
663  end subroutine
664 
665  subroutine calcmassmatrix(fstrPARAM, hecMESH, hecMAT, fstrSOLID, fstrEIG, hecLagMAT)
666  !---- args
667  type(fstr_param), intent(in) :: fstrPARAM
668  type(hecmwst_local_mesh), intent(in) :: hecMESH
669  type(hecmwst_matrix), intent(inout) :: hecMAT
670  type(fstr_solid), intent(inout) :: fstrSOLID
671  type(fstr_eigen), intent(inout) :: fstrEIG
672  type(hecmwst_matrix_lagrange), intent(inout) :: hecLagMAT
673  !---- vals
674  integer(kind=kint) :: ntotal
675  !---- body
676 
677 
678  fstrsolid%dunode = 0.d0
679  call fstr_stiffmatrix( hecmesh, hecmat, fstrsolid, 0.d0, 0.d0 )
680  call fstr_addbc(1, hecmesh, hecmat, fstrsolid, fstrparam, heclagmat, 2)
681 
682  call setmass(fstrsolid, hecmesh, hecmat, fstreig)
683 
684  end subroutine
685 
686  subroutine scaleeigenvector(fstrEIG, ntotaldof, nmode, eigenvector)
687  !---- args
688  type(fstr_eigen), intent(in) :: fstrEIG
689  integer(kind=kint), intent(in) :: ntotaldof
690  integer(kind=kint), intent(in) :: nmode
691  real(kind=kreal), intent(inout) :: eigenvector(:, :)
692  !---- vals
693  integer(kind=kint) :: imode, idof
694  real(kind=kreal) :: mas
695  !---- body
696 
697  do imode=1,nmode
698  mas = 0.0d0
699  do idof=1,ntotaldof
700  mas = mas + fstreig%mass(idof)*eigenvector(idof,imode)**2
701  end do
702  do idof=1,ntotaldof
703  eigenvector(idof,imode) = eigenvector(idof,imode) / sqrt(mas)
704  end do
705  end do
706  end subroutine
707 
708  subroutine checkorthvector(fstrEIG, eigenvector, imode, jmode, prod)
709  !---- args
710  type(fstr_eigen), intent(in) :: fstreig
711  real(kind=kreal), intent(in) :: eigenvector(:, :)
712  integer(kind=kint), intent(in) :: imode
713  integer(kind=kint), intent(in) :: jmode
714  real(kind=kreal), intent(inout) :: prod
715  !---- vals
716  integer(kind=kint) :: idof, s
717  !---- body
718  s = size(eigenvector(:,1))
719  prod = 0.0d0
720 
721  do idof=1, s
722  prod = prod + eigenvector(idof,imode)*fstreig%mass(idof)*eigenvector(idof,jmode)
723  end do
724  return
725  end subroutine
726 
727  subroutine writeoutvector(im, vector)
728  !---- args
729  integer(kind=kint), intent(in) :: im
730  real(kind=kreal), intent(in) :: vector(:)
731  !---- vals
732  integer(kind=kint) :: i, s
733  !---- body
734  s = size(vector)
735  do i=1, s
736  if(i == 1) then
737  write(*,'("eigenvec",i2.2,":[",e12.5,", ")') im, vector(i)
738  else if(i /= s) then
739  write(*,'(e12.5,", ")') vector(i)
740  else
741  write(*,'(e12.5,"];")') vector(i)
742  end if
743  end do
744  write(*,*)
745  return
746  end subroutine
747 
748  subroutine calcdotproduct(a, b, c)
749  !---- args
750  real(kind=kreal), intent(in) :: a(:)
751  real(kind=kreal), intent(in) :: b(:)
752  real(kind=kreal), intent(inout) :: c
753  !---- vals
754  !---- body
755  c = dot_product(a, b)
756  !Next, we need allreduce operation to implement distribute mesh.
757  return
758  end subroutine
759 
760  subroutine calcfreqcoeff(freqData, loadRe, loadIm, inpOmega, bjRe, bjIm)
761  !---- args
762  type(fstr_freqanalysis_data), intent(in) :: freqdata
763  real(kind=kreal), intent(in) :: loadre(:) !intend (numNodeDOF)
764  real(kind=kreal), intent(in) :: loadim(:) !intend (numNodeDOF)
765  real(kind=kreal), intent(in) :: inpomega
766  real(kind=kreal), intent(inout) :: bjre(:) !intend (numMode)
767  real(kind=kreal), intent(inout) :: bjim(:) !intend (numMode)
768  !---- vals
769  integer(kind=kint) :: imode
770  real(kind=kreal) :: ujfr, ujfi, a, b, alp, beta
771  !---- body
772 
773  alp = freqdata%rayAlpha
774  beta = freqdata%rayBeta
775 
776  do imode=1, freqdata%numMode
777  call calcdotproduct(freqdata%eigVector(:,imode), loadre, ujfr)
778  call calcdotproduct(freqdata%eigVector(:,imode), loadim, ujfi)
779 
780  a = ujfr*(freqdata%eigOmega(imode)**2 - inpomega**2) + ujfi*(alp + beta*freqdata%eigOmega(imode)**2)*inpomega
781  b = (freqdata%eigOmega(imode)**2 - inpomega**2)**2 + ((alp + beta*freqdata%eigOmega(imode)**2)*inpomega)**2
782  bjre(imode) = a / b
783 
784  a = ujfi*(freqdata%eigOmega(imode)**2 -inpomega**2) - ujfr*(alp + beta*freqdata%eigOmega(imode)**2)*inpomega
785  b = (freqdata%eigOmega(imode)**2 - inpomega**2)**2 + ((alp + beta*freqdata%eigOmega(imode)**2)*inpomega)**2
786  bjim(imode) = a / b
787  end do
788  return
789  end subroutine
790 
791  subroutine calcdispvector(freqData, bjRe, bjIm, dispRe, dispIm)
792  !---- args
793  type(fstr_freqanalysis_data), intent(in) :: freqdata
794  real(kind=kreal), intent(in) :: bjre(:) !intend (numMode)
795  real(kind=kreal), intent(in) :: bjim(:) !intend (numMode)
796  real(kind=kreal), intent(inout) :: dispre(:) !intend (numNodeDOF)
797  real(kind=kreal), intent(inout) :: dispim(:) !intend (numNodeDOF)
798  !---- vals
799  integer(kind=kint) :: imode
800  !---- body
801 
802  dispre(:) = 0.0d0
803  dispim(:) = 0.0d0
804 
805  do imode=1, freqdata%numMode
806  dispre(:) = dispre(:) + bjre(imode)*freqdata%eigVector(:,imode)
807  dispim(:) = dispim(:) + bjim(imode)*freqdata%eigVector(:,imode)
808  end do
809  return
810  end subroutine
811 
812  subroutine calcvelvector(freqData, omega, bjRe, bjIm, velRe, velIm)
813  !---- args
814  type(fstr_freqanalysis_data), intent(in) :: freqData
815  real(kind=kreal), intent(in) :: omega
816  real(kind=kreal), intent(in) :: bjre(:) !intend (numMode)
817  real(kind=kreal), intent(in) :: bjim(:) !intend (numMode)
818  real(kind=kreal), intent(inout) :: velre(:) !intend (numNodeDOF)
819  real(kind=kreal), intent(inout) :: velim(:) !intend (numNodeDOF)
820  !---- vals
821  integer(kind=kint) :: imode
822  !---- body
823 
824  velre(:) = 0.0d0
825  velim(:) = 0.0d0
826 
827  do imode=1, freqdata%numMode
828  velre(:) = velre(:) - omega * bjim(imode) * freqdata%eigVector(:,imode)
829  velim(:) = velim(:) + omega * bjre(imode) * freqdata%eigVector(:,imode)
830  end do
831  end subroutine
832 
833  subroutine calcaccvector(freqData, omega, bjRe, bjIm, accRe, accIm)
834  !---- args
835  type(fstr_freqanalysis_data), intent(in) :: freqData
836  real(kind=kreal), intent(in) :: omega
837  real(kind=kreal), intent(in) :: bjre(:) !intend (numMode)
838  real(kind=kreal), intent(in) :: bjim(:) !intend (numMode)
839  real(kind=kreal), intent(inout) :: accre(:) !intend (numNodeDOF)
840  real(kind=kreal), intent(inout) :: accim(:) !intend (numNodeDOF)
841  !---- vals
842  integer(kind=kint) :: imode
843  !---- body
844 
845  accre(:) = 0.0d0
846  accim(:) = 0.0d0
847 
848  do imode=1, freqdata%numMode
849  accre(:) = accre(:) - omega**2 * bjre(imode) * freqdata%eigVector(:,imode)
850  accim(:) = accim(:) - omega**2 * bjim(imode) * freqdata%eigVector(:,imode)
851  end do
852 
853  end subroutine
854 
855  subroutine setupfreqparam(fstrDYNAMIC, f_start, f_end, numfreq, raym, rayk, idnode, vistype, ioutl)
856  !---- args
857  type(fstr_dynamic), intent(in) :: fstrDYNAMIC
858  real(kind=kreal), intent(inout) :: f_start
859  real(kind=kreal), intent(inout) :: f_end
860  integer(kind=kint), intent(inout) :: numfreq
861  real(kind=kreal), intent(inout) :: raym
862  real(kind=kreal), intent(inout) :: rayk
863  integer(kind=kint), intent(inout) :: idnode
864  integer(kind=kint), intent(inout) :: vistype
865  integer(kind=kint), intent(inout) :: ioutl(3)
866  !---- vals
867 
868  !---- body
869  f_start = fstrdynamic%t_start
870  f_end = fstrdynamic%t_end
871  numfreq = fstrdynamic%n_step
872  raym = fstrdynamic%ray_m
873  rayk = fstrdynamic%ray_k
874  idnode = fstrdynamic%nout_monit
875  vistype = fstrdynamic%ngrp_monit
876  ioutl(1:3) = fstrdynamic%iout_list(1:3)
877  return
878  end subroutine
879 
880  subroutine calcdispvectortime(freqData, time, omega, bjRe, bjIm, dispRe, dispIm)
881  !---- args
882  type(fstr_freqanalysis_data), intent(in) :: freqData
883  real(kind=kreal), intent(in) :: time
884  real(kind=kreal), intent(in) :: omega
885  real(kind=kreal), intent(in) :: bjre(:) !intend (numMode)
886  real(kind=kreal), intent(in) :: bjim(:) !intend (numMode)
887  real(kind=kreal), intent(inout) :: dispre(:) !intend (numNodeDOF)
888  real(kind=kreal), intent(inout) :: dispim(:) !intend (numNodeDOF)
889  !---- vals
890  integer(kind=kint) :: imode, idf, s
891  complex(kind=kreal) :: a, b, c
892  !---- body
893 
894  dispre(:) = 0.0d0
895  dispim(:) = 0.0d0
896  a = exp(cmplx(0.0d0, omega*time))
897 
898  do imode=1, freqdata%numMode
899  s = size(freqdata%eigvector(:,imode))
900  b = cmplx(bjre(imode), bjim(imode)) * a
901  do idf=1, s
902  c = b*cmplx(freqdata%eigVector(idf,imode), 0.0d0)
903  dispre(idf) = dispre(idf) + dble(c)
904  dispim(idf) = dispim(idf) + imag(c)
905  end do
906  end do
907  return
908  end subroutine
909 
910  subroutine calcvelvectortime(freqData, time, omega, bjRe, bjIm, velRe, velIm)
911  !---- args
912  type(fstr_freqanalysis_data), intent(in) :: freqData
913  real(kind=kreal), intent(in) :: time
914  real(kind=kreal), intent(in) :: omega
915  real(kind=kreal), intent(in) :: bjre(:) !intend (numMode)
916  real(kind=kreal), intent(in) :: bjim(:) !intend (numMode)
917  real(kind=kreal), intent(inout) :: velre(:) !intend (numNodeDOF)
918  real(kind=kreal), intent(inout) :: velim(:) !intend (numNodeDOF)
919  !---- vals
920  integer(kind=kint) :: imode, idf, s
921  complex(kind=kreal) :: a, b, c
922  !---- body
923 
924  velre(:) = 0.0d0
925  velim(:) = 0.0d0
926  a = cmplx(0.0d0, 1.0d0)*cmplx(omega, 0.0d0)*exp(cmplx(0.0d0, omega*time))
927 
928  do imode=1, freqdata%numMode
929  s = size(freqdata%eigvector(:,imode))
930  b = cmplx(bjre(imode), bjim(imode)) * a
931  do idf=1, s
932  c = b*cmplx(freqdata%eigVector(idf,imode), 0.0d0)
933  velre(idf) = velre(idf) + dble(c)
934  velim(idf) = velim(idf) + imag(c)
935  end do
936  end do
937  return
938  end subroutine
939 
940  subroutine calcaccvectortime(freqData, time, omega, bjRe, bjIm, accRe, accIm)
941  !---- args
942  type(fstr_freqanalysis_data), intent(in) :: freqData
943  real(kind=kreal), intent(in) :: time
944  real(kind=kreal), intent(in) :: omega
945  real(kind=kreal), intent(in) :: bjre(:) !intend (numMode)
946  real(kind=kreal), intent(in) :: bjim(:) !intend (numMode)
947  real(kind=kreal), intent(inout) :: accre(:) !intend (numNodeDOF)
948  real(kind=kreal), intent(inout) :: accim(:) !intend (numNodeDOF)
949  !---- vals
950  integer(kind=kint) :: imode, idf, s
951  complex(kind=kreal) :: a, b, c
952  !---- body
953 
954  accre(:) = 0.0d0
955  accim(:) = 0.0d0
956  a = cmplx(-1.0d0, 0.0d0)*cmplx(omega**2, 0.0d0)*exp(cmplx(0.0d0, omega*time))
957 
958  do imode=1, freqdata%numMode
959  s = size(freqdata%eigvector(:,imode))
960  b = cmplx(bjre(imode), bjim(imode)) * a
961  do idf=1, s
962  c = b*cmplx(freqdata%eigVector(idf,imode), 0.0d0)
963  accre(idf) = accre(idf) + dble(c)
964  accim(idf) = accim(idf) + imag(c)
965  end do
966  end do
967  return
968  end subroutine
969 
970  subroutine setupdynaparam(fstrDYNAMIC, t_start, t_end, dynafreq, numdisp)
971  !---- args
972  type(fstr_dynamic), intent(in) :: fstrDYNAMIC
973  real(kind=kreal), intent(inout) :: t_start
974  real(kind=kreal), intent(inout) :: t_end
975  real(kind=kreal), intent(inout) :: dynafreq
976  integer(kind=kint), intent(inout) :: numdisp
977  !---- vals
978  !---- body
979  t_start = fstrdynamic%gamma
980  t_end = fstrdynamic%beta
981  dynafreq = fstrdynamic%t_delta
982  numdisp = fstrdynamic%nout
983  return
984  end subroutine
985 
986  subroutine outputdyna_resfile(hecMESH, time, istp, dispre, dispim, velre, velim, accre, accim, iout)
987  !---- args
988  type(hecmwst_local_mesh), intent(in) :: hecMESH
989  real(kind=kreal), intent(in) :: time
990  integer(kind=kint), intent(in) :: istp
991  real(kind=kreal), intent(in) :: dispre(:) !intend (numnodeDOF)
992  real(kind=kreal), intent(in) :: dispim(:) !intend (numnodeDOF)
993  real(kind=kreal), intent(in) :: velre(:) !intend (numnodeDOF)
994  real(kind=kreal), intent(in) :: velim(:) !intend (numnodeDOF)
995  real(kind=kreal), intent(in) :: accre(:) !intend (numnodeDOF)
996  real(kind=kreal), intent(in) :: accim(:) !intend (numnodeDOF)
997  integer(kind=kint), intent(in) :: iout(3)
998  !---- vals
999  integer(kind=kint) :: im, s
1000  character(len=HECMW_HEADER_LEN) :: header
1001  character(len=HECMW_MSG_LEN) :: comment
1002  character(len=HECMW_NAME_LEN) :: label, nameid
1003  real(kind=kreal), allocatable :: absval(:)
1004  !---- body
1005 
1006  s = size(dispre)
1007  allocate(absval(s))
1008 
1009  nameid='fstrDYNA'
1010  header='*fstrresult'
1011  comment='frequency_result'
1012 
1013  call hecmw_result_init(hecmesh, istp, header, comment)
1014 
1015  label = "time"
1016  absval(1) = time
1017  call hecmw_result_add(hecmw_result_dtype_global, 1, label, absval)
1018 
1019  if(iout(1) == 1) then
1020  label='displacement_real'
1021  call hecmw_result_add(hecmw_result_dtype_node, 3, label, dispre) !mode=node, ndof=3
1022  label='displacement_imag'
1023  call hecmw_result_add(hecmw_result_dtype_node, 3, label, dispim)
1024  label='displacement_abs'
1025  absval(:) = abs(cmplx(dispre(:), dispim(:)))
1026  call hecmw_result_add(hecmw_result_dtype_node, 3, label, absval)
1027  end if
1028 
1029  if(iout(2) == 1) then
1030  label='velocity_real'
1031  call hecmw_result_add(hecmw_result_dtype_node, 3, label, velre) !mode=node, ndof=3
1032  label='velocity_imag'
1033  call hecmw_result_add(hecmw_result_dtype_node, 3, label, velim)
1034  label='velocity_abs'
1035  absval(:) = abs(cmplx(velre(:), velim(:)))
1036  call hecmw_result_add(hecmw_result_dtype_node, 3, label, absval)
1037  end if
1038 
1039  if(iout(3) == 1) then
1040  label='acceleration_real'
1041  call hecmw_result_add(hecmw_result_dtype_node, 3, label, accre) !mode=node, ndof=3
1042  label='acceleration_imag'
1043  call hecmw_result_add(hecmw_result_dtype_node, 3, label, accim)
1044  label='acceleration_abs'
1045  absval(:) = abs(cmplx(velre(:), velim(:)))
1046  call hecmw_result_add(hecmw_result_dtype_node, 3, label, absval)
1047  end if
1048 
1049  call hecmw_result_write_by_name(nameid)
1050  call hecmw_result_finalize()
1051 
1052  deallocate(absval)
1053  return
1054  end subroutine
1055 
1056  subroutine outputdyna_visfile(hecMESH, istp, dispre, dispim, velre, velim, accre, accim, iout)
1057  !---- args
1058  type(hecmwst_local_mesh), intent(inout) :: hecmesh
1059  integer(kind=kint), intent(in) :: istp
1060  real(kind=kreal), intent(in) :: dispre(:)
1061  real(kind=kreal), intent(in) :: dispim(:)
1062  real(kind=kreal), intent(in) :: velre(:)
1063  real(kind=kreal), intent(in) :: velim(:)
1064  real(kind=kreal), intent(in) :: accre(:)
1065  real(kind=kreal), intent(in) :: accim(:)
1066  integer(kind=kint), intent(in) :: iout(3)
1067  !---- vals
1068  type(hecmwst_result_data) :: fstrRESULT
1069  character(len=HECMW_NAME_LEN) :: label
1070  integer(kind=kint) :: s, ncomp, i
1071  real(kind=kreal), allocatable :: absval(:)
1072  !---- body
1073 
1074  s = size(dispre)
1075  allocate(absval(s))
1076 
1077  ncomp = 0
1078  do i=1, 3
1079  if(iout(i) == 1) then
1080  ncomp = ncomp + 3 !re, im, abs
1081  end if
1082  end do
1083 
1084  call fstr_freq_result_init(hecmesh, ncomp, fstrresult) !disp, vel, acc
1085 
1086  ncomp = 1
1087 
1088  if(iout(1) == 1) then
1089  label = 'displace_real'
1090  call fstr_freq_result_add(fstrresult, hecmesh, ncomp, 3, label, dispre)
1091  ncomp = ncomp + 1
1092 
1093  label = 'displace_imag'
1094  call fstr_freq_result_add(fstrresult, hecmesh, ncomp, 3, label, dispim)
1095  ncomp = ncomp + 1
1096 
1097  label = 'displace_abs'
1098  absval(:) = abs(cmplx(dispre(:), dispim(:)))
1099  call fstr_freq_result_add(fstrresult, hecmesh, ncomp, 3, label, absval)
1100  ncomp = ncomp + 1
1101  end if
1102 
1103  if(iout(2) == 1) then
1104  label = 'velocity_real'
1105  call fstr_freq_result_add(fstrresult, hecmesh, ncomp, 3, label, velre)
1106  ncomp = ncomp + 1
1107 
1108  label = 'velocity_imag'
1109  call fstr_freq_result_add(fstrresult, hecmesh, ncomp, 3, label, velim)
1110  ncomp = ncomp + 1
1111 
1112  label = 'velocity_abs'
1113  absval(:) = abs(cmplx(velre(:), velim(:)))
1114  call fstr_freq_result_add(fstrresult, hecmesh, ncomp, 3, label, absval)
1115  ncomp = ncomp + 1
1116  end if
1117 
1118  if(iout(3) == 1) then
1119  label = 'acceleration_real'
1120  call fstr_freq_result_add(fstrresult, hecmesh, ncomp, 3, label, accre)
1121  ncomp = ncomp + 1
1122 
1123  label = 'acceleration_imag'
1124  call fstr_freq_result_add(fstrresult, hecmesh, ncomp, 3, label, accim)
1125  ncomp = ncomp + 1
1126 
1127  label = 'acceleration_abs'
1128  absval(:) = abs(cmplx(accre(:), accim(:)))
1129  call fstr_freq_result_add(fstrresult, hecmesh, ncomp, 3, label, absval)
1130  ncomp = ncomp + 1
1131  end if
1132 
1133  call fstr2hecmw_mesh_conv(hecmesh)
1134  call hecmw_visualize_init
1135  call hecmw_visualize( hecmesh, fstrresult, istp )
1136  call hecmw2fstr_mesh_conv(hecmesh)
1137  call hecmw_result_free(fstrresult)
1138 
1139  deallocate(absval)
1140  end subroutine
1141 
1142 end module
subroutine nullify_result_data(res)
subroutine free_result_data(res)
subroutine calcdispvector(freqData, bjRe, bjIm, dispRe, dispIm)
subroutine read_eigen_vector(logfile, startmode, endmode, numdof, numnode, eigenvector)
subroutine output_resfile(hecMESH, freq, ifreq, disp, vel, acc, iout)
subroutine fstr_solve_frequency_analysis(hecMESH, hecMAT, fstrSOLID, fstrEIG, fstrDYNAMIC, fstrRESULT, fstrPARAM, fstrCPL, fstrFREQ, hecLagMAT, restart_step_num)
subroutine read_eigen_vector_res(hecMESH, startmode, endmode, numdof, numnode, eigenvector)
subroutine calcaccvector(freqData, omega, bjRe, bjIm, accRe, accIm)
subroutine extract_surf2node(hecMESH, freqData, numdof, loadvecRe, loadvecIm)
subroutine writeoutvector(im, vector)
subroutine calcdispvectortime(freqData, time, omega, bjRe, bjIm, dispRe, dispIm)
subroutine checkorthvector(fstrEIG, eigenvector, imode, jmode, prod)
subroutine calcfreqcoeff(freqData, loadRe, loadIm, inpOmega, bjRe, bjIm)
subroutine scaleeigenvector(fstrEIG, ntotaldof, nmode, eigenvector)
subroutine output_visfile(hecMESH, ifreq, disp, vel, acc, iout)
subroutine setupdynaparam(fstrDYNAMIC, t_start, t_end, dynafreq, numdisp)
subroutine calcvelvectortime(freqData, time, omega, bjRe, bjIm, velRe, velIm)
subroutine setupfreqparam(fstrDYNAMIC, f_start, f_end, numfreq, raym, rayk, idnode, vistype, ioutl)
subroutine outputdyna_resfile(hecMESH, time, istp, dispre, dispim, velre, velim, accre, accim, iout)
subroutine read_eigen_values(logfile, startmode, endmode, eigenvalue, anglfreq)
subroutine calcmassmatrix(fstrPARAM, hecMESH, hecMAT, fstrSOLID, fstrEIG, hecLagMAT)
subroutine assemble_nodeload(hecMESH, freqData, numdof, loadvecRe, loadvecIm)
subroutine calcaccvectortime(freqData, time, omega, bjRe, bjIm, accRe, accIm)
subroutine outputdyna_visfile(hecMESH, istp, dispre, dispim, velre, velim, accre, accim, iout)
subroutine dl_c3_freq(ETYPE, NN, XX, YY, ZZ, LTYPE, force, VECT, nsize)
subroutine calcvelvector(freqData, omega, bjRe, bjIm, velRe, velIm)
This module contains steady state frequency analysis.
subroutine fstr_freq_result_init(hecMESH, numcomp, fstrRESULT)
subroutine fstr_freq_result_add(fstrRESULT, hecMESH, comp_index, ndof, label, vect)
This module provides a function to deal with prescribed displacement.
Definition: fstr_AddBC.f90:7
Set up lumped mass matrix.
This module provides function to calculate tangent stiffness matrix.
This module defines common data and basic structures for analysis.
Definition: m_fstr.F90:15
integer(kind=kint), pointer iresult
Definition: m_fstr.F90:124
integer(kind=kint), parameter ilog
FILE HANDLER.
Definition: m_fstr.F90:109
integer(kind=kint), pointer ivisual
Definition: m_fstr.F90:125
HECMW to FSTR Mesh Data Converter. Converting Connectivity of Element Type 232, 342 and 352.
Data for coupling analysis.
Definition: m_fstr.F90:622
Data for DYNAMIC ANSLYSIS (fstrDYNAMIC)
Definition: m_fstr.F90:515
Package of data used by Lanczos eigenvalue solver.
Definition: m_fstr.F90:604
FSTR INNER CONTROL PARAMETERS (fstrPARAM)
Definition: m_fstr.F90:156