d 2 u(t) dt 2 = u 16.4 ε(u) = 0 u(x,y) =?

Save this PDF as:
 WORD  PNG  TXT  JPG

Μέγεθος: px
Εμφάνιση ξεκινά από τη σελίδα:

Download "d 2 u(t) dt 2 = u 16.4 ε(u) = 0 u(x,y) =?"

Transcript

1

2

3

4 d 2 u(t) dt 2 = 9.8 u(t) = 4.9t 2 +v 0 t+u u 16.4 ε(u) = 0 u(x,y) =?

5 Find u H 2 (Ω) s.t. (a(x,y) u)+b(x,y) u+c(x,y)u = f(x,y) in Ω a(x,y) u n = g N (x,y) on Ω N u = g D (x,y) on Ω D Here Ω R d is a bounded domain, n is the unit normal vector, a is a d d spd matrix, b is a vector of length d, and [a] i,j, [b] i, c, f, g N, and g D are scalar functions. Find u h S h H 1 (Ω) s.t. u h = u D + n k=1 U kψ k ψ k

6 Partition Ω n i=1 t i triangles into p subsets, T 1,...,T p such that T i T j i,j and δ h (T 1,...T p ) = min T 1,..., T p δ h ( T 1,..., T p ) T k = 268 δ h = 43 T k = 268 δ h = 111 Equal parts Minimize cut

7 Find u 1 H 2 (Ω 1 ) s.t. Lu 1 = f 1 in Ω 1 Bu 1 = g 1 on Ω 1 \Γ 1 u 1 = u 2 on Γ 1 Find u 2 H 2 (Ω 2 ) s.t. Lu 2 = f 2 in Ω 2 Bu 2 = g 2 on Ω 2 \Γ 2 Define L as the differential operator u 2 = u 1 on Γ 2 Lu (a(x,y) u)+b(x,y) u+c(x,y)u Define B as the boundary operator { a(x,y) u n on ΩN Bu u on Ω D Communicate Γ 1 and Γ 2.

8 [ A1 A 1,2 A 2,1 A 2 ][ U1 U 2 ] = [ B1 B 2 ] [ ][ ] k [ ] [ A1 0 U1 B1 = 0 A 2 U 2 B A 2,1 0 DU k = (E +F)U k 1 +B U k = ( D 1 (E +F) ) U k 1 +C [ ][ ] k [ ] [ A1 0 U1 B1 = 0 A 2 U 2 B 2 (D E)U k = FU k 1 +B 0 0 A 2,1 0 U k = ( (D E) 1 F ) U k 1 +C ][ ] k 1 [ U1 0 A1,2 U ][ ] k [ U1 0 A1,2 U ][ U1 U 2 ] k 1 ][ U1 U 2 ] k 1

9 Find u 1 H 2 (Ω 1 ) s.t. Lu 1 = f 1 in Ω 1 Bu 1 = g 1 on Ω 1 \Γ a u 1 n = λ on Γ Find u 2 H 2 (Ω 2 ) s.t. Constrain u 1 = u 2 on Γ Update λ Lu 2 = f 2 in Ω 1 Bu 2 = g 2 on Ω 2 \Γ a u 2 n = λ on Γ Communicate λ Communicate Γ

10 A II 1 A IB A BI 1 A BB I 0 0 Ā II 2 Ā IB 2 0 Ā BB 0 0 Ā BI 2 0 I 0 I 0 2 I δu I 1 δu B 1 δūi 2 δūb 2 λ = R I 1 R B 1 R I 2 R B 2 U B 2 U B 1 A II 1 A IB 1 0 A BI 1 A BB 1 +ĀBB 2 0 Ā IB 2 Ā BI 2 Ā II 2 δu I 1 δu B 1 δūi 2 = R I 1 R1 B +R2 B +ĀBB 2 (U2 B U1 B ) Ā IB 2 (U2 B U1 B )

11 Equal parts Minimize cut

12 Solving a PDE (1) Find n unknowns instead of u(x,y) (2) Partition with equal parts and minimize cut. (3) Domain Decomposition Method with iterations. When a PDE has strong convection or anistropic diffusion, directional dependence exists and a partition that favors this direction is desirable. Incorporating this information into (2) reduces DD iterations.

13 K (1) ɛ K (2) ɛ U k = ( D 1 (E +F) ) U k 1 +C ρ(d 1 (1) (E (1) +F (1) )) ρ(d 1 (2) (E (2) +F (2) )) u 1 = 0 λ = λ [ β ] u 1 = 0 β > 1 m+1))) Um 2 (1+ 1 β(1+cos( mπ m+1))) Um 2 1(1+ 1 β(1+cos( mπ > m+1))) Um 2 (1+β(1+cos( mπ m+1))) Um 2 1(1+β(1+cos( mπ [ β u+ 0 ] u 1 = 0 βh > 1 ( 1+ (1 βh) βh βh (1+cos( mπ Um 1 2 ( Um 1+ (1 βh) βh m+1)) + 1 βh (1+cos( m+1)) ) mπ ) > ( 1+ (1 βh) βh βh(1+cos( mπ Um 1 2 ( Um 1+ (1 βh) βh ) m+1)) + βh(1+cos( m+1)) ) mπ where U k ( ) is the k th Chebyshev polynomial of the second kind

14 Aspect ratio θ versus growth factor β β = δ h( δ h ( rect K ɛ ) square K 1+θ ɛ ) 2 θ θ β rectangle DD time increase = α+β α+1 where α = Tcomp T comm

15 Define edge weight w(e k ) = q s (ˆn k ˆb) with q s (r) = (sr) s +1 and ˆb is the direction of convection or u and ˆn k is the unit normal to triangle side k. ˆn k ˆb ˆnk+1 w(e k ) = q s (0.94) w(e k+1 ) = q s (0.17)

16 with s = 1.83 e k+1 e k e k+2 w(e k ) = 4 w(e k+1 ) = 2.6 w(e k+2 ) = 1

17 b = [ 1 1 ] b = [ 0.5 y x 0.5 ] u+b u = 1 on Ω = [0,1] [0,1] R 2

18 w(e k ) = q s (ˆn k ˆb) q s (r) = (sr) s +1 s = 2 s = 2.75 s = 4

19 { Ak+1,k + A k+1,k+3 Define w(e k ) = max 2 A k+1,k+1 { Ak+2,k + A k+2,k+3 +max 2 A k+2,k+2, A k,k+1 2 A k,k, A k,k+2 2 A k,k + A } k+3,k+1 2 A k+3,k+3 + A } k+3,k+2 2 A k+3,k+3 where A is the Finite Element Stiffness Matrix and indices k,k +1,k +2,k +3 are defined in the Figure below.

20 α [ α ] u 1 = α α w(e y ) = A k,k 1 + A k,k+1 A k,k A k,k 1 A k,k m A k,k A k,k+m -1 A k,k+1 w(e y ) = 2+βh 4+βh 1 w(e x ) = 2 4+βh 0 (for triangles w(e x ) 1 4 ) -1-1 e y w(e y ) = 2α 2+2α 1 2 w(e x ) = 2+2α 0 (for triangles w(e x ) 1 4 ) w(e y ) = e x 1 βh 4+βh -1-1 w(e x ) = 1 2 u 1 = 0 u+ [ β 0 ] u 1 = 0

21

22 c c c c function geta(i,j,nb,ndf,map,a,ja,jap) use mthdef implicit real(kind=rknd) (a-h,o-z) implicit integer(kind=iknd) (i-n) integer(kind=iknd), dimension(*) :: ja,jap integer(kind=iknd), dimension(ndf) :: map real(kind=rknd), dimension(*) :: a this routine returns A(i,j) nb_low = map(i) nb_high = map(j) if (nb_low == nb_high) then geta = a(nb_low) endif l_shift = 0 if (nb_low > nb_high) then l_shift = ja(nb+1)-ja(1) nb_low = map(j) nb_high = map(i) endif if (nb_low /= nb_high) then n_index = -1 do k=ja(nb_low),ja(nb_low+1)-1 if (nb_high == ja(k)) n_index=k enddo if (n_index /= -1) then geta = a(jap(n_index)+l_shift) else geta = 0.0 endif endif return end do i=1,ntf i1=itdof(1,i) i2=itdof(2,i) i3=itdof(3,i) alpha=100.0 beta=0.5 wght(1,i)= + MAX((abs(geta(i1,i2,nb,ndf,map,a,ja,jns)) + + abs(geta(i1,i3,nb,ndf,map,a,ja,jns))) + /2.0/abs(geta(i1,i1,nb,ndf,map,a,ja,jns)), + abs(geta(i2,i1,nb,ndf,map,a,ja,jns)) + /2.0/abs(geta(i2,i2,nb,ndf,map,a,ja,jns)) + + abs(geta(i3,i1,nb,ndf,map,a,ja,jns)) + /2.0/abs(geta(i3,i3,nb,ndf,map,a,ja,jns))) if (wght(1,i)>1.0) wght(1,i)=1.0 wght(1,i)=alpha*wght(1,i)+beta wght(2,i)= + MAX((abs(geta(i2,i1,nb,ndf,map,a,ja,jns)) + + abs(geta(i2,i3,nb,ndf,map,a,ja,jns))) + /2.0/abs(geta(i2,i2,nb,ndf,map,a,ja,jns)), + abs(geta(i1,i2,nb,ndf,map,a,ja,jns)) + /2.0/abs(geta(i1,i1,nb,ndf,map,a,ja,jns)) + + abs(geta(i3,i2,nb,ndf,map,a,ja,jns)) + /2.0/abs(geta(i3,i3,nb,ndf,map,a,ja,jns))) if (wght(2,i)>1.0) wght(2,i)=1.0 wght(2,i)=alpha*wght(2,i)+beta wght(3,i)= + MAX((abs(geta(i3,i2,nb,ndf,map,a,ja,jns)) + + abs(geta(i3,i1,nb,ndf,map,a,ja,jns))) + /2.0/abs(geta(i3,i3,nb,ndf,map,a,ja,jns)), + abs(geta(i2,i3,nb,ndf,map,a,ja,jns)) + /2.0/abs(geta(i2,i2,nb,ndf,map,a,ja,jns)) + + abs(geta(i1,i3,nb,ndf,map,a,ja,jns)) + /2.0/abs(geta(i1,i1,nb,ndf,map,a,ja,jns))) if (wght(3,i)>1.0) wght(3,i)=1.0 wght(3,i)=alpha*wght(3,i)+beta enddo real(kind=4) :: ubvec real(kind=4), dimension(nproc) :: tpwgts integer(kind=4) :: nvtxs,ncon,nparts,objval integer(kind=4), dimension(ntf+1) :: xadj,vwgt,part,vs integer(kind=4), dimension(3*ntf) :: adjncy,adjwgt integer(kind=4), dimension(40) :: options external METIS_METIS_SetDefaultOptions external METIS_PartGraphRecursive common /chris/wght(3,400000) call METIS_SetDefaultOptions(options) options(8) = 10 index = 1 nvtxs = ntf ncon = 1 nparts = nproc ubvec = do i=1,nproc tpwgts(i) = 1.0/nproc enddo do i=1,ntf do j=1,3 if (itedge(j,i)/4>0) then adjncy(index)=itedge(j,i)/4-1 n=itedge(j,i)/4 m=itedge(j,i)-4*n adjwgt(index)=wght(j,i)+wght(m,n) index=index+1 endif enddo xadj(i+1)=index - 1 vwgt(i)= 1 enddo call METIS_PartGraphRecursive(nvtxs,ncon,xadj,adjncy, + vwgt,vs,adjwgt,nparts,tpwgts,ubvec,options,objval,part) go to 50

23 Find u H 2 (Ω) s.t. u [10 4 0] T u 1 = 0 on Ω = [0,1] [0,1] R 2 u = 0 on Ω

24 Find u H 2 (Ω) s.t. u [10 6 0] T u 1 = 0 on Ω = [0,1] [0,1] R 2 u = 0 on Ω D = {0,1} [0,1] n u = 0 on Ω N = [0,1] {0,1} DD convergence of r k and δu k were Weighted: 0.29 and 0.28 Unweighted: 0.50 and 0.44 STOP DD when δu k L 2 (Ω) < 1 10 u u h L 2 (Ω) Find u H 2 (Ω) s.t. u [10 4 0] T u f(x,y) = 0 on Ω = [0,2π] [0,2π] R 2 u = 0 on Ω f(x,y) = 2sin(x)sin(y) 10 4 cos(x)sin(y) DD convergence of r k and δu k were Weighted: 0.30 and 0.29 Unweighted: 0.48 and 0.41

25 Find u H 2 (Ω) s.t. a u 1 = 0 on Ω = [0,1] 2 u = 0 on Ω where a = 1 [ ][ α ][ ] α unweighted convergence r k / r 0 weighted convergence r k / r 0 unweighted convergence δ k / u 0 weighted convergence δ k / u 0 iteration reduction log/log λ 1 λ 2 (a) 2

26 b h b unweighted convergence r k+1 / r k weighted convergence r k+1 / r k unweighted convergence δu k+1 / δu k weighted convergence δu k+1 / u k iteration reduction log/log b h b unweighted convergence r k+1 / r k weighted convergence r k+1 / r k unweighted convergence δu k+1 / δu k weighted convergence δu k+1 / u k iteration reduction log/log Find u H 2 (Ω) s.t u [β 0] T u 1 = 0 on Ω = [0,1] 2 u = 0 on Ω D n u = 0 on Ω N Vary b and number of processors. b h b unweighted convergence r k+1 / r k weighted convergence r k+1 / r k unweighted convergence δu k+1 / δu k weighted convergence δu k+1 / u k iteration reduction log/log b h b unweighted convergence r k+1 / r k weighted convergence r k+1 / r k unweighted convergence δu k+1 / δu k weighted convergence δu k+1 / u k iteration reduction log/log Keep number of unknowns per proc constant = b h a 1

27 Find u H 2 (Ω) s.t u [β 0] T u 1 = 0 on Ω = [0,1] 2 u = 0 on Ω Vary b h and rectangle aspect ratio.

28 Find u H 2 (Ω) s.t. [ ] α 0 u+1 = 0 on Ω = [0,1] u = 0 on Ω Vary α and rectangle aspect ratio.

29 Find u H 2 (Ω) s.t. u [ ] T u 1 = 0 on Ω = [0,1] 2 u = 0 on Ω Vary unknowns per processor and number of processors. Keep b h constant by adjusting β.

30 Find u H 2 (Ω) s.t. u [10 5 0] T u 1 = 0 on Ω = [0,κ] [0,1] R 2 u = 0 on Ω Vary domain s aspect ratio. Keep b h constant by adjusting β. κ = 1 4 κ = 1 κ = 2 κ = 4 κ = 8

31 u 10 5 u x 1 = 0 Convection Anisotropic diffusion 10u xx u yy 1 = 0

32 2log 2 h h h

33 Define triangle weight w(t k ) = z(p(t k )) s where p(t k ) = (x,y) center of triangle t k and flow function z(x,y) : Ω [0,1]+ɛ For example, z(x,y) = x+10 3 with Ω = [0,1] [0,1] and s = 1.5

34 w(t k ) = z(p(t k )) s z(x,y) = x+10 3 Ω = [0,1] [0,1] s = 0 s = 0.5 s = 0.75 s = 1 s = 1.5 s = 2

35 Find u H 2 (Ω) s.t. Lu = f on [0,1] R u(0) = u(1) = 0 u(x) Find u h S h H 1 (Ω) s.t. u h = 5 k=1 U kψ k

36 Define triangle weight w(t k ) = (u u h ) L2 (t k ) (u 2 u 1 ) L2 (t k ) where u k is the usual Lagrange interpolant For example, u [β 0] T u 1 = 0 in Ω u = 0 on Ω

37 Find u H 2 (Ω) s.t. u [10 6 0] T u 1 = 0 on Ω = [0,1] [0,1] R 2 u = 0 on Ω D = {0,1} [0,1] n u = 0 on Ω N = [0,1] {0,1} STOP DD when δu k L 2 (Ω) < 1 10 u u h L 2 (Ω) DD convergence of r k and δu k were Weighted: 0.34 and 0.20 Unweighted: 0.50 and 0.44 Error u u h L2 (Ω) reduction: 0.40 Find u H 2 (Ω) s.t. u [10 4 0] T u f(x,y) = 0 on Ω = [0,2π] [0,2π] R 2 u = 0 on Ω f(x,y) = 2sin(x)sin(y) 10 4 cos(x)sin(y) DD convergence of r k and δu k were Weighted: 0.20 and 0.14 Unweighted: 0.48 and 0.41 Error u u h L2 (Ω) increase: 1.33

38 Find u H 2 (Ω) s.t u [β 0] T u 1 = 0 on Ω = [0,1] 2 u = 0 on Ω s = 0 s = 0.5 s = 0.75 Vary b h and flow parameter. s = 1 s = 1.5 s = 2

39 flow function convergence convergence r k / r 0 δ k / u 0 figure z(x,y) = x+ɛ z(x,y) = x 0.5 +ɛ z(x,y) = x 1 +ɛ z(x, y) = z(x,y) = y +ɛ z(x,y) = y 0.5 +ɛ z(x,y) = y 1 +ɛ Find u H 2 (Ω) s.t. u [10 6 0] T u 1 = 0 on Ω = [0,1] [0,1] R 2 u = 0 on Ω D = {0,1} [0,1] n u = 0 on Ω N = [0,1] {0,1} flow parameter s = & & 0.51

40 Find u H 2 (Ω) s.t. u [ ] T u 1 = 0 on Ω = [0,1] 2 u = 0 on Ω Vary unknowns per processor and number of processors. Keep b h constant by adjusting β. Ω = [0,κ] [0,1] R 2

41 DD convergent rate of δu k L2 (Ω) s c s f = DD iterations reduction factor Find u H 2 (Ω) s.t. u [10 5 0] T u 1 = 0 on Ω = [0,1] 2 u = 0 on Ω flow function z(x,y) = x+10 3 Vary flow parameter and convection weighting parameter. s c s f = s c = 2 and s f = 1

42 Domain Decomposition converges faster when applying the Edge or Triangle Weighting schemes presented today. Specifically, convection dominated and anisotropic diffusion elliptic PDEs converge faster regardless of boundary conditions, forcing functions, reaction terms, number of processors, problem size, or domain aspect ratio. Expect a reduction in DD iterations between 0.25 and 0.75

43 If Error Weighting can be applied, use it (or Flow Weighting). (Don t use Flow Weighting otherwise.) Don t combine Edge and Triangle Weighting. If Error Weighting cannot be applied, use Stiffness Matrix Weighting (or Convection or Gradient Weighting). For Edge Weighting, adjust rectangle aspect ratio if rp > 400 (where r is the domain aspect ratio in the direction of dependence and P is the number of processors).

44