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