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