16 integer(kind=kint) :: first = 0
17 integer(kind=kint) :: last = 0
24 integer(kind=kint) :: cid = 0
25 integer(kind=kint) :: cache = 1
30 type(hecmwst_local_mesh),
pointer :: mesh
31 type(hecmwst_matrix),
pointer :: mat
48 integer(kind=kint) :: ctrl
56 character(len=HECMW_NAME_LEN) :: name =
''
57 integer(kind=kint) :: version_min = -huge(0_kint)
58 integer(kind=kint) :: version_max = huge(0_kint)
61 logical :: by_line = .false.
62 integer(kind=kint) :: seq = 0
69 integer(kind=kint) :: n_card = 0
71 integer(kind=kint) :: n_seq = 0
80 character(len=256) :: msg
102 subroutine fstr_card_add( T, name, first, second, by_line, seq, version_min, version_max )
105 character(len=*),
intent(in) :: name
107 logical,
intent(in),
optional :: by_line
108 character(len=*),
intent(in),
optional :: seq
109 integer(kind=kint),
intent(in),
optional :: version_min, version_max
112 character(len=HECMW_NAME_LEN) :: seq_name
115 if(
present(first) ) card%first => first
116 if(
present(second) ) card%second => second
117 if(
present(by_line) ) card%by_line = by_line
118 if(
present(version_min) ) card%version_min = version_min
119 if(
present(version_max) ) card%version_max = version_max
121 if(
present(seq) ) seq_name = seq
123 if( card%seq == 0 )
then
125 t%n_seq = t%n_seq + 1
126 t%seq_name(t%n_seq) = seq_name
136 character(len=*),
intent(in) :: alias, name
151 integer(kind=kint) :: i
154 if( t%card(i)%name == card%name .and. t%card(i)%version_min <= card%version_max .and. &
155 card%version_min <= t%card(i)%version_max ) &
159 t%n_card = t%n_card + 1
160 t%card(t%n_card) = card
167 character(len=*),
intent(in) :: name
169 integer(kind=kint) :: i
173 if( t%card(i)%name == name )
then
185 character(len=*),
intent(in) :: name
186 integer(kind=kint),
intent(in) ::
version
188 integer(kind=kint) :: i
192 if( t%card(i)%name == name .and. t%card(i)%version_min <=
version .and. &
193 version <= t%card(i)%version_max )
then
204 character(len=*),
intent(in) :: seq
206 integer(kind=kint) :: i
210 if( t%seq_name(i) == seq )
then
222 integer(kind=kint),
intent(in) :: total(:)
223 character(len=*),
intent(in) :: seq
225 integer(kind=kint) :: i
236 type(hecmwst_local_mesh),
pointer :: hecMESH
237 integer(kind=kint),
intent(in) :: sgrp_id
238 integer(kind=kint),
intent(out) :: ngrp_id
239 integer(kind=kint) :: is, ie, nnode, i, ic, isurf, ic_type, stype, nn, j0, j, ndup, new_nnode
240 integer(kind=kint) :: snode(20)
241 integer(kind=kint),
allocatable :: node(:)
242 character(len=HECMW_NAME_LEN) :: grp_name
243 is= hecmesh%surf_group%grp_index(sgrp_id-1) + 1
244 ie= hecmesh%surf_group%grp_index(sgrp_id )
248 ic = hecmesh%surf_group%grp_item(2*i-1)
249 isurf = hecmesh%surf_group%grp_item(2*i)
250 ic_type = hecmesh%elem_type(ic)
251 call getsubface( ic_type, isurf, stype, snode )
252 nnode = nnode + getnumberofnodes( stype )
255 allocate( node(nnode) )
258 ic = hecmesh%surf_group%grp_item(2*i-1)
259 isurf = hecmesh%surf_group%grp_item(2*i)
260 ic_type = hecmesh%elem_type(ic)
261 call getsubface( ic_type, isurf, stype, snode )
262 nn = getnumberofnodes( stype )
263 j0 = hecmesh%elem_node_index(ic-1)
265 node(nnode+j) = hecmesh%elem_node_item(j0+snode(j))
272 new_nnode = nnode - ndup
274 write( grp_name,
'(a,a)')
'FSTR_S2N_',trim(hecmesh%surf_group%grp_name(sgrp_id))
275 call append_new_group(hecmesh,
'node_grp', grp_name, new_nnode, node, ngrp_id)
283 type(hecmwst_local_mesh),
pointer :: hecMESH
284 integer(kind=kint),
intent(in) :: ngrp_id1, ngrp_id2
285 integer(kind=kint) :: nnode1, nnode2, nnode, is, i, nisect, ngrp_id
286 integer(kind=kint),
allocatable :: node(:), isect(:)
287 character(len=HECMW_NAME_LEN) :: grp_name
288 nnode1 = hecmesh%node_group%grp_index(ngrp_id1) - hecmesh%node_group%grp_index(ngrp_id1-1)
289 nnode2 = hecmesh%node_group%grp_index(ngrp_id2) - hecmesh%node_group%grp_index(ngrp_id2-1)
290 nnode = nnode1 + nnode2
291 allocate( node(nnode) )
292 is= hecmesh%node_group%grp_index(ngrp_id1-1)
294 node(i) = hecmesh%node_group%grp_item(is+i)
296 is= hecmesh%node_group%grp_index(ngrp_id2-1)
298 node(nnode1+i) = hecmesh%node_group%grp_item(is+i)
301 allocate( isect(nnode) )
304 if( node(i) == node(i+1) )
then
306 isect(nisect) = node(i)
309 write( grp_name,
'(a,a,a,a)') &
310 'FSTR_ISCT_',trim(hecmesh%node_group%grp_name(ngrp_id1)),
'_AND_',trim(hecmesh%node_group%grp_name(ngrp_id2))
311 call append_new_group(hecmesh,
'node_grp', grp_name, nisect, isect, ngrp_id)
330 type (hecmwst_local_mesh),
target :: hecmesh
331 character(len=*) :: type_name
332 character(len=*) :: name
333 integer(kind=kint) :: local_id
334 integer(kind=kint) :: i, n, no, fg
335 integer(kind=kint),
pointer :: global_item(:)
342 if( type_name ==
'node' )
then
345 global_item => hecmesh%global_node_ID
346 else if( type_name ==
'element' )
then
349 global_item => hecmesh%global_elem_ID
351 stop
'assert in get_local_member_index: unknown type_name'
355 if( no == global_item(i))
then
374 type (hecmwst_local_mesh),
target :: hecmesh
376 character(len=*) :: type_name
377 character(len=*) :: name
378 integer(kind=kint) :: local_id, idx
379 integer(kind=kint) :: n, no, fg
386 if( type_name ==
'node' )
then
388 n = hecmesh%nn_internal
395 stop
'assert in get_sorted_local_member_index: unknown type_name'
416 type (hecmwST_local_mesh),
target :: hecMESH
417 character(len=*) :: header_name
418 integer(kind=kint) :: n
419 character(len=HECMW_NAME_LEN) :: grp_id_name(:)
420 integer(kind=kint) :: grp_ID(:)
421 integer(kind=kint) :: grp_TYPE(:)
423 integer(kind=kint) :: i, id
424 integer(kind=kint) :: no, no_count, exist_n
425 integer(kind=kint),
pointer :: no_list(:)
426 character(HECMW_NAME_LEN) :: name
427 character(len=256) :: msg
429 allocate( no_list( n ))
433 no_count = no_count + 1
434 no_list(no_count) = no
435 grp_id(i) = hecmesh%node_group%n_grp + no_count
440 do id = 1, hecmesh%node_group%n_grp
441 if (
hecmw_streqr(hecmesh%node_group%grp_name(id), grp_id_name(i)))
then
448 if (grp_id(i) == -1)
then
449 do id = 1, hecmesh%surf_group%n_grp
450 if (
hecmw_streqr(hecmesh%surf_group%grp_name(id), grp_id_name(i)))
then
459 if( grp_id(i) == -1 )
then
460 write(msg,*)
'### Error: ', header_name,
' : Node group "',grp_id_name(i),
'" does not exist.'
465 if( no_count > 0 )
then
470 deallocate( no_list )
479 type (hecmwST_local_mesh),
target :: hecMESH
480 integer(kind=kint) :: n
481 integer(kind=kint),
save :: casha = 1, cashb = 1
482 character(HECMW_NAME_LEN) :: grp_id_name(:)
483 logical :: fg_surface(:)
484 integer(kind=kint) :: grp_ID(:)
485 integer(kind=kint) :: i, id
486 integer(kind=kint) :: no, no_count, exist_n
487 integer(kind=kint),
pointer :: no_list(:)
488 character(HECMW_NAME_LEN) :: name
489 character(len=256) :: msg
491 allocate( no_list( n ))
494 if( fg_surface(i) )
then
496 if(casha < hecmesh%surf_group%n_grp)
then
497 if(
hecmw_streqr(hecmesh%surf_group%grp_name(casha), grp_id_name(i)))
then
503 do id = 1, hecmesh%surf_group%n_grp
504 if(
hecmw_streqr(hecmesh%surf_group%grp_name(id), grp_id_name(i)))
then
510 if( grp_id(i) == -1 )
then
511 write(msg,*)
'### Error: !DLOAD : Surface group "',&
512 grp_id_name(i),
'" does not exist.'
517 no_count = no_count + 1
518 no_list(no_count) = no
519 grp_id(i) = hecmesh%elem_group%n_grp + no_count
522 if(cashb < hecmesh%surf_group%n_grp)
then
523 if(
hecmw_streqr(hecmesh%surf_group%grp_name(cashb), grp_id_name(i)))
then
529 do id = 1, hecmesh%elem_group%n_grp
530 if(
hecmw_streqr(hecmesh%elem_group%grp_name(id), grp_id_name(i)))
then
536 if( grp_id(i) == -1 )
then
537 write(msg,*)
'### Error: !DLOAD : Element group "',&
538 grp_id_name(i),
'" does not exist.'
545 if( no_count > 0 )
then
564 deallocate( no_list )
578 type( hecmwst_amplitude ),
intent(inout) :: amp
579 character(len=HECMW_NAME_LEN),
intent(in) :: name
580 integer(kind=kint),
intent(in) :: type_def
581 integer(kind=kint),
intent(in) :: type_time
582 integer(kind=kint),
intent(in) :: type_val
583 integer(kind=kint),
intent(in) :: np
584 real(kind=kreal),
intent(in) :: val(:)
585 real(kind=kreal),
intent(in) :: table(:)
588 integer(kind=kint) :: n_amp, new_size, old_size, i
592 write(*,*)
'Error: AMPLITUDE with NAME=',trim(name),
' already exists'
608 old_size = amp%amp_index( n_amp )
609 new_size = old_size+np
613 amp%amp_index(amp%n_amp) = amp%amp_index(amp%n_amp-1)+np
614 amp%amp_name(amp%n_amp) = name
615 amp%amp_type_definition(amp%n_amp) = type_def
616 amp%amp_type_time(amp%n_amp) = type_time
617 amp%amp_type_value(amp%n_amp) = type_val
619 amp%amp_val(old_size+i) = val(i)
620 amp%amp_table(old_size+i) = table(i)
627 type (hecmwST_local_mesh) :: hecMESH
628 character(len=*) :: header_name
629 character(len=HECMW_NAME_LEN)::aname
630 integer(kind=kint) :: id
631 character(len=256) :: msg
634 if( aname .eq.
' ' )
return
637 write(msg,*)
'### Error: ', header_name,
' : Amplitude group "',&
638 aname,
'" does not exist.'
649 type (hecmwST_local_mesh) :: hecMESH
650 character(len=HECMW_NAME_LEN)::aname
651 integer(kind=kint) :: id
653 integer(kind=kint) :: i
656 if( aname .eq.
' ' )
return
658 do i = 1, hecmesh%amp%n_amp
670 integer(kind=kint),
pointer :: array(:)
671 integer(kind=kint) :: n;
673 if(
associated( array ))
deallocate(array)
679 real(kind=kreal),
pointer :: array(:)
680 integer(kind=kint) :: n;
682 if(
associated( array ))
deallocate(array)
695 integer(kind=kint) :: ctrl
696 type (hecmwST_local_mesh) :: hecMESH
697 integer(kind=kint) :: rcode
698 character(HECMW_FILENAME_LEN) :: vis_filename =
'hecmw_vis.ini'
702 if(rcode == 0)
return
704 if(hecmesh%my_rank == 0)
then
708 call hecmw_barrier( hecmesh )
710 inquire(file = vis_filename, exist = is_exit)
712 if(.not. is_exit)
then
719 integer(kind=kint) :: ctrl
720 integer(kind=kint) :: rcode
721 integer(kind=kint) :: i, start_n, end_n
722 character(HECMW_FILENAME_LEN) :: vis_filename
723 integer(kind=kint),
parameter :: buffsize = 127
724 character( buffsize ) :: buff
725 character( buffsize ) :: head
726 character( buffsize ) :: msg
731 open (
ifvs, file = trim(vis_filename), status =
'replace', err = 1000)
734 if( rcode /= 0 )
exit
736 if( head ==
'!END')
exit
737 write(
ifvs,
'(a)') buff
743 1000
write(msg,*)
'Error: cannot create file:"', trim(vis_filename),
'" for visualization'
void fstr_ctrl_get_err_msg(char *f_buff, int *len)
int fstr_ctrl_get_line(int *ctrl, int *rec_no, char *buff, int *buff_size)
int fstr_ctrl_seek_header(int *ctrl, const char *header_name)
Reader of a card, called at the header of the card with the places of the card in PSTATEslot.
void version(char *arg)
show version and revision of FrontISTR
This module contains auxiliary functions in calculation setup.
integer(kind=kint) function fstr_card_seq(T, seq)
Index of the sequence named seq in the table T, or 0 if there is none.
subroutine fstr_ctrl_err_stop
integer(kind=kint), parameter fstr_card_max
rows and sequences of a card table
subroutine dload_grp_name_to_id_ex(hecMESH, n, grp_id_name, fg_surface, grp_ID)
subroutine fstr_setup_visualize(ctrl, hecMESH)
subroutine nodesurf_grp_name_to_id_ex(hecMESH, header_name, n, grp_id_name, grp_ID, grp_TYPE)
subroutine fstr_setup_visualize_main(ctrl, vis_filename)
integer(kind=kint) function get_local_member_index(hecMESH, type_name, name, local_id)
integer(kind=kint) function fstr_card_index(T, name)
Index of the first row of the card name in the table T. Stops if the card is not in it.
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 amp_name_to_id(hecMESH, header_name, aname, id)
subroutine append_new_amplitude(amp, name, type_def, type_time, type_val, np, val, table)
Append new amplitude table at the end of existing amplitude tables.
subroutine append_node_grp_from_surf_grp(hecMESH, sgrp_id, ngrp_id)
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.
subroutine fstr_card_alias(T, alias, name)
Adds alias to the table T as another name of the card name.
integer(kind=kint) function fstr_card_total(T, total, seq)
Total of the sequence named seq, from the totals of the sequences of the table T. Stops if the sequen...
subroutine reallocate_real(array, n)
subroutine append_intersection_node_grp(hecMESH, ngrp_id1, ngrp_id2)
subroutine reallocate_integer(array, n)
integer(kind=kint) function get_sorted_local_member_index(hecMESH, hecPARAM, type_name, name, local_id)
subroutine get_amp_id(hecMESH, aname, id)
subroutine fstr_card_append(T, card)
Appends card to the table T. Stops if the table has a row of the same name for !VERSION in the range ...
subroutine, public hecmw_bsearch_int_array(array, istart, iend, val, idx)
recursive subroutine, public hecmw_qsort_int_array(array, istart, iend)
subroutine, public hecmw_uniq_int_array(array, istart, iend, ndup)
This module contains auxiliary functions in calculation setup.
integer(kind=kint) function append_single_group(hecMESH, grp_type_name, no_count, no_list)
logical function hecmw_str2index(s, x)
subroutine hecmw_expand_integer_array(array, old_size, new_size)
subroutine hecmw_expand_real_array(array, old_size, new_size)
subroutine append_new_group(hecMESH, grp_type_name, name, count, list, grp_id)
subroutine hecmw_expand_char_array(array, old_size, new_size)
logical function hecmw_streqr(s1, s2)
subroutine hecmw_expand_index_array(array, old_size, new_size)
This module defines common data and basic structures for analysis.
integer(kind=kint), parameter imsg
integer(kind=kint), parameter kfloadtype_surf
integer(kind=kint), parameter ifvs
subroutine fstr_abort(code)
Terminate the analysis with a classified exit status. MPI_ABORT does not perform the Fortran I/O fina...
integer(kind=kint), parameter kfloadtype_node
Places of a card in its sequence, from first to last. A card counted one by one has one place (first ...
State of reading the cards: the places of the card being read, and what is carried from one card to t...
Table of the cards of the control file, not changed after the cards are added. Each card is counted i...
A row of the card table: the readers of a card in the first and the second reading of the control fil...
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)