44
45
46
47
48
49
50
51
52
53
54
55
56
58 USE elbufdef_mod
59
60
61
62#include "implicit_f.inc"
63#include "spmd_c.inc"
64
65
66
67#include "com01_c.inc"
68#include "com04_c.inc"
69#include "com08_c.inc"
70#include "param_c.inc"
71#include "task_c.inc"
72#include "tabsiz_c.inc"
73
74
75
76
77
78
79
80
81 INTEGER NALE(NUMNOD), NODFT, NODLT, ITASK,
82 . IPARG(NPARG,NGROUP),IXS(NIXS,NUMELS),IXQ(NIXQ,NUMELQ)
83 my_real x(3,sx/3), v(3,sv/3), w(3,sw/3), wa(3,*), xcell(3, *), xface(3,6,*)
84 TYPE(t_connectivity), INTENT(IN) :: ALE_NE_CONNECT
85 INTEGER, INTENT(IN) :: NERCVOIS(*), NESDVOIS(*), LERCVOIS(*), LESDVOIS(*)
86 TYPE(ELBUF_STRUCT_), DIMENSION(NGROUP) :: ELBUF_TAB
87
88
89
90 INTEGER I, LENCOM
91 INTEGER :: IAD1, IAD2, NG, NEL, NFT, ITY, ISOLNOD, IEL, ELT_ID
92 my_real :: sum_vol, y1, y2, y3, y4, z1, z2, z3, z4, a1, a2
93
94
95
96 wa(1:3,nodft:nodlt)=x(1:3,nodft:nodlt)
98 DO ng = itask + 1, ngroup, nthread
99 nel = iparg(2, ng)
100 nft = iparg(3, ng)
101 ity = iparg(5, ng)
102 isolnod = iparg(28, ng)
103 IF (ity == 1 .AND. isolnod /= 4) THEN
105 . xcell(:, 1 + nft : nel + nft),
106 . xface(:, :, 1 + nft : nel + nft))
107 ELSEIF (ity == 1 .AND. isolnod == 4) THEN
109 . xcell(:, 1 + nft : nel + nft),
110 . xface(:, :, 1 + nft : nel + nft))
111 ELSEIF (ity == 2) THEN
113 . xcell(:, 1 + nft : nel + nft),
114 . xface(:, :, 1 + nft : nel + nft))
115 ENDIF
116 IF (ity == 1 .OR. ity == 2) THEN
117
118 IF (n2d /= 1) THEN
119 DO i = 1, nel
120 xface(1,1,i + nft) = elbuf_tab(ng)%GBUF%VOL(i)
121 ENDDO
122 ELSE
123 DO i = 1, nel
124 y1 = x(2, ixq(2, i + nft))
125 y2 = x(2, ixq(3, i + nft))
126 y3 = x(2, ixq(4, i + nft))
127 y4 = x(2, ixq(5, i + nft))
128 z1 = x(3, ixq(2, i + nft))
129 z2 = x(3, ixq(3, i + nft))
130 z3 = x(3, ixq(4, i + nft))
131 z4 = x(3, ixq(5, i + nft))
132 a1 =y2*(z3-z4)+y3*(z4-z2)+y4*(z2-z3)
133 a2 =y2*(z4-z1)+y4*(z1-z2)+y1*(z2-z4)
134 xface(1,1,i + nft) = (a1+a2)*half
135 ENDDO
136 ENDIF
137 ENDIF
138 ENDDO
140 IF (nspmd > 1) THEN
141
142 lencom = nercvois(nspmd + 1) + nesdvois(nspmd + 1)
143 CALL spmd_e1vois(xface(2,1,1:numels + numelq + ne_nsvois + ne_nqvois),
144 . nercvois, nesdvois, lercvois, lesdvois, lencom)
146 . nercvois, nesdvois, lercvois, lesdvois, lencom)
147 CALL spmd_e1vois(xface(1,1,1:numels + numelq + ne_nsvois + ne_nqvois),
148 . nercvois, nesdvois, lercvois, lesdvois, lencom)
149
150 ENDIF
152
153 DO i = nodft, nodlt
154 IF (iabs(nale(i)) == 1) THEN
155 x(1:3, i) = zero
156 sum_vol = zero
157 iad1 = ale_ne_connect%IAD_CONNECT(i)
158 iad2 = ale_ne_connect%IAD_CONNECT(i + 1) - 1
159 DO iel = iad1, iad2
160 elt_id = ale_ne_connect%CONNECTED(iel)
161 x(1:3, i) = x(1:3, i) + xface(1,1,elt_id) * xcell(1:3, elt_id)
162 sum_vol = sum_vol + xface(1,1,elt_id)
163 ENDDO
164 x(1:3, i) = x(1:3, i) / sum_vol
165 ENDIF
166 ENDDO
167 DO i = nodft, nodlt
168 IF ( iabs(nale(i)) == 1 .AND. dt2 > zero) THEN
169 w(1:3,i) = (x(1:3,i) - wa(1:3,i)) / dt2
170 ELSE IF (nale(i) == 0) THEN
171 w(1:3,i) = v(1:3,i)
172 ELSE
173 w(1:3, i) = zero
174 ENDIF
175 x(1:3,i) = wa(1:3,i)
176 ENDDO
178
subroutine centroid3t(nel, length, nft, ixs, xgrid, elem_centroid, face_centroid)
subroutine centroid3(nel, length, nft, ixs, xgrid, elem_centroid, face_centroid)
subroutine centroid2(nel, length, nft, ixq, xgrid, elem_centroid, face_centroid)
subroutine spmd_envois(dim, phi, nercvois, nesdvois, lercvois, lesdvois, lencom)
subroutine spmd_e1vois(phi, nercvois, nesdvois, lercvois, lesdvois, lencom)