FrontISTR  5.7.1
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  private :: pc_strupr
12 contains
13 
14  subroutine pc_strupr( s )
15  implicit none
16  character(*) :: s
17  integer :: i, n, a, da
18 
19  n = len_trim(s)
20  da = iachar('a') - iachar('A')
21  do i = 1, n
22  a = iachar(s(i:i))
23  if( a > iachar('Z')) then
24  a = a - da
25  s(i:i) = achar(a)
26  end if
27  end do
28  end subroutine pc_strupr
29 
30  !* ----------------------------------------------------------------------------------------------- *!
32  !* ----------------------------------------------------------------------------------------------- *!
33 
34  function fstr_ctrl_get_static( ctrl, &
35  & dtime, etime, itime, eps, restart_nout, &
36  & idx_elpl, &
37  & iout_list, &
38  & sig_y0, h_dash, &
39  & nout, nout_monit, node_monit_1, elem_monit_1, intg_monit_1 )
40  implicit none
41  integer(kind=kint) :: ctrl
42  real(kind=kreal) :: dtime
43  real(kind=kreal) :: etime
44  integer(kind=kint) :: itime
45  real(kind=kreal) :: eps
46  integer(kind=kint) :: restart_nout
47  integer(kind=kint) :: idx_elpl
48  real(kind=kreal) :: sig_y0, h_dash
49  integer(kind=kint) :: nout, nout_monit, node_monit_1, elem_monit_1, intg_monit_1
50  integer(kind=kint) :: iout_list(6)
51  integer(kind=kint) :: fstr_ctrl_get_static
52 
54 
55  if( fstr_ctrl_get_data_ex( ctrl, 1, 'rriri ', dtime, etime, itime, eps, restart_nout ) /= 0 ) return
56  if( fstr_ctrl_get_data_ex( ctrl, 2, 'i ', idx_elpl ) /= 0 ) return
57  if( fstr_ctrl_get_data_ex( ctrl, 3, 'iiiiii ', &
58  & iout_list(1), iout_list(2), iout_list(3), iout_list(4), iout_list(5), iout_list(6)) /= 0 ) return
59  if( fstr_ctrl_get_data_ex( ctrl, 4, 'rr ', sig_y0, h_dash ) /= 0 ) return
60  if( fstr_ctrl_get_data_ex( ctrl, 5, 'iiiii ', &
61  & nout, nout_monit, node_monit_1, elem_monit_1, intg_monit_1 ) /= 0 ) return
62 
64  end function fstr_ctrl_get_static
65 
66  !* ----------------------------------------------------------------------------------------------- *!
68  !* ----------------------------------------------------------------------------------------------- *!
69 
70  function fstr_ctrl_get_boundary( ctrl, amp, node_id, node_id_len, dof_ids, dof_ide, value )
71  implicit none
72  integer(kind=kint) :: ctrl
73  character(len=HECMW_NAME_LEN) :: amp
74  character(len=HECMW_NAME_LEN) :: node_id(:)
75  integer(kind=kint) :: node_id_len
76  integer(kind=kint),pointer :: dof_ids (:)
77  integer(kind=kint),pointer :: dof_ide (:)
78  real(kind=kreal),pointer :: value(:)
79  integer(kind=kint) :: fstr_ctrl_get_boundary
80 
81  character(len=HECMW_NAME_LEN) :: data_fmt,ss
82  write(ss,*) node_id_len
83  write(data_fmt,'(a,a,a)') 'S',trim(adjustl(ss)),'IIr '
84 
86  if( fstr_ctrl_get_param_ex( ctrl, 'AMP ', '# ', 0, 'S', amp )/= 0) return
88  fstr_ctrl_get_data_array_ex( ctrl, data_fmt, node_id, dof_ids, dof_ide, value )
89 
90  end function fstr_ctrl_get_boundary
91 
92 
93  !* ----------------------------------------------------------------------------------------------- *!
95  !* ----------------------------------------------------------------------------------------------- *!
96 
97  function fstr_ctrl_get_cload( ctrl, amp, node_id, node_id_len, dof_id, value )
98  implicit none
99  integer(kind=kint) :: ctrl
100  character(len=HECMW_NAME_LEN) :: amp
101  character(len=HECMW_NAME_LEN) :: node_id(:)
102  integer(kind=kint) :: node_id_len
103  integer(kind=kint),pointer :: dof_id(:)
104  real(kind=kreal),pointer :: value(:)
105  integer(kind=kint) :: fstr_ctrl_get_cload
106 
107  character(len=HECMW_NAME_LEN) :: data_fmt,ss
108  write(ss,*) node_id_len
109  write( data_fmt, '(a,a,a)') 'S', trim(adjustl(ss)), 'IR '
110 
112  if( fstr_ctrl_get_param_ex( ctrl, 'AMP ', '# ', 0, 'S', amp )/= 0) return
114  fstr_ctrl_get_data_array_ex( ctrl, data_fmt, node_id, dof_id, value )
115 
116  end function fstr_ctrl_get_cload
117 
118  !* ----------------------------------------------------------------------------------------------- *!
120  !* ----------------------------------------------------------------------------------------------- *!
121 
122  function fstr_ctrl_get_dload( ctrl, amp, follow, element_id, element_id_len, load_type, params )
123  implicit none
124  integer(kind=kint) :: ctrl
125  character(len=HECMW_NAME_LEN) :: amp
126  integer(kind=kint) :: follow
127  character(len=HECMW_NAME_LEN) :: element_id(:)
128  integer(kind=kint) :: element_id_len
129  integer(kind=kint),pointer :: load_type(:)
130  real(kind=kreal),pointer :: params(:,:)
131  integer(kind=kint) :: fstr_ctrl_get_dload
132 
133  character(len=HECMW_NAME_LEN),pointer :: type_name_list(:)
134 
135  integer(kind=kint) :: i, n
136  integer(kind=kint) :: rcode
137  character(len=HECMW_NAME_LEN) :: data_fmt,s1,s2
138  integer(kind=kint) :: lid
139 
141  if( fstr_ctrl_get_param_ex( ctrl, 'AMP ', '# ', 0, 'S', amp )/= 0) return
142  follow = follow+1
143  if( fstr_ctrl_get_param_ex( ctrl, 'FOLLOW ','NO,YES ', 0, 'P', follow ) /= 0) return
144  follow = follow-1
145 
146  write(s1,*) element_id_len
147  write(s2,*) hecmw_name_len
148  write( data_fmt, '(a,a,a,a,a)') 'S', trim(adjustl(s1)), 'S', trim(adjustl(s2)),'Rrrrrrr '
149 
150  n = fstr_ctrl_get_data_line_n(ctrl)
151  allocate( type_name_list(n) )
152 
153  block
154  real(kind=kreal) :: params0(n), params1(n), params2(n), params3(n), params4(n), params5(n), params6(n)
155  params0 = params(0,:)
156  params1 = params(1,:)
157  params2 = params(2,:)
158  params3 = params(3,:)
159  params4 = params(4,:)
160  params5 = params(5,:)
161  params6 = params(6,:)
162  rcode = fstr_ctrl_get_data_array_ex( ctrl, data_fmt, element_id, type_name_list, &
163  params0, params1, params2, params3, params4, params5, params6 )
164  params(0,:) = params0
165  params(1,:) = params1
166  params(2,:) = params2
167  params(3,:) = params3
168  params(4,:) = params4
169  params(5,:) = params5
170  params(6,:) = params6
171  end block
172 
173  if( rcode /= 0 ) then
174  deallocate( type_name_list )
175  return
176  end if
177 
178  do i=1, n
179  call pc_strupr( type_name_list(i) )
180  lid = -1;
181  if( type_name_list(i)(1:2) == 'BX' ) then; lid = 1
182  else if( type_name_list(i)(1:2) == 'BY' ) then; lid = 2
183  else if( type_name_list(i)(1:2) == 'BZ' ) then; lid = 3
184  else if( type_name_list(i)(1:4) == 'GRAV') then; lid = 4
185  else if( type_name_list(i)(1:4) == 'CENT') then; lid = 5
186  else if( type_name_list(i)(1:2) == 'PP' ) then; lid = 10
187  else if( type_name_list(i)(1:2) == 'P0' ) then; lid = 10
188  else if( type_name_list(i)(1:2) == 'PX' ) then
189  lid = 10; params(1,:)=1.d0; params(2,:)=0.d0; params(3,:)=0.d0
190  else if( type_name_list(i)(1:2) == 'PY' ) then
191  lid = 10; params(1,:)=0.d0; params(2,:)=1.d0; params(3,:)=0.d0
192  else if( type_name_list(i)(1:2) == 'PZ' ) then
193  lid = 10; params(1,:)=0.d0; params(2,:)=0.d0; params(3,:)=1.d0
194  else if( type_name_list(i)(1:2) == 'P1' ) then; lid = 10
195  else if( type_name_list(i)(1:2) == 'P2' ) then; lid = 20
196  else if( type_name_list(i)(1:2) == 'P3' ) then; lid = 30
197  else if( type_name_list(i)(1:2) == 'P4' ) then; lid = 40
198  else if( type_name_list(i)(1:2) == 'P5' ) then; lid = 50
199  else if( type_name_list(i)(1:2) == 'P6' ) then; lid = 60
200  else if( type_name_list(i)(1:1) == 'S' ) then; lid = 100
201  else
202  write(ilog, *) 'Error : !DLOAD : Load type ',type_name_list(i), ' is unknown'
203  deallocate( type_name_list )
204  return
205  end if
206  load_type(i) = lid
207  end do
208 
209  deallocate( type_name_list )
211 
212  end function fstr_ctrl_get_dload
213 
214 
215 
216  !* ----------------------------------------------------------------------------------------------- *!
218  !* ----------------------------------------------------------------------------------------------- *!
219 
220  function fstr_ctrl_get_reftemp( ctrl, value )
221  implicit none
222  integer(kind=kint) :: ctrl
223  real(kind=kreal) :: value
224  integer(kind=kint) :: fstr_ctrl_get_reftemp,rcode
225 
226  rcode = fstr_ctrl_get_data_ex( ctrl, 1, 'r ', value )
227  fstr_ctrl_get_reftemp = rcode
228 
229  end function fstr_ctrl_get_reftemp
230 
231  !* ----------------------------------------------------------------------------------------------- *!
233  !* ----------------------------------------------------------------------------------------------- *!
234 
235  function fstr_ctrl_get_temperature( ctrl, irres, tstep, tintl, rtype, node_id, node_id_len, value )
236  implicit none
237  integer(kind=kint) :: ctrl
238  integer(kind=kint) :: irres
239  integer(kind=kint) :: tstep
240  integer(kind=kint) :: tintl
241  integer(kind=kint) :: rtype
242  character(len=HECMW_NAME_LEN) :: node_id(:)
243  integer(kind=kint) :: node_id_len
244  real(kind=kreal),pointer :: value(:)
245  integer(kind=kint) :: fstr_ctrl_get_temperature, rcode
246 
247  character(len=HECMW_NAME_LEN) :: data_fmt,ss
248 
249  irres = 0
250  if( fstr_ctrl_get_param_ex( ctrl, 'READRESULT ', '# ', 0, 'I', irres )/= 0) return
251  if( fstr_ctrl_get_param_ex( ctrl, 'SSTEP ', '# ', 0, 'I', tstep )/= 0) return
252  if( fstr_ctrl_get_param_ex( ctrl, 'INTERVAL ', '# ', 0, 'I', tintl )/= 0) return
253  if( fstr_ctrl_get_param_ex( ctrl, 'READTYPE ', 'STEP,TIME ', 0, 'P', rtype )/= 0) return
254  if( irres > 0 ) then
256  return
257  endif
258 
259  write(ss,*) node_id_len
260  write(data_fmt,'(a,a,a)') 'S',trim(adjustl(ss)),'r '
261 
262  rcode = fstr_ctrl_get_data_array_ex( ctrl, data_fmt, node_id, value )
264 
265  end function fstr_ctrl_get_temperature
266 
267 
268  !* ----------------------------------------------------------------------------------------------- *!
270  !* ----------------------------------------------------------------------------------------------- *!
271 
272  function fstr_ctrl_get_spring( ctrl, amp, node_id, node_id_len, dof_id, value )
273  implicit none
274  integer(kind=kint) :: ctrl
275  character(len=HECMW_NAME_LEN) :: amp
276  character(len=HECMW_NAME_LEN) :: node_id(:)
277  integer(kind=kint) :: node_id_len
278  integer(kind=kint),pointer :: dof_id(:)
279  real(kind=kreal),pointer :: value(:)
280  integer(kind=kint) :: fstr_ctrl_get_spring
281 
282  character(len=HECMW_NAME_LEN) :: data_fmt,ss
283  write(ss,*) node_id_len
284  write( data_fmt, '(a,a,a)') 'S', trim(adjustl(ss)), 'IR '
285 
287  if( fstr_ctrl_get_param_ex( ctrl, 'AMP ', '# ', 0, 'S', amp )/= 0) return
289  fstr_ctrl_get_data_array_ex( ctrl, data_fmt, node_id, dof_id, value )
290 
291  end function fstr_ctrl_get_spring
292 
293 
294  !----------------------------------------------------------------------
296  integer function fstr_ctrl_get_userload( ctrl )
297  use muload
298  integer(kind=kint), intent(in) :: ctrl
299 
300  character(len=256) :: fname
301 
303  if( fstr_ctrl_get_param_ex( ctrl, 'FILE ', '# ', 0, 'S', fname )/=0 ) return
304  if( fname=="" ) stop "You must define a file name before read in user-defined material"
305  if( ureadload(fname)/=0 ) return
306 
308  end function fstr_ctrl_get_userload
309 
310 end module fstr_ctrl_static
311 
312 
313 
314 
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_spring(ctrl, amp, node_id, node_id_len, dof_id, value)
Read in !SPRING.
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_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:142
real(kind=kreal) etime
Definition: m_fstr.f90:140
integer(kind=kint), parameter ilog
FILE HANDLER.
Definition: m_fstr.f90:107
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