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