38
39
40
41
42
43
44
45
46
47
48
49
50 USE multi_fvm_mod
52 USE elbufdef_mod
53
54
55
56#include "implicit_f.inc"
57#include "comlock.inc"
58#include "com04_c.inc"
59#include "param_c.inc"
60#include "task_c.inc"
61#include "com01_c.inc"
62#include "parit_c.inc"
63
64
65
66 INTEGER, INTENT(in) :: ITASK
67 TYPE (ELBUF_STRUCT_), DIMENSION(NGROUP), INTENT(in) :: ELBUF_TAB
68 INTEGER, DIMENSION(NUMELS), INTENT(in) ::IGROUPS
69 INTEGER, DIMENSION(NPARG,*), INTENT(in) ::IPARG
70
71 INTEGER, DIMENSION(NPARI,*), INTENT(in) :: IPARI
72 my_real,
DIMENSION(3,*),
INTENT(in) :: x,v
73 my_real,
DIMENSION(3,*),
INTENT(inout) :: x_append,v_append
74 my_real,
DIMENSION(*),
INTENT(in) :: ms
75 INTEGER, DIMENSION(*), INTENT(in) :: KINET
76 my_real,
DIMENSION(*),
INTENT(inout) :: mass_append
77 INTEGER, DIMENSION(*), INTENT(inout) :: KINET_APPEND
78 my_real,
DIMENSION(3,*),
INTENT(inout) :: force_int
79 INTEGER, DIMENSION(NIXS, *), INTENT(in) :: IXS
80 TYPE(MULTI_FVM_STRUCT) :: MULTI_FVM
81 TYPE (GROUP_) , DIMENSION(NGRBRIC), INTENT(in) :: IGRBRIC
82
83
84
85 INTEGER :: I,J
86 INTEGER :: N,NN,II,JJ,
87 INTEGER :: NFT,GROUP_ID,ILOC,NEL
88 INTEGER :: ISU1,NBRIC,NSN,NTY,INACTI,NODE_ID,IBRIC
89 INTEGER :: NODF,NODL,NSNF,NSNL
91 my_real,
DIMENSION(3) :: local_force_int
92 REAL(kind=8), dimension(3) :: local_force_int_dp
93
94 INTEGER :: SIZE_VEL
95 INTEGER, DIMENSION(NTHREAD) :: INDEX_THREADS
96 my_real,
DIMENSION(:),
ALLOCATABLE,
SAVE :: vel
97 REAL(kind=8), dimension(:,:), ALLOCATABLE, SAVE :: vel_dp
98
99 nodf = 1 + itask * numnod / nthread
100 nodl = (1 + itask) * numnod / nthread
101
102
103 x_append(1:3,nodf:nodl) = x(1:3,nodf:nodl)
104 v_append(1:3,nodf:nodl) = v(1:3,nodf:nodl)
105 mass_append(nodf:nodl) = ms(nodf:nodl)
106 kinet_append(nodf:nodl) = kinet(nodf:nodl)
107
109
110 ! update of vel array : parith/on part
111 IF(iparit/=0) THEN
112 DO nn=1,multi_fvm%NUMBER_INT18
113 n = multi_fvm%INT18_LIST(nn)
114 isu1 = ipari(45,n)
115 nbric = igrbric(isu1)%NENTITY
116 nsn = ipari(5,n)
117 nsnf = 1 + itask * nsn / nthread
118 nsnl = (1 + itask) * nsn / nthread
119
120 DO i = 1,nthread
121 index_threads(i) = 1 + 3*(i-1)*nsn/nthread
122 ENDDO
123
124 ALLOCATE( vel(3*nsn) )
125 ALLOCATE( vel_dp(6,3*nsn) )
126 DO ii = 1,nsn
127 ibric = igrbric(isu1)%ENTITY(ii)
128 group_id = igroups(ibric)
129 nft = iparg(3,group_id)
130 nel=iparg(2,group_id)
131 iloc = ibric - nft
132
133 vel_dp(1:6,(ii-1)+1) = multi_fvm%FORCE_INT_PON(1,1:6,ibric)
134 vel_dp(1:6,(ii-1)+2) = multi_fvm%FORCE_INT_PON(2,1:6,ibric)
135 vel_dp(1:6,(ii-1)+3) = multi_fvm%FORCE_INT_PON(3,1:6,ibric)
136
137 multi_fvm%FORCE_INT_PON(1,1:6,ibric) = 0.d+00
138 multi_fvm%FORCE_INT_PON(2,1:6,ibric) = 0.d+00
139 multi_fvm%FORCE_INT_PON(3,1:6,ibric) = 0.d+00
140
141 DO j=2,nthread
142 vel_dp(1:6,(ii-1)+1) = vel_dp(1:6,(ii-1)+1) + multi_fvm%FORCE_INT_PON(1,1:6,ibric+(j-1)*numels)
143 vel_dp(1:6,(ii-1)+2) = vel_dp(1:6,(ii-1)+2) + multi_fvm%FORCE_INT_PON(2,1:6,ibric+(j-1)*numels)
144 vel_dp(1:6,(ii-1)+3) = vel_dp(1:6,(ii-1)+3) + multi_fvm%FORCE_INT_PON(3,1:6,ibric+(j-1)*numels)
145 multi_fvm%FORCE_INT_PON(1:3,1:6,ibric+(j-1)*numels) = 0.d+00
146 ENDDO
147
148 mass = elbuf_tab(group_id)%GBUF%RHO(iloc) * elbuf_tab(group_id)%GBUF%VOL(iloc)
149
150 local_force_int_dp(1) = vel_dp(1,(ii-1)+1)
151 local_force_int_dp(2) = vel_dp(1,(ii-1)+2)
152 local_force_int_dp(3) = vel_dp(1,(ii-1)+3)
153 DO j=2,6
154 local_force_int_dp(1) = local_force_int_dp(1) + vel_dp(j,(ii-1)+1)
155 local_force_int_dp(2) = local_force_int_dp(2) + vel_dp(j,(ii-1)+2)
156 local_force_int_dp(3) = local_force_int_dp(3) + vel_dp(j,(ii-1)+3)
157 ENDDO
158 local_force_int_dp(1:3) = local_force_int_dp(1:3) / mass
159 multi_fvm%VEL(1:3,ibric) = multi_fvm%VEL(1:3,ibric) + local_force_int_dp(1:3)
160 ENDDO
161
162 DEALLOCATE( vel )
163 DEALLOCATE( vel_dp )
164
165 ENDDO
166
167
168 ELSE
169 DO nn=1,multi_fvm%NUMBER_INT18
170 n = multi_fvm%INT18_LIST(nn)
171 isu1 = ipari(45,n)
172 nbric = igrbric(isu1)%NENTITY
173 nsn = ipari(5,n)
174 nsnf = 1 + itask * nsn / nthread
175 nsnl = (1 + itask) * nsn / nthread
176 DO ii = nsnf,nsnl
177 ibric = igrbric(isu1)%ENTITY(ii)
178 group_id = igroups(ibric)
179 nft = iparg(3,group_id)
180 nel=iparg(2,group_id)
181 iloc = ibric - nft
182
183 mass = elbuf_tab(group_id)%GBUF%RHO(iloc) * elbuf_tab(group_id)%GBUF%VOL(iloc)
184 local_force_int(1:3) = zero
185 DO jj=1,nthread
186 local_force_int(1:3) = local_force_int(1:3) + force_int(1:3, ibric+(jj-1)*numels)
187 ENDDO
188
189 multi_fvm%VEL(1:3, ibric) = multi_fvm%VEL(1:3, ibric) + local_force_int(1:3) / mass
190
191
192 DO jj=1,nthread
193 force_int(1:3, ibric+(jj-1)*numels) = zero
194 ENDDO
195 ENDDO
196 ENDDO
197 ENDIF
198
199
200
201
202
203
204
205 DO nn=1,multi_fvm%NUMBER_INT18
206 n = multi_fvm%INT18_LIST(nn)
207 isu1 = ipari(45,n)
208 nbric = igrbric(isu1)%NENTITY
209 nsn = ipari(5,n)
210 nsnf = 1 + itask * nsn / nthread
211 nsnl = (1 + itask) * nsn / nthread
212 DO ii = nsnf,nsnl
213 ibric = igrbric(isu1)%ENTITY(ii)
214 group_id = igroups(ibric)
215 nft = iparg(3,group_id)
216 nel=iparg(2,group_id)
217 iloc = ibric - nft
218
219 mass = elbuf_tab(group_id)%GBUF%RHO(iloc) * elbuf_tab(group_id)%GBUF%VOL(iloc)
220 mass_append(numnod + ibric) = zero
221
222 IF(iale /= 0) THEN
223 x_append(1, numnod + ibric) = zero
224 x_append(2, numnod + ibric) = zero
225 x_append(3, numnod + ibric) = zero
226 DO jj = 2, 9
227 node_id = ixs(jj, ibric)
228 x_append(1, numnod + ibric) = x_append(1, numnod + ibric) + one_over_8 * x(1, node_id)
229 x_append(2, numnod + ibric) = x_append(2, numnod + ibric) + one_over_8 * x(2, node_id)
230 x_append(3, numnod + ibric) = x_append(3, numnod + ibric) + one_over_8 * x(3, node_id)
231 ENDDO
232 ENDIF
233
234
235 v_append(1, numnod + ibric) = multi_fvm%VEL(1, ibric)
236 v_append(2, numnod + ibric) = multi_fvm%VEL(2, ibric)
237 v_append(3, numnod + ibric) = multi_fvm%VEL(3, ibric)
238
239
240 elbuf_tab(group_id)%GBUF%MOM(iloc+0*nel)= multi_fvm%VEL(1, ibric)
241 elbuf_tab(group_id)%GBUF%MOM(iloc+1*nel)= multi_fvm%VEL(2, ibric)
242 elbuf_tab(group_id)%GBUF%MOM(iloc+2*nel)= multi_fvm%VEL(3, ibric)
243 ENDDO
244 ENDDO
245
246 RETURN