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