38 fstrSOLID, fstrEIG, fstrHEAT, fstrDYNAMIC, fstrCPL, fstrFREQ )
39 character(len=HECMW_FILENAME_LEN) :: inp_filename
40 type(hecmwst_local_mesh),
target :: hecmesh
41 type(hecmwst_matrix),
target :: hecmat
50 integer(kind=kint) :: ctrl, rcode
71 hecmat%Iarray(2) = 106
72 hecmat%Iarray(99) = hecmat%Iarray(2) - 99
73 fstrparam%fg_result =
kon
75 call fstr_setup_inp_cards( t )
79 write(*,*)
'### Error: Cannot read the inp file : ', trim(inp_filename)
80 write(
ilog,*)
'### Error: Cannot read the inp file : ', trim(inp_filename)
84 call fstr_setup_inp_read_cards( ctrl, t, 1, total, p )
89 call fstr_setup_inp_formulation( p )
93 call fstr_setup_inp_read_cards( ctrl, t, 2, total, p )
104 subroutine fstr_setup_inp_cards( T )
112 call fstr_card_add( t,
'STATIC', first=fstr_setup_inp_static, seq=
'analysis' )
113 call fstr_card_add( t,
'FREQUENCY', first=fstr_setup_inp_frequency, seq=
'analysis' )
114 call fstr_card_add( t,
'BOUNDARY', first=fstr_setup_inp_boundary )
116 call fstr_card_add( t,
'TEMPERATURE', first=fstr_setup_inp_temperature )
117 call fstr_card_add( t,
'INITIAL CONDITIONS', first=fstr_setup_inp_initial_conditions )
120 call fstr_card_add( t,
'MATERIAL', second=fstr_setup_inp_material )
121 call fstr_card_add( t,
'EXPANSION', second=fstr_setup_inp_expansion )
144 call fstr_card_add( t,
'NODE PRINT', first=fstr_setup_inp_output_request )
145 call fstr_card_add( t,
'EL PRINT', first=fstr_setup_inp_output_request )
146 call fstr_card_add( t,
'NODE FILE', first=fstr_setup_inp_output_request )
147 call fstr_card_add( t,
'EL FILE', first=fstr_setup_inp_output_request )
148 call fstr_card_add( t,
'CONTACT PRINT', first=fstr_setup_inp_output_request )
149 call fstr_card_add( t,
'CONTACT FILE', first=fstr_setup_inp_output_request )
150 call fstr_card_add( t,
'SECTION PRINT', first=fstr_setup_inp_output_request )
151 call fstr_card_add( t,
'OUTPUT', first=fstr_setup_inp_output_request )
152 call fstr_card_add( t,
'NODE OUTPUT', first=fstr_setup_inp_output_request )
153 call fstr_card_add( t,
'ELEMENT OUTPUT', first=fstr_setup_inp_output_request )
154 call fstr_card_add( t,
'CONTACT OUTPUT', first=fstr_setup_inp_output_request )
155 end subroutine fstr_setup_inp_cards
161 subroutine fstr_setup_inp_read_cards( ctrl, T, ipass, total, P )
163 integer(kind=kint) :: ctrl
165 integer(kind=kint),
intent(in) :: ipass
166 integer(kind=kint),
intent(inout) :: total(:)
169 integer(kind=kint) :: rcode, k, comma, next_comma, i, c
170 integer(kind=kint) :: pos(size(total))
171 character(len=HECMW_NAME_LEN) :: header_name
172 character(len=256) :: header, param
178 if( ipass == 1 )
then
179 select case( trim(header_name) )
180 case(
'*STEP',
'*END STEP',
'*STATIC',
'*FREQUENCY',
'*BOUNDARY',
'*CLOAD', &
181 '*TEMPERATURE',
'*INITIAL CONDITIONS',
'*EXPANSION' )
184 comma = index( header,
',' )
185 do while( comma > 0 )
186 header = adjustl( header(comma+1:) )
187 next_comma = index( header,
',' )
189 if( next_comma > 0 ) param = header(:next_comma-1)
190 if( len_trim(param) > 0 )
then
191 i = scan( param,
'= ' )
192 if( i > 0 ) param = param(:i-1)
193 do i = 1, len_trim(param)
194 c = iachar( param(i:i) )
195 if( c >= iachar(
'a') .and. c <= iachar(
'z') ) param(i:i) = achar( c - iachar(
'a') + iachar(
'A') )
198 select case( trim(header_name) )
200 supported = param ==
'NLGEOM'
202 supported = param ==
'SOLVER' .or. param ==
'STORAGE'
203 case(
'*BOUNDARY',
'*CLOAD' )
204 supported = param ==
'AMPLITUDE'
205 case(
'*TEMPERATURE' )
206 supported = param ==
'AMPLITUDE' .or. param ==
'USER' .or. param ==
'SUBMODEL' .or. param ==
'FILE' &
207 .or. param ==
'INPUT'
208 case(
'*INITIAL CONDITIONS' )
209 supported = param ==
'TYPE' .or. param ==
'INPUT'
211 supported = param ==
'TYPE' .or. param ==
'ZERO'
213 if( .not. supported )
call fstr_setup_inp_warn( ctrl, p, &
214 'unsupported parameter '//trim(param)//
' is skipped' )
222 call fstr_card_read( ctrl, t, k, ipass, header_name, pos, total, p )
223 else if( ipass == 1 )
then
224 call fstr_setup_inp_err_stop( ctrl,
'not supported in an inp file yet' )
228 if( ipass == 1 ) total(:) = pos(:)
229 end subroutine fstr_setup_inp_read_cards
232 subroutine fstr_setup_inp_err_stop( ctrl, msg )
234 integer(kind=kint) :: ctrl
235 character(len=*),
intent(in) :: msg
237 integer(kind=kint) :: rcode
238 character(len=HECMW_NAME_LEN) :: header_name
239 character(len=HECMW_MSG_LEN) :: s
242 write( s,
'(a,a,a,i0,a,a)' )
'### Error: ', trim(header_name),
' (line:',
fstr_ctrl_get_c_h_line_no( ctrl ), &
245 end subroutine fstr_setup_inp_err_stop
248 subroutine fstr_setup_inp_warn( ctrl, P, msg )
250 integer(kind=kint) :: ctrl
252 character(len=*),
intent(in) :: msg
254 integer(kind=kint) :: rcode
255 character(len=HECMW_NAME_LEN) :: header_name
257 if( p%MESH%my_rank /= 0 )
return
259 write(*,
'(a,a,a,i0,a,a)')
' Warning: ', trim(header_name),
' (line:',
fstr_ctrl_get_c_h_line_no( ctrl ), &
261 end subroutine fstr_setup_inp_warn
266 subroutine fstr_setup_inp_step( ctrl, P )
268 integer(kind=kint) :: ctrl
271 integer(kind=kint) :: rcode, is_nlgeom, nlgeom
273 if( p%STATE%slot%first > 1 )
call fstr_setup_inp_err_stop( ctrl,
'more than one step is not supported yet' )
277 if( is_nlgeom == 0 )
return
281 if( nlgeom == 1 )
call fstr_setup_inp_err_stop( ctrl,
'NLGEOM is not supported yet' )
282 end subroutine fstr_setup_inp_step
288 subroutine fstr_setup_inp_static( ctrl, P )
290 integer(kind=kint) :: ctrl
293 if( p%STATE%slot%first > 1 )
call fstr_setup_inp_err_stop( ctrl,
'only one analysis card is allowed in a step' )
296 end subroutine fstr_setup_inp_static
304 subroutine fstr_setup_inp_frequency( ctrl, P )
306 integer(kind=kint) :: ctrl
309 integer(kind=kint) :: rcode, storage
310 real(kind=kreal) :: fmin, fmax
311 character(len=HECMW_NAME_LEN) :: solver
313 if( p%STATE%slot%first > 1 )
call fstr_setup_inp_err_stop( ctrl,
'only one analysis card is allowed in a step' )
318 if( solver ==
'MATRIXSTORAGE' )
then
319 call fstr_setup_inp_err_stop( ctrl,
'SOLVER=MATRIXSTORAGE is not supported' )
320 else if( solver /=
' ' )
then
321 call fstr_setup_inp_warn( ctrl, p,
'SOLVER='//trim(solver)// &
322 ' is skipped. The linear solver is given by *SOLVER, DIRECTmf by default' )
328 if( storage == 1 )
call fstr_setup_inp_warn( ctrl, p, &
329 'STORAGE=YES is skipped. The eigenmodes are written to the result file of FrontISTR' )
335 if( p%EIGEN%nget < 1 )
call fstr_setup_inp_err_stop( ctrl,
'the number of eigenfrequencies must be positive' )
336 if( fmin > 0.0d0 .or. fmax >= 0.0d0 )
call fstr_setup_inp_warn( ctrl, p, &
337 'the frequency range is skipped. All the eigenmodes computed are written to the result file' )
340 end subroutine fstr_setup_inp_frequency
347 subroutine fstr_setup_inp_boundary( ctrl, P )
349 integer(kind=kint) :: ctrl
352 integer(kind=kint) :: rcode, n
353 character(len=HECMW_NAME_LEN) :: amp, rotc_name, data_fmt
354 character(len=HECMW_NAME_LEN),
allocatable :: grp_names(:)
355 integer(kind=kint),
allocatable :: dof_ids(:), dof_ide(:)
356 real(kind=kreal),
allocatable :: vals(:)
364 allocate( grp_names(n), dof_ids(n), dof_ide(n), vals(n) )
368 write( data_fmt,
'(a,i0,a)' )
'S', hecmw_name_len,
'Iir '
372 where( dof_ide == 0 ) dof_ide = dof_ids
375 amp, n, grp_names, dof_ids, dof_ide, vals )
376 end subroutine fstr_setup_inp_boundary
382 subroutine fstr_setup_inp_cload( ctrl, P )
384 integer(kind=kint) :: ctrl
387 integer(kind=kint) :: rcode, n
388 character(len=HECMW_NAME_LEN) :: amp, rotc_name, data_fmt
389 character(len=HECMW_NAME_LEN),
allocatable :: grp_names(:)
390 integer(kind=kint),
allocatable :: dofs(:)
391 real(kind=kreal),
allocatable :: vals(:)
399 allocate( grp_names(n), dofs(n), vals(n) )
401 write( data_fmt,
'(a,i0,a)' )
'S', hecmw_name_len,
'IR '
407 amp, n, grp_names, dofs, vals )
408 end subroutine fstr_setup_inp_cload
415 subroutine fstr_setup_inp_temperature( ctrl, P )
417 integer(kind=kint) :: ctrl
420 integer(kind=kint) :: rcode, n, i, is_given
421 character(len=HECMW_NAME_LEN) :: data_fmt
422 character(len=HECMW_NAME_LEN),
allocatable :: grp_names(:)
423 real(kind=kreal),
allocatable :: vals(:)
424 character(len=9),
parameter :: params(5) = [
'AMPLITUDE',
'USER ',
'SUBMODEL ',
'FILE ',
'INPUT ' ]
426 do i = 1,
size(params)
429 if( is_given /= 0 )
call fstr_setup_inp_err_stop( ctrl, trim(params(i))//
' is not supported yet' )
431 call fstr_setup_inp_check_constant_materials( ctrl, p )
434 allocate( grp_names(n), vals(n) )
436 write( data_fmt,
'(a,i0,a)' )
'S', hecmw_name_len,
'R '
442 end subroutine fstr_setup_inp_temperature
448 subroutine fstr_setup_inp_initial_conditions( ctrl, P )
450 integer(kind=kint) :: ctrl
453 integer(kind=kint) :: rcode, n
454 character(len=HECMW_NAME_LEN) :: type_name
459 if( type_name /=
'TEMPERATURE' ) &
460 call fstr_setup_inp_err_stop( ctrl,
'TYPE='//trim(type_name)//
' is not supported yet' )
463 if( p%MESH%hecmw_flag_initcon == 1 ) n = p%MESH%node_init_val_index(p%MESH%n_node)
464 if( n /= p%MESH%n_node )
call fstr_setup_inp_err_stop( ctrl,
'the initial temperature must be given to all the nodes' )
465 call fstr_setup_inp_check_constant_materials( ctrl, p )
466 end subroutine fstr_setup_inp_initial_conditions
471 subroutine fstr_setup_inp_check_constant_materials( ctrl, P )
473 integer(kind=kint) :: ctrl
476 integer(kind=kint) :: i
478 do i = 1, p%MESH%material%n_mat_subitem
479 if( p%MESH%material%mat_table_index(i) - p%MESH%material%mat_table_index(i-1) > 1 )
then
480 call fstr_setup_inp_err_stop( ctrl, &
481 'not supported yet with a material constant depending on the temperature (*ELASTIC, *DENSITY)' )
484 end subroutine fstr_setup_inp_check_constant_materials
488 subroutine fstr_setup_inp_material( ctrl, P )
490 integer(kind=kint) :: ctrl
493 integer(kind=kint) :: i
494 character(len=HECMW_FILENAME_LEN) :: mname
498 do i = 1, p%MESH%material%n_mat
499 if(
hecmw_streqr( p%MESH%material%mat_name(i), mname ) )
then
504 end subroutine fstr_setup_inp_material
512 subroutine fstr_setup_inp_expansion( ctrl, P )
514 integer(kind=kint) :: ctrl
517 integer(kind=kint) :: rcode, is_type
519 if( p%STATE%cid == 0 )
call fstr_setup_inp_err_stop( ctrl,
'given before *MATERIAL' )
520 if( p%STATE%cid < 0 )
return
523 if( is_type /= 0 )
call fstr_setup_inp_err_stop( ctrl, &
524 'TYPE is not supported yet; omit it for an isotropic coefficient' )
526 'only a coefficient independent of the temperature, in one data line, is supported yet' )
529 end subroutine fstr_setup_inp_expansion
535 subroutine fstr_setup_inp_write( ctrl, P )
537 integer(kind=kint) :: ctrl
541 if( p%PARAM%fg_visual ==
kon )
call fstr_setup_inp_err_stop( ctrl,
'VISUAL is not supported in an inp file yet' )
542 end subroutine fstr_setup_inp_write
545 subroutine fstr_setup_inp_output_request( ctrl, P )
547 integer(kind=kint) :: ctrl
550 integer(kind=kint) :: rcode
551 character(len=HECMW_NAME_LEN) :: header_name
553 if( p%MESH%my_rank /= 0 )
return
556 ') is skipped. The results are written to the result file of FrontISTR'
557 end subroutine fstr_setup_inp_output_request
562 subroutine fstr_setup_inp_formulation( P )
566 integer(kind=kint) :: i
568 do i = 1, p%MESH%section%n_sect
569 select case( p%MESH%section%sect_opt(i) )
570 case( hecmw_sect_opt_solid_fi )
571 p%SOLID%sections(i)%elemopt361 =
kel361fi
572 p%SOLID%sections(i)%elemopt362 =
kel362fi
573 case( hecmw_sect_opt_solid_ic )
574 p%SOLID%sections(i)%elemopt361 =
kel361ic
575 case( hecmw_sect_opt_solid_ri )
576 p%SOLID%sections(i)%elemopt361 =
kel361ri
577 p%SOLID%sections(i)%elemopt362 =
kel362ri
578 case( hecmw_sect_opt_solid_fbar )
582 end subroutine fstr_setup_inp_formulation
int fstr_ctrl_get_param_ex(int *ctrl, const char *param_name, const char *value_list, int *necessity, char *type, void *val)
int fstr_ctrl_get_c_h_name_inp(int *ctrl, char *header_name, int *buff_size)
int fstr_ctrl_open_inp(char *filename)
int fstr_ctrl_get_line(int *ctrl, int *rec_no, char *buff, int *buff_size)
int fstr_ctrl_get_data_array_ex(int *ctrl, const char *format,...)
int fstr_ctrl_get_data_ex(int *ctrl, int *line_no, const char *format,...)
This module manages read in of various material properties.
integer function fstr_ctrl_get_material(ctrl, matname)
Read in !MATERIAL.
This module contains auxiliary functions in calculation setup.
subroutine fstr_ctrl_err_stop
integer(kind=kint), parameter fstr_card_max
rows and sequences of a card table
subroutine fstr_card_read(ctrl, T, k, ipass, header_name, pos, total, P)
Reads the card at the current header of ctrl by the row k of the table T in the reading ipass (1 or 2...
subroutine fstr_card_add(T, name, first, second, by_line, seq, version_min, version_max)
Adds a card to the table T, read by first in the first reading and by second in the second reading....
subroutine fstr_setup_util_err_stop(msg)
integer(kind=kint) function fstr_card_find(T, name, version)
Index of the row of the card name for !VERSION version in the table T, or 0 if there is none.
This module contains auxiliary functions in calculation setup.
logical function hecmw_streqr(s1, s2)
This module provides subroutines to read the cards that go into fstr_param, and the cards that go int...
subroutine fstr_setup_solver(ctrl, P)
Read in !SOLVER !
This module provides subroutines to process the data read from the cards, independently of the input ...
subroutine fstr_setup_prepare(P, counts)
Allocation and preparation after the cards are counted: the arrays sized by counts,...
subroutine fstr_setup_finish(P, counts)
Processing after all the cards are read: the temperature arrays, the default step,...
This module provides functions to read in the analysis data of an inp file and do necessary preparati...
subroutine, public fstr_setup_inp(inp_filename, hecMESH, hecMAT, fstrPARAM, fstrSOLID, fstrEIG, fstrHEAT, fstrDYNAMIC, fstrCPL, fstrFREQ)
Read in and initialize the analysis data of an inp file !
This module provides subroutines to initialize, allocate and finalize fstr_solid, and to read the car...
subroutine fstr_setup_expansion_coeff(ctrl, P)
Read in !EXPANSION_COEF !
subroutine fstr_setup_section(ctrl, P)
Read in !SECTION !
subroutine fstr_setup_write_store(ctrl, P)
Read in !WRITE after fstr_setup_prepare and store the output controls. fg_result and fg_visual are se...
subroutine fstr_solid_append_temperature(hecMESH, fstrSOLID, header_name, gid, n, grp_names, vals)
Append !TEMPERATURE !
subroutine fstr_solid_append_boundary(hecMESH, fstrSOLID, header_name, gid, istot, rotc_name, amp_name, n, grp_names, dof_ids, dof_ide, vals)
Append !BOUNDARY !
subroutine fstr_setup_write_flags(ctrl, P)
Read in !WRITE before fstr_setup_prepare and set fg_result and fg_visual.
subroutine fstr_solid_append_cload(hecMESH, fstrSOLID, header_name, gid, rotc_name, amp_name, n, grp_names, dofs, vals)
Append !CLOAD !
This module defines common data and basic structures for analysis.
integer(kind=kint), parameter kel361ri
integer(kind=kint), parameter kel361fi
integer(kind=kint), parameter kel362fi
integer(kind=kint), parameter kon
integer(kind=kint), parameter kel361ic
integer(kind=kint), parameter ilog
FILE HANDLER.
integer(kind=kint), parameter kststatic
integer(kind=kint), parameter kel362ri
integer(kind=kint), parameter kcaalagrange
integer(kind=kint), parameter kel361fbar
integer(kind=kint), parameter ksteigen
Table of the cards of the control file, not changed after the cards are added. Each card is counted i...
Package of all data needs to initialize.
Data for coupling analysis.
Data for DYNAMIC ANSLYSIS (fstrDYNAMIC)
Package of data used by Lanczos eigenvalue solver.
Data for HEAT ANSLYSIS (fstrHEAT)
FSTR INNER CONTROL PARAMETERS (fstrPARAM)
Counts of the input for fstr_setup_prepare and fstr_setup_finish, independent of the input file forma...