FrontISTR  6.0.0
Large-scale structural analysis program with finit element method
fstr_solve_dynamic.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 !-------------------------------------------------------------------------------
6 
8 
9  use m_fstr
12  use fstr_frequency_analysis !Frequency analysis module
13  use m_fstr_timeinc
14 
15 contains
16 
17  !C================================================================C
19  !C================================================================C
20  subroutine fstr_solve_dynamic(hecMESH,hecMAT,fstrSOLID,fstrEIG &
21  ,fstrDYNAMIC,fstrPARAM &
22  ,fstrCPL,fstrFREQ, hecLagMAT &
23  ,conMAT )
24  use m_fstr_setup
25  implicit none
26  type(hecmwst_local_mesh) :: hecMESH
27  type(hecmwst_matrix) :: hecMAT
28  type(fstr_eigen) :: fstrEIG
29  type(fstr_solid) :: fstrSOLID
30  type(fstr_param) :: fstrPARAM
31  type(fstr_dynamic) :: fstrDYNAMIC
32  type(fstr_couple) :: fstrCPL !for COUPLE
33  type(fstr_freqanalysis) :: fstrFREQ
34  type(hecmwst_matrix_lagrange) :: hecLagMAT
35  type(fstr_info_contactchange) :: infoCTChange
36  type(hecmwst_matrix) :: conMAT
37  integer(kind=kint) :: i, j, num_monit, ig, is, iE, ik, in, ing, iunitS, iunit, ierror, flag, limit
38  character(len=HECMW_FILENAME_LEN) :: fname, header
39  integer(kind=kint) :: restart_step_num, restart_substep_num, restart_step_count, ndof
40 
41  num_monit = 0
42 
43  if(dabs(fstrdynamic%t_delta) < 1.0e-20) then
44  if( hecmesh%my_rank == 0 ) then
45  write(imsg,*) 'stop due to fstrDYNAMIC%t_delta = 0'
46  end if
47  call hecmw_abort( hecmw_comm_get_comm())
48  end if
49  call fstr_dynamic_alloc( hecmesh, fstrdynamic )
50 
51  !C-- file open for local use
52  !C
53  if(fstrdynamic%idx_resp == 1) then ! time history analysis
54  call hecmw_ctrl_is_subdir( flag, limit )
55  if( flag == 0)then
56  header = ""
57  else
58  header = adjustl("MONITOR/")
59  call hecmw_ctrl_make_subdir( adjustl("MONITOR/test.txt"), limit )
60  endif
61  ig = fstrdynamic%ngrp_monit
62  is = hecmesh%node_group%grp_index(ig-1)+1
63  ie = hecmesh%node_group%grp_index(ig)
64  do ik=is,ie
65  in = hecmesh%node_group%grp_item(ik)
66  if (in > hecmesh%nn_internal) cycle
67  num_monit = num_monit+1
68  ing = hecmesh%global_node_id(in)
69  iunits = 10*(num_monit-1)
70 
71  iunit = iunits + fstrdynamic%dynamic_IW4
72  write(fname,'(a,i0,a)') trim(header)//'dyna_disp_',ing,'.txt'
73  if(fstrdynamic%restart_nout < 0 ) then
74  open(iunit,file=fname, position = 'append', iostat=ierror)
75  else
76  open(iunit,file=fname, status = 'replace', iostat=ierror)
77  endif
78  if( ierror /= 0 ) then
79  write(*,*) 'stop due to file opening error:',trim(fname)
80  call hecmw_abort( hecmw_comm_get_comm())
81  end if
82 
83  iunit = iunits + fstrdynamic%dynamic_IW5
84  write(fname,'(a,i0,a)') trim(header)//'dyna_velo_',ing,'.txt'
85  if(fstrdynamic%restart_nout < 0 ) then
86  open(iunit,file=fname, position = 'append', iostat=ierror)
87  else
88  open(iunit,file=fname, status = 'replace', iostat=ierror)
89  endif
90  if( ierror /= 0 ) then
91  write(*,*) 'stop due to file opening error',trim(fname)
92  call hecmw_abort( hecmw_comm_get_comm())
93  end if
94 
95  iunit = iunits + fstrdynamic%dynamic_IW6
96  write(fname,'(a,i0,a)') trim(header)//'dyna_acce_',ing,'.txt'
97  if(fstrdynamic%restart_nout < 0 ) then
98  open(iunit,file=fname, position = 'append', iostat=ierror)
99  else
100  open(iunit,file=fname, status = 'replace', iostat=ierror)
101  endif
102  if( ierror /= 0 ) then
103  write(*,*) 'stop due to file opening error',trim(fname)
104  call hecmw_abort( hecmw_comm_get_comm())
105  end if
106 
107  iunit = iunits + fstrdynamic%dynamic_IW7
108  write(fname,'(a,i0,a)') trim(header)//'dyna_force_',ing,'.txt'
109  if(fstrdynamic%restart_nout < 0 ) then
110  open(iunit,file=fname, position = 'append', iostat=ierror)
111  else
112  open(iunit,file=fname, status = 'replace', iostat=ierror)
113  endif
114  if( ierror /= 0 ) then
115  write(*,*) 'stop due to file opening error',trim(fname)
116  call hecmw_abort( hecmw_comm_get_comm())
117  end if
118  iunit = iunits + fstrdynamic%dynamic_IW8
119  write(fname,'(a,i0,a)') trim(header)//'dyna_strain_',ing,'.txt'
120  if(fstrdynamic%restart_nout < 0 ) then
121  open(iunit,file=fname, position = 'append', iostat=ierror)
122  else
123  open(iunit,file=fname, status = 'replace', iostat=ierror)
124  endif
125  if( ierror /= 0 ) then
126  write(*,*) 'stop due to file opening error',trim(fname)
127  call hecmw_abort( hecmw_comm_get_comm())
128  end if
129 
130  iunit = iunits + fstrdynamic%dynamic_IW9
131  write(fname,'(a,i0,a)') trim(header)//'dyna_stress_',ing,'.txt'
132  if(fstrdynamic%restart_nout < 0 ) then
133  open(iunit,file=fname, position = 'append', iostat=ierror)
134  else
135  open(iunit,file=fname, status = 'replace', iostat=ierror)
136  endif
137  if( ierror /= 0 ) then
138  write(*,*) 'stop due to file opening error',trim(fname)
139  call hecmw_abort( hecmw_comm_get_comm())
140  end if
141  enddo
142  endif
143 
144  !C
145  !C-- initial condition
146  !C
147  fstrdynamic%DISP = 0.d0
148  fstrdynamic%VEL = 0.d0
149  fstrdynamic%ACC = 0.d0
150  fstrsolid%unode(:) =0.d0
151  fstrsolid%QFORCE(:) =0.d0
152  fstrdynamic%kineticEnergy=0.d0
153  fstrdynamic%strainEnergy=0.d0
154  fstrdynamic%totalEnergy=0.d0
155  call fstr_updatestate( hecmesh, fstrsolid, 0.d0 )
156 
157  ! ---- restart
158 
159  restart_step_num = 1
160  restart_substep_num = 1
161  restart_step_count = 0
162  infoctchange%contactNode_previous = 0
163 
164  if(associated(g_initialcnd))then
165  ndof = hecmat%NDOF
166  do j = 1, size(g_initialcnd)
167  if(g_initialcnd(j)%cond_name == "velocity")then
168  do i= 1, hecmesh%n_node
169  ing = g_initialcnd(j)%intval(i)
170  if(ing <= 0) cycle
171  fstrdynamic%VEL(ndof*i-(ndof-ing),1) = g_initialcnd(j)%realval(i)
172  end do
173  elseif(g_initialcnd(j)%cond_name == "acceleration")then
174  do i = 1, hecmesh%n_node
175  ing = g_initialcnd(j)%intval(i)
176  if(ing <= 0) cycle
177  fstrdynamic%ACC(ndof*i-(ndof-ing),1) = g_initialcnd(j)%realval(i)
178  enddo
179  endif
180  enddo
181  endif
182 
183  if(fstrdynamic%restart_nout >= 0 ) then
184  call dynamic_bc_init (hecmesh, hecmat, fstrsolid, fstrdynamic, fstrdynamic%t_curr)
185  call dynamic_bc_init_vl(hecmesh, hecmat, fstrsolid, fstrdynamic, fstrdynamic%t_curr)
186  call dynamic_bc_init_ac(hecmesh, hecmat, fstrsolid, fstrdynamic, fstrdynamic%t_curr)
187  endif
188 
189  !restart
190  if(fstrdynamic%restart_nout < 0 ) then
191  if( fstrdynamic%idx_eqa /= 11 ) then
192  call fstr_read_restart_dyna_nl(restart_step_num,restart_substep_num,hecmesh,fstrsolid,fstrdynamic,fstrparam,&
193  infoctchange%contactNode_previous,restart_step_count)
194  elseif(fstrdynamic%idx_eqa == 11) then
195  call fstr_read_restart_dyna_nl(restart_step_num,restart_substep_num,hecmesh,fstrsolid,fstrdynamic,fstrparam,&
196  infoctchange%contactNode_previous,restart_step_count)
197  endif
198  fstrdynamic%restart_nout = - fstrdynamic%restart_nout
199  hecmat%Iarray(98) = 1
200  call fstr_set_time(fstrdynamic%t_curr)
201  call fstr_set_timeinc_base(fstrdynamic%t_delta)
202  end if
203 
204  if(fstrdynamic%idx_resp == 1) then ! time history analysis
205 
206  if(fstrdynamic%idx_eqa /= 11) then ! implicit dynamic analysis
207  call fstr_solve_nlgeom_dynamic_implicit_contactslag(hecmesh,hecmat,fstrsolid,fstreig &
208  ,fstrdynamic,fstrparam &
209  ,fstrcpl,heclagmat,restart_step_num,restart_substep_num,infoctchange &
210  ,conmat,restart_step_count )
211 
212  else if(fstrdynamic%idx_eqa == 11) then ! explicit dynamic analysis
213  call fstr_solve_dynamic_nlexplicit(hecmesh,hecmat,fstrsolid,fstreig &
214  ,fstrdynamic,fstrparam,infoctchange &
215  ,fstrcpl, restart_substep_num, restart_step_count )
216  endif
217 
218  else if(fstrdynamic%idx_resp == 2) then ! frequency response analysis
219 
220  if( fstrparam%nlgeom ) then
221  if( hecmesh%my_rank .eq. 0 ) then
222  write(imsg,*) 'stop: steady-state harmonic response analysis is not yet available !'
223  end if
224  call hecmw_abort( hecmw_comm_get_comm())
225  end if
226 
227  call fstr_solve_frequency_analysis(hecmesh, hecmat, fstrsolid, fstreig, fstrdynamic, &
228  fstrparam, fstrfreq, heclagmat)
229  end if
230 
231  !C-- file close for local use
232  if(fstrdynamic%idx_resp == 1) then ! time history analysis
233  do i=1,num_monit
234  iunits = 10*(i-1)
235  close(iunits + fstrdynamic%dynamic_IW4)
236  close(iunits + fstrdynamic%dynamic_IW5)
237  close(iunits + fstrdynamic%dynamic_IW6)
238  close(iunits + fstrdynamic%dynamic_IW7)
239  close(iunits + fstrdynamic%dynamic_IW8)
240  close(iunits + fstrdynamic%dynamic_IW9)
241  enddo
242  endif
243  !C-- end of finalization
244 
245  call fstr_dynamic_finalize( fstrdynamic )
246  call hecmat_finalize( hecmat )
247 
248  deallocate( fstreig%mass )
249 
250  end subroutine fstr_solve_dynamic
251 
252 end module fstr_solver_dynamic
void hecmw_ctrl_is_subdir(int *flag, int *limit)
void hecmw_ctrl_make_subdir(char *filename, int *err, int len)
This module contains subroutines for nonlinear explicit dynamic analysis.
subroutine fstr_solve_dynamic_nlexplicit(hecMESH, hecMAT, fstrSOLID, fstrEIG, fstrDYN, fstrPARAM, infoCTChange, fstrCPL, restrt_step_num, restrt_step_count)
This module contains subroutines for nonlinear implicit dynamic analysis.
subroutine fstr_solve_nlgeom_dynamic_implicit_contactslag(hecMESH, hecMAT, fstrSOLID, fstrEIG, fstrDYNAMIC, fstrPARAM, fstrCPL, hecLagMAT, restart_step_num, restart_substep_num, infoCTChange, conMAT, restart_step_count)
This subroutine provides function of nonlinear implicit dynamic analysis using the Newmark or HHT met...
This module contains steady state frequency analysis.
subroutine fstr_solve_frequency_analysis(hecMESH, hecMAT, fstrSOLID, fstrEIG, fstrDYNAMIC, fstrPARAM, fstrFREQ, hecLagMAT)
This module contains subroutines controlling dynamic calculation.
subroutine fstr_solve_dynamic(hecMESH, hecMAT, fstrSOLID, fstrEIG, fstrDYNAMIC, fstrPARAM, fstrCPL, fstrFREQ, hecLagMAT, conMAT)
Master subroutine for dynamic analysis.
This module provides functions to read in data from control file and do necessary preparation for fol...
Definition: fstr_setup.f90:7
This module provides functions to deal with time and increment of stress analysis.
subroutine fstr_set_timeinc_base(dtime_base)
subroutine fstr_set_time(time)
This module defines common data and basic structures for analysis.
Definition: m_fstr.F90:15
subroutine hecmat_finalize(hecMAT)
Definition: m_fstr.F90:1106
integer(kind=kint), parameter imsg
Definition: m_fstr.F90:121
type(tinitialcondition), dimension(:), pointer, save g_initialcnd
Definition: m_fstr.F90:139
Data for coupling analysis.
Definition: m_fstr.F90:642
Data for DYNAMIC ANSLYSIS (fstrDYNAMIC)
Definition: m_fstr.F90:525
Package of data used by Lanczos eigenvalue solver.
Definition: m_fstr.F90:623
FSTR INNER CONTROL PARAMETERS (fstrPARAM)
Definition: m_fstr.F90:142