Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements ...

20
1 Finite element method – basis functions Finite Elements: Basis functions 1-D elements coordinate transformation 1-D elements linear basis functions quadratic basis functions cubic basis functions 2-D elements coordinate transformation triangular elements linear basis functions quadratic basis functions rectangular elements linear basis functions quadratic basis functions Scope: Understand the origin and shape of basis functions used in classical finite element techniques.

Transcript of Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements ...

Page 1: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

1Finite element method – basis functions

Finite Elements: Basis functions

1-D elements

coordinate transformation 1-D elements

linear basis functions quadratic basis functions cubic basis functions

2-D elements

coordinate transformation triangular elements

linear basis functions quadratic basis functions

rectangular elements linear basis functions quadratic basis functions

Scope: Understand the origin and shape of basis functions used in classical finite element techniques.

Page 2: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

2Finite element method – basis functions

1-D elements: coordinate transformation

We wish to approximate a function u(x) defined in an interval [a,b] by some set of basis functions

n

iiicxu

1

)(

where i is the number of grid points (the edges of our elements) defined at locations xi. As the basis functions look the same in all elements (apart from some constant) we make life easier by moving to a local coordinate system

ii

i

xx

xx

1

so that the element is defined for x=[0,1].

Page 3: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

3Finite element method – basis functions

1-D elements – linear basis functions

There is not much choice for the shape of a (straight) 1-D element! Notably the length can vary across the domain.

We require that our function u() be approximated locally by the linear function

21)( ccu Our node points are defined at 1,2=0,1 and we require that

212

11

212

11

uuc

uc

ccu

cu

Auc

11-

01A

Page 4: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

4Finite element method – basis functions

1-D elements – linear basis functions

As we have expressed the coefficients ci as a function of the function values at node points 1,2 we can now express the approximate function using the node values

)()(

)1(

)()(

211

21

211

NNu

uu

uuuu

.. and N1,2(x) are the linear basis functions for 1-D elements.

Page 5: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

5Finite element method – basis functions

1-D quadratic elements

Now we require that our function u(x) be approximated locally by the quadratic function

2321)( cccu

Our node points are defined at 1,2,3=0,1/2,1 and we require that

3213

3212

11

25.05.0

cccu

cccu

cu

Auc

242

143

001

A

Page 6: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

6Finite element method – basis functions

1-D quadratic basis functions

... again we can now express our approximated function as a sum over our basis functions weighted by the values at three node points

... note that now we re using three grid points per element ...

Can we approximate a constant function?

3

1

23

22

21

2321

)(

)2()44()231()(

iiiNu

uuucccu

Page 7: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

7Finite element method – basis functions

1-D cubic basis functions

... using similar arguments the cubic basis functions can be derived as

324

323

322

321

34

2321

)(

23)(

2)(

231)(

)(

N

N

N

N

ccccu

... note that here we need derivative information at the boundaries ...

How can we approximate a constant function?

Page 8: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

8Finite element method – basis functions

2-D elements: coordinate transformation

Let us now discuss the geometry and basis functions of 2-D elements, again we want to consider the problems in a local coordinate system, first we look at triangles

P3

P2

P1

x

y

P3

P2P1

before after

Page 9: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

9Finite element method – basis functions

2-D elements: coordinate transformation

Any triangle with corners Pi(xi,yi), i=1,2,3 can be transformed into a rectangular, equilateral triangle with

P3

P2

P1

P1 (0,0)

P3 (0,1)

P2 (1,0)

)()(

)()(

13121

13121

yyyyyy

xxxxxx

using counterclockwise numbering. Note that if =0, then these equations are equivalent to the 1-D tranformations. We seek to approximate a function by the linear form

321),( cccu

we proceed in the same way as in the 1-D case

Page 10: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

10Finite element method – basis functions

2-D elements: coefficients

... and we obtain P3

P2

P1

P1 (0,0)

P3 (0,1)

P2 (1,0)

... and we obtain the coefficients as a function of the values at the grid nodes by matrix inversion

313

212

11

)1,0(

)0,1(

)0,0(

ccuu

ccuu

cuu

Auc

101

011

001

A containing the 1-D case

11-

01A

Page 11: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

11Finite element method – basis functions

triangles: linear basis functions

from matrix A we can calculate the linear basis functions for triangles

P3

P2

P1

P1 (0,0)

P3 (0,1)

P2 (1,0)

),(

),(

1),(

3

2

1

N

N

N

Page 12: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

12Finite element method – basis functions

triangles: quadratic elements

Any function defined on a triangle can be approximated by the quadratic function 2

652

4321),( yxyxyxyxu and in the transformed system we obtain

265

24321),( ccccccu

as in the 1-D case we need additional points on the element.

P3

P2

P1

P1 (0,0)

P3 (0,1)

P2 (1,0)

P5 (1/2,1/2)

P4 (1/2,0)

P6 (0,1/2)

++

+

+ +

+

P5

P4

P6

Page 13: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

13Finite element method – basis functions

triangles: quadratic elements

To determine the coefficients we calculate the function u at each grid point to obtain

6316

6543215

4214

6313

4212

11

6/12/1

4/14/14/12/12/1

4/12/1

cccu

ccccccu

cccu

cccu

cccu

cu

P3

P2

P1

P1 (0,0)

P3 (0,1)P2 (1,0)

P5 (1/2,1/2)P4 (1/2,0)

P6 (0,1/2)

++

+

+ +

+

P5

P4

P6

... and by matrix inversion we can calculate the coefficients as a function of the values at Pi

Auc

Page 14: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

14Finite element method – basis functions

triangles: basis functions

400202

444004

004022

400103

004013

000001

A

P3

P2

P1

P1 (0,0)

P3 (0,1)P2 (1,0)

P5 (1/2,1/2)P4 (1/2,0)

P6 (0,1/2)

++

+

+ +

+

P5

P4

P6

... to obtain the basis functions

Auc

)1(4),(

4),(

)1(4),(

)12(),(

)12(),(

)221)(1(),(

2

5

4

3

2

1

N

N

N

N

N

N

... and they look like ...

Page 15: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

15Finite element method – basis functions

triangles: quadratic basis functions

P3

P2P1

P1 (0,0)

P3 (0,1)P2 (1,0)

P5 (1/2,1/2)P4 (1/2,0)

P6 (0,1/2)

++

+

+ +

+

P5

P4

P6The first three quadratic basis functions ...

Page 16: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

16Finite element method – basis functions

triangles: quadratic basis functions

P3

P2P1

P1 (0,0)

P3 (0,1)P2 (1,0)

P5 (1/2,1/2)P4 (1/2,0)

P6 (0,1/2)

++

+

+ +

+

P5

P4

P6.. and the rest ...

Page 17: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

17Finite element method – basis functions

rectangles: transformation

Let us consider rectangular elements, and transform them into a local coordinate system

P3

P2P1

x

y

P3

P2P1

before after

P4

P4

Page 18: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

18Finite element method – basis functions

rectangles: linear elements

With the linear Ansatz

4321),( ccccu

we obtain matrix A as

1111

1001

0011

0001

A

and the basis functions

)1(),(

),(

)1(),(

)1)(1(),(

4

3

2

1

N

N

N

N

Page 19: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

19Finite element method – basis functions

rectangles: quadratic elements

With the quadratic Ansatz

28

27

265

24321),( ccccccccu

we obtain an 8x8 matrix A ... and a basis function looks e.g. like

P3

P2P1

P4

+

+

+

+

P5

P6

P7

P8

)1)(1(4),(

)221)(1)(1(),(

5

1

N

N

N1 N2

Page 20: Finite element method – basis functions 1 Finite Elements: Basis functions 1-D elements  coordinate transformation  1-D elements  linear basis functions.

20Finite element method – basis functions

1-D and 2-D elements: summary

The basis functions for finite element problems can be obtained by:

Transforming the system in to a local (to the element) system Making a linear (quadratic, cubic) Ansatz for a function defined across

the element. Using the interpolation condition (which states that the particular basis

functions should be one at the corresponding grid node) to obtain the coefficients as a function of the function values at the grid nodes.

Using these coefficients to derive the n basis functions for the n node points (or conditions).