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