maria ugryumova direct solution techniques in spectral methods casa seminar, 13 december 2007

54
Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Upload: armani-huggins

Post on 02-Apr-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Maria Ugryumova

Direct Solution Techniques in Spectral Methods

CASA Seminar, 13 December 2007

Page 2: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Outline

1. Introduction

2. Ad-hoc Direct Methods

4. Direct methods

5. Conclusions

2/30

3. The matrix diagonalization techniques

Page 3: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

1. Introduction

3/30

,u u f , ( ), 0 and BCdR f f x

• Constant-coefficient Helmholtz equation

L u b

• Some generalizations

• Spectral descretization methods lead to the system

• Steady and unsteady problems;

Page 4: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Outline

1. Introduction

2. Ad-hoc Direct Methods

3. The matrix diagonalization techniques

4. Direct methods

5. Conclusions

4/30

Page 5: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

2. Ad-hoc Direct Methods

• Fourier

• Chebyshev

• Legendre

1. To performe appropriate transform

2. To solve the system

3. To performe an inverse transform on to get .

Solution process:

L u b

ku ju

5/30

Approximations:

Page 6: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

2. Ad-hoc Direct Methods

• Fourier

• Chebyshev

• Legendre

1. To performe appropriate transform

2. To solve the system

3. To performe an inverse transform on to get .

Solution process:

L u b

ku ju

5/30

Approximations:

Page 7: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

2.1 Fourier Approximations

2

2 in (0,2 ), is 2 periodic

d uu f u

dx

2 , ,..., 1, (1)2 2

k k k

N Nk u u f k

ku

Problem

- the Fourier coefficients;

Solution 1a - The Fourier Galerkin approximation

• The solution is 2/( ), ,..., 1.2 2

k k

N Nu f k k

- the trancated Fourier series; / 2 1

/ 2

( )N

ikxkN

k N

P u x u e

6/30

Page 8: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Solution 1b - a Fourier collocation approximation

Given2

, 0,..., 1.j

jx j N

N

2

2| =0, 0,..., -1 (2)

jx x

d uu f j N

dx

7/30

Page 9: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

2 , / 2,..., / 2 1, (3)k k kk u u f k N N k ku fand - the discrete Fourier coefficients;

Solution 1b - a Fourier collocation approximation

• Using the discrete Fourier transform (DFT is a mapping between )

Given2

, 0,..., 1.j

jx j N

N

2

2| =0, 0,..., -1 (2)

jx x

d uu f j N

dx

( ) and kju x u

7/30

Page 10: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

2 , / 2,..., / 2 1, (3)k k kk u u f k N N k ku fand - the discrete Fourier coefficients;

Solution 1b - a Fourier collocation approximation

• Using the discrete Fourier transform (DFT is a mapping between )

Given2

, 0,..., 1.j

jx j N

N

2

2| =0, 0,..., -1 (2)

jx x

d uu f j N

dx

( ) and kju x u

, / 2,..., / 2 1;ku k N N • (3) is solved for

( ) , 0,..., 1.jikxkju x u e j N • Reversing the DFT

7/30

Page 11: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Galerkin and collocation approximation to Helmholz problem are equally

straightfoward and demand operations. 2( log )dO N N

8/30

Page 12: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

2.3 Chebyshev Tau Approximation

, 0,1,... 2,(2)

k k k-u u f k N 0 0

0, ( 1) 0N N

kk k

k k

u u

Solution 1 - Chebyshev Tau approximation:

2

2 in ( 1,1),

( 1) (1) 0

d uu f

dxu u

Problem

9/30

Page 13: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

2.3 Chebyshev Tau Approximation

, 0,1,... 2,(2)

k k k-u u f k N 0 0

0, ( 1) 0N N

kk k

k k

u u

Solution 1 - Chebyshev Tau approximation:

2

2 in ( 1,1),

( 1) (1) 0

d uu f

dxu u

2 2

2 even

1( ) , 0,1,... 2.

N

p k kp kkp k

p p k u u f k Nc

• Rewriting the second derivative

, where L is upper triangular.

• Solution process requires operations 2N

Lu b

Problem

9/30

Page 14: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

(1)

1 11 1 12 , 1,..., 3 (5)k k kk k kku c f u f u k N

( 1) ( ) ( )

1 112 , 0 (4)q q q

k k kkku c u u k

Solution 2 - To rearrange the equations

2.3.1 More efficient solution procedure

For q=2

For q=1 in combination with (5) will lead

10/30

Page 15: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

After simplification

2 2 2 2 , 2,..., (6)k k kk k k k k kk k ku u u f f f k N

0

2 0

4 2

4 6

2 4

2

01 1 1 ...

* * *

* * *.... .

* * *

* * *

* *

N N

N N

kN

u

gu

gu

gu

gu

uu

• To minimize the round-off errors;

• quasi-tridiagonal system;

• not diagonally dominant;

• Nonhomogeneous BC.

For even coefficients:

11/30

Page 16: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

1. Discrete Chebyshev transform;

2. To solve quasi-tridiagonal system;

3. Inverse Chebyshev transform on to get .

2.4 Mixed Collocation Tau Approximation

ku ju

12/30

Solution process:

Page 17: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

0

1

( ) ( ), 2 even( )

( ) ( ), 3 oddk

kk

L x L x kx

L x L x k

2.5 Galerkin Approximation

2

,N

Nk k

k

u u

2

2 in ( 1,1), ( 1) (1) 0

d uu f u u

dx

Solution: Legendre Galerkin approx.

Problem

13/30

Page 18: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

0

1

( ) ( ), 2 even( )

( ) ( ), 3 oddk

kk

L x L x kx

L x L x k

2.5 Galerkin Approximation

2

,N

Nk k

k

u u

2

2 in ( 1,1), ( 1) (1) 0

d uu f u u

dx

2

2, , , , 2,..., (5)

NN

h h h

d uu f h N

dx

Solution: Legendre Galerkin approx.

Ku Mu b

,k hhk

d dK

dx dx

, , , 2,...hk k hM k h N

After integration by parts

Problem

(full matrices)

13/30

Page 19: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

• The same system but

• An alternative set of basis functions produces tridiagonal system:

2

1( ) ( ) ( ) , where

40,

6k k k k kx s L x L x s k

k

• Then expension is2

0

,N

Nk

kku u

K M u u b 0 21( , ,..., )N

Tu u u u

10 2( , ,..., )NTb b b b

1, ,

0, ,hk

k hK

k h

1

2

( , , ), ,

( , , ), 2,

0, otherwise

h k

hk kh h k

G s s h k h

M M G s s k k h

• Two sets of tridiagonal equations; O(N) operations

14/30

Page 20: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

• Transformation between spectral space and physical space: 2( )O N

-2 -2

, 0,1,

- , 2,..., .k k

k

k k k k

s u ku

s u s u k N

• The standard Legendre coefficients of the solution can be found viaNu

15/30

Page 21: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

2.6 Numerical example for Ad Hoc Methods in 1-D

2

2 in ( 1,1), ( 1) (1) 0

d uu f u u

dx

• Galerkin method is more accurate than Tau methods

• Roundoff errors are more for Chebyshev methods, significantly for N>1024

Exact solution is ( ) sin(4 )u x x

( ) sin(4 )u x x

16/30

( 0) 5( 10 )

Page 22: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Outline

1. Introduction

2. Ad-hoc Direct Methods

4. Direct methods

5. Conclusions

17/30

3. The matrix diagonalization techniques

Page 23: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

3.1 Schur Decomposition

0 on u

(6)Tx yDU UD U F

dim( ) = ( 1) ( 1)x yU N N

2 in ( 1,1) ,u u f

• Collocation approx and Legendre G-NI approxim. lead

Problem:

• Solving (6) by Schur decomposition [Bartels, Stewart, 1972]

' ' ' 'p QD U U D U F xD

TyD

lower-triangular

upper-triangular

Tp xD P D P

T TQ yD Q D Q

' TU P UQ' TF P FQ

18/30

Page 24: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Computational cost:

Solution process:

• Reduction and to Schur form

• Construction of F’

• Solution of for U’

• Transformation from U’ to U.

' ' ' 'P QD U U D U F

TyD

3 320( ) 5 ( )x y x y x yN N N N N N

xD

3if = then comp.cost is 50x yN N N N

19/30

Page 25: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

3.2 Matrix Digitalization Approach

• Similar to Schur decomposition. The same solution steps.

• and are diagonalizedTyDxD

' ' ' 'TDx DyU U U F

1

1

,

,

P x Dx

TQ y Dy

D P D P

D Q D Q

1

1

' ,

' .

U P UQ

F P FQ

• Operation cost:3 324( ) 4 ( ) 3x y x y x y x yN N N N N N N N

3if = then comp.cost is 56x yN N N N

20/30

Page 26: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

3.3 Numerical example for Ad Hoc Methods in 2-D

2 in ( 1,1) ,

0 on

u u f

u

Problem:

( ) sin(4 )sin(4 ), 0u x x y

• Matrix diagonalization was used for the solution procedure

Haidvogel and Zang (1979), Shen (1994)

• Results are very similar to 1-D case

21/30

Page 27: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Outline

1. Introduction

2. Ad-hoc Direct Methods

4. Direct methods

5. Conclusions

22/30

3. The matrix diagonalization techniques

Page 28: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

4. Direct Methods

• Matrix structure produced by Galerkin and G-NI methods ;

• How the tensor-product nature of the methods can be used efficiently to build matrices;

• How the sparseness of the matrices in 2D and in 3D can be accounted in direct techniques

23/30

Page 29: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

4.1 Multidimensional Stiffness and Mass Matrices

, ,

in d d

dij i

i j i ji i i

u uu f R

x x x

+ homogen. BC on

. allfor ,1,1,

Vvdxfvdxuvvdxx

udx

x

v

x

u

j

d

jiij

ij

d

jiij

ˆu ( ), b ,k hu f dx

ˆ{ }k

Problem:

Integral formulation:

Galerkin solution: ˆ , , Nk k

k

u u Lu b

– stiffness matrix

Let be a finite tensor-product basis in .

The trial and test function will be chosen in { }N kV span

( )hkL K

24/30

Page 30: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Decomposition of K into its 1st, 2nd, 0 – order components

(2) (1) (0)K K K K

25/30

Page 31: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

then(0) (0; )

1

ld

x

lK K

* *

1

if ( )d

l ll

x const

Decomposition of K into its 1st, 2nd, 0 – order components

(2) (1) (0)K K K K

*(0)hk k hd xK

• for a general , the use of G-NI approach with Lagrange nodal basis*

26/30

will lead to diagonal marix(0)hkK

Page 32: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Decomposition of K into its 1st, 2nd, 0 – order components

(1(2) (0))K KK K *)

1

(1d

khr

r ihk xK d

x

• - tensor-product function,

*r ( ; )(1; )

1

llr

dxr

lK K

• - arbitrary, G-NI approach leads to sparse matrix *r

(a matrix-vector multiply requires operations)

1( )dO N

1( )dO N

27/30

2D 3D

Page 33: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

In 2D: matrix is in general full for arbitrary nonzero

*

, 1

(2)d

k hrs

r s shk

r

d xx

Kx

Decomposition of K into its 1st, 2nd, 0 – order components

(1 )(2) ) (0K KK K

(2)hkK *{ }rs

( ; )(2; , )

1

llr ls

dxr s

lK K

• for arbitrary , G-NI approach (with Lagange nodal basis) leads

*rs

(a matrix-vector multiply requires operations)1( )dO N

In 3D: has sparse structure(2)hkK

28/30

to sparse matrix

Page 34: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

• - decomposition

4. Gaussian Elimination Techniques

29/30

• LU - decomposition

TCC

3

2

- for decomposituin

- solution phase

d

d

O N

O N

2D: special cases of Ad-hoс methods have lower cost

• Frontal and multifrontal [Davis and Duff 1999]

• To get benifit from sparsyty, reodering of matrix to factorization have to be done [Gilbert, 1992, Saad, 1996]

Page 35: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Outline

1. Introduction

2. Ad-hoc Direct Methods

4. Direct methods

5. Conclusions

30/30

3. The matrix diagonalization techniques

Page 36: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

5. Conclusions

31/31

• Approximation techniques;

• Galerkin approximations give more accurate results than other methods;

• Techniques, which can eliminate the cost of solution on prepocessing stage;

• Sparcity matrices

Page 37: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Thank you for attention.

Page 38: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 39: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 40: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 41: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 42: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 43: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 44: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 45: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 46: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 47: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 48: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 49: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 50: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 51: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 52: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 53: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007
Page 54: Maria Ugryumova Direct Solution Techniques in Spectral Methods CASA Seminar, 13 December 2007

Thank you for attention