FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
fstr_setup.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 !-------------------------------------------------------------------------------
8  use m_fstr
12  use fstr_ctrl_heat
13  use fstr_ctrl_eigen
16  use mcontact
17  use mcontactparam
19  use m_out
20  use m_step
21  use m_utilities
22  implicit none
23 
24  include 'fstr_ctrl_util_f.inc'
25 
28  type(hecmwst_local_mesh), pointer :: mesh
29  type(fstr_param), pointer :: param
30  type(fstr_solid), pointer :: solid
31  type(fstr_heat), pointer :: heat
32  type(fstr_eigen), pointer :: eigen
33  type(fstr_dynamic), pointer :: dyn
34  type(fstr_couple), pointer :: cpl
35  type(fstr_freqanalysis), pointer :: freq
36  end type fstr_param_pack
37 
38 contains
39 
40  !=============================================================================!
42  !=============================================================================!
43  subroutine fstr_setup( cntl_filename, hecMESH, fstrPARAM, &
44  fstrSOLID, fstrEIG, fstrHEAT, fstrDYNAMIC, fstrCPL, fstrFREQ )
46  character(len=HECMW_FILENAME_LEN) :: cntl_filename, input_filename
47  type(hecmwst_local_mesh),target :: hecMESH
48  type(fstr_param),target :: fstrPARAM
49  type(fstr_solid),target :: fstrSOLID
50  type(fstr_eigen),target :: fstrEIG
51  type(fstr_heat),target :: fstrHEAT
52  type(fstr_dynamic),target :: fstrDYNAMIC
53  type(fstr_couple),target :: fstrCPL
54  type(fstr_freqanalysis), target :: fstrFREQ
55 
56  integer(kind=kint) :: ctrl, ctrl_list(20), ictrl
57  type(fstr_param_pack) :: P
58 
59  integer, parameter :: MAXOUTFILE = 10
60  double precision, parameter :: dpi = 3.14159265358979323846d0
61 
62  external fstr_ctrl_get_c_h_name
63  integer(kind=kint) :: fstr_ctrl_get_c_h_name
64 
65  integer(kind=kint) :: version, result, visual, femap, n_totlyr
66  integer(kind=kint) :: rcode, n, i, j, cid, nout, nin, ierror, cparam_id
67  character(len=HECMW_NAME_LEN) :: header_name, fname(MAXOUTFILE)
68  real(kind=kreal) :: ee, pp, rho, alpha, thick, alpha_over_mu
69  real(kind=kreal) :: beam_radius, &
70  beam_angle1, beam_angle2, beam_angle3,&
71  beam_angle4, beam_angle5, beam_angle6
72  logical :: isOK
73  type(t_output_ctrl) :: outctrl
74  type(tshellmat),pointer :: shmat(:)
75  character(len=HECMW_FILENAME_LEN) :: logfileNAME, mName, mName2
76 
77  ! counters
78  integer(kind=kint) :: c_solution, c_solver, c_nlsolver, c_step, c_write, c_echo, c_amplitude
79  integer(kind=kint) :: c_static, c_boundary, c_cload, c_dload, c_temperature, c_reftemp, c_spring
80  integer(kind=kint) :: c_heat, c_fixtemp, c_cflux, c_dflux, c_sflux, c_film, c_sfilm, c_radiate, c_sradiate
81  integer(kind=kint) :: c_eigen, c_contact, c_contactparam, c_embed
82  integer(kind=kint) :: c_dynamic, c_velocity, c_acceleration
83  integer(kind=kint) :: c_fload, c_eigenread
84  integer(kind=kint) :: c_couple, c_material
85  integer(kind=kint) :: c_mpc, c_weldline, c_initial
86  integer(kind=kint) :: c_istep, c_localcoord, c_section
87  integer(kind=kint) :: c_elemopt, c_aincparam, c_timepoints
88  integer(kind=kint) :: c_output, islog
89  integer(kind=kint) :: k
90  integer(kind=kint) :: cache = 1
91 
92  write( logfilename, '(i5,''.log'')' ) myrank
93 
94  ! packaging
95  p%MESH => hecmesh
96  p%PARAM => fstrparam
97  p%SOLID => fstrsolid
98  p%EIGEN => fstreig
99  p%HEAT => fstrheat
100  p%DYN => fstrdynamic
101  p%CPL => fstrcpl
102  p%FREQ => fstrfreq
103 
104  fstrparam%contact_algo = kcaalagrange
105 
106  c_solution = 0; c_solver = 0; c_nlsolver = 0; c_step = 0; c_output = 0; c_echo = 0; c_amplitude = 0
107  c_static = 0; c_boundary = 0; c_cload = 0; c_dload = 0; c_temperature = 0; c_reftemp = 0; c_spring = 0;
108  c_heat = 0; c_fixtemp = 0; c_cflux = 0; c_dflux = 0; c_sflux = 0
109  c_film = 0; c_sfilm = 0; c_radiate= 0; c_sradiate = 0
110  c_eigen = 0; c_contact = 0; c_contactparam = 0; c_embed = 0
111  c_dynamic = 0; c_velocity = 0; c_acceleration = 0
112  c_couple = 0; c_material = 0; c_section =0
113  c_mpc = 0; c_weldline = 0; c_initial = 0
114  c_istep = 0; c_localcoord = 0
115  c_fload = 0; c_eigenread = 0
116  c_elemopt = 0;
117  c_aincparam= 0; c_timepoints = 0
118 
119  ctrl_list = 0
120  ictrl = 1
121  ctrl = fstr_ctrl_open( cntl_filename )
122  if( ctrl < 0 ) then
123  write(*,*) '### Error: Cannot open FSTR control file : ', cntl_filename
124  write(ilog,*) '### Error: Cannot open FSTR control file : ', cntl_filename
125  stop
126  end if
127 
128  version =0
129  do
130  rcode = fstr_ctrl_get_c_h_name( ctrl, header_name, hecmw_name_len )
131  if( header_name == '!VERSION' ) then
132  rcode = fstr_ctrl_get_data_array_ex( ctrl, 'i ', version )
133  else if( header_name == '!SOLUTION' ) then
134  c_solution = c_solution + 1
135  call fstr_setup_solution( ctrl, c_solution, p )
136  else if( header_name == '!NONLINEAR_SOLVER' ) then
137  c_nlsolver = c_nlsolver + 1
138  call fstr_setup_nonlinear_solver( ctrl, c_nlsolver, p )
139  else if( header_name == '!SOLVER' ) then
140  c_solver = c_solver + 1
141  call fstr_setup_solver( ctrl, c_solver, p )
142  else if( header_name == '!ISTEP' ) then
143  c_istep = c_istep + 1
144  else if( header_name == '!STEP' ) then
145  if( version==0 ) then
146  c_step = c_step + 1
147  call fstr_setup_step( ctrl, c_step, p )
148  else
149  c_istep = c_istep + 1
150  endif
151  else if( header_name == '!WRITE' ) then
152  call fstr_ctrl_get_output( ctrl, outctrl, islog, result, visual, femap )
153  if( visual==1 ) p%PARAM%fg_visual= 1
154  if( result==1 ) p%PARAM%fg_result = 1
155  c_output = c_output+1
156  else if( header_name == '!ECHO' ) then
157  c_echo = c_echo + 1
158  call fstr_setup_echo( ctrl, c_echo, p )
159  else if( header_name == '!RESTART' ) then
160  call fstr_setup_restart( ctrl, nout, p%PARAM%restart_version )
161  fstrsolid%restart_nout= nout
162  fstrdynamic%restart_nout= nout
163  fstrheat%restart_nout= nout
164  else if( header_name == '!ORIENTATION' ) then
165  c_localcoord = c_localcoord + 1
166  else if( header_name == '!AUTOINC_PARAM' ) then
167  c_aincparam = c_aincparam + 1
168  else if( header_name == '!TIME_POINTS' ) then
169  c_timepoints = c_timepoints + 1
170  else if( header_name == '!OUTPUT_SSTYPE' ) then
171  call fstr_setup_output_sstype( ctrl, p )
172  else if( header_name == '!INITIAL_CONDITION' ) then
173  c_initial = c_initial + 1
174  else if( header_name == '!AMPLITUDE' ) then
175  c_amplitude = c_amplitude + 1
176  call fstr_setup_amplitude( ctrl, p )
177 
178  !--------------- for static -------------------------
179 
180  else if( header_name == '!STATIC' ) then
181  c_static = c_static + 1
182  call fstr_setup_static( ctrl, c_static, p )
183  else if( header_name == '!BOUNDARY' ) then
184  c_boundary = c_boundary + 1
185  call fstr_setup_boundary( ctrl, c_boundary, p )
186  else if( header_name == '!CLOAD' ) then
187  c_cload = c_cload + 1
188  call fstr_setup_cload( ctrl, c_cload, p )
189  n = fstr_ctrl_get_data_line_n( ctrl )
190  else if( header_name == '!DLOAD' ) then
191  c_dload = c_dload + 1
192  call fstr_setup_dload( ctrl, c_dload, p )
193  else if( header_name == '!CONTACT_ALGO' ) then
194  call fstr_setup_contactalgo( ctrl, p )
195  else if( header_name == '!CONTACT' ) then
196  n = fstr_ctrl_get_data_line_n( ctrl )
197  c_contact = c_contact + n
198  else if( header_name == '!EMBED' ) then
199  n = fstr_ctrl_get_data_line_n( ctrl )
200  c_embed = c_embed + n
201  else if( header_name == '!CONTACT_PARAM' ) then
202  c_contactparam = c_contactparam + 1
203  else if( header_name == '!MATERIAL' ) then
204  c_material = c_material + 1
205  else if( header_name == '!TEMPERATURE' ) then
206  c_temperature = c_temperature + 1
207  call fstr_setup_temperature( ctrl, c_temperature, p )
208  else if( header_name == '!SPRING' ) then
209  c_spring = c_spring + 1
210  call fstr_setup_spring( ctrl, c_spring, p )
211  else if( header_name == '!REFTEMP' ) then
212  c_reftemp = c_reftemp + 1
213  call fstr_setup_reftemp( ctrl, c_reftemp, p )
214 
215  !--------------- for heat -------------------------
216 
217  else if( header_name == '!HEAT' ) then
218  c_heat = c_heat + 1
219  else if( header_name == '!FIXTEMP' ) then
220  c_fixtemp = c_fixtemp + 1
221  call fstr_setup_fixtemp( ctrl, c_fixtemp, p )
222  else if( header_name == '!CFLUX' ) then
223  c_cflux = c_cflux + 1
224  call fstr_setup_cflux( ctrl, c_cflux, p )
225  else if( header_name == '!DFLUX' ) then
226  c_dflux = c_dflux + 1
227  call fstr_setup_dflux( ctrl, c_dflux, p )
228  else if( header_name == '!SFLUX' ) then
229  c_sflux = c_sflux + 1
230  call fstr_setup_sflux( ctrl, c_sflux, p )
231  else if( header_name == '!FILM' ) then
232  c_film = c_film + 1
233  call fstr_setup_film( ctrl, c_film, p )
234  else if( header_name == '!SFILM' ) then
235  c_sfilm = c_sfilm + 1
236  call fstr_setup_sfilm( ctrl, c_sfilm, p )
237  else if( header_name == '!RADIATE' ) then
238  c_radiate = c_radiate + 1
239  call fstr_setup_radiate( ctrl, c_radiate, p )
240  else if( header_name == '!SRADIATE' ) then
241  c_sradiate = c_sradiate + 1
242  call fstr_setup_sradiate( ctrl, c_sradiate, p )
243  else if( header_name == '!WELD_LINE' ) then
244  c_weldline = c_weldline + 1
245 
246  !--------------- for eigen -------------------------
247 
248  else if( header_name == '!EIGEN' ) then
249  c_eigen = c_eigen + 1
250  call fstr_setup_eigen( ctrl, c_eigen, p )
251 
252  !--------------- for dynamic -------------------------
253 
254  else if( header_name == '!DYNAMIC' ) then
255  c_dynamic = c_dynamic + 1
256  call fstr_setup_dynamic( ctrl, c_eigen, p )
257  else if( header_name == '!VELOCITY' ) then
258  c_velocity = c_velocity + 1
259  call fstr_setup_velocity( ctrl, c_eigen, p )
260  else if( header_name == '!ACCELERATION' ) then
261  c_acceleration = c_acceleration + 1
262  call fstr_setup_acceleration( ctrl, c_eigen, p )
263  else if( header_name == '!FLOAD' ) then
264  c_fload = c_fload + 1
265  call fstr_setup_fload( ctrl , c_fload, p )
266  else if( header_name == '!EIGENREAD' ) then
267  c_eigenread = c_eigenread + 1
268  call fstr_setup_eigenread( ctrl, c_eigenread, p )
269 
270  !--------------- for couple -------------------------
271 
272  else if( header_name == '!COUPLE' ) then
273  c_couple = c_couple + 1
274  call fstr_setup_couple( ctrl, c_couple, p )
275 
276  !--------------- for mpc -------------------------
277 
278  else if( header_name == '!MPC' ) then
279  c_mpc = c_mpc + 1
280  call fstr_setup_mpc( ctrl, c_mpc, p )
281 
282  !--------------------- for input -------------------------
283 
284  else if( header_name == '!INCLUDE' ) then
285  ctrl_list(ictrl) = ctrl
286  input_filename = ""
287  ierror = fstr_ctrl_get_param_ex( ctrl, 'INPUT ', '# ', 0, 'S', input_filename )
288  ctrl = fstr_ctrl_open( input_filename )
289  if( ctrl < 0 ) then
290  write(*,*) '### Error: Cannot open FSTR control file : ', input_filename
291  write(ilog,*) '### Error: Cannot open FSTR control file : ', input_filename
292  stop
293  end if
294  ictrl = ictrl + 1
295  cycle
296 
297  !--------------------- END -------------------------
298 
299  else if( header_name == '!END' ) then
300  exit
301  end if
302 
303  ! next
304  if( fstr_ctrl_seek_next_header(ctrl) == 0 )then
305  if( ictrl == 1 )then
306  exit
307  else
308  ierror= fstr_ctrl_close( ctrl )
309  ictrl = ictrl - 1
310  ctrl = ctrl_list(ictrl)
311  if( fstr_ctrl_seek_next_header(ctrl) == 0 ) exit
312  endif
313  endif
314  end do
315 
316  ! -----
317  fstrsolid%n_contacts = c_contact
318  if( c_contact>0 ) then
319  allocate( fstrsolid%contacts( c_contact ) )
320  ! convert SURF_SURF contact to NODE_SURF contact
321  call fstr_convert_contact_type( p%MESH )
322  endif
323  fstrsolid%n_embeds = c_embed
324  if( c_embed>0 ) allocate( fstrsolid%embeds( c_embed ) )
325  if( c_weldline>0 ) allocate( fstrheat%weldline( c_weldline ) )
326  if( c_initial>0 ) allocate( g_initialcnd( c_initial ) )
327  if( c_istep>0 ) allocate( fstrsolid%step_ctrl( c_istep ) )
328  if( c_localcoord>0 ) allocate( g_localcoordsys(c_localcoord) )
329  allocate( fstrparam%ainc(0:c_aincparam) )
330  do i=0,c_aincparam
331  call init_aincparam( fstrparam%ainc(i) )
332  end do
333  if( c_timepoints>0 ) allocate( fstrparam%timepoints(c_timepoints) )
334  allocate( fstrparam%contactparam(0:c_contactparam) )
335  do i=0,c_contactparam
336  call init_contactparam( fstrparam%contactparam(i) )
337  end do
338 
339  p%SOLID%is_33shell = 0
340  p%SOLID%is_33beam = 0
341 
342  do i=1,hecmesh%n_elem_type
343  n = hecmesh%elem_type_item(i)
344  if (n == 781 .or. n == 761)then
345  p%SOLID%is_33shell = 1
346  elseif (n == 641)then
347  p%SOLID%is_33beam = 1
348  endif
349  enddo
350 
351  n = c_material
352  if( hecmesh%material%n_mat>n ) n= hecmesh%material%n_mat
353  if( n==0 ) stop "material property not defined!"
354  allocate( fstrsolid%materials( n ) )
355  do i = 1, n
356  call initmaterial(fstrsolid%materials(i))
357  enddo
358  if( hecmesh%section%n_sect >0 ) then
359  do i=1,hecmesh%section%n_sect
360  if( hecmesh%section%sect_type(i) == 4 ) cycle
361  cid = hecmesh%section%sect_mat_ID_item(i)
362  if( cid>n ) stop "Error in material property definition!"
363  if( fstrparam%nlgeom .or. fstrparam%solution_type==kststaticeigen ) &
364  fstrsolid%materials(cid)%nlgeom_flag = 1
365  nullify(shmat)
366  call fstr_get_prop(hecmesh,shmat,i,ee,pp,rho,alpha,thick,&
367  n_totlyr,alpha_over_mu, &
368  beam_radius,beam_angle1,beam_angle2,beam_angle3, &
369  beam_angle4,beam_angle5,beam_angle6)
370  fstrsolid%materials(cid)%name = hecmesh%material%mat_name(cid)
371  fstrsolid%materials(cid)%variables(m_youngs)=ee
372  fstrsolid%materials(cid)%variables(m_poisson)=pp
373  fstrsolid%materials(cid)%variables(m_density)=rho
374  fstrsolid%materials(cid)%variables(m_exapnsion)=alpha
375  fstrsolid%materials(cid)%variables(m_thick)=thick
376  fstrsolid%materials(cid)%variables(m_alpha_over_mu)= alpha_over_mu
377  fstrsolid%materials(cid)%variables(m_beam_radius)=beam_radius
378  fstrsolid%materials(cid)%variables(m_beam_angle1)=beam_angle1
379  fstrsolid%materials(cid)%variables(m_beam_angle2)=beam_angle2
380  fstrsolid%materials(cid)%variables(m_beam_angle3)=beam_angle3
381  fstrsolid%materials(cid)%variables(m_beam_angle4)=beam_angle4
382  fstrsolid%materials(cid)%variables(m_beam_angle5)=beam_angle5
383  fstrsolid%materials(cid)%variables(m_beam_angle6)=beam_angle6
384  fstrsolid%materials(cid)%mtype = elastic
385  fstrsolid%materials(cid)%totallyr = n_totlyr
386  fstrsolid%materials(cid)%shell_var => shmat
387  enddo
388  endif
389 
390  ! for section control
391  allocate( fstrsolid%sections(hecmesh%section%n_sect) )
392  do i=1,hecmesh%section%n_sect
393  ! set default 361 element formulation
394  if( p%PARAM%solution_type==kststatic .or. p%PARAM%solution_type==kstdynamic ) then
395  if( p%PARAM%nlgeom ) then
396  fstrsolid%sections(i)%elemopt361 = kel361fbar
397  else
398  fstrsolid%sections(i)%elemopt361 = kel361ic
399  end if
400  else if( p%PARAM%solution_type==ksteigen ) then
401  fstrsolid%sections(i)%elemopt361 = kel361ic
402  else if( p%PARAM%solution_type==kststaticeigen ) then
403  fstrsolid%sections(i)%elemopt361 = kel361fbar
404  else
405  fstrsolid%sections(i)%elemopt361 = kel361fi
406  end if
407  fstrsolid%sections(i)%elemopt341 = kel341fi
408  enddo
409 
410  allocate( fstrsolid%output_ctrl( 4 ) )
411  call fstr_init_outctrl(fstrsolid%output_ctrl(1))
412  fstrsolid%output_ctrl( 1 )%filename = trim(logfilename)
413  fstrsolid%output_ctrl( 1 )%filenum = ilog
414  call fstr_init_outctrl(fstrsolid%output_ctrl(2))
415  call fstr_init_outctrl(fstrsolid%output_ctrl(3))
416  call fstr_init_outctrl(fstrsolid%output_ctrl(4))
417 
418  ! -----
419  rcode = fstr_ctrl_rewind( ctrl )
420 
421  c_istep = 0
422  c_heat = 0
423  c_material = 0
424  c_output = 0
425  c_contact = 0
426  c_contactparam = 0
427  c_embed = 0
428  c_initial = 0
429  c_localcoord = 0
430  c_section = 0
431  fstrheat%WL_tot = 0
432  c_elemopt = 0
433  c_aincparam = 0
434  c_timepoints = 0
435  fstrsolid%elemopt361 = 0
436  fstrsolid%AutoINC_stat = 0
437  fstrsolid%CutBack_stat = 0
438  fstrsolid%NRstat_i(:) = 0
439  fstrsolid%NRstat_r(:) = 0.d0
440  ictrl = 1
441  do
442  rcode = fstr_ctrl_get_c_h_name( ctrl, header_name, hecmw_name_len )
443 
444  if( header_name == '!ORIENTATION' ) then
445  c_localcoord = c_localcoord + 1
446  if( fstr_setup_orientation( ctrl, hecmesh, c_localcoord, g_localcoordsys(c_localcoord) )/=0 ) then
447  write(*,*) '### Error: Fail in read in ORIENTATION definition : ', c_localcoord
448  write(ilog,*) '### Error: Fail in read in ORIENTATION definition : ', c_localcoord
449  stop
450  endif
451 
452  ! ----- CONTACT condition setting
453  elseif( header_name == '!CONTACT' ) then
454  n = fstr_ctrl_get_data_line_n( ctrl )
455  if( .not. fstr_ctrl_get_contact( ctrl, n, fstrsolid%contacts(c_contact+1:c_contact+n) &
456  ,ee, pp, rho, alpha, p%PARAM%contact_algo, mname ) ) then
457  write(*,*) '### Error: Fail in read in contact condition : ', c_contact
458  write(ilog,*) '### Error: Fail in read in contact condition : ', c_contact
459  stop
460  endif
461  cparam_id = 0
462  do i=1,size(fstrparam%contactparam)-1
463  if( fstr_streqr( fstrparam%contactparam(i)%name, mname ) ) then
464  cparam_id = i; exit
465  endif
466  enddo
467  ! initialize contact condition
468  if( ee>0.d0 ) cdotp = ee
469  if( pp>0.d0 ) mut = pp
470  if( rho>0.d0 ) cgn = rho
471  if( alpha>0.d0 ) cgt = alpha
472  do i=1,n
473  if( .not. fstr_contact_check( fstrsolid%contacts(c_contact+i), p%MESH ) ) then
474  write(*,*) '### Error: Inconsistence in contact and surface definition : ' , i+c_contact
475  write(ilog,*) '### Error: Inconsistence in contact and surface definition : ', i+c_contact
476  stop
477  else
478  if(paracontactflag) then
479  isok = fstr_contact_init( fstrsolid%contacts(c_contact+i), p%MESH, fstrparam%contactparam(cparam_id), myrank)
480  else
481  isok = fstr_contact_init( fstrsolid%contacts(c_contact+i), p%MESH, fstrparam%contactparam(cparam_id))
482  endif
483  ! call fstr_write_contact( 6, fstrSOLID%contacts(c_contact+i) )
484  endif
485  enddo
486  c_contact = c_contact+n
487 
488  ! ----- EMBED condition setting
489  elseif( header_name == '!EMBED' ) then
490  n = fstr_ctrl_get_data_line_n( ctrl )
491  if( .not. fstr_ctrl_get_embed( ctrl, n, fstrsolid%embeds(c_embed+1:c_embed+n), mname ) ) then
492  write(*,*) '### Error: Fail in read in embed condition : ', c_embed
493  write(ilog,*) '### Error: Fail in read in embed condition : ', c_embed
494  stop
495  endif
496  cparam_id = 0
497  do i=1,size(fstrparam%contactparam)-1
498  if( fstr_streqr( fstrparam%contactparam(i)%name, mname ) ) then
499  cparam_id = i; exit
500  endif
501  enddo
502  do i=1,n
503  if( .not. fstr_contact_check( fstrsolid%embeds(c_embed+i), p%MESH ) ) then
504  write(*,*) '### Error: Inconsistence in contact and surface definition : ' , i+c_embed
505  write(ilog,*) '### Error: Inconsistence in contact and surface definition : ', i+c_embed
506  stop
507  else
508  if(paracontactflag) then
509  isok = fstr_embed_init( fstrsolid%embeds(c_embed+i), p%MESH, fstrparam%contactparam(cparam_id), myrank)
510  else
511  isok = fstr_embed_init( fstrsolid%embeds(c_embed+i), p%MESH, fstrparam%contactparam(cparam_id))
512  endif
513  endif
514  enddo
515  c_embed = c_embed+n
516 
517  else if( header_name == '!ISTEP' ) then
518  c_istep = c_istep+1
519  if( .not. fstr_ctrl_get_istep( ctrl, hecmesh, fstrsolid%step_ctrl(c_istep), mname, mname2 ) ) then
520  write(*,*) '### Error: Fail in read in step definition : ' , c_istep
521  write(ilog,*) '### Error: Fail in read in step definition : ', c_istep
522  stop
523  endif
524  if( associated(fstrparam%timepoints) ) then
525  do i=1,size(fstrparam%timepoints)
526  if( fstr_streqr( fstrparam%timepoints(i)%name, mname ) ) then
527  fstrsolid%step_ctrl(c_istep)%timepoint_id = i; exit
528  endif
529  enddo
530  endif
531  if( associated(fstrparam%ainc) ) then
532  do i=1,size(fstrparam%ainc)
533  if( fstr_streqr( fstrparam%ainc(i)%name, mname2 ) ) then
534  fstrsolid%step_ctrl(c_istep)%AincParam_id = i; exit
535  endif
536  enddo
537  endif
538  else if( header_name == '!STEP' .and. version>=1 ) then
539  c_istep = c_istep+1
540  if( .not. fstr_ctrl_get_istep( ctrl, hecmesh, fstrsolid%step_ctrl(c_istep), mname, mname2 ) ) then
541  write(*,*) '### Error: Fail in read in step definition : ' , c_istep
542  write(ilog,*) '### Error: Fail in read in step definition : ', c_istep
543  stop
544  endif
545  if( associated(fstrparam%timepoints) ) then
546  do i=1,size(fstrparam%timepoints)
547  if( fstr_streqr( fstrparam%timepoints(i)%name, mname ) ) then
548  fstrsolid%step_ctrl(c_istep)%timepoint_id = i; exit
549  endif
550  enddo
551  endif
552  if( associated(fstrparam%ainc) ) then
553  do i=1,size(fstrparam%ainc)-1
554  if( fstr_streqr( fstrparam%ainc(i)%name, mname2 ) ) then
555  fstrsolid%step_ctrl(c_istep)%AincParam_id = i; exit
556  endif
557  enddo
558  endif
559 
560  else if( header_name == '!HEAT' ) then
561  c_heat = c_heat + 1
562  call fstr_setup_heat( ctrl, c_heat, p )
563 
564  else if( header_name == '!WELD_LINE' ) then
565  fstrheat%WL_tot = fstrheat%WL_tot+1
566  if( fstr_ctrl_get_weldline( ctrl, hecmesh, hecmw_name_len, fstrheat%weldline(fstrheat%WL_tot) )/=0 ) then
567  write(*,*) '### Error: Fail in read in Weld Line definition : ' , fstrheat%WL_tot
568  write(ilog,*) '### Error: Fail in read in Weld Line definition : ', fstrheat%WL_tot
569  stop
570  endif
571 
572  else if( header_name == '!INITIAL_CONDITION' .or. header_name == '!INITIAL CONDITION' ) then
573  c_initial = c_initial+1
574  if( fstr_setup_initial( ctrl, g_initialcnd(c_initial), p%MESH )/=0 ) then
575  write(*,*) '### Error: Fail in read in INITIAL CONDITION definition : ' ,c_initial
576  write(ilog,*) '### Error: Fail in read in INITIAL CONDITION definition : ', c_initial
577  stop
578  endif
579 
580  else if( header_name == '!SECTION' ) then
581  c_section = c_section+1
582  if( fstr_ctrl_get_section( ctrl, hecmesh, fstrsolid%sections )/=0 ) then
583  write(*,*) '### Error: Fail in read in SECTION definition : ' , c_section
584  write(ilog,*) '### Error: Fail in read in SECTION definition : ', c_section
585  stop
586  endif
587 
588  else if( header_name == '!ELEMOPT' ) then
589  c_elemopt = c_elemopt+1
590  if( fstr_ctrl_get_elemopt( ctrl, fstrsolid%elemopt361 )/=0 ) then
591  write(*,*) '### Error: Fail in read in ELEMOPT definition : ' , c_elemopt
592  write(ilog,*) '### Error: Fail in read in ELEMOPT definition : ', c_elemopt
593  stop
594  endif
595 
596  !== following material properties ==
597  else if( header_name == '!MATERIAL' ) then
598  c_material = c_material+1
599  if( fstr_ctrl_get_material( ctrl, mname )/=0 ) then
600  write(*,*) '### Error: Fail in read in material definition : ' , c_material
601  write(ilog,*) '### Error: Fail in read in material definition : ', c_material
602  stop
603  endif
604  cid = 0
605  if(cache < hecmesh%material%n_mat) then
606  if(fstr_streqr( hecmesh%material%mat_name(cache), mname ))then
607  cid = cache
608  cache = cache + 1
609  endif
610  endif
611  if(cid == 0)then
612  do i=1,hecmesh%material%n_mat
613  if( fstr_streqr( hecmesh%material%mat_name(i), mname ) ) then
614  cid = i
615  cache = i + 1
616  exit
617  endif
618  enddo
619  endif
620  if(cid == 0)then
621  write(*,*) '### Error: Fail in read in material definition : ' , c_material
622  write(ilog,*) '### Error: Fail in read in material definition : ', c_material
623  stop
624  endif
625  fstrsolid%materials(cid)%name = mname
626  if(c_material>hecmesh%material%n_mat) call initmaterial( fstrsolid%materials(cid) )
627 
628  else if( header_name == '!ELASTIC' ) then
629  if( c_material >0 ) then
630  if( fstr_ctrl_get_elasticity( ctrl, &
631  fstrsolid%materials(cid)%mtype, &
632  fstrsolid%materials(cid)%nlgeom_flag, &
633  fstrsolid%materials(cid)%variables, &
634  fstrsolid%materials(cid)%dict)/=0 ) then
635  write(*,*) '### Error: Fail in read in elasticity definition : ' , cid
636  write(ilog,*) '### Error: Fail in read in elasticity definition : ', cid
637  stop
638  endif
639  endif
640  else if( header_name == '!PLASTIC' ) then
641  if( cid >0 ) then
642  if( fstr_ctrl_get_plasticity( ctrl, &
643  fstrsolid%materials(cid)%mtype, &
644  fstrsolid%materials(cid)%nlgeom_flag, &
645  fstrsolid%materials(cid)%variables, &
646  fstrsolid%materials(cid)%table, &
647  fstrsolid%materials(cid)%dict)/=0 ) then
648  write(*,*) '### Error: Fail in read in plasticity definition : ' , cid
649  write(ilog,*) '### Error: Fail in read in plasticity definition : ', cid
650  stop
651  endif
652  endif
653  else if( header_name == '!HYPERELASTIC' ) then
654  if( cid >0 ) then
655  if( fstr_ctrl_get_hyperelastic( ctrl, &
656  fstrsolid%materials(cid)%mtype, &
657  fstrsolid%materials(cid)%nlgeom_flag, &
658  fstrsolid%materials(cid)%variables )/=0 ) then
659  write(*,*) '### Error: Fail in read in elasticity definition : ' , cid
660  write(ilog,*) '### Error: Fail in read in elasticity definition : ', cid
661  stop
662  endif
663  endif
664  else if( header_name == '!VISCOELASTIC' ) then
665  if( cid >0 ) then
666  if( fstr_ctrl_get_viscoelasticity( ctrl, &
667  fstrsolid%materials(cid)%mtype, &
668  fstrsolid%materials(cid)%nlgeom_flag, &
669  fstrsolid%materials(cid)%dict)/=0 ) then
670  write(*,*) '### Error: Fail in read in plasticity definition : ' , cid
671  write(ilog,*) '### Error: Fail in read in plasticity definition : ', cid
672  stop
673  endif
674  endif
675  else if( header_name == '!TRS' ) then
676  if( cid >0 ) then
677  if( fstrsolid%materials(cid)%mtype/=viscoelastic ) then
678  write(*,*) '### WARNING: TRS can only be defined for viscoelastic material! It is ignored! '
679  write(ilog,*) '### WARNING: TRS can only be defined for viscoelastic material! It is ignored! '
680  else
681  if( fstr_ctrl_get_trs( ctrl, fstrsolid%materials(cid)%mtype, fstrsolid%materials(cid)%variables)/=0 ) then
682  write(*,*) '### Error: Fail in read in TRS definition : ' , cid
683  write(ilog,*) '### Error: Fail in read in TRS definition : ', cid
684  stop
685  endif
686  endif
687  endif
688  else if( header_name == '!CREEP' ) then
689  if( cid >0 ) then
690  if( fstr_ctrl_get_viscoplasticity( ctrl, &
691  fstrsolid%materials(cid)%mtype, &
692  fstrsolid%materials(cid)%nlgeom_flag, &
693  fstrsolid%materials(cid)%dict)/=0 ) then
694  write(*,*) '### Error: Fail in read in plasticity definition : ' , cid
695  write(ilog,*) '### Error: Fail in read in plasticity definition : ', cid
696  stop
697  endif
698  endif
699  else if( header_name == '!DENSITY' ) then
700  if( cid >0 ) then
701  if( fstr_ctrl_get_density( ctrl, fstrsolid%materials(cid)%variables )/=0 ) then
702  write(*,*) '### Error: Fail in read in density definition : ' , cid
703  write(ilog,*) '### Error: Fail in read in density definition : ', cid
704  stop
705  endif
706  endif
707  else if( header_name == '!EXPANSION_COEF' .or. header_name == '!EXPANSION_COEFF' .or. &
708  header_name == '!EXPANSION') then
709  if( cid >0 ) then
710  if( fstr_ctrl_get_expansion_coeff( ctrl, fstrsolid%materials(cid)%variables, &
711  fstrsolid%materials(cid)%dict)/=0 ) then
712  write(*,*) '### Error: Fail in read in expansion coefficient definition : ' , cid
713  write(ilog,*) '### Error: Fail in read in expansion coefficient definition : ', cid
714  stop
715  endif
716  endif
717  else if( header_name == '!FLUID' ) then
718  if( c_material >0 ) then
719  if( fstr_ctrl_get_fluid( ctrl, &
720  fstrsolid%materials(cid)%mtype, &
721  fstrsolid%materials(cid)%nlgeom_flag, &
722  fstrsolid%materials(cid)%variables, &
723  fstrsolid%materials(cid)%dict)/=0 ) then
724  write(*,*) '### Error: Fail in read in fluid definition : ' , cid
725  write(ilog,*) '### Error: Fail in read in fluid definition : ', cid
726  stop
727  endif
728  endif
729  else if( header_name == '!SPRING_D' ) then
730  if( c_material >0 ) then
731  if( fstr_ctrl_get_spring_d( ctrl, &
732  fstrsolid%materials(cid)%mtype, &
733  fstrsolid%materials(cid)%nlgeom_flag, &
734  fstrsolid%materials(cid)%variables_i, &
735  fstrsolid%materials(cid)%dict)/=0 ) then
736  write(*,*) '### Error: Fail in read in spring_d definition : ' , cid
737  write(ilog,*) '### Error: Fail in read in spring_d definition : ', cid
738  stop
739  endif
740  endif
741  else if( header_name == '!SPRING_A' ) then
742  if( c_material >0 ) then
743  if( fstr_ctrl_get_spring_a( ctrl, &
744  fstrsolid%materials(cid)%mtype, &
745  fstrsolid%materials(cid)%nlgeom_flag, &
746  fstrsolid%materials(cid)%variables_i, &
747  fstrsolid%materials(cid)%dict)/=0 ) then
748  write(*,*) '### Error: Fail in read in spring_a definition : ' , cid
749  write(ilog,*) '### Error: Fail in read in spring_a definition : ', cid
750  stop
751  endif
752  endif
753  else if( header_name == '!DASHPOT_D' ) then
754  if( c_material >0 ) then
755  if( fstr_ctrl_get_dashpot_d( ctrl, &
756  fstrsolid%materials(cid)%mtype, &
757  fstrsolid%materials(cid)%nlgeom_flag, &
758  fstrsolid%materials(cid)%variables_i, &
759  fstrsolid%materials(cid)%dict)/=0 ) then
760  write(*,*) '### Error: Fail in read in spring_d definition : ' , cid
761  write(ilog,*) '### Error: Fail in read in spring_d definition : ', cid
762  stop
763  endif
764  endif
765  else if( header_name == '!DASHPOT_A' ) then
766  if( c_material >0 ) then
767  if( fstr_ctrl_get_dashpot_a( ctrl, &
768  fstrsolid%materials(cid)%mtype, &
769  fstrsolid%materials(cid)%nlgeom_flag, &
770  fstrsolid%materials(cid)%variables_i, &
771  fstrsolid%materials(cid)%dict)/=0 ) then
772  write(*,*) '### Error: Fail in read in spring_a definition : ' , cid
773  write(ilog,*) '### Error: Fail in read in spring_a definition : ', cid
774  stop
775  endif
776  endif
777  else if( header_name == '!USER_MATERIAL' ) then
778  if( cid >0 ) then
779  if( fstr_ctrl_get_usermaterial( ctrl, fstrsolid%materials(cid)%mtype, &
780  fstrsolid%materials(cid)%nlgeom_flag, fstrsolid%materials(cid)%nfstatus, &
781  fstrsolid%materials(cid)%variables(101:) )/=0 ) then
782  write(*,*) '### Error: Fail in read in user defined material : ' , cid
783  write(ilog,*) '### Error: Fail in read in user defined material : ', cid
784  stop
785  endif
786  endif
787 
788 
789  ! == Following output control ==
790  else if( header_name == '!WRITE' ) then
791  call fstr_ctrl_get_output( ctrl, outctrl, islog, result, visual, femap )
792  if( islog == 1 ) then
793  c_output=1
794  outctrl%filename = trim(logfilename)
795  outctrl%filenum = ilog
796  call fstr_copy_outctrl(fstrsolid%output_ctrl(c_output), outctrl)
797  endif
798  if( femap == 1 ) then
799  c_output=2
800  write( outctrl%filename, *) 'utable.',myrank,".dat"
801  outctrl%filenum = iutb
802  call fstr_copy_outctrl(fstrsolid%output_ctrl(c_output), outctrl)
803  open( unit=outctrl%filenum, file=outctrl%filename, status='REPLACE' )
804  endif
805  if( result == 1 ) then
806  c_output=3
807  call fstr_copy_outctrl(fstrsolid%output_ctrl(c_output), outctrl)
808  endif
809  if( visual == 1 ) then
810  c_output=4
811  call fstr_copy_outctrl(fstrsolid%output_ctrl(c_output), outctrl)
812  endif
813 
814  else if( header_name == '!OUTPUT_RES' ) then
815  c_output=3
816  if( .not. fstr_ctrl_get_outitem( ctrl, hecmesh, fstrsolid%output_ctrl(c_output)%outinfo ) ) then
817  write(*,*) '### Error: Fail in read in node output definition : ' , c_output
818  write(ilog,*) '### Error: Fail in read in node output definition : ', c_output
819  stop
820  endif
821  if( fstrsolid%output_ctrl(c_output)%outinfo%grp_id_name /= 'ALL' ) then
822  c_output=2
823  do i=1,hecmesh%node_group%n_grp
824  if( fstrsolid%output_ctrl(c_output)%outinfo%grp_id_name == hecmesh%node_group%grp_name(i) ) then
825  fstrsolid%output_ctrl(c_output)%outinfo%grp_id = i; exit
826  endif
827  enddo
828  endif
829  else if( header_name == '!OUTPUT_VIS' ) then
830  c_output=4
831  if( .not. fstr_ctrl_get_outitem( ctrl, hecmesh, fstrsolid%output_ctrl(c_output)%outinfo ) ) then
832  write(*,*) '### Error: Fail in read in element output definition : ' , c_output
833  write(ilog,*) '### Error: Fail in read in element output definition : ', c_output
834  stop
835  endif
836  if( fstrsolid%output_ctrl(c_output)%outinfo%grp_id_name /= 'ALL' ) then
837  c_output=2
838  do i=1,hecmesh%node_group%n_grp
839  if( fstrsolid%output_ctrl(c_output)%outinfo%grp_id_name == hecmesh%node_group%grp_name(i) ) then
840  fstrsolid%output_ctrl(c_output)%outinfo%grp_id = i; exit
841  endif
842  enddo
843  endif
844  else if( header_name == '!AUTOINC_PARAM' ) then
845  c_aincparam = c_aincparam + 1
846  if( fstr_get_autoinc( ctrl, fstrparam%ainc(c_aincparam) ) /=0 ) then
847  write(*,*) '### Error: Fail in read in AUTOINC_PARAM definition : ' , c_aincparam
848  write(ilog,*) '### Error: Fail in read in AUTOINC_PARAM definition : ', c_aincparam
849  stop
850  endif
851  else if( header_name == '!TIME_POINTS' ) then
852  c_timepoints = c_timepoints + 1
853  if( fstr_ctrl_get_timepoints( ctrl, fstrparam%timepoints(c_timepoints) )/=0 ) then
854  write(*,*) '### Error: Fail in read in TIME_POINTS definition : ' , c_timepoints
855  write(ilog,*) '### Error: Fail in read in TIME_POINTS definition : ', c_timepoints
856  stop
857  endif
858  else if( header_name == '!CONTACT_PARAM' ) then
859  c_contactparam = c_contactparam + 1
860  if( fstr_ctrl_get_contactparam( ctrl, fstrparam%contactparam(c_contactparam) ) /=0 ) then
861  write(*,*) '### Error: Fail in read in CONTACT_PARAM definition : ' , c_contactparam
862  write(ilog,*) '### Error: Fail in read in CONTACT_PARAM definition : ', c_contactparam
863  stop
864  endif
865  else if( header_name == '!ULOAD' ) then
866  if( fstr_ctrl_get_userload( ctrl )/=0 ) then
867  write(*,*) '### Error: Fail in read in ULOAD definition : '
868  write(ilog,*) '### Error: Fail in read in ULOAD definition : '
869  stop
870  endif
871 
872  else if( header_name == '!INCLUDE' ) then
873  ctrl_list(ictrl) = ctrl
874  input_filename = ""
875  ierror = fstr_ctrl_get_param_ex( ctrl, 'INPUT ', '# ', 0, 'S', input_filename )
876  ctrl = fstr_ctrl_open( input_filename )
877  if( ctrl < 0 ) then
878  write(*,*) '### Error: Cannot open FSTR control file : ', input_filename
879  write(ilog,*) '### Error: Cannot open FSTR control file : ', input_filename
880  stop
881  end if
882  ictrl = ictrl + 1
883  cycle
884 
885  else if( header_name == '!END' ) then
886  exit
887  endif
888 
889  ! next
890  if( fstr_ctrl_seek_next_header(ctrl) == 0 )then
891  if( ictrl == 1 )then
892  exit
893  else
894  ierror= fstr_ctrl_close( ctrl )
895  ictrl = ictrl - 1
896  ctrl = ctrl_list(ictrl)
897  if( fstr_ctrl_seek_next_header(ctrl) == 0 ) exit
898  endif
899  endif
900 
901  end do
902 
903  ! ----- material type judgement. in case of infinitive analysis, nlgeom_flag=0
904  if( .not. p%PARAM%nlgeom ) then
905  do i=1, c_material
906  fstrsolid%materials(i)%nlgeom_flag = 0
907  enddo
908  endif
909 
910  if( fstrsolid%TEMP_ngrp_tot > 0 .or. fstrsolid%TEMP_irres > 0 ) then
911  allocate ( fstrsolid%temperature( hecmesh%n_node ) ,stat=ierror )
912  if( ierror /= 0 ) then
913  write(idbg,*) 'stop due to allocation error <FSTR_SOLID, TEMPERATURE>'
914  write(idbg,*) ' rank = ', myrank,' ierror = ',ierror
915  call flush(idbg)
916  call hecmw_abort( hecmw_comm_get_comm())
917  end if
918  fstrsolid%temperature = ref_temp
919  allocate ( fstrsolid%last_temp( hecmesh%n_node ) ,stat=ierror )
920  if( ierror /= 0 ) then
921  write(idbg,*) 'stop due to allocation error <FSTR_SOLID, LAST_TEMP>'
922  write(idbg,*) ' rank = ', myrank,' ierror = ',ierror
923  call flush(idbg)
924  call hecmw_abort( hecmw_comm_get_comm())
925  end if
926  fstrsolid%last_temp = 0.d0
927  allocate ( fstrsolid%temp_bak( hecmesh%n_node ) ,stat=ierror )
928  if( ierror /= 0 ) then
929  write(idbg,*) 'stop due to allocation error <FSTR_SOLID, TEMP_BAK>'
930  write(idbg,*) ' rank = ', myrank,' ierror = ',ierror
931  call flush(idbg)
932  call hecmw_abort( hecmw_comm_get_comm())
933  end if
934  fstrsolid%temp_bak = 0.d0
935  endif
936 
937  if( associated(fstrsolid%step_ctrl) ) then
938  fstrsolid%nstep_tot = size(fstrsolid%step_ctrl)
939  call setup_stepinfo_starttime( fstrsolid%step_ctrl )
940  !call fstr_print_steps( 6, fstrSOLID%step_ctrl )
941  else
942  if( p%PARAM%solution_type==kststatic .and. p%PARAM%nlgeom ) then
943  write( *,* ) " ERROR: STEP not defined!"
944  write( idbg,* ) "ERROR: STEP not defined!"
945  call flush(idbg)
946  call hecmw_abort( hecmw_comm_get_comm())
947  endif
948 
949  if( myrank==0 ) write(*,*)"Step control not defined! Using default step=1"
950  fstrsolid%nstep_tot = 1
951  allocate( fstrsolid%step_ctrl(1) )
952  call init_stepinfo( fstrsolid%step_ctrl(1) )
953  n = fstrsolid%BOUNDARY_ngrp_tot
954  if( n>0 ) allocate( fstrsolid%step_ctrl(1)%Boundary(n) )
955  do i = 1, n
956  fstrsolid%step_ctrl(1)%Boundary(i) = fstrsolid%BOUNDARY_ngrp_GRPID(i)
957  enddo
958  n = fstrsolid%CLOAD_ngrp_tot + fstrsolid%DLOAD_ngrp_tot + fstrsolid%TEMP_ngrp_tot + fstrsolid%SPRING_ngrp_tot
959  if( n>0 ) allocate( fstrsolid%step_ctrl(1)%Load(n) )
960  n = 0
961  do i = 1, fstrsolid%CLOAD_ngrp_tot
962  n = n + 1
963  fstrsolid%step_ctrl(1)%Load(n) = fstrsolid%CLOAD_ngrp_GRPID(i)
964  enddo
965  do i = 1, fstrsolid%DLOAD_ngrp_tot
966  n = n + 1
967  fstrsolid%step_ctrl(1)%Load(n) = fstrsolid%DLOAD_ngrp_GRPID(i)
968  enddo
969  do i = 1, fstrsolid%TEMP_ngrp_tot
970  n = n + 1
971  fstrsolid%step_ctrl(1)%Load(n) = fstrsolid%TEMP_ngrp_GRPID(i)
972  enddo
973  do i = 1, fstrsolid%SPRING_ngrp_tot
974  n = n + 1
975  fstrsolid%step_ctrl(1)%Load(n) = fstrsolid%SPRING_ngrp_GRPID(i)
976  enddo
977  endif
978 
979  if( p%PARAM%solution_type /= kstheat) call fstr_element_init( hecmesh, fstrsolid )
980  if( p%PARAM%solution_type==kststatic .or. p%PARAM%solution_type==kstdynamic .or. &
981  p%PARAM%solution_type==ksteigen .or. p%PARAM%solution_type==kststaticeigen ) &
982  call fstr_solid_alloc( hecmesh, fstrsolid )
983 
984  if( p%PARAM%solution_type == kstheat) then
985  p%PARAM%fg_irres = fstrsolid%output_ctrl(3)%frequency
986  p%PARAM%fg_iwres = fstrsolid%output_ctrl(4)%frequency
987  endif
988 
989  n_totlyr = 1
990  do i=1,hecmesh%section%n_sect
991  cid = hecmesh%section%sect_mat_ID_item(i)
992  n = fstrsolid%materials(cid)%totallyr
993  if (n > n_totlyr)then
994  n_totlyr = n
995  endif
996  enddo
997  p%SOLID%max_lyr = n_totlyr
998 
999  call fstr_setup_post( ctrl, p )
1000  rcode = fstr_ctrl_close( ctrl )
1001 
1002  end subroutine fstr_setup
1003 
1004 
1006  subroutine fstr_solid_init( hecMESH, fstrSOLID )
1008  type(hecmwst_local_mesh),target :: hecMESH
1009  type(fstr_solid) :: fstrSOLID
1010 
1011  integer :: ndof, ntotal, ierror, ic_type
1012 
1013  fstrsolid%file_type = kbcffstr
1014 
1015  fstrsolid%BOUNDARY_ngrp_tot = 0
1016  fstrsolid%BOUNDARY_ngrp_rot = 0
1017  fstrsolid%CLOAD_ngrp_tot = 0
1018  fstrsolid%CLOAD_ngrp_rot = 0
1019  fstrsolid%DLOAD_ngrp_tot = 0
1020  fstrsolid%DLOAD_follow = 1
1021  fstrsolid%TEMP_ngrp_tot = 0
1022  fstrsolid%SPRING_ngrp_tot = 0
1023  fstrsolid%TEMP_irres = 0
1024  fstrsolid%TEMP_tstep = 1
1025  fstrsolid%TEMP_interval = 1
1026  fstrsolid%TEMP_rtype = 1
1027  fstrsolid%TEMP_factor = 1.d0
1028  fstrsolid%VELOCITY_ngrp_tot = 0
1029  fstrsolid%ACCELERATION_ngrp_tot = 0
1030  fstrsolid%COUPLE_ngrp_tot = 0
1031 
1032  fstrsolid%restart_nout= 0
1033  fstrsolid%is_smoothing_active = .false.
1034 
1035  end subroutine fstr_solid_init
1036 
1038  subroutine fstr_solid_alloc( hecMESH, fstrSOLID )
1040  type(hecmwst_local_mesh),target :: hecMESH
1041  type(fstr_solid) :: fstrSOLID
1042 
1043  integer :: ndof, ntotal, ierror, ic_type
1044 
1045  ndof=hecmesh%n_dof
1046  ntotal=ndof*hecmesh%n_node
1047 
1048  allocate ( fstrsolid%GL( ntotal ) ,stat=ierror )
1049  if( ierror /= 0 ) then
1050  write(idbg,*) 'stop due to allocation error <FSTR_SOLID, GL>'
1051  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1052  call flush(idbg)
1053  call hecmw_abort( hecmw_comm_get_comm())
1054  end if
1055  allocate ( fstrsolid%GL0( ntotal ) ,stat=ierror )
1056  if( ierror /= 0 ) then
1057  write(idbg,*) 'stop due to allocation error <FSTR_SOLID, GL0>'
1058  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1059  call flush(idbg)
1060  call hecmw_abort( hecmw_comm_get_comm())
1061  end if
1062  allocate ( fstrsolid%EFORCE( ntotal ) ,stat=ierror )
1063  if( ierror /= 0 ) then
1064  write(idbg,*) 'stop due to allocation error <FSTR_SOLID, EFORCE>'
1065  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1066  call flush(idbg)
1067  call hecmw_abort( hecmw_comm_get_comm())
1068  end if
1069  ! allocate ( fstrSOLID%TOTAL_DISP( ntotal ) ,STAT=ierror )
1070  ! if( ierror /= 0 ) then
1071  ! write(idbg,*) 'stop due to allocation error <FSTR_SOLID, TOTAL_DISP>'
1072  ! write(idbg,*) ' rank = ', hecMESH%my_rank,' ierror = ',ierror
1073  ! call flush(idbg)
1074  ! call hecmw_abort( hecmw_comm_get_comm())
1075  ! end if
1076  allocate ( fstrsolid%unode( ntotal ) ,stat=ierror )
1077  if( ierror /= 0 ) then
1078  write(idbg,*) 'stop due to allocation error <FSTR_SOLID, unode>'
1079  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1080  call flush(idbg)
1081  call hecmw_abort( hecmw_comm_get_comm())
1082  end if
1083  allocate ( fstrsolid%unode_bak( ntotal ) ,stat=ierror )
1084  if( ierror /= 0 ) then
1085  write(idbg,*) 'stop due to allocation error <FSTR_SOLID, unode>'
1086  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1087  call flush(idbg)
1088  call hecmw_abort( hecmw_comm_get_comm())
1089  end if
1090  allocate ( fstrsolid%dunode( ntotal ) ,stat=ierror )
1091  if( ierror /= 0 ) then
1092  write(idbg,*) 'stop due to allocation error <FSTR_SOLID, dunode>'
1093  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1094  call flush(idbg)
1095  call hecmw_abort( hecmw_comm_get_comm())
1096  end if
1097  allocate ( fstrsolid%ddunode( ntotal ) ,stat=ierror )
1098  if( ierror /= 0 ) then
1099  write(idbg,*) 'stop due to allocation error <FSTR_SOLID, ddunode>'
1100  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1101  call flush(idbg)
1102  call hecmw_abort( hecmw_comm_get_comm())
1103  end if
1104  allocate ( fstrsolid%QFORCE( ntotal ) ,stat=ierror )
1105  if( ierror /= 0 ) then
1106  write(idbg,*) 'stop due to allocation error <FSTR_SOLID, QFORCE>'
1107  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1108  call flush(idbg)
1109  call hecmw_abort( hecmw_comm_get_comm())
1110  end if
1111  allocate ( fstrsolid%QFORCE_bak( ntotal ) ,stat=ierror )
1112  if( ierror /= 0 ) then
1113  write(idbg,*) 'stop due to allocation error <FSTR_SOLID, QFORCE_bak>'
1114  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1115  call flush(idbg)
1116  call hecmw_abort( hecmw_comm_get_comm())
1117  end if
1118 
1119  fstrsolid%GL(:)=0.d0
1120  fstrsolid%GL0(:)=0.d0
1121  ! fstrSOLID%TOTAL_DISP(:)=0.d0
1122  fstrsolid%unode(:) = 0.d0
1123  fstrsolid%unode_bak(:) = 0.d0
1124  fstrsolid%dunode(:) = 0.d0
1125  fstrsolid%ddunode(:) = 0.d0
1126  fstrsolid%QFORCE(:) = 0.d0
1127  fstrsolid%QFORCE_bak(:) = 0.d0
1128  fstrsolid%FACTOR( 1:2 ) = 0.d0
1129 
1130  ! for MPC
1131  fstrsolid%n_fix_mpc = hecmesh%mpc%n_mpc
1132  if( fstrsolid%n_fix_mpc>0 ) then
1133  allocate( fstrsolid%mpc_const( fstrsolid%n_fix_mpc ) )
1134  fstrsolid%mpc_const(:) = hecmesh%mpc%mpc_const(:)
1135  endif
1136 
1137  ! initialize for linear static problems
1138  fstrsolid%FACTOR(2)=1.d0
1139  fstrsolid%FACTOR(1)=0.d0
1140  end subroutine fstr_solid_alloc
1141 
1142  subroutine fstr_smoothed_element_init( hecMESH, fstrSOLID )
1143  type(hecmwst_local_mesh),target :: hecMESH
1144  type(fstr_solid) :: fstrSOLID
1145 
1146  logical, allocatable :: is_selem_list(:)
1147  integer :: i, isect
1148 
1149  do isect=1,hecmesh%section%n_sect
1150  if( fstrsolid%sections(isect)%elemopt341 == kel341sesns ) fstrsolid%is_smoothing_active = .true.
1151  end do
1152  if( .not. fstrsolid%is_smoothing_active ) return
1153 
1154  allocate(is_selem_list(hecmesh%n_elem))
1155  is_selem_list(:) = .false.
1156 
1157  do i=1,hecmesh%n_elem
1158  isect= hecmesh%section_ID(i)
1159  if( hecmesh%elem_type(i) /= fe_tet4n ) cycle
1160  if( fstrsolid%sections(isect)%elemopt341 == kel341sesns ) is_selem_list(i) = .true.
1161  enddo
1162 
1163  call hecmw_create_smoothing_element_connectivity(hecmesh,is_selem_list)
1164 
1165  deallocate(is_selem_list)
1166 
1167  end subroutine
1168 
1169  subroutine fstr_smoothed_element_calcmaxcon( hecMESH, fstrSOLID )
1171  type(hecmwst_local_mesh),target :: hecMESH
1172  type(fstr_solid) :: fstrSOLID
1173 
1174  integer :: i, isect, nodlocal(fstrSOLID%max_ncon), iiS, nn, con_stf
1175 
1176  if( fstrsolid%max_ncon_stf > 20 ) fstrsolid%max_ncon_stf = 20
1177 
1178  do i=1,hecmesh%n_elem
1179  isect= hecmesh%section_ID(i)
1180  if( hecmesh%elem_type(i) /= fe_tet4n ) cycle
1181  if( fstrsolid%sections(isect)%elemopt341 /= kel341sesns ) cycle
1182  iis = hecmesh%elem_node_index(i-1)
1183  nn = hecmesh%elem_node_index(i-1) - iis
1184  nodlocal(1:nn) = hecmesh%elem_node_item(iis+1:iis+nn)
1185  con_stf = return_nn_comp_c3d4_sesns(nn, nodlocal)
1186  if( con_stf > fstrsolid%max_ncon_stf ) fstrsolid%max_ncon_stf = con_stf
1187  enddo
1188  end subroutine
1189 
1191  subroutine fstr_element_init( hecMESH, fstrSOLID )
1193  use mmechgauss
1194  use m_fstr
1195  type(hecmwst_local_mesh),target :: hecMESH
1196  type(fstr_solid) :: fstrSOLID
1197 
1198  integer :: i, j, ng, isect, ndof, id, nn, n_elem
1199  integer :: ncon_stf
1200 
1201  if( hecmesh%n_elem <=0 ) then
1202  stop "no element defined!"
1203  endif
1204 
1205  fstrsolid%maxn_gauss = 0
1206  fstrsolid%max_ncon = 0
1207 
1208  ! elemopt341 = kel341ES
1209  call fstr_smoothed_element_init( hecmesh, fstrsolid )
1210 
1211  ! number of elements
1212  n_elem = hecmesh%elem_type_index(hecmesh%n_elem_type)
1213  allocate( fstrsolid%elements(n_elem) )
1214 
1215  do i= 1, n_elem
1216  fstrsolid%elements(i)%etype = hecmesh%elem_type(i)
1217  if( hecmesh%elem_type(i)==301 ) fstrsolid%elements(i)%etype=111
1218  if (hecmw_is_etype_link(fstrsolid%elements(i)%etype)) cycle
1219  if (hecmw_is_etype_patch(fstrsolid%elements(i)%etype)) cycle
1220  ng = numofquadpoints( fstrsolid%elements(i)%etype )
1221  if( ng > fstrsolid%maxn_gauss ) fstrsolid%maxn_gauss = ng
1222  if( ng > 0 ) allocate( fstrsolid%elements(i)%gausses( ng ) )
1223 
1224  isect= hecmesh%section_ID(i)
1225  ndof = getspacedimension( fstrsolid%elements(i)%etype )
1226  if (ndof == 2) then ! why do this???
1227  id=hecmesh%section%sect_opt(isect)
1228  if( id==0 ) then
1229  fstrsolid%elements(i)%iset=1
1230  else if( id==1) then
1231  fstrsolid%elements(i)%iset=0
1232  else if( id==2) then
1233  fstrsolid%elements(i)%iset=2
1234  endif
1235  endif
1236 
1237  if( isect<0 .or. isect>hecmesh%section%n_sect ) &
1238  stop "Error in element's section definition"
1239  id = hecmesh%section%sect_mat_ID_item(isect)
1240  fstrsolid%materials(id)%cdsys_ID = hecmesh%section%sect_orien_ID(isect)
1241  do j=1,ng
1242  fstrsolid%elements(i)%gausses(j)%pMaterial => fstrsolid%materials(id)
1243  call fstr_init_gauss( fstrsolid%elements(i)%gausses( j ) )
1244  enddo
1245 
1246  nn = hecmesh%elem_node_index(i)-hecmesh%elem_node_index(i-1)
1247  allocate(fstrsolid%elements(i)%equiForces(nn*ndof))
1248  fstrsolid%elements(i)%equiForces = 0.0d0
1249  if( nn > fstrsolid%max_ncon ) fstrsolid%max_ncon = nn
1250 
1251  if( hecmesh%elem_type(i)==361 ) then
1252  if( fstrsolid%sections(isect)%elemopt361==kel361ic ) then
1253  allocate( fstrsolid%elements(i)%aux(3,3) )
1254  fstrsolid%elements(i)%aux = 0.0d0
1255  endif
1256  endif
1257 
1258  enddo
1259 
1260  fstrsolid%max_ncon_stf = fstrsolid%max_ncon
1261  if( fstrsolid%is_smoothing_active ) call fstr_smoothed_element_calcmaxcon( hecmesh, fstrsolid )
1262 
1263  call hecmw_allreduce_i1(hecmesh,fstrsolid%maxn_gauss,hecmw_max)
1264  end subroutine
1265 
1267  subroutine fstr_solid_finalize( fstrSOLID )
1268  type(fstr_solid) :: fstrSOLID
1269  integer :: i, j, ierror
1270  if( associated(fstrsolid%materials) ) then
1271  do j=1,size(fstrsolid%materials)
1272  call finalizematerial(fstrsolid%materials(j))
1273  enddo
1274  deallocate( fstrsolid%materials )
1275  endif
1276  if( .not. associated(fstrsolid%elements ) ) return
1277  do i=1,size(fstrsolid%elements)
1278  if( associated(fstrsolid%elements(i)%gausses) ) then
1279  do j=1,size(fstrsolid%elements(i)%gausses)
1280  call fstr_finalize_gauss(fstrsolid%elements(i)%gausses(j))
1281  enddo
1282  deallocate( fstrsolid%elements(i)%gausses )
1283  endif
1284  if(associated(fstrsolid%elements(i)%equiForces) ) then
1285  deallocate(fstrsolid%elements(i)%equiForces)
1286  endif
1287  if( associated(fstrsolid%elements(i)%aux) ) then
1288  deallocate(fstrsolid%elements(i)%aux)
1289  endif
1290  enddo
1291 
1292  deallocate( fstrsolid%elements )
1293  if( associated( fstrsolid%mpc_const ) ) then
1294  deallocate( fstrsolid%mpc_const )
1295  endif
1296  call free_stepinfo( fstrsolid%step_ctrl_restart )
1297  if( associated(fstrsolid%step_ctrl) ) then
1298  do i=1,size(fstrsolid%step_ctrl)
1299  call free_stepinfo( fstrsolid%step_ctrl(i) )
1300  enddo
1301  deallocate( fstrsolid%step_ctrl )
1302  endif
1303  if(associated(fstrsolid%output_ctrl) ) then
1304  do i=1,size(fstrsolid%output_ctrl)
1305  if( fstrsolid%output_ctrl(i)%filenum==iutb ) &
1306  close(fstrsolid%output_ctrl(i)%filenum)
1307  enddo
1308  deallocate(fstrsolid%output_ctrl)
1309  endif
1310  if( associated( fstrsolid%sections ) ) then
1311  deallocate( fstrsolid%sections )
1312  endif
1313 
1314  if( associated(fstrsolid%GL) ) then
1315  deallocate(fstrsolid%GL ,stat=ierror)
1316  if( ierror /= 0 ) then
1317  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, GL>'
1318  call flush(idbg)
1319  call hecmw_abort( hecmw_comm_get_comm())
1320  end if
1321  endif
1322  if( associated(fstrsolid%EFORCE) ) then
1323  deallocate(fstrsolid%EFORCE ,stat=ierror)
1324  if( ierror /= 0 ) then
1325  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, EFORCE>'
1326  call flush(idbg)
1327  call hecmw_abort( hecmw_comm_get_comm())
1328  end if
1329  endif
1330  if( associated(fstrsolid%unode) ) then
1331  deallocate(fstrsolid%unode ,stat=ierror)
1332  if( ierror /= 0 ) then
1333  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, unode>'
1334  call flush(idbg)
1335  call hecmw_abort( hecmw_comm_get_comm())
1336  end if
1337  endif
1338  if( associated(fstrsolid%unode_bak) ) then
1339  deallocate(fstrsolid%unode_bak ,stat=ierror)
1340  if( ierror /= 0 ) then
1341  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, unode_bak>'
1342  call flush(idbg)
1343  call hecmw_abort( hecmw_comm_get_comm())
1344  end if
1345  endif
1346  if( associated(fstrsolid%dunode) ) then
1347  deallocate(fstrsolid%dunode ,stat=ierror)
1348  if( ierror /= 0 ) then
1349  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, dunode>'
1350  call flush(idbg)
1351  call hecmw_abort( hecmw_comm_get_comm())
1352  end if
1353  endif
1354  if( associated(fstrsolid%ddunode) ) then
1355  deallocate(fstrsolid%ddunode ,stat=ierror)
1356  if( ierror /= 0 ) then
1357  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, ddunode>'
1358  call flush(idbg)
1359  call hecmw_abort( hecmw_comm_get_comm())
1360  end if
1361  endif
1362  if( associated(fstrsolid%QFORCE) ) then
1363  deallocate(fstrsolid%QFORCE ,stat=ierror)
1364  if( ierror /= 0 ) then
1365  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, QFORCE>'
1366  call flush(idbg)
1367  call hecmw_abort( hecmw_comm_get_comm())
1368  end if
1369  endif
1370  if( associated(fstrsolid%temperature) ) then
1371  deallocate(fstrsolid%temperature ,stat=ierror)
1372  if( ierror /= 0 ) then
1373  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, temperature>'
1374  call flush(idbg)
1375  call hecmw_abort( hecmw_comm_get_comm())
1376  end if
1377  endif
1378  if( associated(fstrsolid%last_temp) ) then
1379  deallocate(fstrsolid%last_temp ,stat=ierror)
1380  if( ierror /= 0 ) then
1381  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, reftemp>'
1382  call flush(idbg)
1383  call hecmw_abort( hecmw_comm_get_comm())
1384  end if
1385  endif
1386  if( associated(fstrsolid%temp_bak) ) then
1387  deallocate(fstrsolid%temp_bak ,stat=ierror)
1388  if( ierror /= 0 ) then
1389  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, reftemp>'
1390  call flush(idbg)
1391  call hecmw_abort( hecmw_comm_get_comm())
1392  end if
1393  endif
1394 
1395  ! Allocated in in f str_setup_BOUNDARY */
1396  if( associated(fstrsolid%BOUNDARY_ngrp_GRPID) ) then
1397  deallocate(fstrsolid%BOUNDARY_ngrp_GRPID, stat=ierror)
1398  if( ierror /= 0 ) then
1399  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, BOUNDARY_ngrp_GRPID>'
1400  call flush(idbg)
1401  call hecmw_abort( hecmw_comm_get_comm())
1402  end if
1403  endif
1404  if( associated(fstrsolid%BOUNDARY_ngrp_ID) ) then
1405  deallocate(fstrsolid%BOUNDARY_ngrp_ID, stat=ierror)
1406  if( ierror /= 0 ) then
1407  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, BOUNDARY_ngrp_ID>'
1408  call flush(idbg)
1409  call hecmw_abort( hecmw_comm_get_comm())
1410  end if
1411  endif
1412  if( associated(fstrsolid%BOUNDARY_ngrp_type) ) then
1413  deallocate(fstrsolid%BOUNDARY_ngrp_type, stat=ierror)
1414  if( ierror /= 0 ) then
1415  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, BOUNDARY_ngrp_type>'
1416  call flush(idbg)
1417  call hecmw_abort( hecmw_comm_get_comm())
1418  end if
1419  endif
1420  if( associated(fstrsolid%BOUNDARY_ngrp_val) ) then
1421  deallocate(fstrsolid%BOUNDARY_ngrp_val, stat=ierror)
1422  if( ierror /= 0 ) then
1423  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, BOUNDARY_ngrp_val>'
1424  call flush(idbg)
1425  call hecmw_abort( hecmw_comm_get_comm())
1426  end if
1427  endif
1428  if( associated(fstrsolid%BOUNDARY_ngrp_amp) ) then
1429  deallocate(fstrsolid%BOUNDARY_ngrp_amp, stat=ierror)
1430  if( ierror /= 0 ) then
1431  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, BOUNDARY_ngrp_amp>'
1432  call flush(idbg)
1433  call hecmw_abort( hecmw_comm_get_comm())
1434  end if
1435  endif
1436  if( associated(fstrsolid%BOUNDARY_ngrp_istot) ) then
1437  deallocate(fstrsolid%BOUNDARY_ngrp_istot, stat=ierror)
1438  if( ierror /= 0 ) then
1439  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, BOUNDARY_ngrp_istot>'
1440  call flush(idbg)
1441  call hecmw_abort( hecmw_comm_get_comm())
1442  end if
1443  endif
1444  if( associated(fstrsolid%BOUNDARY_ngrp_rotID) ) then
1445  deallocate(fstrsolid%BOUNDARY_ngrp_rotID, stat=ierror)
1446  if( ierror /= 0 ) then
1447  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, BOUNDARY_ngrp_rotID>'
1448  call flush(idbg)
1449  call hecmw_abort( hecmw_comm_get_comm())
1450  end if
1451  endif
1452  if( associated(fstrsolid%BOUNDARY_ngrp_centerID) ) then
1453  deallocate(fstrsolid%BOUNDARY_ngrp_centerID, stat=ierror)
1454  if( ierror /= 0 ) then
1455  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, BOUNDARY_ngrp_centerID>'
1456  call flush(idbg)
1457  call hecmw_abort( hecmw_comm_get_comm())
1458  end if
1459  endif
1460 
1461  ! Allocated in in fstr_setup_CLOAD
1462  if( associated(fstrsolid%CLOAD_ngrp_GRPID) ) then
1463  deallocate(fstrsolid%CLOAD_ngrp_GRPID, stat=ierror)
1464  if( ierror /= 0 ) then
1465  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, CLOAD_ngrp_GRPID>'
1466  call flush(idbg)
1467  call hecmw_abort( hecmw_comm_get_comm())
1468  end if
1469  endif
1470  if( associated(fstrsolid%CLOAD_ngrp_ID) ) then
1471  deallocate(fstrsolid%CLOAD_ngrp_ID, stat=ierror)
1472  if( ierror /= 0 ) then
1473  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, CLOAD_ngrp_ID>'
1474  call flush(idbg)
1475  call hecmw_abort( hecmw_comm_get_comm())
1476  end if
1477  endif
1478  if( associated(fstrsolid%CLOAD_ngrp_DOF) ) then
1479  deallocate(fstrsolid%CLOAD_ngrp_DOF, stat=ierror)
1480  if( ierror /= 0 ) then
1481  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, CLOAD_ngrp_DOF>'
1482  call flush(idbg)
1483  call hecmw_abort( hecmw_comm_get_comm())
1484  end if
1485  endif
1486  if( associated(fstrsolid%CLOAD_ngrp_val) ) then
1487  deallocate(fstrsolid%CLOAD_ngrp_val, stat=ierror)
1488  if( ierror /= 0 ) then
1489  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, CLOAD_ngrp_val>'
1490  call flush(idbg)
1491  call hecmw_abort( hecmw_comm_get_comm())
1492  end if
1493  endif
1494  if( associated(fstrsolid%CLOAD_ngrp_amp) ) then
1495  deallocate(fstrsolid%CLOAD_ngrp_amp, stat=ierror)
1496  if( ierror /= 0 ) then
1497  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, CLOAD_ngrp_amp>'
1498  call flush(idbg)
1499  call hecmw_abort( hecmw_comm_get_comm())
1500  end if
1501  endif
1502  if( associated(fstrsolid%CLOAD_ngrp_rotID) ) then
1503  deallocate(fstrsolid%CLOAD_ngrp_rotID, stat=ierror)
1504  if( ierror /= 0 ) then
1505  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, CLOAD_ngrp_rotID>'
1506  call flush(idbg)
1507  call hecmw_abort( hecmw_comm_get_comm())
1508  end if
1509  endif
1510  if( associated(fstrsolid%CLOAD_ngrp_centerID) ) then
1511  deallocate(fstrsolid%CLOAD_ngrp_centerID, stat=ierror)
1512  if( ierror /= 0 ) then
1513  write(idbg,*) 'stop due to deallocation error <FSTR_SOLID, CLOAD_ngrp_centerID>'
1514  call flush(idbg)
1515  call hecmw_abort( hecmw_comm_get_comm())
1516  end if
1517  endif
1518 
1519  end subroutine
1520 
1522  subroutine fstr_heat_init( fstrHEAT )
1523  implicit none
1524  type(fstr_heat) :: fstrHEAT
1525 
1526  fstrheat%STEPtot = 0
1527  fstrheat%MATERIALtot = 0
1528  fstrheat%AMPLITUDEtot= 0
1529  fstrheat%T_FIX_tot = 0
1530  fstrheat%Q_NOD_tot = 0
1531  fstrheat%Q_VOL_tot = 0
1532  fstrheat%Q_SUF_tot = 0
1533  fstrheat%R_SUF_tot = 0
1534  fstrheat%H_SUF_tot = 0
1535  fstrheat%WL_tot = 0
1536  fstrheat%beta = -1.0d0
1537  end subroutine fstr_heat_init
1538 
1540  subroutine fstr_eigen_init( fstrEIG )
1541  implicit none
1542  type(fstr_eigen) :: fstrEIG
1543 
1544  fstreig%nget = 5
1545  fstreig%maxiter = 60
1546  fstreig%iter = 0
1547  fstreig%sigma = 0.0d0
1548  fstreig%tolerance = 1.0d-6
1549  fstreig%totalmass = 0.0d0
1550  end subroutine fstr_eigen_init
1551 
1553  subroutine fstr_dynamic_init( fstrDYNAMIC )
1555  type(fstr_dynamic) :: fstrDYNAMIC
1556  fstrdynamic%idx_eqa = 1
1557  fstrdynamic%idx_resp = 1
1558  fstrdynamic%n_step = 1
1559  fstrdynamic%t_start = 0.0
1560  fstrdynamic%t_curr = 0.0d0
1561  fstrdynamic%t_end = 1.0
1562  fstrdynamic%t_delta = 1.0
1563  fstrdynamic%ganma = 0.5
1564  fstrdynamic%beta = 0.25
1565  fstrdynamic%idx_mas = 1
1566  fstrdynamic%idx_dmp = 1
1567  fstrdynamic%ray_m = 0.0
1568  fstrdynamic%ray_k = 0.0
1569  fstrdynamic%restart_nout = 0
1570  fstrdynamic%nout = 100
1571  fstrdynamic%ngrp_monit = 0
1572  fstrdynamic%nout_monit = 1
1573  fstrdynamic%iout_list(1) = 0
1574  fstrdynamic%iout_list(2) = 0
1575  fstrdynamic%iout_list(3) = 0
1576  fstrdynamic%iout_list(4) = 0
1577  fstrdynamic%iout_list(5) = 0
1578  fstrdynamic%iout_list(6) = 0
1579 
1580  end subroutine fstr_dynamic_init
1581 
1582 
1584  subroutine fstr_dynamic_alloc( hecMESH, fstrDYNAMIC )
1586  type(hecmwst_local_mesh),target :: hecMESH
1587  type(fstr_dynamic) :: fstrDYNAMIC
1588 
1589  integer :: ierror, ndof,nnod
1590 
1591  ndof=hecmesh%n_dof
1592  nnod=hecmesh%n_node
1593  if(fstrdynamic%idx_eqa == 11) then
1594  allocate( fstrdynamic%DISP(ndof*nnod,3) ,stat=ierror )
1595  if( ierror /= 0 ) then
1596  write(idbg,*) 'stop due to allocation error <fstr_solve_LINEAR_DYNAMIC, DISP>'
1597  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1598  call flush(idbg)
1599  call hecmw_abort( hecmw_comm_get_comm())
1600  end if
1601  allocate( fstrdynamic%VEL (ndof*nnod,1) ,stat=ierror )
1602  if( ierror /= 0 ) then
1603  write(idbg,*) 'stop due to allocation error <fstr_solve_LINEAR_DYNAMIC, VEL>'
1604  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1605  call flush(idbg)
1606  call hecmw_abort( hecmw_comm_get_comm())
1607  end if
1608  allocate( fstrdynamic%ACC (ndof*nnod,1) ,stat=ierror )
1609  if( ierror /= 0 ) then
1610  write(idbg,*) 'stop due to allocation error <fstr_solve_LINEAR_DYNAMIC, ACC>'
1611  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1612  call flush(idbg)
1613  call hecmw_abort( hecmw_comm_get_comm())
1614  end if
1615  else
1616  allocate( fstrdynamic%DISP(ndof*nnod,2) ,stat=ierror )
1617  if( ierror /= 0 ) then
1618  write(idbg,*) 'stop due to allocation error <fstr_solve_LINEAR_DYNAMIC, DISP>'
1619  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1620  call flush(idbg)
1621  call hecmw_abort( hecmw_comm_get_comm())
1622  end if
1623  allocate( fstrdynamic%VEL (ndof*nnod,2) ,stat=ierror )
1624  if( ierror /= 0 ) then
1625  write(idbg,*) 'stop due to allocation error <fstr_solve_LINEAR_DYNAMIC, VEL>'
1626  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1627  call flush(idbg)
1628  call hecmw_abort( hecmw_comm_get_comm())
1629  end if
1630  allocate( fstrdynamic%ACC (ndof*nnod,2) ,stat=ierror )
1631  if( ierror /= 0 ) then
1632  write(idbg,*) 'stop due to allocation error <fstr_solve_LINEAR_DYNAMIC, ACC>'
1633  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1634  call flush(idbg)
1635  call hecmw_abort( hecmw_comm_get_comm())
1636  end if
1637  endif
1638 
1639 
1640  allocate( fstrdynamic%VEC1(ndof*nnod) ,stat=ierror )
1641  if( ierror /= 0 ) then
1642  write(idbg,*) 'stop due to allocation error <fstr_solve_LINEAR_DYNAMIC, VEC1>'
1643  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1644  call flush(idbg)
1645  call hecmw_abort( hecmw_comm_get_comm())
1646  end if
1647  allocate( fstrdynamic%VEC2(ndof*nnod) ,stat=ierror )
1648  if( ierror /= 0 ) then
1649  write(idbg,*) 'stop due to allocation error <fstr_solve_LINEAR_DYNAMIC, VEC2>'
1650  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1651  call flush(idbg)
1652  call hecmw_abort( hecmw_comm_get_comm())
1653  end if
1654  allocate( fstrdynamic%VEC3(ndof*nnod) ,stat=ierror )
1655  if( ierror /= 0 ) then
1656  write(idbg,*) 'stop due to allocation error <fstr_solve_LINEAR_DYNAMIC, VEC3>'
1657  write(idbg,*) ' rank = ', hecmesh%my_rank,' ierror = ',ierror
1658  call flush(idbg)
1659  call hecmw_abort( hecmw_comm_get_comm())
1660  end if
1661 
1662  end subroutine fstr_dynamic_alloc
1663 
1665  subroutine fstr_dynamic_finalize( fstrDYNAMIC )
1666  type(fstr_dynamic) :: fstrDYNAMIC
1667 
1668  integer :: ierror
1669  if( associated(fstrdynamic%DISP) ) &
1670  deallocate( fstrdynamic%DISP ,stat=ierror )
1671  if( ierror /= 0 ) then
1672  write(idbg,*) 'stop due to deallocation error <fstr_solve_LINEAR_DYNAMIC, DISP>'
1673  call flush(idbg)
1674  call hecmw_abort( hecmw_comm_get_comm())
1675  end if
1676  if( associated(fstrdynamic%VEL) ) &
1677  deallocate( fstrdynamic%VEL ,stat=ierror )
1678  if( ierror /= 0 ) then
1679  write(idbg,*) 'stop due to deallocation error <fstr_solve_LINEAR_DYNAMIC, VEL>'
1680  call flush(idbg)
1681  call hecmw_abort( hecmw_comm_get_comm())
1682  end if
1683  if( associated(fstrdynamic%ACC) ) &
1684  deallocate( fstrdynamic%ACC ,stat=ierror )
1685  if( ierror /= 0 ) then
1686  write(idbg,*) 'stop due to deallocation error <fstr_solve_LINEAR_DYNAMIC, ACC>'
1687  call flush(idbg)
1688  call hecmw_abort( hecmw_comm_get_comm())
1689  end if
1690  if( associated(fstrdynamic%VEC1) ) &
1691  deallocate( fstrdynamic%VEC1 ,stat=ierror )
1692  if( ierror /= 0 ) then
1693  write(idbg,*) 'stop due to deallocation error <fstr_solve_LINEAR_DYNAMIC, VEC1>'
1694  call flush(idbg)
1695  call hecmw_abort( hecmw_comm_get_comm())
1696  end if
1697  if( associated(fstrdynamic%VEC2) ) &
1698  deallocate( fstrdynamic%VEC2 ,stat=ierror )
1699  if( ierror /= 0 ) then
1700  write(idbg,*) 'stop due to deallocation error <fstr_solve_LINEAR_DYNAMIC, VEC2>'
1701  call flush(idbg)
1702  call hecmw_abort( hecmw_comm_get_comm())
1703  end if
1704  if( associated(fstrdynamic%VEC3) ) &
1705  deallocate( fstrdynamic%VEC3 ,stat=ierror )
1706  if( ierror /= 0 ) then
1707  write(idbg,*) 'stop due to deallocation error <fstr_solve_LINEAR_DYNAMIC, VEC3>'
1708  call flush(idbg)
1709  call hecmw_abort( hecmw_comm_get_comm())
1710  end if
1711 
1712  end subroutine
1713 
1714 
1715  !-----------------------------------------------------------------------------!
1717 
1718  subroutine fstr_setup_post_phys_alloc(phys, NDOF, n_node, n_elem)
1719  implicit none
1720  type(fstr_solid_physic_val), pointer :: phys
1721  integer(kind=kint) :: NDOF, n_node, n_elem, mdof
1722  mdof = (ndof*ndof+ndof)/2;
1723  allocate ( phys%STRAIN (mdof*n_node))
1724  allocate ( phys%STRESS (mdof*n_node))
1725  allocate ( phys%MISES ( n_node))
1726  allocate ( phys%ESTRAIN (mdof*n_elem))
1727  allocate ( phys%ESTRESS (mdof*n_elem))
1728  allocate ( phys%EMISES ( n_elem))
1729  allocate ( phys%EPLSTRAIN ( n_elem))
1730  allocate ( phys%ENQM (12*n_elem))
1731  end subroutine fstr_setup_post_phys_alloc
1732 
1733  subroutine fstr_setup_post( ctrl, P )
1734  implicit none
1735  integer(kind=kint) :: ctrl, i
1736  type(fstr_param_pack) :: P
1737  type(fstr_solid_physic_val), pointer :: phys => null()
1738 
1739  if( p%PARAM%solution_type == kststatic &
1740  .or. p%PARAM%solution_type == ksteigen &
1741  .or. p%PARAM%solution_type == kstdynamic &
1742  .or. p%PARAM%solution_type == kststaticeigen ) then
1743  ! Memory Allocation for Result Vectors ------------
1744  if( p%MESH%n_dof == 6 .or. p%SOLID%is_33shell == 1 ) then
1745  allocate ( p%SOLID%SHELL )
1746  call fstr_setup_post_phys_alloc(p%SOLID%SHELL,3, p%MESH%n_node,p%MESH%n_elem)
1747  allocate ( p%SOLID%SHELL%LAYER(p%SOLID%max_lyr) )
1748  do i=1,p%SOLID%max_lyr
1749  allocate ( p%SOLID%SHELL%LAYER(i)%PLUS )
1750  allocate ( p%SOLID%SHELL%LAYER(i)%MINUS )
1751  call fstr_setup_post_phys_alloc(p%SOLID%SHELL%LAYER(i)%PLUS , 3, p%MESH%n_node, p%MESH%n_elem)
1752  call fstr_setup_post_phys_alloc(p%SOLID%SHELL%LAYER(i)%MINUS, 3, p%MESH%n_node, p%MESH%n_elem)
1753  enddo
1754  phys => p%SOLID%SHELL
1755  else
1756  allocate ( p%SOLID%SOLID )
1757  phys => p%SOLID%SOLID
1758  call fstr_setup_post_phys_alloc(phys, p%MESH%n_dof, p%MESH%n_node, p%MESH%n_elem)
1759  end if
1760  p%SOLID%STRAIN => phys%STRAIN
1761  p%SOLID%STRESS => phys%STRESS
1762  p%SOLID%MISES => phys%MISES
1763  p%SOLID%ESTRAIN => phys%ESTRAIN
1764  p%SOLID%ESTRESS => phys%ESTRESS
1765  p%SOLID%EMISES => phys%EMISES
1766  p%SOLID%ENQM => phys%ENQM
1767  allocate( p%SOLID%REACTION( p%MESH%n_dof*p%MESH%n_node ) )
1768  end if
1769 
1770  if( p%PARAM%fg_visual == kon )then
1771  call fstr_setup_visualize( ctrl, p%MESH )
1772  end if
1773 
1774  call hecmw_barrier( p%MESH ) ! JP-7
1775 
1776  if( p%HEAT%STEPtot == 0 ) then ! No !HEAT Input
1777  if( p%PARAM%analysis_n == 0 ) then ! No !STATIC Input
1778  call reallocate_real( p%PARAM%dtime, 1)
1779  call reallocate_real( p%PARAM%etime, 1)
1780  call reallocate_real( p%PARAM%dtmin, 1)
1781  call reallocate_real( p%PARAM%delmax,1)
1782  call reallocate_integer( p%PARAM%itmax, 1)
1783  call reallocate_real( p%PARAM%eps, 1)
1784  p%PARAM%analysis_n = 1
1785  p%PARAM%dtime = 0
1786  p%PARAM%etime = 0
1787  p%PARAM%dtmin = 0
1788  p%PARAM%delmax = 0
1789  p%PARAM%itmax = 20
1790  p%PARAM%eps = 1.0e-6
1791  end if
1792  p%HEAT%STEPtot = 1
1793  call reallocate_real( p%HEAT%STEP_DLTIME, 1)
1794  call reallocate_real( p%HEAT%STEP_EETIME, 1)
1795  call reallocate_real( p%HEAT%STEP_DELMIN, 1)
1796  call reallocate_real( p%HEAT%STEP_DELMAX, 1)
1797  p%HEAT%STEP_DLTIME = 0
1798  p%HEAT%STEP_EETIME = 0
1799  p%HEAT%STEP_DELMIN = 0
1800  p%HEAT%STEP_DELMAX = 0
1801  end if
1802  end subroutine fstr_setup_post
1803 
1804  !*****************************************************************************!
1805  !* GENERAL HEADERS ***********************************************************!
1806  !*****************************************************************************!
1807 
1808  !-----------------------------------------------------------------------------!
1810  !-----------------------------------------------------------------------------!
1811 
1812  subroutine fstr_setup_solution( ctrl, counter, P )
1813  implicit none
1814  integer(kind=kint) :: ctrl
1815  integer(kind=kint) :: counter
1816  type(fstr_param_pack) :: P
1817 
1818  integer(kind=kint) :: rcode
1819 
1820  rcode = fstr_ctrl_get_solution( ctrl, p%PARAM%solution_type, p%PARAM%nlgeom )
1821  if( rcode /= 0 ) call fstr_ctrl_err_stop
1822 
1823  end subroutine fstr_setup_solution
1824 
1825  !-----------------------------------------------------------------------------!
1827  !-----------------------------------------------------------------------------!
1828 
1829  subroutine fstr_setup_nonlinear_solver( ctrl, counter, P )
1830  implicit none
1831  integer(kind=kint) :: ctrl
1832  integer(kind=kint) :: counter
1833  type(fstr_param_pack) :: P
1834 
1835  integer(kind=kint) :: rcode
1836 
1837  rcode = fstr_ctrl_get_nonlinear_solver( ctrl, p%PARAM%nlsolver_method )
1838  if( rcode /= 0 ) call fstr_ctrl_err_stop
1839 
1840  end subroutine fstr_setup_nonlinear_solver
1841 
1842  !-----------------------------------------------------------------------------!
1844  !-----------------------------------------------------------------------------!
1845 
1846  subroutine fstr_setup_solver( ctrl, counter, P )
1847  implicit none
1848  integer(kind=kint) :: ctrl
1849  integer(kind=kint) :: counter
1850  type(fstr_param_pack),target :: P
1851 
1852  integer(kind=kint) :: rcode
1853 
1854  if( counter >= 2 ) then
1855  write(ilog,*) '### Error : !SOLVER exists twice in FSTR control file.'
1856  stop
1857  endif
1858 
1859  ! nier => svIarray(1)
1860  ! method => svIarray(2)
1861  ! precond => svIarray(3)
1862  ! nset => svIarray(4)
1863  ! iterpremax => svIarray(5)
1864  ! nrest => svIarray(6)
1865  ! scaling => svIarray(7)
1866  ! iterlog => svIarray(21)
1867  ! timelog => svIarray(22)
1868  ! steplog => svIarray(23)
1869  ! dumptype => svIarray(31)
1870  ! dumpexit => svIarray(32)
1871  ! usejad => svIarray(33)
1872  ! ncolor_in => svIarray(34)
1873  ! mpc_method => svIarray(13)
1874  ! estcond => svIarray(14)
1875  ! contact_elim=> svIarray(15)
1876  ! method2 => svIarray(8)
1877  ! recyclepre => svIarray(35)
1878  ! solver_opt => svIarray(41:50)
1879  ! nBFGS => svIarray(60)
1880 
1881  ! resid => svRarray(1)
1882  ! sigma_diag => svRarray(2)
1883  ! sigma => svRarray(3)
1884  ! thresh => svRarray(4)
1885  ! filter => svRarray(5)
1886 
1887  rcode = fstr_ctrl_get_solver( ctrl, &
1888  sviarray(2), sviarray(3), sviarray(4), sviarray(21), sviarray(22), sviarray(23),&
1889  sviarray(1), sviarray(5), sviarray(6), sviarray(60), sviarray(7), &
1890  sviarray(31), sviarray(32), sviarray(33), sviarray(34), sviarray(13), sviarray(14), sviarray(8),&
1891  sviarray(35), sviarray(41:50), sviarray(15), &
1892  svrarray(1), svrarray(2), svrarray(3), &
1893  svrarray(4), svrarray(5) )
1894  if( rcode /= 0 ) call fstr_ctrl_err_stop
1895 
1896  if( sviarray(2) <= 100 ) then
1897  sviarray(99) = 1 ! indirect method
1898  else
1899  sviarray(99) = sviarray(2)-99 !2 ! direct method
1900  end if
1901 
1902  end subroutine fstr_setup_solver
1903 
1904  !* ----------------------------------------------------------------------------------------------- *!
1906  !* ----------------------------------------------------------------------------------------------- *!
1907 
1908  integer function fstr_setup_orientation( ctrl, hecMESH, cnt, coordsys )
1909  implicit none
1910  integer(kind=kint) :: ctrl
1911  type( hecmwst_local_mesh ) :: hecmesh
1912  integer :: cnt
1913  type( tlocalcoordsys ) :: coordsys
1914 
1915  integer :: j, is, ie, grp_id(1)
1916  character(len=HECMW_NAME_LEN) :: grp_id_name(1)
1917 
1918  integer :: nid, dtype
1919  character(len=HECMW_NAME_LEN) :: data_fmt
1920  real(kind=kreal) :: fdum, xyza(3), xyzb(3), xyzc(3), ff1(3), ff2(3), ff3(3)
1921 
1923 
1924  nid = 1
1925  coordsys%sys_type = 10
1926 
1927  nid = 1
1928  data_fmt = 'COORDINATES,NODES '
1929  if( fstr_ctrl_get_param_ex( ctrl, 'DEFINITION ', data_fmt, 0, 'P', nid )/=0 ) return
1930  dtype = nid-1
1931  coordsys%sys_type = coordsys%sys_type + dtype
1932 
1933  if( fstr_ctrl_get_param_ex( ctrl, 'NAME ', '# ', 1, 'S', grp_id_name(1) )/= 0) return
1934  coordsys%sys_name = grp_id_name(1)
1935  call fstr_strupr( coordsys%sys_name )
1936 
1937  if( dtype==0 ) then
1938  data_fmt = "RRRRRRrrr "
1939  xyzc(:) = 0.d0
1940  if( fstr_ctrl_get_data_array_ex( ctrl, data_fmt, xyza(1), xyza(2), &
1941  xyza(3), xyzb(1), xyzb(2), xyzb(3), xyzc(1), xyzc(2), xyzc(3) )/=0 ) return
1942  if( coordsys%sys_type==10 ) then
1943  ff1 = xyza-xyzc
1944  fdum = dsqrt( dot_product(ff1, ff1) )
1945  if( fdum==0.d0 ) return
1946  ff1 = ff1/fdum
1947  ff2 = xyzb-xyzc
1948  call cross_product(ff1,ff2,ff3)
1949  coordsys%CoordSys(1,:) = ff1
1950 
1951  fdum = dsqrt( dot_product(ff3, ff3) )
1952  if( fdum==0.d0 ) return
1953  coordsys%CoordSys(3,:) = ff3/fdum
1954 
1955  call cross_product(coordsys%CoordSys(3,:), coordsys%CoordSys(1,:), coordsys%CoordSys(2,:) )
1956  else
1957  coordsys%CoordSys(1,:) = xyza
1958  coordsys%CoordSys(2,:) = xyzb
1959  endif
1960 
1961  else
1962  coordsys%node_ID(3) = 0 ! global origin
1963  data_fmt = "IIi "
1964  if( fstr_ctrl_get_data_array_ex( ctrl, data_fmt, coordsys%node_ID(1), &
1965  coordsys%node_ID(2), coordsys%node_ID(3) )/=0 ) return
1966  if( coordsys%node_ID(3) == 0 ) then
1967  nid = node_global_to_local( hecmesh, coordsys%node_ID(1:2), 2 )
1968  if( nid/=0 .and. nid/=2 ) then
1969  write(*,*) "We cannot define coordinate system using nodes in other CPU!"
1970  write(idbg,*) "We cannot define coordinate system using nodes in other CPU!"
1971  return
1972  endif
1973  else
1974  nid = node_global_to_local( hecmesh, coordsys%node_ID, 3 )
1975  if( nid/=0 .and. nid/=3 ) then
1976  write(*,*) "We cannot define coordinate system using nodes in other CPU!"
1977  write(idbg,*) "We cannot define coordinate system using nodes in other CPU!"
1978  return
1979  endif
1980  endif
1981  endif
1982 
1984  end function fstr_setup_orientation
1985 
1986 
1987  !-----------------------------------------------------------------------------!
1989  !-----------------------------------------------------------------------------!
1990 
1991  subroutine fstr_setup_step( ctrl, counter, P )
1992  implicit none
1993  integer(kind=kint) :: ctrl
1994  integer(kind=kint) :: counter
1995  type(fstr_param_pack) :: P
1996  character(HECMW_NAME_LEN) :: amp
1997  integer(kind=kint) :: amp_id
1998 
1999  integer(kind=kint) :: rcode, iproc
2000 
2001  amp = ' '
2002  rcode = fstr_ctrl_get_step( ctrl, amp, iproc )
2003  if( rcode /= 0 ) call fstr_ctrl_err_stop
2004  call amp_name_to_id( p%MESH, '!STEP', amp, amp_id )
2005  ! P%SOLID%NLSTATIC_ngrp_amp = amp_id;
2006 
2007  end subroutine fstr_setup_step
2008 
2009  integer(kind=kint) function fstr_setup_initial( ctrl, cond, hecMESH )
2010  implicit none
2011  integer(kind=kint) :: ctrl
2012  type( tinitialcondition ) :: cond
2013  type(hecmwst_local_mesh) :: hecmesh
2014  integer, pointer :: grp_id(:), dof(:)
2015  real(kind=kreal), pointer :: temp(:)
2016  character(len=HECMW_NAME_LEN), pointer :: grp_id_name(:)
2017  character(len=HECMW_NAME_LEN) :: data_fmt, ss
2018  integer :: i,j,n, is, ie, gid, nid, rcode
2019 
2020  fstr_setup_initial = -1
2021 
2022  ss = 'TEMPERATURE,VELOCITY,ACCELERATION '
2023  rcode = fstr_ctrl_get_param_ex( ctrl, 'TYPE ', ss, 1, 'P', nid )
2024  if( nid==1 ) then
2025  cond%cond_name = "temperature"
2026  allocate( cond%intval(hecmesh%n_node) )
2027  allocate( cond%realval(hecmesh%n_node) )
2028  elseif( nid==2 ) then
2029  cond%cond_name = "velocity"
2030  allocate( cond%intval(hecmesh%n_node) )
2031  allocate( cond%realval(hecmesh%n_node) )
2032  elseif( nid==3 ) then
2033  cond%cond_name = "acceleration"
2034  allocate( cond%intval(hecmesh%n_node) )
2035  allocate( cond%realval(hecmesh%n_node) )
2036  else
2037  return
2038  endif
2039 
2040  cond%intval = -1
2041  cond%realval = 0.d0
2042 
2043  n = fstr_ctrl_get_data_line_n( ctrl )
2044  if( n<=0 ) return
2045  allocate( temp(n), grp_id_name(n), grp_id(n), dof(n) )
2046  dof = 0
2047  write(ss,*) hecmw_name_len
2048  if( nid==1 ) then
2049  write(data_fmt,'(a,a,a)') 'S',trim(adjustl(ss)),'R '
2050  fstr_setup_initial = &
2051  fstr_ctrl_get_data_array_ex( ctrl, data_fmt, grp_id_name, temp )
2052  else
2053  write(data_fmt,'(a,a,a)') 'S',trim(adjustl(ss)),'IR '
2054  fstr_setup_initial = &
2055  fstr_ctrl_get_data_array_ex( ctrl, data_fmt, grp_id_name, dof, temp )
2056  endif
2057 
2058  if( fstr_setup_initial /= 0 ) then
2059  if( associated(grp_id) ) deallocate( grp_id )
2060  if( associated(temp) ) deallocate( temp )
2061  if( associated(dof) ) deallocate( dof )
2062  if( associated(grp_id_name) ) deallocate( grp_id_name )
2063  return
2064  end if
2065 
2066  call node_grp_name_to_id_ex( hecmesh, '!INITIAL CONDITION', n, grp_id_name, grp_id )
2067  do i=1,n
2068  gid = grp_id(i)
2069  is = hecmesh%node_group%grp_index(gid-1) + 1
2070  ie = hecmesh%node_group%grp_index(gid )
2071  do j=is, ie
2072  nid = hecmesh%node_group%grp_item(j)
2073  cond%realval(nid) = temp(i)
2074  cond%intval(nid) = dof(i)
2075  enddo
2076  enddo
2077 
2078  if( associated(grp_id) ) deallocate( grp_id )
2079  if( associated(temp) ) deallocate( temp )
2080  if( associated(dof) ) deallocate( dof )
2081  if( associated(grp_id_name) ) deallocate( grp_id_name )
2082 end function fstr_setup_initial
2083 
2084  !-----------------------------------------------------------------------------!
2086  !-----------------------------------------------------------------------------!
2087 
2088  subroutine fstr_setup_write( ctrl, counter, P )
2089  implicit none
2090  integer(kind=kint) :: ctrl
2091  integer(kind=kint) :: counter
2092  type(fstr_param_pack) :: P
2093  integer(kind=kint) :: res, visual, neutral
2094 
2095  integer(kind=kint) :: rcode
2096 
2097  rcode = fstr_ctrl_get_write( ctrl, res, visual, neutral )
2098  if( rcode /= 0 ) call fstr_ctrl_err_stop
2099  if( res == 1 ) p%PARAM%fg_result = 1
2100  if( visual == 1 ) p%PARAM%fg_visual = 1
2101  if( neutral == 1 ) p%PARAM%fg_neutral = 1
2102 
2103  end subroutine fstr_setup_write
2104 
2105 
2106  !-----------------------------------------------------------------------------!
2108  !-----------------------------------------------------------------------------!
2109  subroutine fstr_setup_echo( ctrl, counter, P )
2110  implicit none
2111  integer(kind=kint) :: ctrl
2112  integer(kind=kint) :: counter
2113  type(fstr_param_pack) :: P
2114 
2115  integer(kind=kint) :: rcode
2116 
2117  rcode = fstr_ctrl_get_echo( ctrl, &
2118  p%PARAM%fg_echo )
2119  if( rcode /= 0 ) call fstr_ctrl_err_stop
2120 
2121  end subroutine fstr_setup_echo
2122 
2123 
2124  !-----------------------------------------------------------------------------!
2126  !-----------------------------------------------------------------------------!
2127  subroutine fstr_setup_restart( ctrl, nout, version )
2128  implicit none
2129  integer(kind=kint) :: ctrl
2130  integer(kind=kint) :: nout
2131  integer(kind=kint) :: version
2132 
2133  integer(kind=kint) :: rcode
2134  nout = 0
2135  rcode = fstr_ctrl_get_param_ex( ctrl, 'FREQUENCY ', '# ', 0, 'I', nout )
2136  if( rcode /= 0 ) call fstr_ctrl_err_stop
2137  rcode = fstr_ctrl_get_param_ex( ctrl, 'VERSION ', '# ', 0, 'I', version )
2138  if( rcode /= 0 ) call fstr_ctrl_err_stop
2139 
2140  end subroutine fstr_setup_restart
2141 
2142 
2143  !-----------------------------------------------------------------------------!
2145  !-----------------------------------------------------------------------------!
2146 
2147  subroutine fstr_setup_couple( ctrl, counter, P )
2148  implicit none
2149  integer(kind=kint) :: ctrl
2150  integer(kind=kint) :: counter
2151  type(fstr_param_pack) :: P
2152  integer(kind=kint) :: rcode
2153  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
2154  integer(kind=kint) :: i, n, old_size, new_size
2155 
2156  if( p%SOLID%file_type /= kbcffstr ) return
2157 
2158  n = fstr_ctrl_get_data_line_n( ctrl )
2159  if( n == 0 ) return
2160  old_size = p%SOLID%COUPLE_ngrp_tot
2161  new_size = old_size + n
2162  p%SOLID%COUPLE_ngrp_tot = new_size
2163 
2164  call fstr_expand_integer_array ( p%SOLID%COUPLE_ngrp_ID, old_size, new_size )
2165 
2166  allocate( grp_id_name(n))
2167  rcode = fstr_ctrl_get_couple( ctrl, &
2168  p%PARAM%fg_couple_type, &
2169  p%PARAM%fg_couple_first, &
2170  p%PARAM%fg_couple_window, &
2171  grp_id_name, hecmw_name_len )
2172  if( rcode /= 0 ) call fstr_ctrl_err_stop
2173 
2174  call surf_grp_name_to_id_ex( p%MESH, '!COUPLE', &
2175  n, grp_id_name, p%SOLID%COUPLE_ngrp_ID(old_size+1:))
2176 
2177  deallocate( grp_id_name )
2178  p%PARAM%fg_couple = 1
2179 
2180  end subroutine fstr_setup_couple
2181 
2182  !-----------------------------------------------------------------------------!
2184  !-----------------------------------------------------------------------------!
2185 
2186  subroutine fstr_setup_amplitude( ctrl, P )
2187  implicit none
2188  integer(kind=kint) :: ctrl
2189  type(fstr_param_pack) :: P
2190  real(kind=kreal), pointer :: val(:), table(:)
2191  character(len=HECMW_NAME_LEN) :: name
2192  integer :: nline, n, type_def, type_time, type_val, rcode
2193 
2194  nline = fstr_ctrl_get_data_line_n( ctrl )
2195  if( nline<=0 ) return
2196  allocate( val(nline*4) )
2197  allocate( table(nline*4) )
2198  rcode = fstr_ctrl_get_amplitude( ctrl, nline, name, type_def, type_time, type_val, &
2199  n, val, table )
2200  if( rcode /= 0 ) call fstr_ctrl_err_stop
2201 
2202  call append_new_amplitude( p%MESH%amp, name, type_def, type_time, type_val, n, val, table )
2203 
2204  if( associated(val) ) deallocate( val )
2205  if( associated(table) ) deallocate( table )
2206  end subroutine fstr_setup_amplitude
2207 
2208 
2209  !*****************************************************************************!
2210  !* HEADERS FOR STATIC ANALYSIS ***********************************************!
2211  !*****************************************************************************!
2212 
2213  !-----------------------------------------------------------------------------!
2215  !-----------------------------------------------------------------------------!
2216 
2217  subroutine fstr_setup_static( ctrl, counter, P )
2218  implicit none
2219  integer(kind=kint) :: ctrl
2220  integer(kind=kint) :: counter
2221  type(fstr_param_pack) :: P
2222  integer(kind=kint) :: rcode
2223 
2224  integer :: nout, nout_monit,node_monit_1 ,elem_monit_1 ,intg_monit_1
2225  integer :: ipt, idx_elpl, iout_list(6)
2226  real(kind=kreal) :: sig_y0, h_dash
2227 
2228  if( counter > 1 ) then
2229  write(*,*)
2230  endif
2231 
2232  ipt = 0
2233  if( fstr_ctrl_get_param_ex( ctrl, 'TYPE ', 'INFINITESIMAL,NLGEOM,INFINITE ', 0, 'P', ipt )/=0 ) &
2234  return
2235  if( ipt == 2 ) p%PARAM%nlgeom = .true.
2236 
2237  ! for backward compatibility
2238  if( ipt == 3 ) then
2239  write(*,*) "Warning : !STATIC : parameter 'TYPE=INFINITE' is deprecated." &
2240  & // " Please use the replacement parameter 'TYPE=INFINITESIMAL'"
2241  endif
2242 
2243  rcode = fstr_ctrl_get_static( ctrl, &
2244  dt, etime, itmax, eps, p%SOLID%restart_nout, &
2245  idx_elpl, &
2246  iout_list, &
2247  sig_y0, h_dash, &
2248  nout, nout_monit, node_monit_1, &
2249  elem_monit_1, intg_monit_1 )
2250 
2251  if( rcode /= 0 ) call fstr_ctrl_err_stop
2252 
2253  end subroutine fstr_setup_static
2254 
2255 
2256  !-----------------------------------------------------------------------------!
2258  !-----------------------------------------------------------------------------!
2259 
2260  subroutine fstr_setup_boundary( ctrl, counter, P )
2261  implicit none
2262  integer(kind=kint) :: ctrl
2263  integer(kind=kint) :: counter
2264  type(fstr_param_pack) :: P
2265 
2266  integer(kind=kint) :: rcode
2267  integer(kind=kint) :: type = 0
2268  character(HECMW_NAME_LEN) :: amp, rotc_name(1)
2269  integer(kind=kint) :: amp_id, rotc_id(1), n_rotc
2270  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
2271  integer(kind=kint),pointer :: dof_ids (:)
2272  integer(kind=kint),pointer :: dof_ide (:)
2273  real(kind=kreal),pointer :: val_ptr(:)
2274  integer(kind=kint) :: i, n, old_size, new_size
2275 
2276  integer(kind=kint) :: gid, istot
2277 
2278  gid = 1
2279  rcode = fstr_ctrl_get_param_ex( ctrl, 'GRPID ', '# ', 0, 'I', gid )
2280  ! rcode = fstr_ctrl_get_param_ex( ctrl, 'TYPE ', 'FSTR,NASTRAN ', 0, 'P', type )
2281  ! if( rcode < 0 ) call fstr_ctrl_err_stop
2282  ! if( rcode == 1 ) type = 0 ! PARAM_NOTHING
2283 
2284  ! if( type == 0 ) then
2285 
2286  istot = 0
2287  rcode = fstr_ctrl_get_param_ex( ctrl, 'TOTAL ', '# ', 0, 'E', istot )
2288  if( rcode /= 0 ) call fstr_ctrl_err_stop
2289 
2290  ! get center of torque load
2291  rotc_name = ' '
2292  rotc_id = -1
2293  n_rotc = -1
2294  rcode = fstr_ctrl_get_param_ex( ctrl, 'ROT_CENTER ', '# ', 0, 'S', rotc_name )
2295  if( rcode /= 0 ) call fstr_ctrl_err_stop
2296  if( rotc_name(1) /= ' ' ) then
2297  if( istot /= 0 ) then
2298  write(*,*) 'fstr control file error : !BOUNDARY : rotational boundary cannot be specified with total value'
2299  write(ilog,*) 'fstr control file error : !BOUNDARY : rotational boundary cannot be specified with total value'
2300  call fstr_ctrl_err_stop
2301  endif
2302  p%SOLID%BOUNDARY_ngrp_rot = p%SOLID%BOUNDARY_ngrp_rot + 1
2303  n_rotc = p%SOLID%BOUNDARY_ngrp_rot
2304  call node_grp_name_to_id_ex( p%MESH, '!BOUNDARY,ROT_CENTER=', 1, rotc_name, rotc_id)
2305  endif
2306 
2307 
2308  ! ENTIRE -----------------------------------------------
2309  p%SOLID%file_type = kbcffstr
2310 
2311  n = fstr_ctrl_get_data_line_n( ctrl )
2312  if( n == 0 ) return
2313  old_size = p%SOLID%BOUNDARY_ngrp_tot
2314  new_size = old_size + n
2315  p%SOLID%BOUNDARY_ngrp_tot = new_size
2316  call fstr_expand_integer_array (p%SOLID%BOUNDARY_ngrp_GRPID, old_size, new_size )
2317  call fstr_expand_integer_array (p%SOLID%BOUNDARY_ngrp_ID, old_size, new_size )
2318  call fstr_expand_integer_array (p%SOLID%BOUNDARY_ngrp_type, old_size, new_size )
2319  call fstr_expand_real_array (p%SOLID%BOUNDARY_ngrp_val, old_size, new_size )
2320  call fstr_expand_integer_array (p%SOLID%BOUNDARY_ngrp_amp, old_size, new_size )
2321  call fstr_expand_integer_array (p%SOLID%BOUNDARY_ngrp_istot, old_size, new_size )
2322  call fstr_expand_integer_array (p%SOLID%BOUNDARY_ngrp_rotID, old_size, new_size )
2323  call fstr_expand_integer_array (p%SOLID%BOUNDARY_ngrp_centerID, old_size, new_size )
2324 
2325  allocate( grp_id_name(n) )
2326  allocate( dof_ids(n) )
2327  allocate( dof_ide(n) )
2328 
2329  amp = ' '
2330  val_ptr => p%SOLID%BOUNDARY_ngrp_val(old_size+1:)
2331  val_ptr = 0
2332  rcode = fstr_ctrl_get_boundary( ctrl, amp, grp_id_name, hecmw_name_len, dof_ids, dof_ide, val_ptr)
2333  if( rcode /= 0 ) call fstr_ctrl_err_stop
2334  call amp_name_to_id( p%MESH, '!BOUNDARY', amp, amp_id )
2335  p%SOLID%BOUNDARY_ngrp_GRPID(old_size+1:new_size) = gid
2336  call node_grp_name_to_id_ex( p%MESH, '!BOUNDARY', n, grp_id_name, p%SOLID%BOUNDARY_ngrp_ID(old_size+1:))
2337  p%SOLID%BOUNDARY_ngrp_istot(old_size+1:new_size) = istot
2338 
2339  ! set up information about rotation ( default value is set if ROT_CENTER is not given.)
2340  p%SOLID%BOUNDARY_ngrp_rotID(old_size+1:) = n_rotc
2341  p%SOLID%BOUNDARY_ngrp_centerID(old_size+1:) = rotc_id(1)
2342 
2343  do i = 1, n
2344  if( (dof_ids(i) < 1).or.(6 < dof_ids(i)).or.(dof_ide(i) < 1).or.(6 < dof_ide(i)) ) then
2345  write(*,*) 'fstr control file error : !BOUNDARY : range of dof_ids and dof_ide is from 1 to 6'
2346  write(ilog,*) 'fstr control file error : !BOUNDARY : range of dof_ids and dof_ide is from 1 to 6'
2347  call fstr_ctrl_err_stop
2348  end if
2349  p%SOLID%BOUNDARY_ngrp_type(old_size+i) = 10 * dof_ids(i) + dof_ide(i)
2350  p%SOLID%BOUNDARY_ngrp_amp(old_size+i) = amp_id
2351  end do
2352 
2353  deallocate( grp_id_name )
2354  deallocate( dof_ids )
2355  deallocate( dof_ide )
2356  ! else
2357  ! ! NASTRAN ---------------------------------------------
2358  !
2359  ! P%SOLID%file_type = kbcfNASTRAN
2360  ! call fstr_setup_solid_nastran( ctrl, P%MESH, P%SOLID )
2361  ! end if
2362 
2363  end subroutine fstr_setup_boundary
2364 
2365 
2366  !-----------------------------------------------------------------------------!
2368  !-----------------------------------------------------------------------------!
2369 
2370  subroutine fstr_setup_cload( ctrl, counter, P )
2371  implicit none
2372  integer(kind=kint) :: ctrl
2373  integer(kind=kint) :: counter
2374  type(fstr_param_pack) :: P
2375 
2376  integer(kind=kint) :: rcode
2377  character(HECMW_NAME_LEN) :: amp, rotc_name(1)
2378  integer(kind=kint) :: amp_id, rotc_id(1), n_rotc
2379  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
2380  real(kind=kreal),pointer :: val_ptr(:)
2381  integer(kind=kint),pointer :: id_ptr(:)
2382  integer(kind=kint) :: i, n, old_size, new_size
2383  integer(kind=kint) :: gid
2384 
2385  if( p%SOLID%file_type /= kbcffstr ) return
2386  gid = 1
2387  rcode = fstr_ctrl_get_param_ex( ctrl, 'GRPID ', '# ', 0, 'I', gid )
2388  if( rcode /= 0 ) call fstr_ctrl_err_stop
2389 
2390  ! get center of torque load
2391  rotc_name = ' '
2392  rotc_id = -1
2393  n_rotc = -1
2394  rcode = fstr_ctrl_get_param_ex( ctrl, 'ROT_CENTER ', '# ', 0, 'S', rotc_name )
2395  if( rcode /= 0 ) call fstr_ctrl_err_stop
2396  if( rotc_name(1) /= ' ' ) then
2397  p%SOLID%CLOAD_ngrp_rot = p%SOLID%CLOAD_ngrp_rot + 1
2398  n_rotc = p%SOLID%CLOAD_ngrp_rot
2399  call node_grp_name_to_id_ex( p%MESH, '!CLOAD,ROT_CENTER=', 1, rotc_name, rotc_id)
2400  endif
2401 
2402  n = fstr_ctrl_get_data_line_n( ctrl )
2403  if( n == 0 ) return
2404  old_size = p%SOLID%CLOAD_ngrp_tot
2405  new_size = old_size + n
2406  p%SOLID%CLOAD_ngrp_tot = new_size
2407  ! Keiji Suemitsu (20140624) <
2408  call fstr_expand_integer_array ( p%SOLID%CLOAD_ngrp_GRPID, old_size, new_size )
2409  call fstr_expand_integer_array ( p%SOLID%CLOAD_ngrp_ID, old_size, new_size )
2410  call fstr_expand_integer_array ( p%SOLID%CLOAD_ngrp_DOF, old_size, new_size )
2411  call fstr_expand_real_array ( p%SOLID%CLOAD_ngrp_val, old_size, new_size )
2412  call fstr_expand_integer_array ( p%SOLID%CLOAD_ngrp_amp, old_size, new_size )
2413  call fstr_expand_integer_array ( p%SOLID%CLOAD_ngrp_rotID, old_size, new_size )
2414  call fstr_expand_integer_array ( p%SOLID%CLOAD_ngrp_centerID, old_size, new_size )
2415  ! > Keiji Suemitsu (20140624)
2416 
2417  allocate( grp_id_name(n))
2418  amp = ' '
2419  val_ptr => p%SOLID%CLOAD_ngrp_val(old_size+1:)
2420  id_ptr =>p%SOLID%CLOAD_ngrp_DOF(old_size+1:)
2421  val_ptr = 0
2422  rcode = fstr_ctrl_get_cload( ctrl, amp, grp_id_name, hecmw_name_len, id_ptr, val_ptr )
2423  if( rcode /= 0 ) call fstr_ctrl_err_stop
2424 
2425  ! set up information about torque load ( default value is set if ROT_CENTER is not given.)
2426  p%SOLID%CLOAD_ngrp_rotID(old_size+1:) = n_rotc
2427  p%SOLID%CLOAD_ngrp_centerID(old_size+1:) = rotc_id(1)
2428 
2429  call amp_name_to_id( p%MESH, '!CLOAD', amp, amp_id )
2430  do i=1,n
2431  p%SOLID%CLOAD_ngrp_amp(old_size+i) = amp_id
2432  end do
2433  p%SOLID%CLOAD_ngrp_GRPID(old_size+1:new_size) = gid
2434  call node_grp_name_to_id_ex( p%MESH, '!CLOAD', n, grp_id_name, p%SOLID%CLOAD_ngrp_ID(old_size+1:))
2435 
2436  deallocate( grp_id_name )
2437 
2438  end subroutine fstr_setup_cload
2439 
2440  !-----------------------------------------------------------------------------!
2442  !-----------------------------------------------------------------------------!
2443  include 'fstr_ctrl_freq.f90'
2444 
2445  !-----------------------------------------------------------------------------!
2447  !-----------------------------------------------------------------------------!
2448 
2449  subroutine fstr_expand_dload_array( array, old_size, new_size )
2450  implicit none
2451  real(kind=kreal), pointer :: array(:,:)
2452  integer(kind=kint) :: old_size, new_size, i, j
2453  real(kind=kreal), pointer :: temp(:,:)
2454 
2455  if( old_size >= new_size ) then
2456  return
2457  end if
2458 
2459  if( associated( array ) ) then
2460  allocate(temp(0:6, old_size))
2461  temp = array
2462  deallocate(array)
2463  allocate(array(0:6, new_size))
2464  array = 0
2465  do i=1,old_size
2466  do j=0,6
2467  array(j,i) = temp(j,i)
2468  end do
2469  end do
2470  deallocate(temp)
2471  else
2472  allocate(array(0:6, new_size))
2473  array = 0
2474  end if
2475  end subroutine fstr_expand_dload_array
2476 
2478  subroutine fstr_setup_dload( ctrl, counter, P )
2479  implicit none
2480  integer(kind=kint) :: ctrl
2481  integer(kind=kint) :: counter
2482  type(fstr_param_pack) :: P
2483 
2484  integer(kind=kint) :: rcode
2485  character(HECMW_NAME_LEN) :: amp
2486  integer(kind=kint) :: amp_id
2487  integer(kind=kint) :: follow
2488  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
2489  real(kind=kreal),pointer :: new_params(:,:)
2490  logical,pointer :: fg_surface(:)
2491  integer(kind=kint),pointer :: lid_ptr(:)
2492  integer(kind=kint) :: i, j, n, old_size, new_size
2493  integer(kind=kint) :: gid
2494 
2495  if( p%SOLID%file_type /= kbcffstr ) return
2496 
2497  gid = 1
2498  rcode = fstr_ctrl_get_param_ex( ctrl, 'GRPID ', '# ', 0, 'I', gid )
2499 
2500  n = fstr_ctrl_get_data_line_n( ctrl )
2501  if( n == 0 ) return
2502  old_size = p%SOLID%DLOAD_ngrp_tot
2503  new_size = old_size + n
2504  p%SOLID%DLOAD_ngrp_tot = new_size
2505  ! Keiji Suemitsu (20140624) <
2506  call fstr_expand_integer_array ( p%SOLID%DLOAD_ngrp_GRPID, old_size, new_size )
2507  call fstr_expand_integer_array ( p%SOLID%DLOAD_ngrp_ID, old_size, new_size )
2508  call fstr_expand_integer_array ( p%SOLID%DLOAD_ngrp_LID, old_size, new_size )
2509  call fstr_expand_integer_array ( p%SOLID%DLOAD_ngrp_amp, old_size, new_size )
2510  call fstr_expand_dload_array ( p%SOLID%DLOAD_ngrp_params, old_size, new_size )
2511  ! > Keiji Suemitsu (20140624)
2512 
2513  allocate( grp_id_name(n))
2514  allocate( new_params(0:6,n))
2515  allocate( fg_surface(n))
2516  new_params = 0
2517  amp = ' '
2518  follow = p%SOLID%DLOAD_follow
2519  if( .not. p%PARAM%nlgeom ) follow = 0
2520  lid_ptr => p%SOLID%DLOAD_ngrp_LID(old_size+1:)
2521  rcode = fstr_ctrl_get_dload( ctrl, amp, follow, &
2522  grp_id_name, hecmw_name_len, &
2523  lid_ptr, new_params )
2524  if( rcode /= 0 ) call fstr_ctrl_err_stop
2525  call amp_name_to_id( p%MESH, '!DLOAD', amp, amp_id )
2526  p%SOLID%DLOAD_follow = follow
2527  do i=1,n
2528  p%SOLID%DLOAD_ngrp_amp(old_size+i) = amp_id
2529  do j=0, 6
2530  p%SOLID%DLOAD_ngrp_params(j,old_size+i) = new_params(j,i)
2531  end do
2532  fg_surface(i) = ( lid_ptr(i) == 100 )
2533  end do
2534  p%SOLID%DLOAD_ngrp_GRPID(old_size+1:new_size) = gid
2535  call dload_grp_name_to_id_ex( p%MESH, n, grp_id_name, fg_surface, p%SOLID%DLOAD_ngrp_ID(old_size+1:))
2536  deallocate( grp_id_name )
2537  deallocate( new_params )
2538  deallocate( fg_surface )
2539  end subroutine fstr_setup_dload
2540 
2541 
2542  !-----------------------------------------------------------------------------!
2544  !-----------------------------------------------------------------------------!
2545 
2546  subroutine fstr_setup_temperature( ctrl, counter, P )
2547  implicit none
2548  integer(kind=kint) :: ctrl
2549  integer(kind=kint) :: counter
2550  type(fstr_param_pack) :: P
2551 
2552  integer(kind=kint) :: rcode, gid
2553  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
2554  real(kind=kreal),pointer :: val_ptr(:)
2555  integer(kind=kint) :: n, old_size, new_size
2556 
2557  if( p%SOLID%file_type /= kbcffstr ) return
2558 
2559  gid = 1
2560  rcode = fstr_ctrl_get_param_ex( ctrl, 'GRPID ', '# ', 0, 'I', gid )
2561 
2562  n = fstr_ctrl_get_data_line_n( ctrl )
2563  old_size = p%SOLID%TEMP_ngrp_tot
2564  if( n > 0 ) then
2565  new_size = old_size + n
2566  else
2567  new_size = old_size + 1
2568  endif
2569  call fstr_expand_integer_array ( p%SOLID%TEMP_ngrp_GRPID, old_size, new_size )
2570  call fstr_expand_integer_array ( p%SOLID%TEMP_ngrp_ID, old_size, new_size )
2571  call fstr_expand_real_array ( p%SOLID%TEMP_ngrp_val,old_size, new_size )
2572 
2573  allocate( grp_id_name(n))
2574  val_ptr => p%SOLID%TEMP_ngrp_val( old_size+1: )
2575 
2576  rcode = fstr_ctrl_get_temperature( ctrl, &
2577  p%SOLID%TEMP_irres, &
2578  p%SOLID%TEMP_tstep, &
2579  p%SOLID%TEMP_interval, &
2580  p%SOLID%TEMP_rtype, &
2581  grp_id_name, hecmw_name_len, &
2582  val_ptr )
2583  if( rcode /= 0 ) call fstr_ctrl_err_stop
2584 
2585  p%SOLID%TEMP_ngrp_GRPID(old_size+1:new_size) = gid
2586  if( n > 0 ) then
2587  if( p%SOLID%TEMP_irres == 0 ) then
2588  p%SOLID%TEMP_ngrp_tot = new_size
2589  call node_grp_name_to_id_ex( p%MESH, '!TEMPERATURE', &
2590  n, grp_id_name, p%SOLID%TEMP_ngrp_ID(old_size+1:))
2591  endif
2592  deallocate( grp_id_name )
2593  endif
2594 
2595  end subroutine fstr_setup_temperature
2596 
2597 
2598  !-----------------------------------------------------------------------------!
2600  !-----------------------------------------------------------------------------!
2601 
2602  subroutine fstr_setup_spring( ctrl, counter, P )
2603  implicit none
2604  integer(kind=kint) :: ctrl
2605  integer(kind=kint) :: counter
2606  type(fstr_param_pack) :: P
2607 
2608  integer(kind=kint) :: rcode
2609  character(HECMW_NAME_LEN) :: amp
2610  integer(kind=kint) :: amp_id
2611  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
2612  real(kind=kreal),pointer :: val_ptr(:)
2613  integer(kind=kint),pointer :: id_ptr(:)
2614  integer(kind=kint) :: i, n, old_size, new_size
2615  integer(kind=kint) :: gid
2616 
2617  if( p%SOLID%file_type /= kbcffstr ) return
2618  gid = 1
2619  rcode = fstr_ctrl_get_param_ex( ctrl, 'GRPID ', '# ', 0, 'I', gid )
2620  n = fstr_ctrl_get_data_line_n( ctrl )
2621  if( n == 0 ) return
2622  old_size = p%SOLID%SPRING_ngrp_tot
2623  new_size = old_size + n
2624  p%SOLID%SPRING_ngrp_tot = new_size
2625  call fstr_expand_integer_array ( p%SOLID%SPRING_ngrp_GRPID, old_size, new_size )
2626  call fstr_expand_integer_array ( p%SOLID%SPRING_ngrp_ID, old_size, new_size )
2627  call fstr_expand_integer_array ( p%SOLID%SPRING_ngrp_DOF, old_size, new_size )
2628  call fstr_expand_real_array ( p%SOLID%SPRING_ngrp_val, old_size, new_size )
2629  call fstr_expand_integer_array ( p%SOLID%SPRING_ngrp_amp, old_size, new_size )
2630 
2631  allocate( grp_id_name(n))
2632  amp = ' '
2633  val_ptr => p%SOLID%SPRING_ngrp_val(old_size+1:)
2634  id_ptr =>p%SOLID%SPRING_ngrp_DOF(old_size+1:)
2635  val_ptr = 0
2636  rcode = fstr_ctrl_get_spring( ctrl, amp, grp_id_name, hecmw_name_len, id_ptr, val_ptr )
2637  if( rcode /= 0 ) call fstr_ctrl_err_stop
2638 
2639  call amp_name_to_id( p%MESH, '!SPRING', amp, amp_id )
2640  do i=1,n
2641  p%SOLID%SPRING_ngrp_amp(old_size+i) = amp_id
2642  end do
2643  p%SOLID%SPRING_ngrp_GRPID(old_size+1:new_size) = gid
2644  call node_grp_name_to_id_ex( p%MESH, '!SPRING', n, grp_id_name, p%SOLID%SPRING_ngrp_ID(old_size+1:))
2645 
2646  deallocate( grp_id_name )
2647 
2648  end subroutine fstr_setup_spring
2649 
2650 
2651  !-----------------------------------------------------------------------------!
2653  !-----------------------------------------------------------------------------!
2654 
2655  subroutine fstr_setup_reftemp( ctrl, counter, P )
2656  implicit none
2657  integer(kind=kint) :: ctrl
2658  integer(kind=kint) :: counter
2659  type(fstr_param_pack) :: P
2660 
2661  integer(kind=kint) :: rcode
2662 
2663  rcode = fstr_ctrl_get_reftemp( ctrl, p%PARAM%ref_temp )
2664  if( rcode /= 0 ) call fstr_ctrl_err_stop
2665 
2666  end subroutine fstr_setup_reftemp
2667 
2668 
2669  !*****************************************************************************!
2670  !* HEADERS FOR HEAT ANALYSIS *************************************************!
2671  !*****************************************************************************!
2672 
2673  !-----------------------------------------------------------------------------!
2675  !-----------------------------------------------------------------------------!
2676 
2677  subroutine fstr_setup_heat( ctrl, counter, P )
2678  implicit none
2679  integer(kind=kint) :: ctrl
2680  integer(kind=kint) :: counter
2681  type(fstr_param_pack) :: P
2682 
2683  integer(kind=kint) :: rcode
2684  integer(kind=kint) :: n
2685  character(len=HECMW_NAME_LEN) :: mName
2686  integer(kind=kint) :: i
2687 
2688  n = fstr_ctrl_get_data_line_n( ctrl )
2689 
2690  if( n == 0 ) return
2691 
2692  call reallocate_real( p%PARAM%dtime, n)
2693  call reallocate_real( p%PARAM%etime, n)
2694  call reallocate_real( p%PARAM%dtmin, n)
2695  call reallocate_real( p%PARAM%delmax,n)
2696  call reallocate_integer( p%PARAM%itmax, n)
2697  call reallocate_real( p%PARAM%eps, n)
2698  p%PARAM%analysis_n = n
2699 
2700  p%PARAM%dtime = 0
2701  p%PARAM%etime = 0
2702  p%PARAM%dtmin = 0
2703  p%PARAM%delmax = 0
2704  p%PARAM%itmax = 20
2705  p%PARAM%eps = 1.0e-6
2706  p%PARAM%timepoint_id = 0
2707 
2708  rcode = fstr_ctrl_get_heat( ctrl, &
2709  p%PARAM%dtime, &
2710  p%PARAM%etime, &
2711  p%PARAM%dtmin, &
2712  p%PARAM%delmax, &
2713  p%PARAM%itmax, &
2714  p%PARAM%eps, &
2715  mname, &
2716  p%HEAT%beta)
2717  if( rcode /= 0 ) then
2718  call fstr_ctrl_err_stop
2719  end if
2720 
2721  if( associated(p%PARAM%timepoints) ) then
2722  do i=1,size(p%PARAM%timepoints)
2723  if( fstr_streqr( p%PARAM%timepoints(i)%name, mname ) ) then
2724  p%PARAM%timepoint_id = i; exit
2725  endif
2726  enddo
2727  endif
2728 
2729  call reallocate_real( p%HEAT%STEP_DLTIME, n)
2730  call reallocate_real( p%HEAT%STEP_EETIME, n)
2731  call reallocate_real( p%HEAT%STEP_DELMIN, n)
2732  call reallocate_real( p%HEAT%STEP_DELMAX, n)
2733  p%HEAT%STEPtot = n
2734 
2735  p%HEAT%STEP_DLTIME = p%PARAM%dtime
2736  p%HEAT%STEP_EETIME = p%PARAM%etime
2737  p%HEAT%STEP_DELMIN = p%PARAM%dtmin
2738  p%HEAT%STEP_DELMAX = p%PARAM%delmax
2739  p%HEAT%timepoint_id = p%PARAM%timepoint_id
2740 
2741  end subroutine fstr_setup_heat
2742 
2743  !-----------------------------------------------------------------------------!
2745  !-----------------------------------------------------------------------------!
2746 
2747  subroutine fstr_setup_fixtemp( ctrl, counter, P )
2748  implicit none
2749  integer(kind=kint) :: ctrl
2750  integer(kind=kint) :: counter
2751  type(fstr_param_pack),target :: P
2752 
2753  integer(kind=kint) :: rcode
2754  character(HECMW_NAME_LEN) :: amp
2755  integer(kind=kint) :: amp_id
2756  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
2757  real(kind=kreal),pointer :: value(:)
2758  integer(kind=kint) :: i, j, n, m, head, id, member_n, old_size, new_size
2759  integer(kind=kint),pointer :: member(:)
2760  integer(kind=kint) :: local_id, rtc
2761  ! ------------------------------------------------
2762 
2763  n = fstr_ctrl_get_data_line_n( ctrl )
2764  if( n == 0 ) return
2765 
2766  allocate( grp_id_name(n))
2767  allocate( value(n))
2768 
2769  amp = ' '
2770  rcode = fstr_ctrl_get_fixtemp( ctrl, amp, &
2771  grp_id_name, hecmw_name_len, value )
2772  if( rcode /= 0 ) call fstr_ctrl_err_stop
2773 
2774  call amp_name_to_id( p%MESH, '!FIXTEMP', amp, amp_id )
2775 
2776  m = 0
2777  do i = 1, n
2778  !rtc = get_local_member_index( P%MESH, 'node', grp_id_name(i), local_id )
2779  rtc = get_sorted_local_member_index( p%MESH, p%PARAM, 'node', grp_id_name(i), local_id )
2780  if( rtc > 0 ) then
2781  m = m + 1
2782  else if( rtc < 0 ) then
2783  m = m + get_grp_member_n( p%MESH, 'node_grp', grp_id_name(i) )
2784  end if
2785  end do
2786 
2787  if (m == 0) then
2788  deallocate( grp_id_name )
2789  deallocate( value )
2790  return
2791  endif
2792 
2793  ! JP-8
2794  old_size = p%HEAT%T_FIX_tot
2795  new_size = old_size + m
2796  call fstr_expand_integer_array( p%HEAT%T_FIX_node, old_size, new_size )
2797  call fstr_expand_integer_array( p%HEAT%T_FIX_ampl, old_size, new_size )
2798  call fstr_expand_real_array( p%HEAT%T_FIX_val, old_size, new_size )
2799  p%HEAT%T_FIX_tot = new_size
2800 
2801  head = old_size + 1
2802  member => p%HEAT%T_FIX_node(head:)
2803  id = head
2804  do i = 1, n
2805  !rtc = get_local_member_index( P%MESH, 'node', grp_id_name(i), local_id )
2806  rtc = get_sorted_local_member_index( p%MESH, p%PARAM, 'node', grp_id_name(i), local_id )
2807  if( rtc > 0 ) then
2808  member(1) = local_id
2809  member_n = 1
2810  else if( rtc < 0 ) then
2811  member_n = get_grp_member( p%MESH, 'node_grp', grp_id_name(i), member )
2812  else
2813  cycle
2814  end if
2815  if( i<n ) then
2816  member => member( member_n+1 : )
2817  endif
2818  do j = 1, member_n
2819  p%HEAT%T_FIX_val (id) = value(i)
2820  p%HEAT%T_FIX_ampl (id) = amp_id
2821  id = id + 1
2822  end do
2823  end do
2824 
2825  deallocate( grp_id_name )
2826  deallocate( value )
2827  end subroutine fstr_setup_fixtemp
2828 
2829 
2830  !-----------------------------------------------------------------------------!
2832  !-----------------------------------------------------------------------------!
2833 
2834  subroutine fstr_setup_cflux( ctrl, counter, P )
2835  implicit none
2836  integer(kind=kint) :: ctrl
2837  integer(kind=kint) :: counter
2838  type(fstr_param_pack) :: P
2839 
2840  integer(kind=kint) :: rcode
2841  character(HECMW_NAME_LEN) :: amp
2842  integer(kind=kint) :: amp_id
2843  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
2844  real(kind=kreal),pointer :: value(:)
2845  integer(kind=kint) :: i, j, n, m, head, id, member_n, old_size, new_size
2846  integer(kind=kint),pointer :: member(:)
2847  integer(kind=kint) :: local_id, rtc
2848  ! ------------------------------------------------
2849 
2850  n = fstr_ctrl_get_data_line_n( ctrl )
2851  if( n == 0 ) return
2852 
2853  allocate( grp_id_name(n))
2854  allocate( value(n))
2855 
2856  amp = ' '
2857  rcode = fstr_ctrl_get_cflux( ctrl, amp, &
2858  grp_id_name, hecmw_name_len, value )
2859  if( rcode /= 0 ) call fstr_ctrl_err_stop
2860 
2861  call amp_name_to_id( p%MESH, '!CFLUX', amp, amp_id )
2862 
2863  m = 0
2864 
2865  do i = 1, n
2866  rtc = get_local_member_index( p%MESH, 'node', grp_id_name(i), local_id )
2867  if( rtc > 0 ) then
2868  m = m + 1
2869  else if( rtc < 0 ) then
2870  m = m + get_grp_member_n( p%MESH, 'node_grp', grp_id_name(i) )
2871  end if
2872  end do
2873 
2874  if (m == 0) then
2875  deallocate( grp_id_name )
2876  deallocate( value )
2877  return
2878  endif
2879 
2880  ! JP-9
2881  old_size = p%HEAT%Q_NOD_tot
2882  new_size = old_size + m
2883  call fstr_expand_integer_array( p%HEAT%Q_NOD_node, old_size, new_size )
2884  call fstr_expand_integer_array( p%HEAT%Q_NOD_ampl, old_size, new_size )
2885  call fstr_expand_real_array( p%HEAT%Q_NOD_val, old_size, new_size )
2886  p%HEAT%Q_NOD_tot = new_size
2887 
2888  head = old_size + 1
2889  member => p%HEAT%Q_NOD_node(head:)
2890  id = head
2891  do i = 1, n
2892  rtc = get_local_member_index( p%MESH, 'node', grp_id_name(i), local_id )
2893  if( rtc > 0 ) then
2894  member(1) = local_id
2895  member_n = 1
2896  else if( rtc < 0 ) then
2897  member_n = get_grp_member( p%MESH, 'node_grp', grp_id_name(i), member )
2898  else
2899  cycle
2900  end if
2901  if( i<n ) member => member( member_n+1 : )
2902  do j = 1, member_n
2903  p%HEAT%Q_NOD_val (id) = value(i)
2904  p%HEAT%Q_NOD_ampl (id) = amp_id
2905  id = id + 1
2906  end do
2907  end do
2908 
2909  deallocate( grp_id_name )
2910  deallocate( value )
2911  end subroutine fstr_setup_cflux
2912 
2913 
2914  !-----------------------------------------------------------------------------!
2916  !-----------------------------------------------------------------------------!
2917 
2918 
2919  subroutine fstr_setup_dflux( ctrl, counter, P )
2920  implicit none
2921  integer(kind=kint) :: ctrl
2922  integer(kind=kint) :: counter
2923  type(fstr_param_pack) :: P
2924 
2925  integer(kind=kint) :: rcode
2926  character(HECMW_NAME_LEN) :: amp
2927  integer(kind=kint) :: amp_id
2928  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
2929  integer(kind=kint),pointer :: load_type(:)
2930  real(kind=kreal),pointer :: value(:)
2931  integer(kind=kint) :: i, j, n, m, head, id, member_n, old_size, new_size
2932  integer(kind=kint),pointer :: member(:)
2933  integer(kind=kint) :: local_id, rtc
2934  ! ------------------------------------------------
2935 
2936  n = fstr_ctrl_get_data_line_n( ctrl )
2937  if( n == 0 ) return
2938 
2939  allocate( grp_id_name(n))
2940  allocate( load_type(n))
2941  allocate( value(n))
2942 
2943  amp = ' '
2944  rcode = fstr_ctrl_get_dflux( ctrl, amp, &
2945  grp_id_name, hecmw_name_len, load_type, value )
2946  if( rcode /= 0 ) call fstr_ctrl_err_stop
2947 
2948  call amp_name_to_id( p%MESH, '!DFLUX', amp, amp_id )
2949 
2950  m = 0
2951  do i = 1, n
2952  rtc = get_local_member_index( p%MESH, 'element', grp_id_name(i), local_id )
2953  if( rtc > 0 ) then
2954  m = m + 1
2955  else if( rtc < 0 ) then
2956  m = m + get_grp_member_n( p%MESH, 'elem_grp', grp_id_name(i) )
2957  end if
2958  end do
2959 
2960  if (m == 0) then
2961  deallocate( grp_id_name )
2962  deallocate( load_type )
2963  deallocate( value )
2964  return
2965  endif
2966 
2967  ! JP-10
2968  old_size = p%HEAT%Q_SUF_tot
2969  new_size = old_size + m
2970  call fstr_expand_integer_array( p%HEAT%Q_SUF_elem, old_size, new_size )
2971  call fstr_expand_integer_array( p%HEAT%Q_SUF_ampl, old_size, new_size )
2972  call fstr_expand_integer_array( p%HEAT%Q_SUF_surf, old_size, new_size )
2973  call fstr_expand_real_array( p%HEAT%Q_SUF_val, old_size, new_size )
2974  p%HEAT%Q_SUF_tot = new_size
2975 
2976  head = old_size + 1
2977  member => p%HEAT%Q_SUF_elem(head:)
2978  id = head
2979  do i = 1, n
2980  rtc = get_local_member_index( p%MESH, 'element', grp_id_name(i), local_id )
2981  if( rtc > 0 ) then
2982  member(1) = local_id
2983  member_n = 1
2984  else if( rtc < 0 ) then
2985  member_n = get_grp_member( p%MESH, 'elem_grp', grp_id_name(i), member )
2986  else
2987  cycle
2988  end if
2989  if( i<n ) member => member( member_n+1 : )
2990  do j = 1, member_n
2991  p%HEAT%Q_SUF_surf (id) = load_type(i)
2992  p%HEAT%Q_SUF_val (id) = value(i)
2993  p%HEAT%Q_SUF_ampl (id) = amp_id
2994  id = id + 1
2995  end do
2996  end do
2997 
2998  deallocate( grp_id_name )
2999  deallocate( load_type )
3000  deallocate( value )
3001  end subroutine fstr_setup_dflux
3002 
3003 
3004  !-----------------------------------------------------------------------------!
3006  !-----------------------------------------------------------------------------!
3007 
3008 
3009  subroutine fstr_setup_sflux( ctrl, counter, P )
3010  implicit none
3011  integer(kind=kint) :: ctrl
3012  integer(kind=kint) :: counter
3013  type(fstr_param_pack) :: P
3014 
3015  integer(kind=kint) :: rcode
3016  character(HECMW_NAME_LEN) :: amp
3017  integer(kind=kint) :: amp_id
3018  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
3019  real(kind=kreal),pointer :: value(:)
3020  integer(kind=kint) :: i, j, n, m, head, id, member_n, old_size, new_size
3021  integer(kind=kint),pointer :: member1(:), member2(:)
3022  ! ------------------------------------------------
3023 
3024  n = fstr_ctrl_get_data_line_n( ctrl )
3025  if( n == 0 ) return
3026 
3027  allocate( grp_id_name(n))
3028  allocate( value(n))
3029 
3030  amp = ' '
3031  rcode = fstr_ctrl_get_sflux( ctrl, amp, &
3032  grp_id_name, hecmw_name_len, value )
3033  if( rcode /= 0 ) call fstr_ctrl_err_stop
3034 
3035  call amp_name_to_id( p%MESH, '!SFLUX', amp, amp_id )
3036 
3037  m = 0
3038  do i = 1, n
3039  m = m + get_grp_member_n( p%MESH, 'surf_grp', grp_id_name(i) )
3040  end do
3041 
3042  if (m == 0) then
3043  deallocate( grp_id_name )
3044  deallocate( value )
3045  return
3046  endif
3047 
3048  ! JP-11
3049  old_size = p%HEAT%Q_SUF_tot
3050  new_size = old_size + m
3051  call fstr_expand_integer_array( p%HEAT%Q_SUF_elem, old_size, new_size )
3052  call fstr_expand_integer_array( p%HEAT%Q_SUF_ampl, old_size, new_size )
3053  call fstr_expand_integer_array( p%HEAT%Q_SUF_surf, old_size, new_size )
3054  call fstr_expand_real_array( p%HEAT%Q_SUF_val, old_size, new_size )
3055  p%HEAT%Q_SUF_tot = new_size
3056 
3057  head = old_size + 1
3058  member1 => p%HEAT%Q_SUF_elem(head:)
3059  member2 => p%HEAT%Q_SUF_surf(head:)
3060  id = head
3061  do i = 1, n
3062  member_n = get_grp_member( p%MESH, 'surf_grp', grp_id_name(i), member1, member2 )
3063  if( i<n ) then
3064  member1 => member1( member_n+1 : )
3065  member2 => member2( member_n+1 : )
3066  end if
3067  do j = 1, member_n
3068  p%HEAT%Q_SUF_val (id) = value(i)
3069  p%HEAT%Q_SUF_ampl (id) = amp_id
3070  id = id + 1
3071  end do
3072  end do
3073 
3074  deallocate( grp_id_name )
3075  deallocate( value )
3076  end subroutine fstr_setup_sflux
3077 
3078 
3079  !-----------------------------------------------------------------------------!
3081  !-----------------------------------------------------------------------------!
3082 
3083 
3084  subroutine fstr_setup_film( ctrl, counter, P )
3085  implicit none
3086  integer(kind=kint) :: ctrl
3087  integer(kind=kint) :: counter
3088  type(fstr_param_pack) :: P
3089 
3090  integer(kind=kint) :: rcode
3091  character(HECMW_NAME_LEN) :: amp1, amp2
3092  integer(kind=kint) :: amp_id1, amp_id2
3093  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
3094  integer(kind=kint),pointer :: load_type(:)
3095  real(kind=kreal),pointer :: value(:)
3096  real(kind=kreal),pointer :: shink(:)
3097  integer(kind=kint) :: i, j, n, m, head, id, member_n, old_size, new_size
3098  integer(kind=kint),pointer :: member(:)
3099  integer(kind=kint) :: local_id, rtc
3100  ! ------------------------------------------------
3101 
3102  n = fstr_ctrl_get_data_line_n( ctrl )
3103  if( n == 0 ) return
3104 
3105  allocate( grp_id_name(n))
3106  allocate( load_type(n))
3107  allocate( value(n))
3108  allocate( shink(n))
3109 
3110  amp1 = ' '
3111  amp2 = ' '
3112 
3113  rcode = fstr_ctrl_get_film( ctrl, amp1, amp2, &
3114  grp_id_name, hecmw_name_len, load_type, value, shink )
3115  if( rcode /= 0 ) call fstr_ctrl_err_stop
3116 
3117  call amp_name_to_id( p%MESH, '!FILM', amp1, amp_id1 )
3118  call amp_name_to_id( p%MESH, '!FILM', amp2, amp_id2 )
3119 
3120  m = 0
3121  do i = 1, n
3122  rtc = get_local_member_index( p%MESH, 'element', grp_id_name(i), local_id )
3123  if( rtc > 0 ) then
3124  m = m + 1
3125  else if( rtc < 0 ) then
3126  m = m + get_grp_member_n( p%MESH, 'elem_grp', grp_id_name(i) )
3127  end if
3128  end do
3129 
3130  if (m == 0) then
3131  deallocate( grp_id_name )
3132  deallocate( load_type )
3133  deallocate( value )
3134  deallocate( shink )
3135  return
3136  endif
3137 
3138  ! JP-12
3139  old_size = p%HEAT%H_SUF_tot
3140  new_size = old_size + m
3141  call fstr_expand_integer_array( p%HEAT%H_SUF_elem, old_size, new_size )
3142  call fstr_expand_integer_array2( p%HEAT%H_SUF_ampl, 2, old_size, new_size )
3143  call fstr_expand_integer_array( p%HEAT%H_SUF_surf, old_size, new_size )
3144  call fstr_expand_real_array2( p%HEAT%H_SUF_val, 2, old_size, new_size )
3145  p%HEAT%H_SUF_tot = new_size
3146 
3147  head = old_size + 1
3148  member => p%HEAT%H_SUF_elem(head:)
3149  id = head
3150  do i = 1, n
3151  rtc = get_local_member_index( p%MESH, 'element', grp_id_name(i), local_id )
3152  if( rtc > 0 ) then
3153  member(1) = local_id
3154  member_n = 1
3155  else if( rtc < 0 ) then
3156  member_n = get_grp_member( p%MESH, 'elem_grp', grp_id_name(i), member )
3157  else
3158  cycle
3159  end if
3160  if( i<n ) member => member( member_n+1 : )
3161  do j = 1, member_n
3162  p%HEAT%H_SUF_surf (id) = load_type(i)
3163  p%HEAT%H_SUF_val (id,1) = value(i)
3164  p%HEAT%H_SUF_val (id,2) = shink(i)
3165  p%HEAT%H_SUF_ampl (id,1) = amp_id1
3166  p%HEAT%H_SUF_ampl (id,2) = amp_id2
3167  id= id + 1
3168  end do
3169  end do
3170 
3171  deallocate( grp_id_name )
3172  deallocate( load_type )
3173  deallocate( value )
3174  deallocate( shink )
3175  end subroutine fstr_setup_film
3176 
3177 
3178  !-----------------------------------------------------------------------------!
3180  !-----------------------------------------------------------------------------!
3181 
3182 
3183  subroutine fstr_setup_sfilm( ctrl, counter, P )
3184  implicit none
3185  integer(kind=kint) :: ctrl
3186  integer(kind=kint) :: counter
3187  type(fstr_param_pack) :: P
3188 
3189  integer(kind=kint) :: rcode
3190  character(HECMW_NAME_LEN) :: amp1, amp2
3191  integer(kind=kint) :: amp_id1, amp_id2
3192  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
3193  real(kind=kreal),pointer :: value(:)
3194  real(kind=kreal),pointer :: shink(:)
3195  integer(kind=kint) :: i, j, n, m, head, id, member_n, old_size, new_size
3196  integer(kind=kint),pointer :: member1(:), member2(:)
3197  ! ------------------------------------------------
3198 
3199  n = fstr_ctrl_get_data_line_n( ctrl )
3200  if( n == 0 ) return
3201 
3202  allocate( grp_id_name(n))
3203  allocate( value(n))
3204  allocate( shink(n))
3205 
3206  amp1 = ' '
3207  amp2 = ' '
3208  rcode = fstr_ctrl_get_sfilm( ctrl, amp1, amp2, &
3209  grp_id_name, hecmw_name_len, value, shink )
3210  if( rcode /= 0 ) call fstr_ctrl_err_stop
3211 
3212  call amp_name_to_id( p%MESH, '!SFILM', amp1, amp_id1 )
3213  call amp_name_to_id( p%MESH, '!SFILM', amp2, amp_id2 )
3214 
3215  m = 0
3216  do i = 1, n
3217  m = m + get_grp_member_n( p%MESH, 'surf_grp', grp_id_name(i) )
3218  end do
3219 
3220  if (m == 0) then
3221  deallocate( grp_id_name )
3222  deallocate( value )
3223  deallocate( shink )
3224  return
3225  endif
3226 
3227  ! JP-13
3228  old_size = p%HEAT%H_SUF_tot
3229  new_size = old_size + m
3230  call fstr_expand_integer_array( p%HEAT%H_SUF_elem, old_size, new_size )
3231  call fstr_expand_integer_array2( p%HEAT%H_SUF_ampl, 2, old_size, new_size )
3232  call fstr_expand_integer_array( p%HEAT%H_SUF_surf, old_size, new_size )
3233  call fstr_expand_real_array2( p%HEAT%H_SUF_val, 2, old_size, new_size )
3234  p%HEAT%H_SUF_tot = new_size
3235 
3236  head = old_size + 1
3237  member1 => p%HEAT%H_SUF_elem(head:)
3238  member2 => p%HEAT%H_SUF_surf(head:)
3239  id = head
3240  do i = 1, n
3241  member_n = get_grp_member( p%MESH, 'surf_grp', grp_id_name(i), member1, member2 )
3242  if( i<n ) then
3243  member1 => member1( member_n+1 : )
3244  member2 => member2( member_n+1 : )
3245  end if
3246  do j = 1, member_n
3247  p%HEAT%H_SUF_val (id,1) = value(i)
3248  p%HEAT%H_SUF_val (id,2) = shink(i)
3249  p%HEAT%H_SUF_ampl (id,1) = amp_id1
3250  p%HEAT%H_SUF_ampl (id,2) = amp_id2
3251  id = id + 1
3252  end do
3253  end do
3254 
3255  deallocate( grp_id_name )
3256  deallocate( value )
3257  deallocate( shink )
3258  end subroutine fstr_setup_sfilm
3259 
3260 
3261  !-----------------------------------------------------------------------------!
3263  !-----------------------------------------------------------------------------!
3264 
3265 
3266  subroutine fstr_setup_radiate( ctrl, counter, P )
3267  implicit none
3268  integer(kind=kint) :: ctrl
3269  integer(kind=kint) :: counter
3270  type(fstr_param_pack) :: P
3271 
3272  integer(kind=kint) :: rcode
3273  character(HECMW_NAME_LEN) :: amp1, amp2
3274  integer(kind=kint) :: amp_id1, amp_id2
3275  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
3276  integer(kind=kint),pointer :: load_type(:)
3277  real(kind=kreal),pointer :: value(:)
3278  real(kind=kreal),pointer :: shink(:)
3279  integer(kind=kint) :: i, j, n, m, head, id, member_n, old_size, new_size
3280  integer(kind=kint),pointer :: member(:)
3281  integer(kind=kint) :: local_id, rtc
3282  ! ------------------------------------------------
3283 
3284  n = fstr_ctrl_get_data_line_n( ctrl )
3285  if( n == 0 ) return
3286 
3287  allocate( grp_id_name(n))
3288  allocate( load_type(n))
3289  allocate( value(n))
3290  allocate( shink(n))
3291 
3292  amp1 = ' '
3293  amp2 = ' '
3294  rcode = fstr_ctrl_get_radiate( ctrl, amp1, amp2, &
3295  grp_id_name, hecmw_name_len, load_type, value, shink )
3296  if( rcode /= 0 ) call fstr_ctrl_err_stop
3297 
3298  call amp_name_to_id( p%MESH, '!RADIATE', amp1, amp_id1 )
3299  call amp_name_to_id( p%MESH, '!RADIATE', amp2, amp_id2 )
3300 
3301  m = 0
3302  do i = 1, n
3303  rtc = get_local_member_index( p%MESH, 'element', grp_id_name(i), local_id )
3304  if( rtc > 0 ) then
3305  m = m + 1
3306  else if( rtc < 0 ) then
3307  m = m + get_grp_member_n( p%MESH, 'elem_grp', grp_id_name(i) )
3308  end if
3309  end do
3310 
3311  if (m == 0) then
3312  deallocate( grp_id_name )
3313  deallocate( load_type )
3314  deallocate( value )
3315  deallocate( shink )
3316  return
3317  endif
3318 
3319  ! JP-14
3320  old_size = p%HEAT%R_SUF_tot
3321  new_size = old_size + m
3322  call fstr_expand_integer_array( p%HEAT%R_SUF_elem, old_size, new_size )
3323  call fstr_expand_integer_array2( p%HEAT%R_SUF_ampl, 2, old_size, new_size )
3324  call fstr_expand_integer_array( p%HEAT%R_SUF_surf, old_size, new_size )
3325  call fstr_expand_real_array2( p%HEAT%R_SUF_val, 2, old_size, new_size )
3326  p%HEAT%R_SUF_tot = new_size
3327 
3328  head = old_size + 1
3329  member => p%HEAT%R_SUF_elem(head:)
3330  id = head
3331  do i = 1, n
3332  rtc = get_local_member_index( p%MESH, 'element', grp_id_name(i), local_id )
3333  if( rtc > 0 ) then
3334  member(1) = local_id
3335  member_n = 1
3336  else if( rtc < 0 ) then
3337  member_n = get_grp_member( p%MESH, 'elem_grp', grp_id_name(i), member )
3338  else
3339  cycle
3340  end if
3341  if( i<n ) member => member( member_n+1 : )
3342  do j = 1, member_n
3343  p%HEAT%R_SUF_surf (id) = load_type(i)
3344  p%HEAT%R_SUF_val (id,1) = value(i)
3345  p%HEAT%R_SUF_val (id,2) = shink(i)
3346  p%HEAT%R_SUF_ampl (id,1) = amp_id1
3347  p%HEAT%R_SUF_ampl (id,2) = amp_id2
3348  id = id + 1
3349  end do
3350  end do
3351 
3352  deallocate( grp_id_name )
3353  deallocate( load_type )
3354  deallocate( value )
3355  deallocate( shink )
3356  end subroutine fstr_setup_radiate
3357 
3358 
3359  !-----------------------------------------------------------------------------!
3361  !-----------------------------------------------------------------------------!
3362 
3363 
3364  subroutine fstr_setup_sradiate( ctrl, counter, P )
3365  implicit none
3366  integer(kind=kint) :: ctrl
3367  integer(kind=kint) :: counter
3368  type(fstr_param_pack) :: P
3369 
3370  integer(kind=kint) :: rcode
3371  character(HECMW_NAME_LEN) :: amp1, amp2
3372  integer(kind=kint) :: amp_id1, amp_id2
3373  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
3374  real(kind=kreal),pointer :: value(:)
3375  real(kind=kreal),pointer :: shink(:)
3376  integer(kind=kint) :: i, j, n, m, head, id, member_n, old_size, new_size
3377  integer(kind=kint),pointer :: member1(:), member2(:)
3378  ! ------------------------------------------------
3379 
3380  n = fstr_ctrl_get_data_line_n( ctrl )
3381  if( n == 0 ) return
3382 
3383  allocate( grp_id_name(n))
3384  allocate( value(n))
3385  allocate( shink(n))
3386 
3387  amp1 = ' '
3388  amp2 = ' '
3389  rcode = fstr_ctrl_get_sradiate( ctrl, amp1, amp2, grp_id_name, hecmw_name_len, value, shink )
3390  if( rcode /= 0 ) call fstr_ctrl_err_stop
3391 
3392  call amp_name_to_id( p%MESH, '!SRADIATE', amp1, amp_id1 )
3393  call amp_name_to_id( p%MESH, '!SRADIATE', amp2, amp_id2 )
3394 
3395  m = 0
3396  do i = 1, n
3397  m = m + get_grp_member_n( p%MESH, 'surf_grp', grp_id_name(i) )
3398  end do
3399 
3400  if (m == 0) then
3401  deallocate( grp_id_name )
3402  deallocate( value )
3403  deallocate( shink )
3404  return
3405  endif
3406 
3407  ! JP-15
3408  old_size = p%HEAT%R_SUF_tot
3409  new_size = old_size + m
3410  call fstr_expand_integer_array( p%HEAT%R_SUF_elem, old_size, new_size )
3411  call fstr_expand_integer_array2( p%HEAT%R_SUF_ampl, 2, old_size, new_size )
3412  call fstr_expand_integer_array( p%HEAT%R_SUF_surf, old_size, new_size )
3413  call fstr_expand_real_array2( p%HEAT%R_SUF_val, 2, old_size, new_size )
3414  p%HEAT%R_SUF_tot = new_size
3415 
3416  head = old_size + 1
3417  member1 => p%HEAT%R_SUF_elem(head:)
3418  member2 => p%HEAT%R_SUF_surf(head:)
3419  id = head
3420  do i = 1, n
3421  member_n = get_grp_member( p%MESH, 'surf_grp', grp_id_name(i), member1, member2 )
3422  if( i<n ) then
3423  member1 => member1( member_n+1 : )
3424  member2 => member2( member_n+1 : )
3425  end if
3426  do j = 1, member_n
3427  p%HEAT%R_SUF_val (id,1) = value(i)
3428  p%HEAT%R_SUF_val (id,2) = shink(i)
3429  p%HEAT%R_SUF_ampl (id,1) = amp_id1
3430  p%HEAT%R_SUF_ampl (id,2) = amp_id2
3431  id = id + 1
3432  end do
3433  end do
3434 
3435  deallocate( grp_id_name )
3436  deallocate( value )
3437  deallocate( shink )
3438  end subroutine fstr_setup_sradiate
3439 
3440 
3441  !*****************************************************************************!
3442  !* HEADERS FOR EIGEN ANALYSIS ************************************************!
3443  !*****************************************************************************!
3444 
3445  !-----------------------------------------------------------------------------!
3447  !-----------------------------------------------------------------------------!
3448 
3449  subroutine fstr_setup_eigen( ctrl, counter, P )
3450  implicit none
3451  integer(kind=kint) :: ctrl
3452  integer(kind=kint) :: counter
3453  type(fstr_param_pack) :: P
3454 
3455  integer(kind=kint) :: rcode
3456 
3457  rcode = fstr_ctrl_get_eigen( ctrl, p%EIGEN%nget, p%EIGEN%tolerance, p%EIGEN%maxiter)
3458  if( rcode /= 0) call fstr_ctrl_err_stop
3459 
3460  end subroutine fstr_setup_eigen
3461 
3462 
3463  !*****************************************************************************!
3464  !* HEADERS FOR DYNAMIC ANALYSIS **********************************************!
3465  !*****************************************************************************!
3466 
3467  !-----------------------------------------------------------------------------!
3469  !-----------------------------------------------------------------------------!
3470 
3471  subroutine fstr_setup_dynamic( ctrl, counter, P )
3472  implicit none
3473  integer(kind=kint) :: ctrl
3474  integer(kind=kint) :: counter
3475  type(fstr_param_pack) :: P
3476  integer(kind=kint) :: rcode
3477  character(HECMW_NAME_LEN) :: grp_id_name(1)
3478  integer(kind=kint) :: grp_id(1)
3479 
3480  rcode = fstr_ctrl_get_dynamic( ctrl, &
3481  p%PARAM%nlgeom, &
3482  p%DYN%idx_eqa, &
3483  p%DYN%idx_resp,&
3484  p%DYN%n_step, &
3485  p%DYN%t_start, &
3486  p%DYN%t_end, &
3487  p%DYN%t_delta, &
3488  p%DYN%ganma, &
3489  p%DYN%beta, &
3490  p%DYN%idx_mas, &
3491  p%DYN%idx_dmp, &
3492  p%DYN%ray_m, &
3493  p%DYN%ray_k, &
3494  p%DYN%nout, &
3495  grp_id_name(1), hecmw_name_len, &
3496  p%DYN%nout_monit, &
3497  p%DYN%iout_list )
3498 
3499  if( rcode /= 0) call fstr_ctrl_err_stop
3500 
3501  if (p%DYN%idx_resp == 1) then
3502  call node_grp_name_to_id_ex( p%MESH, '!DYNAMIC', 1, grp_id_name, grp_id)
3503  p%DYN%ngrp_monit = grp_id(1)
3504  else
3505  read(grp_id_name,*) p%DYN%ngrp_monit
3506  endif
3507 
3508  end subroutine fstr_setup_dynamic
3509 
3510 
3511  !-----------------------------------------------------------------------------!
3513  !-----------------------------------------------------------------------------!
3514 
3515  subroutine fstr_setup_velocity( ctrl, counter, P )
3516  implicit none
3517  integer(kind=kint) :: ctrl
3518  integer(kind=kint) :: counter
3519  type(fstr_param_pack) :: P
3520 
3521  integer(kind=kint) :: rcode
3522  integer(kind=kint) :: vType
3523  character(HECMW_NAME_LEN) :: amp
3524  integer(kind=kint) :: amp_id
3525  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
3526  integer(kind=kint),pointer :: dof_ids (:)
3527  integer(kind=kint),pointer :: dof_ide (:)
3528  real(kind=kreal),pointer :: val_ptr(:)
3529  integer(kind=kint) :: i, j, n, old_size, new_size
3530 
3531  n = fstr_ctrl_get_data_line_n( ctrl )
3532  if( n == 0 ) return
3533  old_size = p%SOLID%VELOCITY_ngrp_tot
3534  new_size = old_size + n
3535  p%SOLID%VELOCITY_ngrp_tot = new_size
3536 
3537  call fstr_expand_integer_array (p%SOLID%VELOCITY_ngrp_ID , old_size, new_size )
3538  call fstr_expand_integer_array (p%SOLID%VELOCITY_ngrp_type, old_size, new_size )
3539  call fstr_expand_real_array (p%SOLID%VELOCITY_ngrp_val , old_size, new_size )
3540  call fstr_expand_integer_array (p%SOLID%VELOCITY_ngrp_amp , old_size, new_size )
3541 
3542  allocate( grp_id_name(n))
3543  allocate( dof_ids(n))
3544  allocate( dof_ide(n))
3545 
3546  amp = ''
3547  val_ptr => p%SOLID%VELOCITY_ngrp_val(old_size+1:)
3548  val_ptr = 0
3549  rcode = fstr_ctrl_get_velocity( ctrl, vtype, amp, &
3550  grp_id_name, hecmw_name_len, &
3551  dof_ids, dof_ide, val_ptr )
3552  if( rcode /= 0 ) call fstr_ctrl_err_stop
3553  p%SOLID%VELOCITY_type = vtype
3554  if( vtype == kbcinitial ) p%DYN%VarInitialize = .true.
3555  call amp_name_to_id( p%MESH, '!VELOCITY', amp, amp_id )
3556  call node_grp_name_to_id_ex( p%MESH, '!VELOCITY', &
3557  n, grp_id_name, p%SOLID%VELOCITY_ngrp_ID(old_size+1:))
3558 
3559  j = old_size+1
3560  do i = 1, n
3561  if( (dof_ids(i) < 1).or.(6 < dof_ids(i)).or.(dof_ide(i) < 1).or.(6 < dof_ide(i)) ) then
3562  write(ilog,*) 'fstr control file error : !VELOCITY : range of dof_ids and dof_ide is from 1 to 6'
3563  stop
3564  end if
3565  p%SOLID%VELOCITY_ngrp_type(j) = 10 * dof_ids(i) + dof_ide(i)
3566  p%SOLID%VELOCITY_ngrp_amp(j) = amp_id
3567  j = j+1
3568  end do
3569 
3570  deallocate( grp_id_name )
3571  deallocate( dof_ids )
3572  deallocate( dof_ide )
3573 
3574  end subroutine fstr_setup_velocity
3575 
3576 
3577  !-----------------------------------------------------------------------------!
3579  !-----------------------------------------------------------------------------!
3580 
3581  subroutine fstr_setup_acceleration( ctrl, counter, P )
3582  implicit none
3583  integer(kind=kint) :: ctrl
3584  integer(kind=kint) :: counter
3585  type(fstr_param_pack) :: P
3586 
3587  integer(kind=kint) :: rcode
3588  integer(kind=kint) :: aType
3589  character(HECMW_NAME_LEN) :: amp
3590  integer(kind=kint) :: amp_id
3591  character(HECMW_NAME_LEN), pointer :: grp_id_name(:)
3592  integer(kind=kint),pointer :: dof_ids (:)
3593  integer(kind=kint),pointer :: dof_ide (:)
3594  real(kind=kreal),pointer :: val_ptr(:)
3595  integer(kind=kint) :: i, j, n, old_size, new_size
3596 
3597 
3598  n = fstr_ctrl_get_data_line_n( ctrl )
3599  if( n == 0 ) return
3600  old_size = p%SOLID%ACCELERATION_ngrp_tot
3601  new_size = old_size + n
3602  p%SOLID%ACCELERATION_ngrp_tot = new_size
3603 
3604  call fstr_expand_integer_array (p%SOLID%ACCELERATION_ngrp_ID , old_size, new_size )
3605  call fstr_expand_integer_array (p%SOLID%ACCELERATION_ngrp_type, old_size, new_size )
3606  call fstr_expand_real_array (p%SOLID%ACCELERATION_ngrp_val , old_size, new_size )
3607  call fstr_expand_integer_array (p%SOLID%ACCELERATION_ngrp_amp , old_size, new_size )
3608 
3609  allocate( grp_id_name(n))
3610  allocate( dof_ids(n))
3611  allocate( dof_ide(n))
3612 
3613  amp = ' '
3614  val_ptr => p%SOLID%ACCELERATION_ngrp_val(old_size+1:)
3615  val_ptr = 0
3616  rcode = fstr_ctrl_get_acceleration( ctrl, atype, amp, &
3617  grp_id_name, hecmw_name_len, &
3618  dof_ids, dof_ide, val_ptr)
3619  if( rcode /= 0 ) call fstr_ctrl_err_stop
3620  p%SOLID%ACCELERATION_type = atype
3621  if( atype == kbcinitial )p%DYN%VarInitialize = .true.
3622  call amp_name_to_id( p%MESH, '!ACCELERATION', amp, amp_id )
3623  call node_grp_name_to_id_ex( p%MESH, '!ACCELERATION', &
3624  n, grp_id_name, p%SOLID%ACCELERATION_ngrp_ID(old_size+1:))
3625 
3626  j = old_size+1
3627  do i = 1, n
3628  if( (dof_ids(i) < 1).or.(6 < dof_ids(i)).or.(dof_ide(i) < 1).or.(6 < dof_ide(i)) ) then
3629  write(ilog,*) 'fstr control file error : !ACCELERATION : range of dof_ids and dof_ide is from 1 to 6'
3630  stop
3631  end if
3632  p%SOLID%ACCELERATION_ngrp_type(j) = 10 * dof_ids(i) + dof_ide(i)
3633  p%SOLID%ACCELERATION_ngrp_amp(j) = amp_id
3634  j = j+1
3635  end do
3636 
3637  deallocate( grp_id_name )
3638  deallocate( dof_ids )
3639  deallocate( dof_ide )
3640  end subroutine fstr_setup_acceleration
3641 
3642 
3643  !*****************************************************************************!
3644  !* MPC ***********************************************************************!
3645  !*****************************************************************************!
3646 
3647  !-----------------------------------------------------------------------------!
3649  !-----------------------------------------------------------------------------!
3650 
3651  subroutine fstr_setup_mpc( ctrl, counter, P )
3652  implicit none
3653  integer(kind=kint) :: ctrl
3654  integer(kind=kint) :: counter
3655  type(fstr_param_pack), target :: P
3656 
3657  integer(kind=kint) :: rcode
3658  ! integer(kind=kint) :: type
3659  ! integer(kind=kint),pointer :: node1_ptr(:)
3660  ! integer(kind=kint),pointer :: node2_ptr(:)
3661  ! integer(kind=kint),pointer :: dof_ptr(:)
3662  ! integer(kind=kint) :: n, old_size, new_size
3663  !
3664  ! rcode = fstr_ctrl_get_param_ex( ctrl, 'TYPE ', 'RIGID ', 1, 'P', type )
3665  ! if( rcode < 0 ) call fstr_ctrl_err_stop
3666  !
3667  ! n = fstr_ctrl_get_data_line_n( ctrl )
3668  ! if( n == 0 ) return
3669  ! old_size = P%MPC_RD%nmpc
3670  ! new_size = old_size + n
3671  ! P%MPC_RD%nmpc = new_size
3672  !
3673  ! call fstr_expand_integer_array ( P%MPC_RD%node1, old_size, new_size )
3674  ! call fstr_expand_integer_array ( P%MPC_RD%node2, old_size, new_size )
3675  ! call fstr_expand_integer_array ( P%MPC_RD%dof, old_size, new_size )
3676  !
3677  ! node1_ptr => P%MPC_RD%node1(old_size+1:)
3678  ! node2_ptr => P%MPC_RD%node2(old_size+1:)
3679  ! dof_ptr => P%MPC_RD%dof(old_size+1:)
3680  !
3681  ! rcode = fstr_ctrl_get_MPC( ctrl, type, node1_ptr, node2_ptr, dof_ptr )
3682  ! if( rcode /= 0 ) call fstr_ctrl_err_stop
3683  !
3684  ! if( node_global_to_local( P%MESH, node1_ptr, n ) /= n ) then
3685  ! call fstr_setup_util_err_stop( '### Error : not exist node (!MPC)' )
3686  ! endif
3687  ! if( node_global_to_local( P%MESH, node2_ptr, n ) /= n ) then
3688  ! call fstr_setup_util_err_stop( '### Error : not exist node (!MPC)' )
3689  ! endif
3690 
3691  ! penalty => svRarray(11)
3692  rcode = fstr_ctrl_get_mpc( ctrl, svrarray(11))
3693  if( rcode /= 0) call fstr_ctrl_err_stop
3694  end subroutine fstr_setup_mpc
3695 
3696 
3697  !*****************************************************************************!
3698  !* IMPORTING NASTRAN BOUNDARY CONDITIONS *************************************!
3699  !*****************************************************************************!
3700 
3701  subroutine fstr_setup_solid_nastran( ctrl, hecMESH, fstrSOLID )
3702  implicit none
3703  integer(kind=kint) :: ctrl
3704  type (hecmwST_local_mesh) :: hecMESH
3705  type (fstr_solid ) :: fstrSOLID
3706  write(ilog,*) '### Error : In !BOUNDARY, TYPE=NASTRAN is not supported.'
3707  call hecmw_abort( hecmw_comm_get_comm())
3708  end subroutine fstr_setup_solid_nastran
3709 
3710  !-----------------------------------------------------------------------------!
3712  !-----------------------------------------------------------------------------!
3713 
3714  subroutine fstr_setup_contactalgo( ctrl, P )
3715  implicit none
3716  integer(kind=kint) :: ctrl
3717  ! integer(kind=kint) :: counter
3718  type(fstr_param_pack) :: P
3719 
3720  integer(kind=kint) :: rcode
3721 
3722 
3723  rcode = fstr_ctrl_get_contactalgo( ctrl, p%PARAM%contact_algo )
3724  if( rcode /= 0 ) call fstr_ctrl_err_stop
3725 
3726  end subroutine fstr_setup_contactalgo
3727 
3728  !-----------------------------------------------------------------------------!
3730  !-----------------------------------------------------------------------------!
3731 
3732  subroutine fstr_setup_output_sstype( ctrl, P )
3733  implicit none
3734  integer(kind=kint) :: ctrl
3735  type(fstr_param_pack) :: P
3736 
3737  integer(kind=kint) :: rcode, nid
3738  character(len=HECMW_NAME_LEN) :: data_fmt
3739 
3740  data_fmt = 'SOLUTION,MATERIAL '
3741  rcode = fstr_ctrl_get_param_ex( ctrl, 'TYPE ', data_fmt, 0, 'P', nid )
3742  opsstype = nid
3743  if( rcode /= 0 ) call fstr_ctrl_err_stop
3744 
3745  end subroutine fstr_setup_output_sstype
3746 
3747  !-----------------------------------------------------------------------------!
3749  !-----------------------------------------------------------------------------!
3750 
3751  subroutine fstr_convert_contact_type( hecMESH )
3752  implicit none
3753  type(hecmwst_local_mesh), pointer :: hecMESH
3754  integer(kind=kint) :: n, i, sgrp_id, ngrp_id, ngrp_id2
3755  ! convert SURF_SURF to NODE_SURF
3756  n = hecmesh%contact_pair%n_pair
3757  do i = 1,n
3758  if( hecmesh%contact_pair%type(i) /= hecmw_contact_type_surf_surf ) cycle
3759  sgrp_id = hecmesh%contact_pair%slave_grp_id(i)
3760  call append_node_grp_from_surf_grp( hecmesh, sgrp_id, ngrp_id )
3761  ! change type of contact and slave group ID
3762  hecmesh%contact_pair%type(i) = hecmw_contact_type_node_surf
3763  hecmesh%contact_pair%slave_grp_id(i) = ngrp_id
3764  ! ! for DEBUG
3765  ! sgrp_id = hecMESH%contact_pair%master_grp_id(i)
3766  ! call append_node_grp_from_surf_grp( hecMESH, sgrp_id, ngrp_id2 )
3767  ! ! intersection node group of slave and master
3768  ! call append_intersection_node_grp( hecMESH, ngrp_id, ngrp_id2 )
3769  ! ! intersection node_group of original slave and patch-slave
3770  ! ngrp_id=get_grp_id( hecMESH, 'node_grp', 'SLAVE' )
3771  ! ngrp_id2=get_grp_id( hecMESH, 'node_grp', '_PT_SLAVE_S' )
3772  ! call append_intersection_node_grp( hecMESH, ngrp_id, ngrp_id2 )
3773  enddo
3774  end subroutine fstr_convert_contact_type
3775 
3776 end module m_fstr_setup
m_out::fstr_copy_outctrl
subroutine fstr_copy_outctrl(outctrl1, outctrl2)
Definition: m_out.f90:233
m_fstr_setup::fstr_setup_solid_nastran
subroutine fstr_setup_solid_nastran(ctrl, hecMESH, fstrSOLID)
Definition: fstr_setup.f90:3702
m_fstr_setup::fstr_smoothed_element_calcmaxcon
subroutine fstr_smoothed_element_calcmaxcon(hecMESH, fstrSOLID)
Definition: fstr_setup.f90:1170
m_fstr_setup::fstr_setup_heat
subroutine fstr_setup_heat(ctrl, counter, P)
Read in !HEAT !
Definition: fstr_setup.f90:2678
fstr_ctrl_common::fstr_ctrl_get_contactparam
integer(kind=kint) function fstr_ctrl_get_contactparam(ctrl, contactparam)
Read in !CONTACT_PARAM !
Definition: fstr_ctrl_common.f90:645
m_fstr_setup::fstr_solid_alloc
subroutine fstr_solid_alloc(hecMESH, fstrSOLID)
Initializer of structure fstr_solid.
Definition: fstr_setup.f90:1039
fstr_ctrl_eigen::fstr_ctrl_get_eigen
integer(kind=kint) function fstr_ctrl_get_eigen(ctrl, nget, tolerance, maxiter)
Read in !EIGEN (struct)
Definition: fstr_ctrl_eigen.f90:34
mmaterial::m_exapnsion
integer(kind=kint), parameter m_exapnsion
Definition: material.f90:105
m_out
This module manages step information.
Definition: m_out.f90:6
fstr_setup_util::get_local_member_index
integer(kind=kint) function get_local_member_index(hecMESH, type_name, name, local_id)
Definition: fstr_setup_util.f90:516
fstr_setup_util::fstr_expand_integer_array2
subroutine fstr_expand_integer_array2(array, column, old_size, new_size)
Definition: fstr_setup_util.f90:1257
m_fstr_setup::fstr_setup_film
subroutine fstr_setup_film(ctrl, counter, P)
Read in !FILM !
Definition: fstr_setup.f90:3085
fstr_ctrl_heat
This module contains control file data obtaining functions for heat conductive analysis.
Definition: fstr_ctrl_heat.f90:6
fstr_ctrl_heat::fstr_ctrl_get_dflux
integer(kind=kint) function fstr_ctrl_get_dflux(ctrl, amp, elem_grp_name, elem_grp_name_len, load_type, value)
Read in !DFLUX (heat)
Definition: fstr_ctrl_heat.f90:120
m_fstr_setup::fstr_setup_dload
subroutine fstr_setup_dload(ctrl, counter, P)
Read in !DLOAD.
Definition: fstr_setup.f90:2479
mmaterial::m_beam_angle1
integer(kind=kint), parameter m_beam_angle1
Definition: material.f90:110
elementinfo::numofquadpoints
integer function numofquadpoints(fetype)
Obtains the number of quadrature points of the element.
Definition: element.f90:450
fstr_ctrl_dynamic::fstr_ctrl_get_velocity
integer(kind=kint) function fstr_ctrl_get_velocity(ctrl, vType, amp, node_id, node_id_len, dof_ids, dof_ide, value)
Read in !VELOCITY.
Definition: fstr_ctrl_dynamic.f90:50
mmaterial::m_density
integer(kind=kint), parameter m_density
Definition: material.f90:94
fstr_ctrl_material::fstr_ctrl_get_density
integer function fstr_ctrl_get_density(ctrl, matval)
Read in !DENSITY.
Definition: fstr_ctrl_material.f90:609
fstr_ctrl_common::fstr_ctrl_get_amplitude
integer(kind=kint) function fstr_ctrl_get_amplitude(ctrl, nline, name, type_def, type_time, type_val, n, val, table)
Read in !AMPLITUDE.
Definition: fstr_ctrl_common.f90:863
m_fstr_setup::fstr_eigen_init
subroutine fstr_eigen_init(fstrEIG)
Initial setting of eigen ca;culation.
Definition: fstr_setup.f90:1541
m_fstr_setup::fstr_setup_restart
subroutine fstr_setup_restart(ctrl, nout, version)
Read in !RESTART !
Definition: fstr_setup.f90:2128
m_fstr::kon
integer(kind=kint), parameter kon
Definition: m_fstr.f90:32
m_fstr_setup::fstr_setup_write
subroutine fstr_setup_write(ctrl, counter, P)
Read in !WRITE !
Definition: fstr_setup.f90:2089
fstr_ctrl_common::fstr_ctrl_get_solver
integer(kind=kint) function fstr_ctrl_get_solver(ctrl, method, precond, nset, iterlog, timelog, steplog, nier, iterpremax, nrest, nBFGS, scaling, dumptype, dumpexit, usejad, ncolor_in, mpc_method, estcond, method2, recyclepre, solver_opt, contact_elim, resid, singma_diag, sigma, thresh, filter)
Read in !SOLVER.
Definition: fstr_ctrl_common.f90:89
m_utilities
This module provides aux functions.
Definition: utilities.f90:6
mcontact::cgn
real(kind=kreal), save cgn
convergent condition of penetration
Definition: fstr_contact.f90:21
fstr_ctrl_common
This module contains fstr control file data obtaining functions.
Definition: fstr_ctrl_common.f90:7
m_fstr::kel361fi
integer(kind=kint), parameter kel361fi
Definition: m_fstr.f90:77
fstr_setup_util::append_node_grp_from_surf_grp
subroutine append_node_grp_from_surf_grp(hecMESH, sgrp_id, ngrp_id)
Definition: fstr_setup_util.f90:325
fstr_setup_util::fstr_expand_real_array
subroutine fstr_expand_real_array(array, old_size, new_size)
Definition: fstr_setup_util.f90:1228
mmaterial::m_beam_angle4
integer(kind=kint), parameter m_beam_angle4
Definition: material.f90:113
m_fstr_setup::fstr_setup_spring
subroutine fstr_setup_spring(ctrl, counter, P)
Read in !SPRING !
Definition: fstr_setup.f90:2603
fstr_setup_util::fstr_expand_real_array2
subroutine fstr_expand_real_array2(array, column, old_size, new_size)
Definition: fstr_setup_util.f90:1292
fstr_ctrl_common::fstr_ctrl_get_mpc
integer(kind=kint) function fstr_ctrl_get_mpc(ctrl, penalty)
Read in !MPC.
Definition: fstr_ctrl_common.f90:450
m_fstr_setup
This module provides functions to read in data from control file and do necessary preparation for fol...
Definition: fstr_setup.f90:7
fstr_ctrl_material::fstr_ctrl_get_hyperelastic
integer function fstr_ctrl_get_hyperelastic(ctrl, mattype, nlgeom, matval)
Read in !HYPERELASTIC.
Definition: fstr_ctrl_material.f90:165
fstr_ctrl_heat::fstr_ctrl_get_film
integer(kind=kint) function fstr_ctrl_get_film(ctrl, amp1, amp2, elem_grp_name, elem_grp_name_len, load_type, value, sink)
Read in !FILM (heat)
Definition: fstr_ctrl_heat.f90:217
m_fstr_setup::fstr_setup_reftemp
subroutine fstr_setup_reftemp(ctrl, counter, P)
Read in !REFTEMP !
Definition: fstr_setup.f90:2656
m_fstr::myrank
integer(kind=kint) myrank
PARALLEL EXECUTION.
Definition: m_fstr.f90:96
fstr_ctrl_heat::fstr_ctrl_get_weldline
integer(kind=kint) function fstr_ctrl_get_weldline(ctrl, hecMESH, grp_name_len, weldline)
Read in !WELD_LINE (heat)
Definition: fstr_ctrl_heat.f90:424
m_fstr::fstr_eigen
Package of data used by Lanczos eigenvalue solver.
Definition: m_fstr.f90:593
m_fstr::kststaticeigen
integer(kind=kint), parameter kststaticeigen
Definition: m_fstr.f90:42
mcontactparam::init_contactparam
subroutine, public init_contactparam(cparam)
Definition: fstr_contact_param.f90:34
mmaterial::initmaterial
subroutine initmaterial(material)
Initializer.
Definition: material.f90:188
m_fstr::itmax
integer(kind=kint) itmax
Definition: m_fstr.f90:141
m_fstr_setup::fstr_setup_eigen
subroutine fstr_setup_eigen(ctrl, counter, P)
Read in !EIGEN !
Definition: fstr_setup.f90:3450
fstr_ctrl_close
int fstr_ctrl_close(int *ctrl)
Definition: fstr_ctrl_util.c:1757
fstr_setup_util::fstr_strupr
subroutine fstr_strupr(s)
Definition: fstr_setup_util.f90:58
m_fstr::fstr_heat
Data for HEAT ANSLYSIS (fstrHEAT)
Definition: m_fstr.f90:425
m_fstr_setup::fstr_setup_boundary
subroutine fstr_setup_boundary(ctrl, counter, P)
Read in !BOUNDARY !
Definition: fstr_setup.f90:2261
fstr_setup_util::dload_grp_name_to_id_ex
subroutine dload_grp_name_to_id_ex(hecMESH, n, grp_id_name, fg_surface, grp_ID)
Definition: fstr_setup_util.f90:936
fstr_ctrl_heat::fstr_ctrl_get_sfilm
integer(kind=kint) function fstr_ctrl_get_sfilm(ctrl, amp1, amp2, surface_grp_name, surface_grp_name_len, value, sink)
Read in !SFILM (heat)
Definition: fstr_ctrl_heat.f90:288
fstr_ctrl_static::fstr_ctrl_get_spring
integer(kind=kint) function fstr_ctrl_get_spring(ctrl, amp, node_id, node_id_len, dof_id, value)
Read in !SPRING.
Definition: fstr_ctrl_static.f90:270
m_fstr_setup::fstr_setup_fixtemp
subroutine fstr_setup_fixtemp(ctrl, counter, P)
Read in !FIXTEMP !
Definition: fstr_setup.f90:2748
mmaterial::m_beam_angle2
integer(kind=kint), parameter m_beam_angle2
Definition: material.f90:111
m_fstr_setup::fstr_setup_nonlinear_solver
subroutine fstr_setup_nonlinear_solver(ctrl, counter, P)
Read in !NONLINEAR_SOLVER !
Definition: fstr_setup.f90:1830
fstr_ctrl_static::fstr_ctrl_get_static
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.
Definition: fstr_ctrl_static.f90:40
fstr_setup_util::reallocate_real
subroutine reallocate_real(array, n)
Definition: fstr_setup_util.f90:1451
mmaterial::m_youngs
integer(kind=kint), parameter m_youngs
Definition: material.f90:92
m_fstr::kbcinitial
integer(kind=kint), parameter kbcinitial
Definition: m_fstr.f90:66
fstr_ctrl_static::fstr_ctrl_get_dload
integer(kind=kint) function fstr_ctrl_get_dload(ctrl, amp, follow, element_id, element_id_len, load_type, params)
Read in !DLOAD.
Definition: fstr_ctrl_static.f90:127
m_fstr_setup::fstr_setup_amplitude
subroutine fstr_setup_amplitude(ctrl, P)
Read in !AMPLITUDE !
Definition: fstr_setup.f90:2187
fstr_ctrl_common::fstr_ctrl_get_embed
logical function fstr_ctrl_get_embed(ctrl, n, embed, cpname)
Read in contact definition.
Definition: fstr_ctrl_common.f90:605
fstr_ctrl_material::fstr_ctrl_get_expansion_coeff
integer function fstr_ctrl_get_expansion_coeff(ctrl, matval, dict)
Read in !EXPANSION_COEFF.
Definition: fstr_ctrl_material.f90:640
fstr_setup_fload
subroutine fstr_setup_fload(ctrl, counter, P)
This source file contains subroutine for reading control data for harmonic response analysis (this im...
Definition: fstr_ctrl_freq.f90:12
m_out::t_output_ctrl
output control such as output filename, output frequency etc.
Definition: m_out.f90:29
m_fstr_setup::fstr_setup_solution
subroutine fstr_setup_solution(ctrl, counter, P)
Read in !SOLUTION !
Definition: fstr_setup.f90:1813
m_fstr::fstr_solid
Definition: m_fstr.f90:238
fstr_setup_util::fstr_streqr
logical function fstr_streqr(s1, s2)
Definition: fstr_setup_util.f90:72
mcontactparam
This module manage the parameters for contact calculation.
Definition: fstr_contact_param.f90:7
mmaterial::m_poisson
integer(kind=kint), parameter m_poisson
Definition: material.f90:93
mcontact::cdotp
real(kind=kreal), save cdotp
mu=cdotp*maxval
Definition: fstr_contact.f90:19
m_fstr::fstr_dynamic
Data for DYNAMIC ANSLYSIS (fstrDYNAMIC)
Definition: m_fstr.f90:504
fstr_ctrl_common::fstr_ctrl_get_solution
integer(kind=kint) function fstr_ctrl_get_solution(ctrl, type, nlgeom)
Read in !SOLUTION.
Definition: fstr_ctrl_common.f90:40
mmaterial::m_alpha_over_mu
integer(kind=kint), parameter m_alpha_over_mu
Definition: material.f90:107
m_fstr_setup::fstr_setup_sradiate
subroutine fstr_setup_sradiate(ctrl, counter, P)
Read in !SRADIATE !
Definition: fstr_setup.f90:3365
m_fstr_setup::fstr_expand_dload_array
subroutine fstr_expand_dload_array(array, old_size, new_size)
Read !FLOAD !
Definition: fstr_setup.f90:2450
m_fstr::idbg
integer(kind=kint), parameter idbg
Definition: m_fstr.f90:111
m_fstr_setup::fstr_dynamic_alloc
subroutine fstr_dynamic_alloc(hecMESH, fstrDYNAMIC)
Initial setting of dynamic calculation.
Definition: fstr_setup.f90:1585
m_fstr::fstr_param
FSTR INNER CONTROL PARAMETERS (fstrPARAM)
Definition: m_fstr.f90:154
fstr_ctrl_static::fstr_ctrl_get_cload
integer(kind=kint) function fstr_ctrl_get_cload(ctrl, amp, node_id, node_id_len, dof_id, value)
Read in !CLOAD.
Definition: fstr_ctrl_static.f90:100
mmaterial::viscoelastic
integer(kind=kint), parameter viscoelastic
Definition: material.f90:77
fstr_setup_util::node_grp_name_to_id_ex
subroutine node_grp_name_to_id_ex(hecMESH, header_name, n, grp_id_name, grp_ID)
Definition: fstr_setup_util.f90:734
m_fstr::kel341fi
integer(kind=kint), parameter kel341fi
section control
Definition: m_fstr.f90:74
m_fstr::opsstype
integer(kind=kint) opsstype
Definition: m_fstr.f90:132
fstr_ctrl_get_c_h_name
int fstr_ctrl_get_c_h_name(int *ctrl, char *header_name, int *buff_size)
Definition: fstr_ctrl_util.c:1272
m_fstr_setup::fstr_setup_velocity
subroutine fstr_setup_velocity(ctrl, counter, P)
Read in !VELOCITY !
Definition: fstr_setup.f90:3516
m_fstr_setup::fstr_setup_dynamic
subroutine fstr_setup_dynamic(ctrl, counter, P)
Read in !DYNAMIC !
Definition: fstr_setup.f90:3472
m_fstr_setup::fstr_setup
subroutine fstr_setup(cntl_filename, hecMESH, fstrPARAM, fstrSOLID, fstrEIG, fstrHEAT, fstrDYNAMIC, fstrCPL, fstrFREQ)
Read in and initialize control data !
Definition: fstr_setup.f90:45
m_out::fstr_init_outctrl
subroutine fstr_init_outctrl(outctrl)
Definition: m_out.f90:225
m_fstr_setup::fstr_dynamic_init
subroutine fstr_dynamic_init(fstrDYNAMIC)
Initial setting of dynamic calculation.
Definition: fstr_setup.f90:1554
m_fstr::eps
real(kind=kreal) eps
Definition: m_fstr.f90:142
fstr_ctrl_heat::fstr_ctrl_get_heat
integer(kind=kint) function fstr_ctrl_get_heat(ctrl, dt, etime, dtmin, deltmx, itmax, eps, tpname, beta)
Read in !HEAT.
Definition: fstr_ctrl_heat.f90:36
mmechgauss
This modules defines a structure to record history dependent parameter in static analysis.
Definition: mechgauss.f90:6
mmaterial::elastic
integer(kind=kint), parameter elastic
Definition: material.f90:65
fstr_ctrl_material::fstr_ctrl_get_usermaterial
integer function fstr_ctrl_get_usermaterial(ctrl, mattype, nlgeom, nstatus, matval)
Read in !USER_MATERIAL.
Definition: fstr_ctrl_material.f90:32
fstr_ctrl_open
int fstr_ctrl_open(char *filename)
Definition: fstr_ctrl_util.c:1106
m_fstr::fstr_freqanalysis
Definition: m_fstr.f90:571
m_fstr::kel341sesns
integer(kind=kint), parameter kel341sesns
Definition: m_fstr.f90:75
mmaterial::m_beam_angle6
integer(kind=kint), parameter m_beam_angle6
Definition: material.f90:115
m_fstr::kcaalagrange
integer(kind=kint), parameter kcaalagrange
Definition: m_fstr.f90:60
m_out::fstr_ctrl_get_output
subroutine fstr_ctrl_get_output(ctrl, outctrl, islog, res, visual, femap)
Definition: m_out.f90:256
m_fstr::dt
real(kind=kreal) dt
ANALYSIS CONTROL for NLGEOM and HEAT.
Definition: m_fstr.f90:139
fstr_ctrl_common::fstr_ctrl_get_section
integer function fstr_ctrl_get_section(ctrl, hecMESH, sections)
Read in !SECTION.
Definition: fstr_ctrl_common.f90:336
m_fstr::kststatic
integer(kind=kint), parameter kststatic
Definition: m_fstr.f90:37
fstr_ctrl_common::fstr_ctrl_get_contactalgo
integer(kind=kint) function fstr_ctrl_get_contactalgo(ctrl, algo)
Read in !CONTACT.
Definition: fstr_ctrl_common.f90:525
fstr_ctrl_dynamic
This module contains control file data obtaining functions for dynamic analysis.
Definition: fstr_ctrl_dynamic.f90:7
fstr_ctrl_eigen
This module contains control file data obtaining functions for dynamic analysis.
Definition: fstr_ctrl_eigen.f90:7
fstr_ctrl_material::fstr_ctrl_get_spring_d
integer function fstr_ctrl_get_spring_d(ctrl, mattype, nlgeom, matval_i, dict)
Read in !SPRING_D.
Definition: fstr_ctrl_material.f90:787
fstr_ctrl_static::fstr_ctrl_get_boundary
integer(kind=kint) function fstr_ctrl_get_boundary(ctrl, amp, node_id, node_id_len, dof_ids, dof_ide, value)
Read in !BOUNDARY.
Definition: fstr_ctrl_static.f90:71
m_fstr
This module defines common data and basic structures for analysis.
Definition: m_fstr.f90:15
m_fstr::tinitialcondition
Definition: m_fstr.f90:144
fstr_ctrl_seek_next_header
int fstr_ctrl_seek_next_header(int *ctrl)
Definition: fstr_ctrl_util.c:1246
fstr_ctrl_static
This module contains control file data obtaining functions for static analysis.
Definition: fstr_ctrl_static.f90:6
fstr_ctrl_material::fstr_ctrl_get_spring_a
integer function fstr_ctrl_get_spring_a(ctrl, mattype, nlgeom, matval_i, dict)
Read in !SPRING_A.
Definition: fstr_ctrl_material.f90:838
m_fstr::ref_temp
real(kind=kreal), pointer ref_temp
REFTEMP.
Definition: m_fstr.f90:136
m_fstr_setup::fstr_setup_post_phys_alloc
subroutine fstr_setup_post_phys_alloc(phys, NDOF, n_node, n_elem)
Initial setting of postprecessor.
Definition: fstr_setup.f90:1719
m_fstr_setup::fstr_setup_couple
subroutine fstr_setup_couple(ctrl, counter, P)
Read in !COUPLE !
Definition: fstr_setup.f90:2148
fstr_ctrl_heat::fstr_ctrl_get_radiate
integer(kind=kint) function fstr_ctrl_get_radiate(ctrl, amp1, amp2, elem_grp_name, elem_grp_name_len, load_type, value, sink)
Read in !RADIATE (heat)
Definition: fstr_ctrl_heat.f90:320
fstr_ctrl_get_data_line_n
int fstr_ctrl_get_data_line_n(int *ctrl)
Definition: fstr_ctrl_util.c:1462
m_fstr::g_initialcnd
type(tinitialcondition), dimension(:), pointer, save g_initialcnd
Definition: m_fstr.f90:151
mcontact::cgt
real(kind=kreal), save cgt
convergent condition of relative tangent disp
Definition: fstr_contact.f90:22
m_fstr::fstr_couple
Data for coupling analysis.
Definition: m_fstr.f90:611
fstr_setup_util::amp_name_to_id
subroutine amp_name_to_id(hecMESH, header_name, aname, id)
Definition: fstr_setup_util.f90:1078
mmaterial::m_thick
integer(kind=kint), parameter m_thick
Definition: material.f90:95
mmaterial::m_beam_angle5
integer(kind=kint), parameter m_beam_angle5
Definition: material.f90:114
m_fstr::fstr_solid_physic_val
Data for STATIC ANSLYSIS (fstrSOLID)
Definition: m_fstr.f90:211
m_static_get_prop::fstr_get_prop
subroutine fstr_get_prop(hecMESH, shell_var, isect, ee, pp, rho, alpha, thick, n_totlyr, alpha_over_mu, beam_radius, beam_angle1, beam_angle2, beam_angle3, beam_angle4, beam_angle5, beam_angle6)
Definition: fstr_get_prop.f90:16
fstr_ctrl_common::fstr_ctrl_get_contact
logical function fstr_ctrl_get_contact(ctrl, n, contact, np, tp, ntol, ttol, ctAlgo, cpname)
Read in contact definition.
Definition: fstr_ctrl_common.f90:539
m_step::setup_stepinfo_starttime
subroutine setup_stepinfo_starttime(stepinfos)
Definition: m_step.f90:88
fstr_ctrl_heat::fstr_ctrl_get_fixtemp
integer(kind=kint) function fstr_ctrl_get_fixtemp(ctrl, amp, node_grp_name, node_grp_name_len, value)
Read in !FIXTEMP.
Definition: fstr_ctrl_heat.f90:67
fstr_ctrl_heat::fstr_ctrl_get_sradiate
integer(kind=kint) function fstr_ctrl_get_sradiate(ctrl, amp1, amp2, surface_grp_name, surface_grp_name_len, value, sink)
Read in !SRADIATE (heat)
Definition: fstr_ctrl_heat.f90:391
fstr_ctrl_common::fstr_ctrl_get_outitem
logical function fstr_ctrl_get_outitem(ctrl, hecMESH, outinfo)
Read in !OUTPUT_RES & !OUTPUT_VIS.
Definition: fstr_ctrl_common.f90:466
m_fstr::kstheat
integer(kind=kint), parameter kstheat
Definition: m_fstr.f90:39
m_fstr_setup::fstr_setup_cload
subroutine fstr_setup_cload(ctrl, counter, P)
Read in !CLOAD !
Definition: fstr_setup.f90:2371
m_fstr_setup::fstr_solid_finalize
subroutine fstr_solid_finalize(fstrSOLID)
Finalizer of fstr_solid.
Definition: fstr_setup.f90:1268
m_fstr_setup::fstr_setup_output_sstype
subroutine fstr_setup_output_sstype(ctrl, P)
Read in !OUTPUT_SSTYPE !
Definition: fstr_setup.f90:3733
fstr_setup_util::fstr_expand_integer_array
subroutine fstr_expand_integer_array(array, old_size, new_size)
Definition: fstr_setup_util.f90:1200
m_fstr::ksteigen
integer(kind=kint), parameter ksteigen
Definition: m_fstr.f90:38
fstr_ctrl_common::fstr_ctrl_get_timepoints
integer(kind=kint) function fstr_ctrl_get_timepoints(ctrl, tp)
Read in !TIME_POINTS.
Definition: fstr_ctrl_common.f90:820
elementinfo
This module encapsulate the basic functions of all elements provide by this software.
Definition: element.f90:43
fstr_ctrl_material::fstr_ctrl_get_elasticity
integer function fstr_ctrl_get_elasticity(ctrl, mattype, nlgeom, matval, dict)
Read in !ELASTIC.
Definition: fstr_ctrl_material.f90:56
mmaterial::m_beam_radius
integer(kind=kint), parameter m_beam_radius
Definition: material.f90:109
fstr_ctrl_static::fstr_ctrl_get_userload
integer function fstr_ctrl_get_userload(ctrl)
Read in !ULOAD.
Definition: fstr_ctrl_static.f90:296
m_fstr_setup::fstr_setup_acceleration
subroutine fstr_setup_acceleration(ctrl, counter, P)
Read in !ACCELERATION !
Definition: fstr_setup.f90:3582
fstr_ctrl_common::fstr_ctrl_get_step
integer(kind=kint) function fstr_ctrl_get_step(ctrl, amp, iproc)
Read in !STEP.
Definition: fstr_ctrl_common.f90:204
m_fstr_setup::fstr_setup_initial
integer(kind=kint) function fstr_setup_initial(ctrl, cond, hecMESH)
Definition: fstr_setup.f90:2010
fstr_ctrl_common::fstr_ctrl_get_couple
integer(kind=kint) function fstr_ctrl_get_couple(ctrl, fg_type, fg_first, fg_window, surf_id, surf_id_len)
Read in !COUPLE.
Definition: fstr_ctrl_common.f90:424
m_fstr_setup::fstr_setup_orientation
integer function fstr_setup_orientation(ctrl, hecMESH, cnt, coordsys)
Read in !ORIENTATION.
Definition: fstr_setup.f90:1909
fstr_ctrl_static::fstr_ctrl_get_reftemp
integer(kind=kint) function fstr_ctrl_get_reftemp(ctrl, value)
Read in !REFTEMP.
Definition: fstr_ctrl_static.f90:216
m_fstr_setup::fstr_dynamic_finalize
subroutine fstr_dynamic_finalize(fstrDYNAMIC)
Finalizer of fstr_solid.
Definition: fstr_setup.f90:1666
fstr_setup_util::node_global_to_local
integer(kind=kint) function node_global_to_local(hecMESH, list, n)
Definition: fstr_setup_util.f90:171
m_fstr::kel361fbar
integer(kind=kint), parameter kel361fbar
Definition: m_fstr.f90:80
fstr_setup_util::fstr_setup_visualize
subroutine fstr_setup_visualize(ctrl, hecMESH)
Definition: fstr_setup_util.f90:1467
mmechgauss::fstr_init_gauss
subroutine fstr_init_gauss(gauss)
Initializer.
Definition: mechgauss.f90:44
m_static_lib_c3d4sesns::return_nn_comp_c3d4_sesns
integer(kind=kint) function, public return_nn_comp_c3d4_sesns(nn, nodlocal)
Definition: static_LIB_C3D4_selectiveESNS.f90:69
fstr_ctrl_get_param_ex
int fstr_ctrl_get_param_ex(int *ctrl, const char *param_name, const char *value_list, int *necessity, char *type, void *val)
Definition: fstr_ctrl_util.c:1404
m_fstr::kel361ic
integer(kind=kint), parameter kel361ic
Definition: m_fstr.f90:79
fstr_ctrl_material::fstr_ctrl_get_dashpot_d
integer function fstr_ctrl_get_dashpot_d(ctrl, mattype, nlgeom, matval_i, dict)
Read in !DASHPOT_D.
Definition: fstr_ctrl_material.f90:883
m_fstr_setup::fstr_setup_radiate
subroutine fstr_setup_radiate(ctrl, counter, P)
Read in !RADIATE !
Definition: fstr_setup.f90:3267
fstr_ctrl_common::fstr_ctrl_get_echo
integer(kind=kint) function fstr_ctrl_get_echo(ctrl, echo)
Read in !ECHO.
Definition: fstr_ctrl_common.f90:412
fstr_ctrl_common::fstr_ctrl_get_istep
logical function fstr_ctrl_get_istep(ctrl, hecMESH, steps, tpname, apname)
Read in !STEP and !ISTEP.
Definition: fstr_ctrl_common.f90:226
m_fstr_setup::fstr_setup_step
subroutine fstr_setup_step(ctrl, counter, P)
Read in !STEP !
Definition: fstr_setup.f90:1992
m_fstr_setup::fstr_setup_mpc
subroutine fstr_setup_mpc(ctrl, counter, P)
Read in !MPC !
Definition: fstr_setup.f90:3652
m_step::init_aincparam
subroutine init_aincparam(aincparam)
Initializer.
Definition: m_step.f90:166
fstr_ctrl_dynamic::fstr_ctrl_get_dynamic
integer(kind=kint) function fstr_ctrl_get_dynamic(ctrl, nlgeom, idx_eqa, idx_resp, n_step, t_start, t_end, t_delta, ganma, beta, idx_mas, idx_dmp, ray_m, ray_k, nout, node_id, node_id_len, nout_monit, iout_list)
Read in !DYNAMIC.
Definition: fstr_ctrl_dynamic.f90:89
fstr_setup_util::reallocate_integer
subroutine reallocate_integer(array, n)
Definition: fstr_setup_util.f90:1442
m_fstr_setup::fstr_smoothed_element_init
subroutine fstr_smoothed_element_init(hecMESH, fstrSOLID)
Definition: fstr_setup.f90:1143
fstr_ctrl_heat::fstr_ctrl_get_sflux
integer(kind=kint) function fstr_ctrl_get_sflux(ctrl, amp, surface_grp_name, surface_grp_name_len, value)
Read in !SFLUX (heat)
Definition: fstr_ctrl_heat.f90:188
mmaterial::m_beam_angle3
integer(kind=kint), parameter m_beam_angle3
Definition: material.f90:112
fstr_setup_util::append_new_amplitude
subroutine append_new_amplitude(amp, name, type_def, type_time, type_val, np, val, table)
Append new amplitude table at the end of existing amplitude tables.
Definition: fstr_setup_util.f90:1030
m_fstr_setup::fstr_convert_contact_type
subroutine fstr_convert_contact_type(hecMESH)
Convert SURF-SURF contact to NODE-SURF contact !
Definition: fstr_setup.f90:3752
m_fstr_setup::fstr_setup_cflux
subroutine fstr_setup_cflux(ctrl, counter, P)
Read in !CFLUX !
Definition: fstr_setup.f90:2835
m_fstr::kbcffstr
integer(kind=kint), parameter kbcffstr
boundary condition file type (bcf)
Definition: m_fstr.f90:63
elementinfo::getspacedimension
integer(kind=kind(2)) function getspacedimension(etype)
Obtain the space dimension of the element.
Definition: element.f90:117
mmaterial::tshellmat
Definition: material.f90:151
fstr_ctrl_material::fstr_ctrl_get_plasticity
integer function fstr_ctrl_get_plasticity(ctrl, mattype, nlgeom, matval, mattable, dict)
Read in !PLASTIC.
Definition: fstr_ctrl_material.f90:365
m_fstr::iutb
integer(kind=kint), parameter iutb
Definition: m_fstr.f90:109
m_fstr_setup::fstr_setup_contactalgo
subroutine fstr_setup_contactalgo(ctrl, P)
Read in !CONTACT !
Definition: fstr_setup.f90:3715
m_fstr_setup::fstr_solid_init
subroutine fstr_solid_init(hecMESH, fstrSOLID)
Initializer of structure fstr_solid.
Definition: fstr_setup.f90:1007
m_fstr_setup::fstr_setup_solver
subroutine fstr_setup_solver(ctrl, counter, P)
Read in !SOLVER !
Definition: fstr_setup.f90:1847
fstr_ctrl_get_data_array_ex
int fstr_ctrl_get_data_array_ex(int *ctrl, const char *format,...)
Definition: fstr_ctrl_util.c:1701
m_fstr::paracontactflag
logical paracontactflag
PARALLEL CONTACT FLAG.
Definition: m_fstr.f90:100
fstr_ctrl_common::fstr_ctrl_get_elemopt
integer(kind=kint) function fstr_ctrl_get_elemopt(ctrl, elemopt361)
Read in !ELEMOPT.
Definition: fstr_ctrl_common.f90:718
m_step::init_stepinfo
subroutine init_stepinfo(stepinfo)
Initializer.
Definition: m_step.f90:67
fstr_ctrl_material::fstr_ctrl_get_material
integer function fstr_ctrl_get_material(ctrl, matname)
Read in !MATERIAL.
Definition: fstr_ctrl_material.f90:22
m_fstr_setup::fstr_setup_sflux
subroutine fstr_setup_sflux(ctrl, counter, P)
Read in !SFLUX !
Definition: fstr_setup.f90:3010
fstr_ctrl_dynamic::fstr_ctrl_get_acceleration
integer(kind=kint) function fstr_ctrl_get_acceleration(ctrl, aType, amp, node_id, node_id_len, dof_ids, dof_ide, value)
Read in !ACCELERATION.
Definition: fstr_ctrl_dynamic.f90:68
fstr_ctrl_material::fstr_ctrl_get_fluid
integer function fstr_ctrl_get_fluid(ctrl, mattype, nlgeom, matval, dict)
Read in !FLUID.
Definition: fstr_ctrl_material.f90:729
fstr_ctrl_material::fstr_ctrl_get_trs
integer function fstr_ctrl_get_trs(ctrl, mattype, matval)
Read in !TRS.
Definition: fstr_ctrl_material.f90:343
mcontact::mut
real(kind=kreal), save mut
penalty along tangent direction
Definition: fstr_contact.f90:18
m_fstr::sviarray
integer(kind=kint), dimension(100) sviarray
SOLVER CONTROL.
Definition: m_fstr.f90:117
fstr_setup_util::get_sorted_local_member_index
integer(kind=kint) function get_sorted_local_member_index(hecMESH, hecPARAM, type_name, name, local_id)
Definition: fstr_setup_util.f90:558
m_fstr_setup::fstr_element_init
subroutine fstr_element_init(hecMESH, fstrSOLID)
Initialize elements info in static calculation.
Definition: fstr_setup.f90:1192
fstr_ctrl_common::fstr_get_autoinc
integer(kind=kint) function fstr_get_autoinc(ctrl, aincparam)
Read in !AUTOINC_PARAM !
Definition: fstr_ctrl_common.f90:742
m_fstr::etime
real(kind=kreal) etime
Definition: m_fstr.f90:140
m_fstr_setup::fstr_setup_sfilm
subroutine fstr_setup_sfilm(ctrl, counter, P)
Read in !SFILM !
Definition: fstr_setup.f90:3184
mmaterial
This module summarizes all information of material properties.
Definition: material.f90:6
fstr_ctrl_common::fstr_ctrl_get_nonlinear_solver
integer(kind=kint) function fstr_ctrl_get_nonlinear_solver(ctrl, method)
Read in !NONLINEAR_SOLVER.
Definition: fstr_ctrl_common.f90:69
m_static_lib_c3d4sesns
This module contains several strategy to free locking problem in Eight-node hexagonal element.
Definition: static_LIB_C3D4_selectiveESNS.f90:7
fstr_setup_util::get_grp_member_n
integer(kind=kint) function get_grp_member_n(hecMESH, grp_type_name, name)
Definition: fstr_setup_util.f90:410
m_fstr::ilog
integer(kind=kint), parameter ilog
FILE HANDLER.
Definition: m_fstr.f90:107
m_fstr_setup::fstr_setup_dflux
subroutine fstr_setup_dflux(ctrl, counter, P)
Read in !DFLUX !
Definition: fstr_setup.f90:2920
fstr_setup_util::surf_grp_name_to_id_ex
subroutine surf_grp_name_to_id_ex(hecMESH, header_name, n, grp_id_name, grp_ID)
Definition: fstr_setup_util.f90:909
fstr_setup_eigenread
subroutine fstr_setup_eigenread(ctrl, counter, P)
Read in !EIGENREAD !
Definition: fstr_ctrl_freq.f90:103
fstr_ctrl_common::fstr_ctrl_get_write
integer(kind=kint) function fstr_ctrl_get_write(ctrl, res, visual, femap)
Read in !WRITE.
Definition: fstr_ctrl_common.f90:393
m_fstr::svrarray
real(kind=kreal), dimension(100) svrarray
Definition: m_fstr.f90:118
m_static_get_prop
This module provides a function to fetch material properties from hecmw.
Definition: fstr_get_prop.f90:6
m_fstr_setup::fstr_setup_static
subroutine fstr_setup_static(ctrl, counter, P)
Read in !STATIC(old) !
Definition: fstr_setup.f90:2218
fstr_ctrl_material::fstr_ctrl_get_dashpot_a
integer function fstr_ctrl_get_dashpot_a(ctrl, mattype, nlgeom, matval_i, dict)
Read in !DASHPOT_A.
Definition: fstr_ctrl_material.f90:934
m_fstr_setup::fstr_heat_init
subroutine fstr_heat_init(fstrHEAT)
Initial setting of heat analysis.
Definition: fstr_setup.f90:1523
m_step
This module manages step information.
Definition: m_step.f90:6
m_fstr_setup::fstr_setup_temperature
subroutine fstr_setup_temperature(ctrl, counter, P)
Read in !TEMPERATURE !
Definition: fstr_setup.f90:2547
fstr_ctrl_heat::fstr_ctrl_get_cflux
integer(kind=kint) function fstr_ctrl_get_cflux(ctrl, amp, node_grp_name, node_grp_name_len, value)
Read in !CFLUX (heat)
Definition: fstr_ctrl_heat.f90:94
fstr_setup_util::fstr_ctrl_err_stop
subroutine fstr_ctrl_err_stop
Definition: fstr_setup_util.f90:95
fstr_ctrl_rewind
int fstr_ctrl_rewind(int *ctrl)
Definition: fstr_ctrl_util.c:81
fstr_ctrl_material::fstr_ctrl_get_viscoelasticity
integer function fstr_ctrl_get_viscoelasticity(ctrl, mattype, nlgeom, dict)
Read in !VISCOELASTIC.
Definition: fstr_ctrl_material.f90:276
m_fstr_setup::fstr_setup_post
subroutine fstr_setup_post(ctrl, P)
Definition: fstr_setup.f90:1734
m_fstr_setup::fstr_param_pack
Package of all data needs to initialize.
Definition: fstr_setup.f90:27
fstr_ctrl_static::fstr_ctrl_get_temperature
integer(kind=kint) function fstr_ctrl_get_temperature(ctrl, irres, tstep, tintl, rtype, node_id, node_id_len, value)
Read in !TEMPERATURE.
Definition: fstr_ctrl_static.f90:231
m_utilities::cross_product
subroutine cross_product(v1, v2, vn)
Definition: utilities.f90:330
fstr_ctrl_material::fstr_ctrl_get_viscoplasticity
integer function fstr_ctrl_get_viscoplasticity(ctrl, mattype, nlgeom, dict)
Read in !CREEP.
Definition: fstr_ctrl_material.f90:552
m_fstr_setup::fstr_setup_echo
subroutine fstr_setup_echo(ctrl, counter, P)
Read in !ECHO !
Definition: fstr_setup.f90:2110
fstr_setup_util
This module contains auxiliary functions in calculation setup.
Definition: fstr_setup_util.f90:7
m_fstr::kstdynamic
integer(kind=kint), parameter kstdynamic
Definition: m_fstr.f90:40
fstr_ctrl_material
This module manages read in of various material properties.
Definition: fstr_ctrl_material.f90:6
mcontact
This module provides functions to calculate contact stiff matrix.
Definition: fstr_contact.f90:6
m_step::free_stepinfo
subroutine free_stepinfo(step)
Finalizer.
Definition: m_step.f90:127
fstr_setup_util::get_grp_member
integer(kind=kint) function get_grp_member(hecMESH, grp_type_name, name, member1, member2)
Definition: fstr_setup_util.f90:464