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.

Finite elements : basis functions

Embed Size (px)

DESCRIPTION

Finite elements : basis functions

Citation preview

Page 1: Finite elements : basis functions

1Finite element method – basis functions

Finite Elements: Basis functions

1-D elements

coordinate transformation1-D elements

linear basis functionsquadratic basis functionscubic basis functions

2-D elements

coordinate transformationtriangular elements

linear basis functionsquadratic basis functions

rectangular elementslinear basis functions

quadratic basis functions

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

Page 2: Finite elements : 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

xxxx−−

=+1

ξ

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

Page 3: Finite elements : 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

uucuc

ccucu

+−==

⇒+=⇒=

Auc =

⎥⎦

⎤⎢⎣

⎡=

11-01

A

Page 4: Finite elements : 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

NNuuu

uuuu

+=+−=

+−+=

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

Page 5: Finite elements : 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.0cccu

cccucu

++=++=

=Auc =

⎥⎥⎥

⎢⎢⎢

−−−=242143

001A

Page 6: Finite elements : 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()(

iii Nu

uuucccu

ξ

ξξξξξξξξξ

Page 7: Finite elements : 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 elements : 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 elements : 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

yyyyyyxxxxxx−+−+=−+−+=

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 elements : 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(

ccuuccuu

cuu

+==+==

==

Auc =

⎥⎥⎥

⎢⎢⎢

−−=

101011001

A containing the 1-D case ⎥

⎤⎢⎣

⎡=

11-01

A

Page 11: Finite elements : 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

NNN

Page 12: Finite elements : 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 elements : 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/14/14/14/12/12/1

4/12/1

cccuccccccu

cccucccucccu

cu

++=+++++=

++=++=++=

=

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 by matrix inversion we can calculate the coefficients as a function of the values at Pi

Auc =

Page 14: Finite elements : basis functions

14Finite element method – basis functions

triangles: basis functions

⎥⎥⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢⎢⎢

−−−

−−−

−−

=

400202444004

004022400103004013000001

A

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

... to obtain the basis functions

Auc =

)1(4),(4),(

)1(4),()12(),()12(),(

)221)(1(),(

2

5

4

3

2

1

ηξηηξξηηξ

ηξξηξηηηξξξηξ

ηξηξηξ

−−==

−−=−=−=

−−−−=

NNNNNN

... and they look like ...

Page 15: Finite elements : 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/2P4 (1/2,0)

P6 (0,1/2)

++

++ +

+

P5

P4

P6The first three quadratic basis functions ...

Page 16: Finite elements : 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/2P4 (1/2,0)

P6 (0,1/2)

++

++ +

+

P5

P4

P6.. and the rest ...

Page 17: Finite elements : 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

P4P4

Page 18: Finite elements : basis functions

18Finite element method – basis functions

rectangles: linear elements

With the linear Ansatz

ξηηξηξ 4321),( ccccu +++=

we obtain matrix A as

⎥⎥⎥⎥

⎢⎢⎢⎢

−−−−

=

1111100100110001

A

and the basis functions

ηξηξξηηξ

ηξηξηξηξ

)1(),(),(

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

4

3

2

1

−==

−=−−=

NNNN

Page 19: Finite elements : basis functions

19Finite element method – basis functions

rectangles: quadratic elementsWith 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

ηξξηξηξηξηξ

−−=−−−−=

NN

N1 N2

Page 20: Finite elements : 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) systemMaking 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).