53 SUBROUTINE v3d4_ale(v_bar,a_bar,d,vhalf,Rnet, &
54 e,xnu,rho,numnp,numat_vol, &
55 numcstet,matcstet,lmcstet,meshcoor, &
64 REAL*8,
DIMENSION(1:3*numnp) :: v_bar
66 REAL*8,
DIMENSION(1:3*numnp) :: a_bar
68 REAL*8,
DIMENSION(1:3*numnp) ::
d
70 REAL*8,
DIMENSION(1:3*numnp) :: vhalf
72 REAL*8,
DIMENSION(1:3*numnp) :: rnet
74 REAL*8,
DIMENSION(1:numat_vol) :: e
76 REAL*8,
DIMENSION(1:numat_vol) :: xnu
78 REAL*8,
DIMENSION(1:numat_vol) :: rho
80 REAL*8,
DIMENSION(1:3,1:numnp) :: meshcoor
82 INTEGER,
DIMENSION(1:4,1:numcstet) :: lmcstet
84 INTEGER matcstet(numcstet)
85 INTEGER ielem , nx, ny, nz
90 INTEGER ndof, nnode, ndim, nmat, nsurf
93 REAL*8 meshpos(3,4), meshvel(3,4), meshacc(3,4), mat(3)
107 INTEGER nintk_v, knode, &
108 knodr, knodc,
i,
j,rindx,cindx,
k,mm,ll, &
109 iface, igauss, grindx,grindy,grindz
112 parameter( nintk_v = 1)
114 DOUBLE PRECISION shfn(8,8), shdx(3,8,8), dv(8), dvsum, &
115 mvgss(3), magss(3), mcgss(3,3), &
116 wsp1,wsparr(3),trmcgss,wsp2,wsp3,wsp4, &
117 third,wsp5,vxi(8),veta(8),vzeta(8),wvar, &
118 sxi(4,6),seta(4,6),szeta(4,6),shdxi(3,8,8), &
119 wsparr1(3),shdx_av(3,8)
120 DOUBLE PRECISION disp(12), velo(12), rimsi(12), dimsi(12)
121 DOUBLE PRECISION multiplier , ajacin(3,3), surfnormal(3,4)
122 DOUBLE PRECISION wt_cst, da,
sum,factor
123 DOUBLE PRECISION sto_wsp1(4),sto_wsp2(4),sto_wsp3(4),sto_wsp4(4)
124 INTEGER surf_elem(3,4), k2
126 INTEGER :: nstart, nend
132 multiplier = 1.d0/6.d0
150 wvar = 1.d0/dsqrt(3.d0)
189 DO ielem = nstart, nend
196 nx = lmcstet(
i,ielem)*3-2
197 ny = lmcstet(
i,ielem)*3-1
198 nz = lmcstet(
i,ielem)*3
199 meshpos(1,
i) = meshcoor(1,lmcstet(
i,ielem))
200 meshpos(2,
i) = meshcoor(2,lmcstet(
i,ielem))
201 meshpos(3,
i) = meshcoor(3,lmcstet(
i,ielem))
202 meshvel(1,
i) = v_bar(nx)
203 meshvel(2,
i) = v_bar(ny)
204 meshvel(3,
i) = v_bar(nz)
205 meshacc(1,
i) = a_bar(nx)
206 meshacc(2,
i) = a_bar(ny)
207 meshacc(3,
i) = a_bar(nz)
211 velo(
i*3-2) = vhalf(nx)
212 velo(
i*3-1) = vhalf(ny)
213 velo(
i*3 ) = vhalf(nz)
217 CALL
shcalc(shfn, shdx, dv, dvsum, shdx_av, meshpos, &
218 ndim,nnode,nintk_v,vxi,veta,vzeta,shdxi,ajacin)
227 mvgss(1) = 0.25d0*(meshvel(1,1)+meshvel(1,2)+ &
228 meshvel(1,3)+meshvel(1,4))
229 mvgss(2) = 0.25d0*(meshvel(2,1)+meshvel(2,2)+ &
230 meshvel(2,3)+meshvel(2,4))
231 mvgss(3) = 0.25d0*(meshvel(3,1)+meshvel(3,2)+ &
232 meshvel(3,3)+meshvel(3,4))
233 magss(1) = 0.25d0*(meshacc(1,1)+meshacc(1,2)+ &
234 meshacc(1,3)+meshacc(1,4))
235 magss(2) = 0.25d0*(meshacc(2,1)+meshacc(2,2)+ &
236 meshacc(2,3)+meshacc(2,4))
237 magss(3) = 0.25d0*(meshacc(3,1)+meshacc(3,2)+ &
238 meshacc(3,3)+meshacc(3,4))
250 mcgss(1,1) = mcgss(1,1) + meshvel(1,knode)* &
252 mcgss(2,1) = mcgss(2,1) + meshvel(2,knode)* &
254 mcgss(3,1) = mcgss(3,1) + meshvel(3,knode)* &
256 mcgss(1,2) = mcgss(1,2) + meshvel(1,knode)* &
258 mcgss(2,2) = mcgss(2,2) + meshvel(2,knode)* &
260 mcgss(3,2) = mcgss(3,2) + meshvel(3,knode)* &
262 mcgss(1,3) = mcgss(1,3) + meshvel(1,knode)* &
264 mcgss(2,3) = mcgss(2,3) + meshvel(2,knode)* &
266 mcgss(3,3) = mcgss(3,3) + meshvel(3,knode)* &
270 trmcgss = mcgss(1,1) + mcgss(2,2) + mcgss(3,3)
272 wsparr(1) = mcgss(1,1)*mvgss(1) + &
273 mcgss(1,2)*mvgss(2) + &
275 wsparr(2) = mcgss(2,1)*mvgss(1) + &
276 mcgss(2,2)*mvgss(2) + &
278 wsparr(3) = mcgss(3,1)*mvgss(1) + &
279 mcgss(3,2)*mvgss(2) + &
285 mvgss(1)*shdx(1,knodc,igauss) + &
286 mvgss(2)*shdx(2,knodc,igauss) + &
287 mvgss(3)*shdx(3,knodc,igauss)
289 wsparr(1)*shdx(1,knodc,igauss) + &
290 wsparr(2)*shdx(2,knodc,igauss) + &
291 wsparr(3)*shdx(3,knodc,igauss)
293 mvgss(1)*shdx(1,knodc,igauss) + &
294 mvgss(2)*shdx(2,knodc,igauss) + &
295 mvgss(3)*shdx(3,knodc,igauss)
297 magss(1)*shdx(1,knodc,igauss) + &
298 magss(2)*shdx(2,knodc,igauss) + &
299 magss(3)*shdx(3,knodc,igauss)
302 factor=mat(1)*dv(1)*multiplier
304 grindx = (lmcstet(knodr,ielem)-1)*3 + 1
305 grindy = (lmcstet(knodr,ielem)-1)*3 + 2
306 grindz = (lmcstet(knodr,ielem)-1)*3 + 3
311 rnet(grindx) = rnet(grindx) + &
312 factor*shfn(knodr,igauss)*2.d0* &
313 ( sto_wsp1(1)*velo((1-1)*ndim+1) + &
314 sto_wsp1(2)*velo((2-1)*ndim+1) + &
315 sto_wsp1(3)*velo((3-1)*ndim+1) + &
316 sto_wsp1(4)*velo((4-1)*ndim+1) )
318 rnet(grindy) = rnet(grindy) + &
319 factor*shfn(knodr,igauss)*2.d0* &
320 ( sto_wsp1(1)*velo((1-1)*ndim+2) + &
321 sto_wsp1(2)*velo((2-1)*ndim+2) + &
322 sto_wsp1(3)*velo((3-1)*ndim+2) + &
323 sto_wsp1(4)*velo((4-1)*ndim+2) )
325 rnet(grindz) = rnet(grindz) + &
326 factor*shfn(knodr,igauss)*2.d0* &
327 ( sto_wsp1(1)*velo((1-1)*ndim+3) + &
328 sto_wsp1(2)*velo((2-1)*ndim+3) + &
329 sto_wsp1(3)*velo((3-1)*ndim+3) + &
330 sto_wsp1(4)*velo((4-1)*ndim+3) )
335 rnet(grindx) = rnet(grindx) &
336 - factor*shfn(knodr,igauss) * ( &
337 -trmcgss*sto_wsp1(1)*disp((1-1)*ndim+1) &
338 -trmcgss*sto_wsp1(2)*disp((2-1)*ndim+1) &
339 -trmcgss*sto_wsp1(3)*disp((3-1)*ndim+1) &
340 -trmcgss*sto_wsp1(4)*disp((4-1)*ndim+1) &
341 + sto_wsp2(1)*disp((1-1)*ndim+1) &
342 + sto_wsp2(2)*disp((2-1)*ndim+1) &
343 + sto_wsp2(3)*disp((3-1)*ndim+1) &
344 + sto_wsp2(4)*disp((4-1)*ndim+1) &
345 - sto_wsp4(1)*disp((1-1)*ndim+1) &
346 - sto_wsp4(2)*disp((2-1)*ndim+1) &
347 - sto_wsp4(3)*disp((3-1)*ndim+1) &
348 - sto_wsp4(4)*disp((4-1)*ndim+1) ) &
349 - factor*sto_wsp3(knodr) * ( &
350 - sto_wsp1(1)*disp((1-1)*ndim+1) &
351 - sto_wsp1(2)*disp((2-1)*ndim+1) &
352 - sto_wsp1(3)*disp((3-1)*ndim+1) &
353 - sto_wsp1(4)*disp((4-1)*ndim+1) )
356 rnet(grindy) = rnet(grindy) &
357 - factor*shfn(knodr,igauss) * ( &
358 -trmcgss*sto_wsp1(1)*disp((1-1)*ndim+2) &
359 -trmcgss*sto_wsp1(2)*disp((2-1)*ndim+2) &
360 -trmcgss*sto_wsp1(3)*disp((3-1)*ndim+2) &
361 -trmcgss*sto_wsp1(4)*disp((4-1)*ndim+2) &
362 + sto_wsp2(1)*disp((1-1)*ndim+2) &
363 + sto_wsp2(2)*disp((2-1)*ndim+2) &
364 + sto_wsp2(3)*disp((3-1)*ndim+2) &
365 + sto_wsp2(4)*disp((4-1)*ndim+2) &
366 - sto_wsp4(1)*disp((1-1)*ndim+2) &
367 - sto_wsp4(2)*disp((2-1)*ndim+2) &
368 - sto_wsp4(3)*disp((3-1)*ndim+2) &
369 - sto_wsp4(4)*disp((4-1)*ndim+2) ) &
370 - factor*sto_wsp3(knodr) * ( &
371 - sto_wsp1(1)*disp((1-1)*ndim+2) &
372 - sto_wsp1(2)*disp((2-1)*ndim+2) &
373 - sto_wsp1(3)*disp((3-1)*ndim+2) &
374 - sto_wsp1(4)*disp((4-1)*ndim+2) )
376 rnet(grindz) = rnet(grindz) &
377 - factor*shfn(knodr,igauss) * ( &
378 -trmcgss*sto_wsp1(1)*disp((1-1)*ndim+3) &
379 -trmcgss*sto_wsp1(2)*disp((2-1)*ndim+3) &
380 -trmcgss*sto_wsp1(3)*disp((3-1)*ndim+3) &
381 -trmcgss*sto_wsp1(4)*disp((4-1)*ndim+3) &
382 + sto_wsp2(1)*disp((1-1)*ndim+3) &
383 + sto_wsp2(2)*disp((2-1)*ndim+3) &
384 + sto_wsp2(3)*disp((3-1)*ndim+3) &
385 + sto_wsp2(4)*disp((4-1)*ndim+3) &
386 - sto_wsp4(1)*disp((1-1)*ndim+3) &
387 - sto_wsp4(2)*disp((2-1)*ndim+3) &
388 - sto_wsp4(3)*disp((3-1)*ndim+3) &
389 - sto_wsp4(4)*disp((4-1)*ndim+3) ) &
390 - factor*sto_wsp3(knodr) * ( &
391 - sto_wsp1(1)*disp((1-1)*ndim+3) &
392 - sto_wsp1(2)*disp((2-1)*ndim+3) &
393 - sto_wsp1(3)*disp((3-1)*ndim+3) &
394 - sto_wsp1(4)*disp((4-1)*ndim+3) )
412 shfn(1,1)=szeta(1,iface)
413 shfn(2,1)=sxi(1,iface)
414 shfn(3,1)=1.d0-sxi(1,iface)-seta(1,iface)-szeta(1,iface)
415 shfn(4,1)=seta(1,iface)
420 mvgss(
j) = mvgss(
j) + meshvel(
j,knode)* &
428 wsparr(
j) =meshpos(
j,surf_elem(2,iface)) - &
429 meshpos(
j,surf_elem(1,iface))
430 wsparr1(
j)=meshpos(
j,surf_elem(3,iface)) - &
431 meshpos(
j,surf_elem(1,iface))
436 wsp1 = wsparr(2)*wsparr1(3) - wsparr(3)*wsparr1(2)
437 wsp2 = wsparr(3)*wsparr1(1) - wsparr(1)*wsparr1(3)
438 wsp3 = wsparr(1)*wsparr1(2) - wsparr(2)*wsparr1(1)
439 wsparr(1) = wsp1 * 0.5d0
440 wsparr(2) = wsp2 * 0.5d0
441 wsparr(3) = wsp3 * 0.5d0
446 wsp1 = mvgss(1)*wsparr(1) &
447 + mvgss(2)*wsparr(2) &
455 mvgss(1)*shdx(1,knodc,igauss) + &
456 mvgss(2)*shdx(2,knodc,igauss) + &
457 mvgss(3)*shdx(3,knodc,igauss)
462 grindx = (lmcstet(knodr,ielem)-1)*3 + 1
463 grindy = (lmcstet(knodr,ielem)-1)*3 + 2
464 grindz = (lmcstet(knodr,ielem)-1)*3 + 3
466 rnet(grindx) = rnet(grindx) &
467 - mat(1)*shfn(knodr,igauss)*wsp1*( &
468 + sto_wsp2(1)*disp((1-1)*ndim+1) &
469 + sto_wsp2(2)*disp((2-1)*ndim+1) &
470 + sto_wsp2(3)*disp((3-1)*ndim+1) &
471 + sto_wsp2(4)*disp((4-1)*ndim+1) )
473 rnet(grindy) = rnet(grindy) &
474 - mat(1)*shfn(knodr,igauss)*wsp1*( &
475 + sto_wsp2(1)*disp((1-1)*ndim+2) &
476 + sto_wsp2(2)*disp((2-1)*ndim+2) &
477 + sto_wsp2(3)*disp((3-1)*ndim+2) &
478 + sto_wsp2(4)*disp((4-1)*ndim+2) )
480 rnet(grindz) = rnet(grindz) &
481 - mat(1)*shfn(knodr,igauss)*wsp1*( &
482 + sto_wsp2(1)*disp((1-1)*ndim+3) &
483 + sto_wsp2(2)*disp((2-1)*ndim+3) &
484 + sto_wsp2(3)*disp((3-1)*ndim+3) &
485 + sto_wsp2(4)*disp((4-1)*ndim+3) )
494 111
FORMAT(i5,5e15.7)
Tfloat sum() const
Return the sum of all the pixel values in an image.
subroutine shcalc(shfn, shdx, dv, dvsum, shdx_av, meshpos, ndim, nnode, nintk, xi, eta, zeta, shdxi, wsp2)
subroutine v3d4_ale(v_bar, a_bar, d, vhalf, Rnet, E, xnu, rho, numnp, numat_vol, numcstet, matcstet, lmcstet, meshcoor, nstart, nend)