FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
fstr_ctrl_static.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  use hecmw
10 
11 contains
12 
13  !* ----------------------------------------------------------------------------------------------- *!
15  !* ----------------------------------------------------------------------------------------------- *!
16 
17  function fstr_ctrl_get_static( ctrl, &
18  & dtime, etime, itime, eps, restart_nout, &
19  & idx_elpl, &
20  & iout_list, &
21  & sig_y0, h_dash, &
22  & nout, nout_monit, node_monit_1, elem_monit_1, intg_monit_1 )
23  implicit none
24  integer(kind=kint) :: ctrl
25  real(kind=kreal) :: dtime
26  real(kind=kreal) :: etime
27  integer(kind=kint) :: itime
28  real(kind=kreal) :: eps
29  integer(kind=kint) :: restart_nout
30  integer(kind=kint) :: idx_elpl
31  real(kind=kreal) :: sig_y0, h_dash
32  integer(kind=kint) :: nout, nout_monit, node_monit_1, elem_monit_1, intg_monit_1
33  integer(kind=kint) :: iout_list(6)
34  integer(kind=kint) :: fstr_ctrl_get_static
35 
37 
38  if( fstr_ctrl_get_data_ex( ctrl, 1, 'rriri ', dtime, etime, itime, eps, restart_nout ) /= 0 ) return
39  if( fstr_ctrl_get_data_ex( ctrl, 2, 'i ', idx_elpl ) /= 0 ) return
40  if( fstr_ctrl_get_data_ex( ctrl, 3, 'iiiiii ', &
41  & iout_list(1), iout_list(2), iout_list(3), iout_list(4), iout_list(5), iout_list(6)) /= 0 ) return
42  if( fstr_ctrl_get_data_ex( ctrl, 4, 'rr ', sig_y0, h_dash ) /= 0 ) return
43  if( fstr_ctrl_get_data_ex( ctrl, 5, 'iiiii ', &
44  & nout, nout_monit, node_monit_1, elem_monit_1, intg_monit_1 ) /= 0 ) return
45 
47  end function fstr_ctrl_get_static
48 
49  !* ----------------------------------------------------------------------------------------------- *!
51  !* ----------------------------------------------------------------------------------------------- *!
52 
53  function fstr_ctrl_get_boundary( ctrl, amp, node_id, node_id_len, dof_ids, dof_ide, value )
54  implicit none
55  integer(kind=kint) :: ctrl
56  character(len=HECMW_NAME_LEN) :: amp
57  character(len=HECMW_NAME_LEN) :: node_id(:)
58  integer(kind=kint) :: node_id_len
59  integer(kind=kint),pointer :: dof_ids (:)
60  integer(kind=kint),pointer :: dof_ide (:)
61  real(kind=kreal),pointer :: value(:)
62  integer(kind=kint) :: fstr_ctrl_get_boundary
63 
64  character(len=HECMW_NAME_LEN) :: data_fmt,ss
65  write(ss,*) node_id_len
66  write(data_fmt,'(a,a,a)') 'S',trim(adjustl(ss)),'IIr '
67 
69  if( fstr_ctrl_get_param_ex( ctrl, 'AMP ', '# ', 0, 'S', amp )/= 0) return
71  fstr_ctrl_get_data_array_ex( ctrl, data_fmt, node_id, dof_ids, dof_ide, value )
72 
73  end function fstr_ctrl_get_boundary
74 
75 
76  !* ----------------------------------------------------------------------------------------------- *!
78  !* ----------------------------------------------------------------------------------------------- *!
79 
80  function fstr_ctrl_get_cload( ctrl, amp, node_id, node_id_len, dof_id, value )
81  implicit none
82  integer(kind=kint) :: ctrl
83  character(len=HECMW_NAME_LEN) :: amp
84  character(len=HECMW_NAME_LEN) :: node_id(:)
85  integer(kind=kint) :: node_id_len
86  integer(kind=kint),pointer :: dof_id(:)
87  real(kind=kreal),pointer :: value(:)
88  integer(kind=kint) :: fstr_ctrl_get_cload
89 
90  character(len=HECMW_NAME_LEN) :: data_fmt,ss
91  write(ss,*) node_id_len
92  write( data_fmt, '(a,a,a)') 'S', trim(adjustl(ss)), 'IR '
93 
95  if( fstr_ctrl_get_param_ex( ctrl, 'AMP ', '# ', 0, 'S', amp )/= 0) return
97  fstr_ctrl_get_data_array_ex( ctrl, data_fmt, node_id, dof_id, value )
98 
99  end function fstr_ctrl_get_cload
100 
101  !* ----------------------------------------------------------------------------------------------- *!
103  !* ----------------------------------------------------------------------------------------------- *!
104 
105  function fstr_ctrl_get_dload( ctrl, amp, follow, element_id, element_id_len, load_type, params )
106  implicit none
107  integer(kind=kint) :: ctrl
108  character(len=HECMW_NAME_LEN) :: amp
109  integer(kind=kint) :: follow
110  character(len=HECMW_NAME_LEN) :: element_id(:)
111  integer(kind=kint) :: element_id_len
112  integer(kind=kint),pointer :: load_type(:)
113  real(kind=kreal),pointer :: params(:,:)
114  integer(kind=kint) :: fstr_ctrl_get_dload
115 
116  character(len=HECMW_NAME_LEN),pointer :: type_name_list(:)
117 
118  integer(kind=kint) :: i, n
119  integer(kind=kint) :: rcode
120  character(len=HECMW_NAME_LEN) :: data_fmt,s1,s2
121  integer(kind=kint) :: lid
122 
124  if( fstr_ctrl_get_param_ex( ctrl, 'AMP ', '# ', 0, 'S', amp )/= 0) return
125  follow = follow+1
126  if( fstr_ctrl_get_param_ex( ctrl, 'FOLLOW ','NO,YES ', 0, 'P', follow ) /= 0) return
127  follow = follow-1
128 
129  write(s1,*) element_id_len
130  write(s2,*) hecmw_name_len
131  write( data_fmt, '(a,a,a,a,a)') 'S', trim(adjustl(s1)), 'S', trim(adjustl(s2)),'Rrrrrrr '
132 
133  n = fstr_ctrl_get_data_line_n(ctrl)
134  allocate( type_name_list(n) )
135 
136  block
137  real(kind=kreal) :: params0(n), params1(n), params2(n), params3(n), params4(n), params5(n), params6(n)
138  params0 = params(0,:)
139  params1 = params(1,:)
140  params2 = params(2,:)
141  params3 = params(3,:)
142  params4 = params(4,:)
143  params5 = params(5,:)
144  params6 = params(6,:)
145  rcode = fstr_ctrl_get_data_array_ex( ctrl, data_fmt, element_id, type_name_list, &
146  params0, params1, params2, params3, params4, params5, params6 )
147  params(0,:) = params0
148  params(1,:) = params1
149  params(2,:) = params2
150  params(3,:) = params3
151  params(4,:) = params4
152  params(5,:) = params5
153  params(6,:) = params6
154  end block
155 
156  if( rcode /= 0 ) then
157  deallocate( type_name_list )
158  return
159  end if
160 
161  do i=1, n
162  lid = -1;
163  if( type_name_list(i)(1:2) == 'BX' ) then; lid = 1
164  else if( type_name_list(i)(1:2) == 'BY' ) then; lid = 2
165  else if( type_name_list(i)(1:2) == 'BZ' ) then; lid = 3
166  else if( type_name_list(i)(1:4) == 'GRAV') then; lid = 4
167  else if( type_name_list(i)(1:4) == 'CENT') then; lid = 5
168  else if( type_name_list(i)(1:2) == 'PP' ) then; lid = 10
169  else if( type_name_list(i)(1:2) == 'P0' ) then; lid = 10
170  else if( type_name_list(i)(1:2) == 'PX' ) then
171  lid = 10; params(1,:)=1.d0; params(2,:)=0.d0; params(3,:)=0.d0
172  else if( type_name_list(i)(1:2) == 'PY' ) then
173  lid = 10; params(1,:)=0.d0; params(2,:)=1.d0; params(3,:)=0.d0
174  else if( type_name_list(i)(1:2) == 'PZ' ) then
175  lid = 10; params(1,:)=0.d0; params(2,:)=0.d0; params(3,:)=1.d0
176  else if( type_name_list(i)(1:2) == 'P1' ) then; lid = 10
177  else if( type_name_list(i)(1:2) == 'P2' ) then; lid = 20
178  else if( type_name_list(i)(1:2) == 'P3' ) then; lid = 30
179  else if( type_name_list(i)(1:2) == 'P4' ) then; lid = 40
180  else if( type_name_list(i)(1:2) == 'P5' ) then; lid = 50
181  else if( type_name_list(i)(1:2) == 'P6' ) then; lid = 60
182  else if( type_name_list(i)(1:1) == 'S' ) then; lid = 100
183  else
184  write(ilog, *) 'Error : !DLOAD : Load type ',type_name_list(i), ' is unknown'
185  deallocate( type_name_list )
186  return
187  end if
188  load_type(i) = lid
189  end do
190 
191  deallocate( type_name_list )
193 
194  end function fstr_ctrl_get_dload
195 
196 
197 
198  !* ----------------------------------------------------------------------------------------------- *!
200  !* ----------------------------------------------------------------------------------------------- *!
201 
202  function fstr_ctrl_get_reftemp( ctrl, value )
203  implicit none
204  integer(kind=kint) :: ctrl
205  real(kind=kreal) :: value
206  integer(kind=kint) :: fstr_ctrl_get_reftemp,rcode
207 
208  rcode = fstr_ctrl_get_data_ex( ctrl, 1, 'r ', value )
209  fstr_ctrl_get_reftemp = rcode
210 
211  end function fstr_ctrl_get_reftemp
212 
213  !* ----------------------------------------------------------------------------------------------- *!
215  !* ----------------------------------------------------------------------------------------------- *!
216 
217  function fstr_ctrl_get_temperature( ctrl, irres, tstep, tintl, rtype, node_id, node_id_len, value )
218  implicit none
219  integer(kind=kint) :: ctrl
220  integer(kind=kint) :: irres
221  integer(kind=kint) :: tstep
222  integer(kind=kint) :: tintl
223  integer(kind=kint) :: rtype
224  character(len=HECMW_NAME_LEN) :: node_id(:)
225  integer(kind=kint) :: node_id_len
226  real(kind=kreal),pointer :: value(:)
227  integer(kind=kint) :: fstr_ctrl_get_temperature, rcode
228 
229  character(len=HECMW_NAME_LEN) :: data_fmt,ss
230 
231  irres = 0
232  if( fstr_ctrl_get_param_ex( ctrl, 'READRESULT ', '# ', 0, 'I', irres )/= 0) return
233  if( fstr_ctrl_get_param_ex( ctrl, 'SSTEP ', '# ', 0, 'I', tstep )/= 0) return
234  if( fstr_ctrl_get_param_ex( ctrl, 'INTERVAL ', '# ', 0, 'I', tintl )/= 0) return
235  if( fstr_ctrl_get_param_ex( ctrl, 'READTYPE ', 'STEP,TIME ', 0, 'P', rtype )/= 0) return
236  if( irres > 0 ) then
238  return
239  endif
240 
241  write(ss,*) node_id_len
242  write(data_fmt,'(a,a,a)') 'S',trim(adjustl(ss)),'r '
243 
244  rcode = fstr_ctrl_get_data_array_ex( ctrl, data_fmt, node_id, value )
246 
247  end function fstr_ctrl_get_temperature
248 
249 
250  !* ----------------------------------------------------------------------------------------------- *!
252  !* ----------------------------------------------------------------------------------------------- *!
253 
254  function fstr_ctrl_get_spring( ctrl, amp, node_id, node_id_len, dof_id, value, incremental )
255  implicit none
256  integer(kind=kint) :: ctrl, incremental
257  character(len=HECMW_NAME_LEN) :: amp
258  character(len=HECMW_NAME_LEN) :: node_id(:)
259  integer(kind=kint) :: node_id_len
260  integer(kind=kint),pointer :: dof_id(:)
261  real(kind=kreal),pointer :: value(:)
262  integer(kind=kint) :: fstr_ctrl_get_spring
263 
264  character(len=HECMW_NAME_LEN) :: data_fmt,ss
265  write(ss,*) node_id_len
266  write( data_fmt, '(a,a,a)') 'S', trim(adjustl(ss)), 'IR '
267 
269  if( fstr_ctrl_get_param_ex( ctrl, 'AMP ', '# ', 0, 'S', amp )/= 0) return
270  incremental = incremental + 1
271  if( fstr_ctrl_get_param_ex( ctrl, 'INCREMENTAL ','NO,YES ', 0, 'P', incremental ) /= 0) return
272  incremental = incremental - 1
274  fstr_ctrl_get_data_array_ex( ctrl, data_fmt, node_id, dof_id, value )
275 
276  end function fstr_ctrl_get_spring
277 
278 
279  !----------------------------------------------------------------------
281  integer function fstr_ctrl_get_userload( ctrl )
282  use muload
283  integer(kind=kint), intent(in) :: ctrl
284 
285  character(len=256) :: fname
286 
288  if( fstr_ctrl_get_param_ex( ctrl, 'FILE ', '# ', 0, 'F', fname )/=0 ) return
289  if( fname=="" ) stop "You must define a file name before read in user-defined material"
290  if( ureadload(fname)/=0 ) return
291 
293  end function fstr_ctrl_get_userload
294 
295 end module fstr_ctrl_static
296 
297 
298 
299 
int fstr_ctrl_get_param_ex(int *ctrl, const char *param_name, const char *value_list, int *necessity, char *type, void *val)
int fstr_ctrl_get_data_array_ex(int *ctrl, const char *format,...)
int fstr_ctrl_get_data_ex(int *ctrl, int *line_no, const char *format,...)
This module contains control file data obtaining functions for static analysis.
integer(kind=kint) function fstr_ctrl_get_static(ctrl, dtime, etime, itime, eps, restart_nout, idx_elpl, iout_list, sig_y0, h_dash, nout, nout_monit, node_monit_1, elem_monit_1, intg_monit_1)
Read in !STATIC.
integer(kind=kint) function fstr_ctrl_get_boundary(ctrl, amp, node_id, node_id_len, dof_ids, dof_ide, value)
Read in !BOUNDARY.
integer(kind=kint) function fstr_ctrl_get_reftemp(ctrl, value)
Read in !REFTEMP.
integer(kind=kint) function fstr_ctrl_get_spring(ctrl, amp, node_id, node_id_len, dof_id, value, incremental)
Read in !SPRING.
integer(kind=kint) function fstr_ctrl_get_dload(ctrl, amp, follow, element_id, element_id_len, load_type, params)
Read in !DLOAD.
integer(kind=kint) function fstr_ctrl_get_temperature(ctrl, irres, tstep, tintl, rtype, node_id, node_id_len, value)
Read in !TEMPERATURE.
integer(kind=kint) function fstr_ctrl_get_cload(ctrl, amp, node_id, node_id_len, dof_id, value)
Read in !CLOAD.
integer function fstr_ctrl_get_userload(ctrl)
Read in !ULOAD.
Definition: hecmw.f90:6
This module defines common data and basic structures for analysis.
Definition: m_fstr.F90:15
real(kind=kreal) eps
Definition: m_fstr.F90:149
real(kind=kreal) etime
Definition: m_fstr.F90:147
integer(kind=kint), parameter ilog
FILE HANDLER.
Definition: m_fstr.F90:114
This subroutine read in used-defined loading tangent.
Definition: uload.f90:7
integer function ureadload(fname)
This subroutine read in variables needs to define user-defined external loads.
Definition: uload.f90:25