33 coor, nodes, mattype, ri, rho, cap, elconnvol )
45 INTEGER :: numel, numnp, nummat
46 INTEGER,
DIMENSION(1:NumEl) :: mattype
47 INTEGER,
DIMENSION(1:8,1:NumEl) :: nodes
48 REAL(KIND=wp),
DIMENSION(1:3,1:NumNP) :: coor
49 REAL(KIND=wp),
DIMENSION(1:3,1:8) :: ri
50 REAL(KIND=wp),
DIMENSION(1:NumMat) :: rho, cap
51 INTEGER,
DIMENSION(1:8,1:NumEl) :: elconnvol
54 REAL(kind=wp),
DIMENSION(1:8) ::
n
55 REAL(kind=wp),
DIMENSION(1:8,1:3) :: dn
56 REAL(kind=wp),
DIMENSION(1:8,1:8) :: ntn
61 INTEGER ::
i,
j,
k, l, tempi, tempj
62 INTEGER :: dof1, dof2, gdof1, gdof2, ldof1, ldof2
63 REAL(kind=wp) :: tempval, tempval2, tempval3
65 REAL(kind=wp) :: element_volume
66 REAL(kind=wp),
DIMENSION(1:3,1:3) :: jac, jacinv
71 INTEGER :: diag_width = 30
72 REAL(kind=wp) :: t1,t2,t3,t4
74 INTEGER :: n1,n2,n3,n4,n5,n6,n7,n8
75 REAL(kind=wp),
DIMENSION(1:3,1:8) :: coordtmp
76 INTEGER,
DIMENSION(1:8) :: l2g_temp
79 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: rp, cval
80 REAL(KIND=wp),
ALLOCATABLE,
DIMENSION(:) :: aval
81 REAL(kind=wp),
ALLOCATABLE,
DIMENSION(:,:) :: glmassmat
85 REAL(kind=wp),
ALLOCATABLE,
DIMENSION(:) :: values
86 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: col_index
100 ALLOCATE(values(1:gnumnp*diag_width))
101 ALLOCATE(col_index(1:gnumnp*diag_width))
115 CALL mpi_barrier(rocstar_communicator,ierr)
121 n1 = elconnvol(1,ielem)
122 n2 = elconnvol(2,ielem)
123 n3 = elconnvol(3,ielem)
124 n4 = elconnvol(4,ielem)
125 n5 = elconnvol(5,ielem)
126 n6 = elconnvol(6,ielem)
127 n7 = elconnvol(7,ielem)
128 n8 = elconnvol(8,ielem)
130 coordtmp(1,1) = coor(1,n1)
131 coordtmp(2,1) = coor(2,n1)
132 coordtmp(3,1) = coor(3,n1)
133 coordtmp(1,2) = coor(1,n2)
134 coordtmp(2,2) = coor(2,n2)
135 coordtmp(3,2) = coor(3,n2)
136 coordtmp(1,3) = coor(1,n3)
137 coordtmp(2,3) = coor(2,n3)
138 coordtmp(3,3) = coor(3,n3)
139 coordtmp(1,4) = coor(1,n4)
140 coordtmp(2,4) = coor(2,n4)
141 coordtmp(3,4) = coor(3,n4)
142 coordtmp(1,5) = coor(1,n5)
143 coordtmp(2,5) = coor(2,n5)
144 coordtmp(3,5) = coor(3,n5)
145 coordtmp(1,6) = coor(1,n6)
146 coordtmp(2,6) = coor(2,n6)
147 coordtmp(3,6) = coor(3,n6)
148 coordtmp(1,7) = coor(1,n7)
149 coordtmp(2,7) = coor(2,n7)
150 coordtmp(3,7) = coor(3,n7)
151 coordtmp(1,8) = coor(1,n8)
152 coordtmp(2,8) = coor(2,n8)
153 coordtmp(3,8) = coor(3,n8)
156 imat = mattype(ielem)
173 jacinv(1:3,1:3) = 0.0
175 element_volume = element_volume + detj
180 ntn(
i,
j) = ntn(
i,
j) + cap(imat)*rho(imat)*
n(
i)*
n(
j)*detj
191 gdof1 = local2global(elconnvol(
i,ielem))
195 gdof2 = local2global(elconnvol(
j,ielem))
198 IF ( ldof1 <= ldof2 )
THEN
199 tempval = ntn(ldof1,ldof2)
201 tempval = ntn(ldof2,ldof1)
204 IF ( tempval == 0.0 )
THEN
205 print*,
'ZERO DETECTED IN LOCAL CAPACITANCE MATRIX!',gdof1,gdof2,myid
207 tempi = (gdof1-1)*diag_width
212 IF(col_index(tempi+
k).EQ.-1)
THEN
214 col_index(tempi+
k)=gdof2
215 values(tempi+
k)=tempval
221 ELSEIF((col_index(tempi+
k).LT.gdof2).AND.(col_index(tempi+
k+1).GT.gdof2))
THEN
222 DO l= diag_width-1,
k+1, -1
223 tempj = col_index(tempi+l)
224 col_index(tempi+l+1)=tempj
225 tempval2 = values(tempi+l)
226 values(tempi+l+1) = tempval2
229 col_index(tempi+
k+1) = gdof2
230 values(tempi+
k+1) = tempval
234 ELSEIF((col_index(tempi+
k).LT.gdof2).AND.(col_index(tempi+
k+1).EQ.-1))
THEN
235 values(tempi+
k+1)=tempval
236 col_index(tempi+
k+1)=gdof2
241 ELSEIF(col_index(tempi+
k).EQ.gdof2)
THEN
242 values(tempi+
k)= values(tempi+
k) + tempval
247 ELSEIF(col_index(tempi+
k).GT.gdof2)
THEN
248 DO l= diag_width-1,
k, -1
249 tempj = col_index(tempi+l)
250 col_index(tempi+l+1)=tempj
251 tempval2 = values(tempi+l)
252 values(tempi+l+1) = tempval2
254 col_index(tempi+
k) = gdof2
255 values(tempi+
k) = tempval
262 if(myid.eq.0)
print*,
'FINISHED FORMING GLB CAPACITANCE MATRIX FOR ELEMENT',ielem
266 DO i= 1,gnumnp*diag_width
267 IF (col_index(
i).NE.-1)
THEN
273 ALLOCATE(rp_temp(1:gnumnp+1))
274 ALLOCATE(cval_temp(1:tempi))
275 ALLOCATE(aval_temp(1:tempi))
280 DO i= 1, gnumnp*diag_width
281 IF (col_index(
i).NE.-1)
THEN
282 cval_temp(tempi) = col_index(
i)
283 aval_temp(tempi) = values(
i)
294 IF (col_index((
i-1)*diag_width+
j).NE.-1)
THEN
298 rp_temp(
i+1) = rp_temp(
i) + tempi
303 cval_temp(
i)=cval_temp(
i)-1
308 DEALLOCATE(col_index)
subroutine locthermcap_v3d8(NumEl, NumNP, NumMat, coor, nodes, MatType, ri, rho, cap, ElConnVol)
subroutine get_jacobien(coords, mcrd, nnode, dn, jac, jacinv, detj, error)
subroutine get_shape(r, n, dn, igpt)