15 include
'fstr_ctrl_util_f.inc'
21 subroutine pc_strupr( s )
24 integer :: i, n, a, da
27 da = iachar(
'a') - iachar(
'A')
30 if( a > iachar(
'Z'))
then
35 end subroutine pc_strupr
40 integer(kind=kint) :: ctrl
41 integer(kind=kint) :: type
45 integer(kind=kint) :: ipt
46 character(len=80) :: s
50 s =
'ELEMCHECK,STATIC,EIGEN,HEAT,DYNAMIC,NLSTATIC,STATICEIGEN,NZPROF '
69 integer(kind=kint) :: ctrl
70 integer(kind=kint) :: method
73 integer(kind=kint) :: ipt
74 character(len=80) :: s
78 s =
'NEWTON,QUASINEWTON '
85 iterpremax, nrest, nBFGS, scaling, &
86 dumptype, dumpexit, usejad, ncolor_in, mpc_method, estcond, method2, recyclepre, &
87 solver_opt, contact_elim, &
88 resid, singma_diag, sigma, thresh, filter )
89 integer(kind=kint) :: ctrl
90 integer(kind=kint) :: method
91 integer(kind=kint) :: precond
92 integer(kind=kint) :: nset
93 integer(kind=kint) :: iterlog
94 integer(kind=kint) :: timelog
95 integer(kind=kint) :: steplog
96 integer(kind=kint) :: nier
97 integer(kind=kint) :: iterpremax
98 integer(kind=kint) :: nrest
99 integer(kind=kint) :: nbfgs
100 integer(kind=kint) :: scaling
101 integer(kind=kint) :: dumptype
102 integer(kind=kint) :: dumpexit
103 integer(kind=kint) :: usejad
104 integer(kind=kint) :: ncolor_in
105 integer(kind=kint) :: mpc_method
106 integer(kind=kint) :: estcond
107 integer(kind=kint) :: method2
108 integer(kind=kint) :: recyclepre
109 integer(kind=kint) :: solver_opt(10)
110 integer(kind=kint) :: contact_elim
111 real(kind=kreal) :: resid
112 real(kind=kreal) :: singma_diag
113 real(kind=kreal) :: sigma
114 real(kind=kreal) :: thresh
115 real(kind=kreal) :: filter
118 character(92) :: mlist =
'1,2,3,4,101,CG,BiCGSTAB,GMRES,GPBiCG,GMRESR,GMRESREN,DIRECT,DIRECTmkl,DIRECTlag,MUMPS,MKL '
120 character(24) :: dlist =
'0,1,2,3,NONE,MM,CSR,BSR '
122 integer(kind=kint) :: number_number = 5
123 integer(kind=kint) :: indirect_number = 6
124 integer(kind=kint) :: iter, time, sclg, dmpt, dmpx, usjd, step
139 if(
fstr_ctrl_get_param_ex( ctrl,
'PRECOND ',
'1,2,3,4,5,6,7,8,9,10,11,12,20,21,30,31,32 ' ,0,
'I', precond ) /= 0)
return
153 if( method > number_number )
then
154 method = method - number_number
155 if( method > indirect_number )
then
157 method = method - indirect_number + 100
158 if( method == 103 ) method = 101
159 if( method == 105 ) method = 102
162 if( method2 > number_number )
then
163 method2 = method2 - number_number
164 if( method2 > indirect_number )
then
166 method2 = method2 - indirect_number + 100
171 if( dumptype >= 4 )
then
172 dumptype = dumptype - 4
177 if(
fstr_ctrl_get_data_ex( ctrl, 1,
'iiiiii ', nier, iterpremax, nrest, ncolor_in, recyclepre, nbfgs )/= 0)
return
180 if( precond == 20 .or. precond == 21)
then
182 else if( precond == 5 )
then
184 solver_opt(1), solver_opt(2), solver_opt(3), solver_opt(4), solver_opt(5), &
185 solver_opt(6), solver_opt(7), solver_opt(8), solver_opt(9), solver_opt(10) )/= 0)
return
186 else if( method == 101 )
then
204 integer(kind=kint) :: ctrl
205 character(len=HECMW_NAME_LEN) :: amp
206 integer(kind=kint) :: iproc
209 integer(kind=kint) :: ipt = 0
210 integer(kind=kint) :: ip = 0
218 if( ipt == 2 .or. ip == 1 ) iproc = 1
228 integer(kind=kint),
intent(in) :: ctrl
229 type (hecmwst_local_mesh),
intent(in) :: hecmesh
231 character(len=*),
intent(out) :: tpname
232 character(len=*),
intent(out) :: apname
234 character(len=HECMW_NAME_LEN) :: data_fmt,ss, data_fmt1
235 character(len=HECMW_NAME_LEN) :: amp
236 character(len=HECMW_NAME_LEN) :: header_name
237 integer(kind=kint) :: bcid
238 integer(kind=kint) :: i, n, sn, ierr
239 integer(kind=kint) :: bc_n, load_n, contact_n
240 real(kind=kreal) :: fn, f1, f2, f3
244 write(ss,*) hecmw_name_len
245 write( data_fmt,
'(a,a,a)')
'S', trim(adjustl(ss)),
'I '
246 write( data_fmt1,
'(a,a,a)')
'S', trim(adjustl(ss)),
'rrr '
254 steps%initdt = 1.d0/steps%num_substep
264 if( len( trim(amp) )>0 )
then
280 read( ss, * , iostat=ierr ) fn
284 steps%elapsetime = f1
286 steps%mindt = min(f2,steps%initdt)
289 steps%num_substep = max(int((f1+0.999999999d0*fn)/fn),steps%num_substep)
299 if( trim(header_name) ==
'BOUNDARY' )
then
301 else if( trim(header_name) ==
'LOAD' )
then
303 else if( trim(header_name) ==
'CONTACT' )
then
304 contact_n = contact_n+1
305 else if( trim(header_name) ==
'TEMPERATURE' )
then
310 if( bc_n>0 )
allocate( steps%Boundary(bc_n) )
311 if( load_n>0 )
allocate( steps%Load(load_n) )
312 if( contact_n>0 )
allocate( steps%Contact(contact_n) )
319 if( trim(header_name) ==
'BOUNDARY' )
then
321 steps%Boundary(bc_n) = bcid
322 else if( trim(header_name) ==
'LOAD' )
then
324 steps%Load(load_n) = bcid
325 else if( trim(header_name) ==
'CONTACT' )
then
326 contact_n = contact_n+1
327 steps%Contact(contact_n) = bcid
337 integer(kind=kint),
intent(in) :: ctrl
338 type (hecmwst_local_mesh),
intent(inout) :: hecmesh
339 type (
tsection),
pointer,
intent(inout) :: sections(:)
341 integer(kind=kint) :: j, k, sect_id, ori_id, elemopt
342 integer(kind=kint),
save :: cache = 1
343 character(len=HECMW_NAME_LEN) :: sect_orien
344 character(19) :: form341list =
'FI,SELECTIVE_ESNS '
345 character(16) :: form361list =
'FI,BBAR,IC,FBAR '
350 if( sect_id > hecmesh%section%n_sect )
return
354 if( elemopt > 0 ) sections(sect_id)%elemopt341 = elemopt
358 if( elemopt > 0 ) sections(sect_id)%elemopt361 = elemopt
361 hecmesh%section%sect_orien_ID(sect_id) = -1
364 if(
associated(g_localcoordsys) )
then
366 k =
size(g_localcoordsys)
369 if( sect_orien == g_localcoordsys(cache)%sys_name )
then
370 hecmesh%section%sect_orien_ID(sect_id) = cache
378 if( sect_orien == g_localcoordsys(j)%sys_name )
then
379 hecmesh%section%sect_orien_ID(sect_id) = j
393 integer(kind=kint) :: ctrl
394 integer(kind=kint) :: res
395 integer(kind=kint) :: visual
396 integer(kind=kint) :: femap
412 integer(kind=kint) :: ctrl
413 integer(kind=kint) :: echo
424 integer(kind=kint) :: ctrl
425 integer(kind=kint) :: fg_type
426 integer(kind=kint) :: fg_first
427 integer(kind=kint) :: fg_window
428 character(len=HECMW_NAME_LEN),
target :: surf_id(:)
429 character(len=HECMW_NAME_LEN),
pointer :: surf_id_p
430 integer(kind=kint) :: surf_id_len
433 character(len=HECMW_NAME_LEN) :: data_fmt,ss
434 write(ss,*) surf_id_len
435 write(data_fmt,
'(a,a,a)')
'S',trim(adjustl(ss)),
' '
438 if(
fstr_ctrl_get_param_ex( ctrl,
'TYPE ',
'1,2,3,4,5,6 ', 0,
'I', fg_type )/= 0)
return
442 surf_id_p => surf_id(1)
450 integer(kind=kint),
intent(in) :: ctrl
451 real(kind=kreal),
intent(out) :: penalty
455 if( penalty <= 1.0 )
then
457 write(
imsg,*)
"Warging : !MPC : too small penalty: ", penalty
458 write(*,*)
"Warging : !MPC : too small penalty: ", penalty
468 integer(kind=kint),
intent(in) :: ctrl
469 type (hecmwst_local_mesh),
intent(in) :: hecmesh
472 integer(kind=kint) :: rcode, ipos
473 integer(kind=kint) :: n, i, j
474 character(len=HECMW_NAME_LEN) :: data_fmt, ss
475 character(len=HECMW_NAME_LEN),
allocatable :: header_name(:), onoff(:), vtype(:)
477 write( ss, * ) hecmw_name_len
478 write( data_fmt,
'(a,a,a,a,a)')
'S', trim(adjustl(ss)),
'S', trim(adjustl(ss)),
' '
483 outinfo%grp_id_name =
"ALL"
491 allocate( header_name(n), onoff(n), vtype(n) )
492 header_name(:) =
""; vtype(:) =
""; onoff(:) =
""
497 do j = 1, outinfo%num_items
498 if( trim(header_name(i)) == outinfo%keyWord(j) )
then
499 outinfo%on(j) = .true.
500 if( trim(onoff(i)) ==
'OFF' ) outinfo%on(j) = .false.
501 if( len( trim(vtype(i)) )>0 )
then
503 outinfo%vtype(j) = ipos
504 else if( trim(vtype(i)) ==
"SCALER" )
then
505 outinfo%vtype(j) = -1
506 else if( trim(vtype(i)) ==
"VECTOR" )
then
507 outinfo%vtype(j) = -2
508 else if( trim(vtype(i)) ==
"SYMTENSOR" )
then
509 outinfo%vtype(j) = -3
510 else if( trim(vtype(i)) ==
"TENSOR" )
then
511 outinfo%vtype(j) = -4
518 deallocate( header_name, onoff, vtype )
525 integer(kind=kint) :: ctrl
526 integer(kind=kint) :: algo
529 integer(kind=kint) :: rcode
530 character(len=80) :: s
532 s =
'SLAGRANGE,ALAGRANGE '
540 integer(kind=kint),
intent(in) :: ctrl
541 integer(kind=kint),
intent(in) :: n
542 integer(kind=kint),
intent(in) :: ctalgo
543 type(tcontact),
intent(out) :: contact(n)
544 real(kind=kreal),
intent(out) :: np
545 real(kind=kreal),
intent(out) :: tp
546 real(kind=kreal),
intent(out) :: ntol
547 real(kind=kreal),
intent(out) :: ttol
548 character(len=*),
intent(out) :: cpname
550 integer :: rcode, ipt
551 character(len=30) :: s1 =
'TIED,GLUED,SSLID,FSLID '
552 character(len=HECMW_NAME_LEN) :: data_fmt,ss
553 character(len=HECMW_NAME_LEN) :: cp_name(n)
554 real(kind=kreal) :: fcoeff(n),tpenalty(n)
558 write(ss,*) hecmw_name_len
562 contact(1)%algtype = contactsslid
564 if( contact(1)%algtype==contactglued ) contact(1)%algtype=contactfslid
567 contact(rcode)%ctype = contact(1)%ctype
568 contact(rcode)%group = contact(1)%group
569 contact(rcode)%algtype = contact(1)%algtype
572 if( contact(1)%algtype==contactsslid .or. contact(1)%algtype==contactfslid )
then
573 write( data_fmt,
'(a,a,a)')
'S', trim(adjustl(ss)),
'Rr '
577 contact(rcode)%pair_name = cp_name(rcode)
578 contact(rcode)%fcoeff = fcoeff(rcode)
579 contact(rcode)%tPenalty = tpenalty(rcode)
581 else if( contact(1)%algtype==contacttied )
then
582 write( data_fmt,
'(a,a)')
'S', trim(adjustl(ss))
586 contact(rcode)%pair_name = cp_name(rcode)
587 contact(rcode)%fcoeff = 0.d0
588 contact(rcode)%tPenalty = 1.d+4
593 ntol = 0.d0; ttol=0.d0
606 integer(kind=kint),
intent(in) :: ctrl
607 integer(kind=kint),
intent(in) :: n
608 type(tcontact),
intent(out) :: embed(n)
609 character(len=*),
intent(out) :: cpname
611 integer :: rcode, ipt
612 character(len=30) :: s1 =
'TIED,GLUED,SSLID,FSLID '
613 character(len=HECMW_NAME_LEN) :: data_fmt,ss
614 character(len=HECMW_NAME_LEN) :: cp_name(n)
615 real(kind=kreal) :: fcoeff(n),tpenalty(n)
619 write(ss,*) hecmw_name_len
623 embed(1)%algtype = contacttied
626 embed(rcode)%ctype = embed(1)%ctype
627 embed(rcode)%group = embed(1)%group
628 embed(rcode)%algtype = embed(1)%algtype
631 write( data_fmt,
'(a,a)')
'S', trim(adjustl(ss))
635 embed(rcode)%pair_name = cp_name(rcode)
646 integer(kind=kint) :: ctrl
647 type( tcontactparam ) :: contactparam
650 integer(kind=kint) :: rcode
651 character(len=HECMW_NAME_LEN) :: data_fmt
652 character(len=128) :: msg
653 real(kind=kreal) :: clearance, clr_same_elem, clr_difflpos, clr_cal_norm
654 real(kind=kreal) :: distclr_init, distclr_free, distclr_nocheck, tensile_force
655 real(kind=kreal) :: box_exp_rate
660 contactparam%name =
''
666 & clearance, clr_same_elem, clr_difflpos, clr_cal_norm )
667 if( rcode /= 0 )
return
668 contactparam%CLEARANCE = clearance
669 contactparam%CLR_SAME_ELEM = clr_same_elem
670 contactparam%CLR_DIFFLPOS = clr_difflpos
671 contactparam%CLR_CAL_NORM = clr_cal_norm
676 & distclr_init, distclr_free, distclr_nocheck, tensile_force, box_exp_rate )
677 if( rcode /= 0 )
return
678 contactparam%DISTCLR_INIT = distclr_init
679 contactparam%DISTCLR_FREE = distclr_free
680 contactparam%DISTCLR_NOCHECK = distclr_nocheck
681 contactparam%TENSILE_FORCE = tensile_force
682 contactparam%BOX_EXP_RATE = box_exp_rate
686 if( clearance<0.d0 .OR. 1.d0<clearance )
THEN
687 write(msg,*)
'fstr control file error : !CONTACT_PARAM : CLEARANCE must be 0 < CLEARANCE < 1.'
688 else if( clr_same_elem<0.d0 .or. 1.d0<clr_same_elem )
then
689 write(msg,*)
'fstr control file error : !CONTACT_PARAM : CLR_SAME_ELEM must be 0 < CLR_SAME_ELEM < 1.'
690 else if( clr_difflpos<0.d0 .or. 1.d0<clr_difflpos )
then
691 write(msg,*)
'fstr control file error : !CONTACT_PARAM : CLR_DIFFLPOS must be 0 < CLR_DIFFLPOS < 1.'
692 else if( clr_cal_norm<0.d0 .or. 1.d0<clr_cal_norm )
then
693 write(msg,*)
'fstr control file error : !CONTACT_PARAM : CLR_CAL_NORM must be 0 < CLR_CAL_NORM < 1.'
694 else if( distclr_init<0.d0 .or. 1.d0<distclr_init )
then
695 write(msg,*)
'fstr control file error : !CONTACT_PARAM : DISTCLR_INIT must be 0 < DISTCLR_INIT < 1.'
696 else if( distclr_free<-1.d0 .or. 1.d0<distclr_free )
then
697 write(msg,*)
'fstr control file error : !CONTACT_PARAM : DISTCLR_FREE must be -1 < DISTCLR_FREE < 1.'
698 else if( distclr_nocheck<0.5d0 )
then
699 write(msg,*)
'fstr control file error : !CONTACT_PARAM : DISTCLR_NOCHECK must be >= 0.5.'
700 else if( tensile_force>=0.d0 )
then
701 write(msg,*)
'fstr control file error : !CONTACT_PARAM : TENSILE_FORCE must be < 0.'
702 else if( box_exp_rate<=1.d0 .or. 2.0<box_exp_rate )
then
703 write(msg,*)
'fstr control file error : !CONTACT_PARAM : BOX_EXP_RATE must be 1 < BOX_EXP_RATE <= 2.'
707 if( rcode /= 0 )
then
709 write(
ilog,*) trim(msg)
718 integer(kind=kint) :: ctrl
719 integer(kind=kint) :: elemopt361
722 character(72) :: o361list =
'IC,Bbar '
724 integer(kind=kint) :: o361
728 o361 = elemopt361 + 1
733 elemopt361 = o361 - 1
743 integer(kind=kint) :: ctrl
744 type( tparamautoinc ) :: aincparam
747 integer(kind=kint) :: rcode
748 character(len=HECMW_NAME_LEN) :: data_fmt
749 character(len=128) :: msg
750 integer(kind=kint) :: bound_s(10), bound_l(10)
751 real(kind=kreal) :: rs, rl
765 & bound_s(1), bound_s(2), bound_s(3), aincparam%NRtimes_s )
766 if( rcode /= 0 )
return
767 aincparam%ainc_Rs = rs
768 aincparam%NRbound_s(knstmaxit) = bound_s(1)
769 aincparam%NRbound_s(knstsumit) = bound_s(2)
770 aincparam%NRbound_s(knstciter) = bound_s(3)
775 & bound_l(1), bound_l(2), bound_l(3), aincparam%NRtimes_l )
776 if( rcode /= 0 )
return
777 aincparam%ainc_Rl = rl
778 aincparam%NRbound_l(knstmaxit) = bound_l(1)
779 aincparam%NRbound_l(knstsumit) = bound_l(2)
780 aincparam%NRbound_l(knstciter) = bound_l(3)
785 & aincparam%ainc_Rc, aincparam%CBbound )
786 if( rcode /= 0 )
return
790 if( rs<0.d0 .or. rs>1.d0 )
then
791 write(msg,*)
'fstr control file error : !AUTOINC_PARAM : decrease ratio Rs must 0 < Rs < 1.'
792 else if( any(bound_s<0) )
then
793 write(msg,*)
'fstr control file error : !AUTOINC_PARAM : decrease NR bound must >= 0.'
794 else if( aincparam%NRtimes_s < 1 )
then
795 write(msg,*)
'fstr control file error : !AUTOINC_PARAM : # of times to decrease must > 0.'
796 else if( rl<1.d0 )
then
797 write(msg,*)
'fstr control file error : !AUTOINC_PARAM : increase ratio Rl must > 1.'
798 else if( any(bound_l<0) )
then
799 write(msg,*)
'fstr control file error : !AUTOINC_PARAM : increase NR bound must >= 0.'
800 else if( aincparam%NRtimes_l < 1 )
then
801 write(msg,*)
'fstr control file error : !AUTOINC_PARAM : # of times to increase must > 0.'
802 elseif( aincparam%ainc_Rc<0.d0 .or. aincparam%ainc_Rc>1.d0 )
then
803 write(msg,*)
'fstr control file error : !AUTOINC_PARAM : cutback decrease ratio Rc must 0 < Rc < 1.'
804 else if( aincparam%CBbound < 1 )
then
805 write(msg,*)
'fstr control file error : !AUTOINC_PARAM : maximum # of cutback times must > 0.'
809 if( rcode /= 0 )
then
811 write(
ilog,*) trim(msg)
820 integer(kind=kint) :: ctrl
824 integer(kind=kint) :: i, n, rcode
826 real(kind=kreal) :: stime,
etime, interval
838 stime = 0.d0;
etime = 0.d0; interval = 1.d0
840 tp%n_points = int((
etime-stime)/interval)+1
841 allocate(tp%points(tp%n_points))
843 tp%points(i) = stime + dble(i-1)*interval
849 allocate(tp%points(tp%n_points))
852 if( tp%points(i) < tp%points(i+1) ) cycle
853 write(*,*)
'Error in reading !TIME_POINT: time points must be given in ascending order.'
864 integer(kind=kint),
intent(in) :: ctrl
865 integer(kind=kint),
intent(in) :: nline
866 character(len=HECMW_NAME_LEN),
intent(out) :: name
867 integer(kind=kint),
intent(out) :: type_def
868 integer(kind=kint),
intent(out) :: type_time
869 integer(kind=kint),
intent(out) :: type_val
870 integer(kind=kint),
intent(out) :: n
871 real(kind=kreal),
pointer :: val(:)
872 real(kind=kreal),
pointer :: table(:)
875 integer(kind=kint) :: t_def, t_time, t_val
876 integer(kind=kint) :: i, j
877 real(kind=kreal) :: r(4), t(4)
892 type_def = hecmw_amp_typedef_tabular
894 write(*,*)
'Error in reading !AMPLITUDE: invalid value for parameter DEFINITION.'
897 type_time = hecmw_amp_typetime_step
899 write(*,*)
'Error in reading !AMPLITUDE: invalid value for parameter TIME.'
902 type_val = hecmw_amp_typeval_relative
903 elseif( t_val==2 )
then
904 type_val = hecmw_amp_typeval_absolute
906 write(*,*)
'Error in reading !AMPLITUDE: invalid value for parameter VALUE.'
911 r(:)=huge(0.0d0); t(:)=huge(0.0d0)
912 if(
fstr_ctrl_get_data_ex( ctrl, 1,
'RRrrrrrr ', r(1), t(1), r(2), t(2), r(3), t(3), r(4), t(4) ) /= 0)
return
917 if (r(j) < huge(0.0d0) .and. t(j) < huge(0.0d0))
then