18 integer(kind=kint),
private :: n_iter, n_rcap
19 real(kind=kreal),
private :: t_start, t_end, t_rcap
20 real(kind=kreal),
private :: t_start_all, t_end_all, t_rcap_all
28 type( hecmwst_local_mesh ) :: hecmesh
33 character( len=16) :: portfile
34 integer(kind=kint) ::
myrank
35 integer(kind=kint) :: i,err,nid,nid_old
36 real(kind=kreal) :: t_s, t_e
38 write(
idbg,*)
"fstr_rcap_initialize: start"
39 t_start_all = hecmw_wtime()
41 if( fstrparam%fg_couple /= 1 )
return
43 write(
idbg,*)
"fstr_rcap_initialize: calling rcapf_init_solid_solver"
45 portfile=
'port'//char(0)
48 call rcapf_init_solid_solver( hecmesh%my_rank, portfile )
50 t_rcap_all = t_e - t_s
52 write(
idbg,*)
"fstr_rcap_initialize: calling rcapf_get_num_of_matching_node"
57 call rcapf_get_num_of_matching_node( fstrcpl%coupled_node_n )
59 t_rcap_all = t_rcap_all + (t_e - t_s)
61 fstrcpl%ndof = fstrcpl%coupled_node_n * fstrcpl%dof
62 allocate( fstrcpl%coupled_node( fstrcpl%coupled_node_n ), stat=err)
63 if( err /= 0 )
goto 1000
64 allocate( fstrcpl%trac( fstrcpl%ndof ), stat=err)
65 if( err /= 0 )
goto 1000
66 allocate( fstrcpl%disp( fstrcpl%ndof ), stat=err)
67 if( err /= 0 )
goto 1000
68 allocate( fstrcpl%velo( fstrcpl%ndof ), stat=err)
69 if( err /= 0 )
goto 1000
70 allocate( fstrcpl%accel( fstrcpl%ndof ), stat=err)
71 if( err /= 0 )
goto 1000
72 allocate( fstrcpl%index( hecmesh%n_node_gross ), stat=err)
73 if( err /= 0 )
goto 1000
77 write(
idbg,*)
"fstr_rcap_initialize: calling rcapf_get_mathcing_node_id"
80 call rcapf_get_matching_node_id( fstrcpl%coupled_node, fstrcpl%coupled_node_n )
82 t_rcap_all = t_rcap_all + (t_e - t_s)
84 write(
idbg,*)
"fstr_rcap_initialize: converting to local id: ", fstrcpl%coupled_node_n
86 do i=1, fstrcpl%coupled_node_n
87 nid = fstrcpl%coupled_node(i)
88 if( nid <= 0 .or. nid>hecmesh%n_node_gross )
then
89 write(*,*)
'##Fatal error in fstr_rcap_initialize ', i, nid
90 call hecmw_abort( hecmw_comm_get_comm());
92 if( hecmesh%n_refine > 0 )
then
94 if(
associated( hecmesh%node_old2new ) )
then
95 nid = hecmesh%node_old2new( nid ) + 1
97 write(
idbg,*) nid_old, nid
99 fstrcpl%index( nid ) = i
105 write(
idbg,*)
"fstr_rcap_initialize: end"
108 1000
write(*,*)
"##Error : not enough memory"
109 call hecmw_abort( hecmw_comm_get_comm() )
113 if( fstrparam%fg_couple == 0 )
return
115 if( hecmw_comm_get_rank() == 0 )
then
116 write(*,*)
"##Error : REVOCAP functions are not supported"
118 call hecmw_abort( hecmw_comm_get_comm() )
129 real(kind=kreal) :: t_tot, t_tot_avg, t_rcap_avg, tr
130 real(kind=kreal) :: t_tot_all, tr_all
131 real(kind=kreal) :: t_s, t_e
133 write(
idbg,*)
"fstr_rcap_finalize: start"
135 if( fstrparam%fg_couple /= 1 )
return
136 deallocate( fstrcpl%coupled_node )
137 deallocate( fstrcpl%trac )
138 deallocate( fstrcpl%disp )
139 deallocate( fstrcpl%velo )
140 deallocate( fstrcpl%accel )
141 deallocate( fstrcpl%index )
143 write(
idbg,*)
"fstr_rcap_finalize: calling rcapf_finalize"
146 call rcapf_finalize()
148 t_rcap_all = t_rcap_all + (t_e - t_s)
150 t_tot = t_end - t_start
151 t_tot_avg = t_tot / n_iter
152 t_rcap_avg = t_rcap / n_rcap
153 tr = t_rcap_avg / t_tot_avg * 100.d0
155 write(
idbg,
'(a,f11.3,a,i0,a,f11.3,a)') &
156 &
'fstr + rcap:', t_tot,
's for ',n_iter,
' iters / avg. ', t_tot_avg,
's/iter'
157 write(
idbg,
'(a,f11.3,a,i0,a,f11.3,a)') &
158 &
' rcap:',t_rcap,
's for ',n_rcap,
' calls / avg. ',t_rcap_avg,
's/call'
159 write(
idbg,
'(a,f11.3,a)') &
160 &
' rcap ratio:',tr,
'%/iter'
162 t_end_all = hecmw_wtime()
164 t_tot_all = t_end_all - t_start_all
165 tr_all = t_rcap_all / t_tot_all * 100.d0
167 write(
idbg,
'(a,f11.3,a)')
'fstr total:',t_tot_all,
's'
168 write(
idbg,
'(a,f11.3,a)')
'rcap total:',t_rcap_all,
's'
169 write(
idbg,
'(a,f11.3,a)')
'rcap ratio:',tr_all,
'%'
171 write(
idbg,*)
"fstr_rcap_finalize: end"
175 if( fstrparam%fg_couple == 0 )
return
177 if( hecmw_comm_get_rank() == 0 )
then
178 write(*,*)
"##Error : REVOCAP functions are not supported"
180 call hecmw_abort( hecmw_comm_get_comm() )
189 write(
idbg,*)
"fstr_rcap_send: start"
195 call rcapf_set_velo( fstrcpl%coupled_node, &
196 fstrcpl%coupled_node_n, &
197 fstrcpl%velo, fstrcpl%ndof )
203 write(
idbg,*)
"fstr_rcap_send: end"
207 if( hecmw_comm_get_rank() == 0 )
then
208 write(*,*)
"##Error : REVOCAP functions are not supported"
210 call hecmw_abort( hecmw_comm_get_comm() )
219 real(kind=kreal) :: t_s, t_e
221 write(
idbg,*)
"fstr_rcap_get: start"
223 if (n_rcap == 0)
then
224 t_start = hecmw_wtime()
227 t_end = hecmw_wtime()
231 write(
idbg,*)
"fstr_rcap_get: calling rcapf_get_trac"
234 call rcapf_get_trac( fstrcpl%coupled_node, &
235 fstrcpl%coupled_node_n, &
236 fstrcpl%trac, fstrcpl%ndof )
239 t_rcap = t_rcap + (t_e - t_s)
242 t_rcap_all = t_rcap_all + (t_e - t_s)
244 write(
idbg,*)
"fstr_rcap_get: end"
248 if( hecmw_comm_get_rank() == 0 )
then
249 write(*,*)
"##Error : REVOCAP functions are not supported"
251 call hecmw_abort( hecmw_comm_get_comm() )
257 integer(kind=kint) :: revocap_flag
260 write(
idbg,*)
"fstr_get_convergence: start"
262 call rcapf_get_convergence( revocap_flag )
264 write(
idbg,*)
"fstr_get_convergence: end"
268 if( hecmw_comm_get_rank() == 0 )
then
269 write(*,*)
"##Error : REVOCAP functions are not supported"
271 call hecmw_abort( hecmw_comm_get_comm() )