20 INTEGER,
POINTER :: me, mes
21 INTEGER,
DIMENSION(:, :),
POINTER :: jj
22 INTEGER,
DIMENSION(:, :),
POINTER :: js
23 REAL(KIND=8),
DIMENSION(:, :),
POINTER :: rr
25 INTEGER,
PARAMETER :: k_d = 2, n_w = 6, l_g = 7, &
28 REAL(KIND=8),
DIMENSION(:, :),
POINTER :: ww
29 REAL(KIND=8),
DIMENSION(:, :),
POINTER :: wws
30 REAL(KIND=8),
DIMENSION(:, :, :, :),
POINTER :: dw
31 REAL(KIND=8),
DIMENSION(:, :, :),
POINTER :: rnorms
32 REAL(KIND=8),
DIMENSION(:, :),
POINTER :: rj
33 REAL(KIND=8),
DIMENSION(:, :),
POINTER :: rjs
34 REAL(KIND=8),
DIMENSION(:, :, :, :),
POINTER :: dw_s
35 REAL(KIND=8),
DIMENSION(:, :, :, :),
POINTER :: dwps
36 REAL(KIND=8),
DIMENSION(:, :, :, :),
POINTER :: dws
38 REAL(KIND=8),
DIMENSION(k_d, n_w, l_G) :: dd
39 REAL(KIND=8),
DIMENSION(1, n_ws, l_Gs) :: dds
40 REAL(KIND=8),
DIMENSION(l_G) :: pp
41 REAL(KIND=8),
DIMENSION(l_Gs) :: pps
42 REAL(KIND=8),
DIMENSION(n_w) :: r
43 REAL(KIND=8),
DIMENSION(n_ws) :: rs
44 REAL(KIND=8),
DIMENSION(k_d, k_d) :: dr
45 REAL(KIND=8),
DIMENSION(1, k_d) :: drs
47 REAL(KIND=8) :: rjac, rjacs, x
48 INTEGER :: m, l, k, k1, n, ms, ls, face, n1, n2, cote, sign
49 REAL(KIND=8),
DIMENSION(2) :: rnor, rsd
52 REAL(KIND=8),
DIMENSION(n_w, l_G) :: ww_s
55 INTEGER,
DIMENSION(n_ws) :: nface
56 INTEGER,
DIMENSION(l_Gs) :: ngauss
65 IF (mesh%edge_stab)
THEN
66 ALLOCATE(mesh%gauss%dwni(n_w, l_gs, 2, mesh%mi))
67 ALLOCATE(mesh%gauss%rji(l_gs, mesh%mi))
68 ALLOCATE(mesh%gauss%rnormsi(k_d, l_gs, 2, mesh%mi))
69 ALLOCATE(mesh%gauss%wwsi(n_ws, l_gs))
73 ALLOCATE(mesh%gauss%ww(n_w, l_g))
74 ALLOCATE(mesh%gauss%wws(n_ws, l_gs))
75 ALLOCATE(mesh%gauss%dw(k_d, n_w, l_g, me ))
76 ALLOCATE(mesh%gauss%rnorms(k_d, l_gs, mes))
77 ALLOCATE(mesh%gauss%rj(l_g, me ))
78 ALLOCATE(mesh%gauss%rjs(l_gs, mes))
80 ALLOCATE(mesh%gauss%dw_s(k_d, n_w, l_gs, mesh%mes))
82 ALLOCATE(mesh%gauss%dwps(1, n_ws, l_gs, mes))
83 ALLOCATE(mesh%gauss%dws(1, n_ws, l_gs, mes))
88 rnorms => mesh%gauss%rnorms
92 dw_s => mesh%gauss%dw_s
94 dwps => mesh%gauss%dwps
100 mesh%gauss%n_ws = n_ws
101 mesh%gauss%l_Gs = l_gs
117 dr(k, k1) = sum(r * dd(k1,:,l))
121 rjac = dr(1,1)*dr(2,2) - dr(1,2)*dr(2,1)
125 = (+ dd(1,n,l)*dr(2,2) - dd(2,n,l)*dr(2,1))/rjac
127 = (- dd(1,n,l)*dr(1,2) + dd(2,n,l)*dr(1,1))/rjac
130 rj(l, m) = rjac * pp(l)
145 IF (minval(abs(js(:,ms)-jj(n,m)))==0) cycle
149 n1 = modulo(face,3)+1; n2 = modulo(face+1,3)+1
150 IF (js(1,ms)==jj(n1,m) .AND. js(2,ms)==jj(n2,m))
THEN
151 nface(1)=n1; nface(2)=n2; nface(3)=face+3
152 ngauss(1)=1; ngauss(2)=2; ngauss(3)=3;
154 ELSE IF (js(1,ms)==jj(n2,m) .AND. js(2,ms)==jj(n1,m))
THEN
155 nface(1)=n2; nface(2)=n1; nface(3)=face+3
156 ngauss(1)=3; ngauss(2)=2; ngauss(3)=1;
159 WRITE(*,*)
' BUG : gauss_points_2d_p2'
171 dr(k, k1) = sum(r * dd(k1,:,ls))
175 rjac = (dr(1,1)*dr(2,2) - dr(1,2)*dr(2,1))
178 dw_s(1, n, ngauss(ls), ms) &
179 = (+ dd(1,n,ls)*dr(2,2) - dd(2,n,ls)*dr(2,1))/rjac
180 dw_s(2, n, ngauss(ls), ms) &
181 = (- dd(1,n,ls)*dr(1,2) + dd(2,n,ls)*dr(1,1))/rjac
197 drs(1, k) = sum(rs * dds(1,:,ls))
200 rjacs = sqrt( drs(1,1)**2 + drs(1,2)**2 )
202 rnorms(1, ls, ms) = - drs(1,2)/rjacs
203 rnorms(2, ls, ms) = + drs(1,1)/rjacs
205 rjs(ls, ms) = rjacs * pps(ls)
210 IF (minval(abs(js(:,ms)-jj(n,m)))==0) cycle
213 rs(1:k_d) = rr(:,jj(face,m)) - (rr(:,js(1,ms))+rr(:,js(2,ms)))/2
214 x = sum(rnorms(:,ls,ms)*rs(1:k_d))
216 rnorms(:,ls,ms) = -rnorms(:,ls,ms)
241 dwps(1, :, ls, ms) = dds(1, :, ls) * pps(ls)
242 dws(1, :, ls, ms) = dds(1, :, ls)
252 IF (mesh%edge_stab)
THEN
256 m = mesh%neighi(cote,ms)
259 IF (minval(abs(mesh%jjsi(:,ms)-jj(n,m)))==0) cycle
263 n1 = modulo(face,3)+1; n2 = modulo(face+1,3)+1
264 IF (mesh%jjsi(1,ms)==jj(n1,m) .AND. mesh%jjsi(2,ms)==jj(n2,m))
THEN
265 nface(1)=n1; nface(2)=n2
267 ngauss(1)=1; ngauss(2)=2; ngauss(3)=3
268 ELSE IF (mesh%jjsi(1,ms)==jj(n2,m) .AND. mesh%jjsi(2,ms)==jj(n1,m))
THEN
269 nface(1)=n2; nface(2)=n1
271 ngauss(1)=3; ngauss(2)=2; ngauss(3)=1
273 WRITE(*,*)
' BUG : gauss_points_2d_p2'
279 rs = rr(k, mesh%jjsi(:,ms))
280 drs(1, k) = sum(rs * dds(1,:,ls))
282 rjacs = sqrt( drs(1,1)**2 + drs(1,2)**2 )
283 mesh%gauss%rji(ls, ms) = rjacs * pps(ls)
284 rnor(1) = drs(1,2)/rjacs
285 rnor(2) = - drs(1,1)/rjacs
286 mesh%gauss%rnormsi(1, ls, cote, ms) = rnor(1)
287 mesh%gauss%rnormsi(2, ls, cote, ms) = rnor(2)
288 rsd = rr(:,jj(face,m)) - (rr(:,mesh%jjsi(1,ms))+rr(:,mesh%jjsi(2,ms)))/2
299 dr(k, k1) = sum(r * dd(k1,:,ls))
302 rjac = (dr(1,1)*dr(2,2) - dr(1,2)*dr(2,1))
310 mesh%gauss%dwni(n, ngauss(ls), cote, ms) &
311 = rnor(1)*(+ dd(1,n,ls)*dr(2,2) - dd(2,n,ls)*dr(2,1))/rjac &
312 + rnor(2)*(- dd(1,n,ls)*dr(1,2) + dd(2,n,ls)*dr(1,1))/rjac
325 m = mesh%neighi(cote,ms)
327 x = abs(sqrt(sum(mesh%gauss%rnormsi(:, ls, cote, ms)**2))-1.d0)
329 IF (x.GE.1.d-13)
THEN
330 write(*,*)
'Bug1 in normal '
333 rjac = (rr(1, mesh%jjsi(2,ms)) - rr(1, mesh%jjsi(1,ms)))*mesh%gauss%rnormsi(1, ls, cote, ms) &
334 + (rr(2, mesh%jjsi(2,ms)) - rr(2, mesh%jjsi(1,ms)))*mesh%gauss%rnormsi(2, ls, cote, ms)
335 x = sqrt((rr(1, mesh%jjsi(2,ms)) - rr(1, mesh%jjsi(1,ms)))**2 +&
336 (rr(2, mesh%jjsi(2,ms)) - rr(2, mesh%jjsi(1,ms)))**2)
338 IF (abs(rjac/x) .GE. 1.d-13)
THEN
339 write(*,*)
'Bug2 in normal '
362 REAL(KIND=8),
DIMENSION( n_w, l_G),
INTENT(OUT) :: w
363 REAL(KIND=8),
DIMENSION(2, n_w, l_G),
INTENT(OUT) :: d
364 REAL(KIND=8),
DIMENSION(l_G),
INTENT(OUT) :: p
366 REAL(KIND=8),
DIMENSION(l_G) :: xx, yy
369 REAL(KIND=8) :: zero = 0, half = 0.5, one = 1, &
370 two = 2, three = 3, four = 4, &
373 REAL(KIND=8) :: f1, f2, f3, f4, f5, f6, &
374 df1x, df2x, df3x, df4x, df5x, df6x, &
375 df1y, df2y, df3y, df4y, df5y, df6y, &
376 x, y, r, a, s1, s2, t1, t2, b1, b2, area, sq
379 f1(x, y) = (half - x - y) * (one - x - y) * two
380 f2(x, y) = x * (x - half) * two
381 f3(x, y) = y * (y - half) * two
382 f4(x, y) = x * y * four
383 f5(x, y) = y * (one - x - y) * four
384 f6(x, y) = x * (one - x - y) * four
386 df1x(x, y) = -three + four * (x + y)
387 df2x(x, y) = (two*x - half) * two
389 df4x(x, y) = y * four
390 df5x(x, y) = -y * four
391 df6x(x, y) = (one - two*x - y) * four
393 df1y(x, y) = -three + four * (x + y)
395 df3y(x, y) = (two*y - half) * two
396 df4y(x, y) = x * four
397 df5y(x, y) = (one - x - two*y) * four
398 df6y(x, y) = -x * four
405 sq = sqrt(three*five)
407 r = one/three; a = area * nine/40
409 s1 = (6 - sq)/21; t1 = (9 + 2*sq)/21; b1 = area * (155 - sq)/1200
411 s2 = (6 + sq)/21; t2 = (9 - 2*sq)/21; b2 = area * (155 + sq)/1200
413 xx(1) = r; yy(1) = r; p(1) = a
415 xx(2) = s1; yy(2) = s1; p(2) = b1
416 xx(3) = s1; yy(3) = t1; p(3) = b1
417 xx(4) = t1; yy(4) = s1; p(4) = b1
419 xx(5) = s2; yy(5) = s2; p(5) = b2
420 xx(6) = s2; yy(6) = t2; p(6) = b2
421 xx(7) = t2; yy(7) = s2; p(7) = b2
426 w(1, j) = f1(xx(j), yy(j))
427 d(1, 1, j) = df1x(xx(j), yy(j))
428 d(2, 1, j) = df1y(xx(j), yy(j))
430 w(2, j) = f2(xx(j), yy(j))
431 d(1, 2, j) = df2x(xx(j), yy(j))
432 d(2, 2, j) = df2y(xx(j), yy(j))
434 w(3, j) = f3(xx(j), yy(j))
435 d(1, 3, j) = df3x(xx(j), yy(j))
436 d(2, 3, j) = df3y(xx(j), yy(j))
438 w(4, j) = f4(xx(j), yy(j))
439 d(1, 4, j) = df4x(xx(j), yy(j))
440 d(2, 4, j) = df4y(xx(j), yy(j))
442 w(5, j) = f5(xx(j), yy(j))
443 d(1, 5, j) = df5x(xx(j), yy(j))
444 d(2, 5, j) = df5y(xx(j), yy(j))
446 w(6, j) = f6(xx(j), yy(j))
447 d(1, 6, j) = df6x(xx(j), yy(j))
448 d(2, 6, j) = df6y(xx(j), yy(j))
463 INTEGER,
INTENT(IN) :: face
464 REAL(KIND=8),
DIMENSION(2, n_w, l_Gs),
INTENT(OUT) :: d
465 REAL(KIND=8),
DIMENSION( n_w, l_G),
INTENT(OUT) :: w
467 REAL(KIND=8),
DIMENSION(l_G) :: xx, yy
470 REAL(KIND=8) :: zero = 0, half = 0.5d0, one = 1, &
471 two = 2, three = 3, four = 4, &
474 REAL(KIND=8) :: f1, f2, f3, f4, f5, f6, &
475 df1x, df2x, df3x, df4x, df5x, df6x, &
476 df1y, df2y, df3y, df4y, df5y, df6y, &
480 f1(x, y) = (half - x - y) * (one - x - y) * two
481 f2(x, y) = x * (x - half) * two
482 f3(x, y) = y * (y - half) * two
483 f4(x, y) = x * y * four
484 f5(x, y) = y * (one - x - y) * four
485 f6(x, y) = x * (one - x - y) * four
487 df1x(x, y) = -three + four * (x + y)
488 df2x(x, y) = (two*x - half) * two
490 df4x(x, y) = y * four
491 df5x(x, y) = -y * four
492 df6x(x, y) = (one - two*x - y) * four
494 df1y(x, y) = -three + four * (x + y)
496 df3y(x, y) = (two*y - half) * two
497 df4y(x, y) = x * four
498 df5y(x, y) = (one - x - two*y) * four
499 df6y(x, y) = -x * four
502 xx(1) = half + half*sqrt(three/five)
503 yy(1) = half - half*sqrt(three/five)
508 xx(3) = half - half*sqrt(three/five)
509 yy(3) = half + half*sqrt(three/five)
510 ELSE IF (face==2)
THEN
512 yy(1) = half + half*sqrt(three/five)
518 yy(3) = half - half*sqrt(three/five)
520 xx(1) = half - half*sqrt(three/five)
526 xx(3) = half + half*sqrt(three/five)
533 w(1, j) = f1(xx(j), yy(j))
534 d(1, 1, j) = df1x(xx(j), yy(j))
535 d(2, 1, j) = df1y(xx(j), yy(j))
537 w(2, j) = f2(xx(j), yy(j))
538 d(1, 2, j) = df2x(xx(j), yy(j))
539 d(2, 2, j) = df2y(xx(j), yy(j))
541 w(3, j) = f3(xx(j), yy(j))
542 d(1, 3, j) = df3x(xx(j), yy(j))
543 d(2, 3, j) = df3y(xx(j), yy(j))
545 w(4, j) = f4(xx(j), yy(j))
546 d(1, 4, j) = df4x(xx(j), yy(j))
547 d(2, 4, j) = df4y(xx(j), yy(j))
549 w(5, j) = f5(xx(j), yy(j))
550 d(1, 5, j) = df5x(xx(j), yy(j))
551 d(2, 5, j) = df5y(xx(j), yy(j))
553 w(6, j) = f6(xx(j), yy(j))
554 d(1, 6, j) = df6x(xx(j), yy(j))
555 d(2, 6, j) = df6y(xx(j), yy(j))
574 REAL(KIND=8),
DIMENSION( n_ws, l_Gs),
INTENT(OUT) :: w
575 REAL(KIND=8),
DIMENSION(1, n_ws, l_Gs),
INTENT(OUT) :: d
576 REAL(KIND=8),
DIMENSION(l_Gs),
INTENT(OUT) :: p
578 REAL(KIND=8),
DIMENSION(l_Gs) :: xx
581 REAL(KIND=8) :: zero = 0, one = 1, two = 2, three = 3, &
582 five = 5, eight= 8, nine = 9
584 REAL(KIND=8) :: f1, f2, f3, df1, df2, df3, x
586 f1(x) = (x - one)*x/two
587 f2(x) = (x + one)*x/two
588 f3(x) = (x + one)*(one - x)
590 df1(x) = (two*x - one)/two
591 df2(x) = (two*x + one)/two
594 xx(1) = -sqrt(three/five)
596 xx(3) = sqrt(three/five)
605 d(1, 1, j) = df1(xx(j))
608 d(1, 2, j) = df2(xx(j))
611 d(1, 3, j) = df3(xx(j))
subroutine, public gauss_points_2d_p2(mesh)
subroutine element_1d_p2(w, d, p)
subroutine element_2d_p2_boundary(face, d, w)
subroutine element_2d_p2(w, d, p)