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