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