Finite Elements (I) Model Equation
Transcript of Finite Elements (I) Model Equation
9/29/2021
1
© Numerical Factory
Mètodes Numèrics: A First Course on Finite Elements
Dept. Matemàtiques ETSEIB - UPC BarcelonaTech
Finite Elements (I)
Following: Curs d’Elements Finits amb Aplicacions (J. Masdemont)http://hdl.handle.net/2099.3/36166
© Numerical Factory
Model Equation
© Numerical Factory
Finite Elements
Differential Equations (physical problem):
1-dim:Let’s assume that 𝑢(𝑥) is a magnitude (temperature, displacement, etc.)
1D Model Equation
© Numerical Factory
Finite Elements
Differential Equations (physical problem):
1-dim:
2-dim:
Let’s assume that 𝑢(𝑥) is a magnitude (temperature, displacement, etc.)
1D Model Equation
Now 𝑢(𝑥, 𝑦) is a magnitude
2D Model Equation
© Numerical Factory
Finite Elements
Differential Equations (physical problem):
1-dim:
2-dim:
Let’s assume that 𝑢(𝑥) is a magnitude (temperature, displacement, etc.)
1D Model Equation
Now 𝑢(𝑥, 𝑦) is a magnitude (temperature, etc.)
2D Model Equation
2on Order Terms
© Numerical Factory
Finite Elements Procedure :
• First Step: To set up and express the equation at each element (element linear eq. system)
• Second Step: To assemble the contribution of each element (global linear eq. system)
• Third Step: To solve the linear eq. system
( 2x2 or 3x3 )
( NxN )
9/29/2021
2
© Numerical Factory
Finite Elements Procedure :
• First Step: To set up and express the equation at each element (element linear eq. system)
• Second Step: To assemble the contribution of each element (global linear eq. system)
• Third Step: To solve the linear eq. system
( 2x2 or 3x3 )
( NxN )
© Numerical Factory
Finite Elements Procedure :
• First Step: To set up and express the equation at each element (element linear eq. system)
• Second Step: To assemble the contribution of each element (global linear eq. system)
• Third Step: To solve the linear eq. system
( 2x2 or 3x3 )
( NxN )
© Numerical Factory
Element Decomposition
© Numerical Factory
Finite Elements
Element decomposition (meshing):
1-dim: (a line)
𝑥 = 0 𝑥 = 𝐿
© Numerical Factory
Finite Elements
Element decomposition (meshing):
1-dim: (a line)
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
𝑥 = 0 𝑥 = 𝐿
© Numerical Factory
Finite Elements
Element decomposition (meshing):
1-dim: (a line)
2-dim: (a 2D region)
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
9/29/2021
3
© Numerical Factory
1D Elements
© Numerical Factory
• For 1D domains, generically, the elements are defined as segments Ω𝑒 = [𝑥𝑖 , 𝑥𝑖+1] that covers de complete domain 𝛀.
Finite Elements 1D
(local) Nodes1 2
Linear Element 𝛀
(local) Nodes
1 2
Quadratic Element 𝛀3
Ω𝑒
Ω𝑒
© Numerical Factory
• For 1D domains, generically, the elements are defined as segments Ω𝑒 = [𝑥𝑖 , 𝑥𝑖+1] that covers de complete domain 𝛀.
Finite Elements 1D
(local) Nodes
1 2
Linear Element 𝛀
(local) Nodes1 2
Quadratic Element 𝛀3
Ω𝑒
Ω𝑒
© Numerical Factory
Let’s assume that 𝑢(𝑥) is a magnitude (temperature, displacement, etc.) that we want to compute in the nodes 𝑛𝑖 of one element Ω𝑒 the usual FEM notation is:
𝑢 𝑛𝑖 = 𝑢𝑖𝑒
For the linear case:
Finite Elements 1D
𝛀Ω𝑒
𝑢1𝑒 𝑢2
𝑒
© Numerical Factory
Let’s assume that 𝑢(𝑥) is a magnitude (temperature, displacement, etc.) that we want to compute in the nodes 𝑛𝑖 of one element Ω𝑒 the usual FEM notation is:
𝑢 𝑛𝑖 = 𝑢𝑖𝑒
For the quadratic case:
Finite Elements 1D
𝛀Ω𝑒
𝑢1𝑒 𝑢3
𝑒𝑢2𝑒
© Numerical Factory
When we consider the total domain, nodes of consecutive elements must be identify in order to obtain continuous solutions: (last node equals the next first one)
𝑢𝑁𝑒−1 = 𝑢1
𝑒 , 𝑢𝑁𝑒= 𝑢1
𝑒+1
For the linear case (𝑁 =2):
Nodes enumeration
𝛀Ω𝑒
𝑢2𝑒−1 = 𝑢1
𝑒
Ω𝑒−1 Ω𝑒+1
𝑢2𝑒 = 𝑢1
𝑒+1
9/29/2021
4
© Numerical Factory
When we consider the total domain, nodes of consecutive elements must be identify in order to obtain continuous solutions: (last node equals the next first one)
𝑢𝑁𝑒−1 = 𝑢1
𝑒 , 𝑢𝑁𝑒= 𝑢1
𝑒+1
For the linear case (𝑁 =2):
Nodes enumeration
𝛀Ω𝑒
𝑢2𝑒−1 = 𝑢1
𝑒
Ω𝑒−1 Ω𝑒+1
𝑢2𝑒 = 𝑢1
𝑒+1
𝑢1𝑒−1 𝑢2
𝑒−1 𝑢1𝑒 𝑢2
𝑒 𝑢1𝑒+1 𝑢2
𝑒+1
© Numerical Factory
When we consider the total domain, nodes of consecutive elements must be identify in order to obtain continuous solutions: (last node equals the next first one)
𝑢𝑁𝑒−1 = 𝑢1
𝑒 , 𝑢𝑁𝑒= 𝑢1
𝑒+1
For the quadratic case (𝑁 =3):
Nodes enumeration
𝛀Ω𝑒
𝑢3𝑒−1 = 𝑢1
𝑒
Ω𝑒−1
© Numerical Factory
Nodes enumeration
• Global enumeration: Once we have identify the connected nodes, we rename them using a global
enumeration.
Global Nodes
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
© Numerical Factory
Connectivity Matrix
• Connectivity Matrix: Says the global nodes attached
to each element.• Example:
Global Nodes
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
𝑒𝑙𝑒𝑚 =
12
23
34
45
One row for each element
Node numbers
© Numerical Factory
Connectivity Matrix
• Connectivity Matrix: Says the global nodes attached
to each element.• Example:
Global Nodes
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
𝑒𝑙𝑒𝑚 =
12
23
34
45
One row for each element
Node numbers
© Numerical Factory
Stiff Matrix
Element Stiff Matrix (𝑲𝒆): Is the one related to the physical problem stated for each element (this is the thought part of the method).
Because it is associated to each element, its size agrees with the number of nodes in each element.
1-dim linear element (two nodes) 𝑲𝒆 is a 2x2 matrix
1-dim quadratic element (three nodes) 𝑲𝒆 is a 3x3 matrix
2-dim linear Triangular element (three nodes) 𝑲𝒆 is a 3x3 matrix
2-dim linear Quadrilateral element (four nodes) 𝑲𝒆 is a 4x4 mat
9/29/2021
5
© Numerical Factory
Stiff Matrix
Element Stiff Matrix (𝑲𝒆): Is the one related to the physical problem stated for each element (this is the thought part of the method).
Because it is associated to each element, its size agrees with the number of nodes in each element.
1-dim linear element (two nodes) 𝑲𝒆 is a 2x2 matrix
1-dim quadratic element (three nodes) 𝑲𝒆 is a 3x3 matrix
2-dim linear Triangular element (three nodes) 𝑲𝒆 is a 3x3 matrix
2-dim linear Quadrilateral element (four nodes) 𝑲𝒆 is a 4x4 mat
𝐾𝑒 =𝑘11𝑒 𝑘12
𝑒
𝑘21𝑒 𝑘22
𝑒
© Numerical Factory
Stiff Matrix
Element Stiff Matrix (𝑲𝒆): Is the one related to the physical problem stated for each element (this is the thought part of the method).
Because it is associated to each element, its size agrees with the number of nodes in each element.
1-dim linear element (two nodes) 𝑲𝒆 is a 2x2 matrix
1-dim quadratic element (three nodes) 𝑲𝒆 is a 3x3 matrix
2-dim linear Triangular element (three nodes) 𝑲𝒆 is a 3x3 matrix
2-dim linear Quadrilateral element (four nodes) 𝑲𝒆 is a 4x4 mat 𝐾𝑒 =
𝑘11𝑒 𝑘12
𝑒 𝑘13𝑒
𝑘21𝑒 𝑘22
𝑒 𝑘23𝑒
𝑘31𝑒 𝑘32
𝑒 𝑘33𝑒
© Numerical Factory
Stiff Matrix
Element Stiff Matrix (𝑲𝒆): Is the one related to the physical problem stated for each element (this is the thought part of the method).
Because it is associated to each element, its size agrees with the number of nodes in each element.
1-dim linear element (two nodes) 𝑲𝒆 is a 2x2 matrix
1-dim quadratic element (three nodes) 𝑲𝒆 is a 3x3 matrix
2-dim linear Triangular elem (three nodes) 𝑲𝒆 is a 3x3 matrix
2-dim linear Quadrilateral elem (four nodes) 𝑲𝒆 is a 4x4 mat
© Numerical Factory
Stiff Matrix
Element Stiff Matrix (𝑲𝒆): Is the one related to the physical problem stated for each element (this is the thought part of the method).
Because it is associated to each element, its size agrees with the number of nodes in each element.
1-dim linear element (two nodes) 𝑲𝒆 is a 2x2 matrix
1-dim quadratic element (three nodes) 𝑲𝒆 is a 3x3 matrix
2-dim linear Triangular elem (three nodes) 𝑲𝒆 is a 3x3 matrix
2-dim linear Quadrilateral elem (four nodes) 𝑲𝒆 is a 4x4 mat
© Numerical Factory
Stiff Matrix
Element Stiff Matrix (𝑲𝒆): Is the one related to the physical problem stated for each element (this is the thought part of the method).
Because it is associated to each element, its size agrees with the number of nodes in each element.
1-dim linear element (two nodes) 𝑲𝒆 is a 2x2 matrix
1-dim quadratic element (three nodes) 𝑲𝒆 is a 3x3 matrix
2-dim linear Triangular elem (three nodes) 𝑲𝒆 is a 3x3 matrix
2-dim linear Quadrilateral elem (four nodes) 𝑲𝒆 is a 4x4 mat
Usually 𝐾𝑒 are symmetric matrices
© Numerical Factory
Global Stiff Matrix
• Global Stiff Matrix (𝑲) : Is the assembled matrix of all 𝑲𝒆 element stiff matrices.
In a generic way, for a 1dim problem, 𝑲 is squarematrix of dimension the number of global nodes.
Example:
𝑲 =
𝑘11𝑘21
𝑘12𝑘22
𝑘13 𝑘14 𝑘15𝑘23 𝑘24 𝑘25
𝑘31 𝑘32 𝑘33 𝑘34 𝑘35𝑘41𝑘51
𝑘42𝑘52
𝑘43 𝑘44 𝑘45𝑘53 𝑘54 𝑘55
9/29/2021
6
© Numerical Factory
Global Stiff Matrix
• Global Stiff Matrix (𝑲) : Is the assembled matrix of all 𝑲𝒆 element stiff matrices.
In a generic way, for a 1dim problem, 𝑲 is square matrix of dimension the number of global nodes.
Example:
𝑲 =
𝑘11𝑘21
𝑘12𝑘22
𝑘13 𝑘14 𝑘15𝑘23 𝑘24 𝑘25
𝑘31 𝑘32 𝑘33 𝑘34 𝑘35𝑘41𝑘51
𝑘42𝑘52
𝑘43 𝑘44 𝑘45𝑘53 𝑘54 𝑘55
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
© Numerical Factory
Element Assembly
© Numerical Factory
1D Elements Assembly
• Assembly
𝑲 =
𝑘11𝑘21
𝑘12𝑘22
𝑘13 𝑘14 𝑘15𝑘23 𝑘24 𝑘25
𝑘31 𝑘32 𝑘33 𝑘34 𝑘35𝑘41𝑘51
𝑘42𝑘52
𝑘43 𝑘44 𝑘45𝑘53 𝑘54 𝑘55
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
𝑒𝑙𝑒𝑚 =1⋮4
2⋮5
𝐾1 =𝑘111 𝑘12
1
𝑘211 𝑘22
1
© Numerical Factory
1D Elements Assembly
• Assembly
𝑲 =
𝑘111
𝑘211
𝑘121
𝑘221
𝑘13 𝑘14 𝑘15𝑘23 𝑘24 𝑘25
𝑘31 𝑘32 𝑘33 𝑘34 𝑘35𝑘41𝑘51
𝑘42𝑘52
𝑘43 𝑘44 𝑘45𝑘53 𝑘54 𝑘55
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
𝑒𝑙𝑒𝑚 =1⋮4
2⋮5
𝐾1 =𝑘111 𝑘12
1
𝑘211 𝑘22
1
© Numerical Factory
1D Elements Assembly
• Assembly
𝑲 =
𝑘11𝑘21
𝑘12𝑘22
𝑘13 𝑘14 𝑘15𝑘23 𝑘24 𝑘25
𝑘31 𝑘32 𝑘33 𝑘34 𝑘35𝑘41𝑘51
𝑘42𝑘52
𝑘43 𝑘44 𝑘45𝑘53 𝑘54 𝑘55
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
𝑒𝑙𝑒𝑚 =1⋮4
2⋮5
© Numerical Factory
1D Elements Assembly
• Assembly
𝑲 =
𝑘11𝑘21
𝑘12𝑘22
𝑘13 𝑘14 𝑘15𝑘23 𝑘24 𝑘25
𝑘31 𝑘32 𝑘33 𝑘34 𝑘35𝑘41𝑘51
𝑘42𝑘52
𝑘43 𝑘44 𝑘45𝑘53 𝑘54 𝑘55
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
𝑒𝑙𝑒𝑚 =1⋮4
2⋮5
𝑘22 = 𝑘221 + 𝑘11
2
Contribution of two elements
9/29/2021
7
© Numerical Factory
1D Elements Assembly
• Assembly
𝑲 =
𝑘11𝑘21
𝑘12𝑘22
𝑘13 𝑘14 𝑘15𝑘23 𝑘24 𝑘25
𝑘31 𝑘32 𝑘33 𝑘34 𝑘35𝑘41𝑘51
𝑘42𝑘52
𝑘43 𝑘44 𝑘45𝑘53 𝑘54 𝑘55
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
𝑒𝑙𝑒𝑚 =1⋮4
2⋮5
© Numerical Factory
1D Elements Assembly
• Assembly
𝑲 =
𝑘11𝑘21
𝑘12𝑘22
𝑘13 𝑘14 𝑘15𝑘23 𝑘24 𝑘25
𝑘31 𝑘32 𝑘33 𝑘34 𝑘35𝑘41𝑘51
𝑘42𝑘52
𝑘43 𝑘44 𝑘45𝑘53 𝑘54 𝑘55
The rest of the elements in 𝑲 are zero
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
𝑒𝑙𝑒𝑚 =1⋮4
2⋮5
© Numerical Factory
1D Elements Assembly
• Example: Suppose that for each element its local Stiff matrix is constant (we’ll see later how to compute it)
𝐾𝑒 =𝑘11𝑒 𝑘12
𝑒
𝑘21𝑒 𝑘22
𝑒 = 𝐶 ·1 −1−1 1
© Numerical Factory
1D Elements Assembly
• Example: Suppose that for each element its local Stiff matrix is constant (we’ll see later how to compute it)
𝐾𝑒 =𝑘11𝑒 𝑘12
𝑒
𝑘21𝑒 𝑘22
𝑒 = 𝐶 ·1 −1−1 1
For the bar:
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
𝑲 = 𝐶
1−1
−11
0 0 00 0 0
0 0 0 0 000
00
0 0 00 0 0
© Numerical Factory
1D Elements Assembly
• Example: Suppose that for each element its local Stiff matrix is constant (we’ll see later how to compute it)
𝐾𝑒 =𝑘11𝑒 𝑘12
𝑒
𝑘21𝑒 𝑘22
𝑒 = 𝐶 ·1 −1−1 1
For the bar:
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
𝑲 = 𝐶
1−1
−12
0 0 0−1 0 0
0 −1 1 0 000
00
0 0 00 0 0
© Numerical Factory
1D Elements Assembly
• Example: Suppose that for each element its local Stiff matrix is constant (we’ll see later how to compute it)
𝐾𝑒 =𝑘11𝑒 𝑘12
𝑒
𝑘21𝑒 𝑘22
𝑒 = 𝐶 ·1 −1−1 1
For the bar:
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2 Ω3 Ω4
𝑛5
𝑲 = 𝐶
1−1
−12
0 0 0−1 0 0
0 −1 2 −1 000
00
−1 2 −10 −1 1
9/29/2021
8
© Numerical Factory
1D Elements Assembly
• Exercise: Consider the problem of the previous bar, but using now quadratic elements.
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2
𝑛5
𝐾𝑒 =4 2 −12 16 2−1 2 4
Modify the previous steps in order to obtain the assembly matrix when only two elements are taken
© Numerical Factory
1D Elements Assembly
• Exercise: Consider the problem of the previous bar, but using now quadratic elements.
𝑛2 𝑛3 𝑛4𝑛1
Ω1 Ω2
𝑛5
𝐾𝑒 =4 2 −12 16 2−1 2 4
𝑲 =
𝑘111
𝑘211
𝑘121
𝑘221
𝑘13 𝑘14 𝑘15𝑘23 𝑘24 𝑘25
𝑘31 𝑘32 𝑘33 𝑘34 𝑘35𝑘41𝑘51
𝑘42𝑘52
𝑘43 𝑘44 𝑘45𝑘53 𝑘54 𝑘55
Modify the previous steps in order to obtain the assembly matrix when only two elements are taken
© Numerical Factory
2D Element Assembly
© Numerical Factory
2D Elements Assembly
• Example of local and global 2D nodes enumeration for linear triangular elements
Hint: Notice that the local enumeration must becounter-clockwise in order to preserve orientation
© Numerical Factory
2D Elements Assembly
• Example of local and global 2D nodes enumeration for linear triangular elements
Connectivity matrix
𝐵 =
1523
2345
3256
© Numerical Factory
2D Elements Assembly
• Example of local and global 2D nodes enumeration for linear triangular elements
Connectivity matrix
𝐵 =
1523
2345
3256
Compute the global stiff matrix for this example: 𝐾𝑒 =𝑘11 ⋯ 𝑘16⋮ ⋱ ⋮𝑘61 ⋯ 𝑘66
9/29/2021
9
© Numerical Factory
2D Elements Assembly
For linear triangular elements:
Let’s do the assembly process for this example.
If 𝑢 𝑥 is a 1D magnitude (temperature)For each element the Stiffness Matrix isa 3x3 matrix
𝐾𝑒 =
𝑘11𝑒 𝑘12
𝑒 𝑘13𝑒
𝑘21𝑒 𝑘22
𝑒 𝑘23𝑒
𝑘31𝑒 𝑘32
𝑒 𝑘33𝑒
, 𝑢 =
𝑢1𝑒
𝑢2𝑒
𝑢3𝑒
© Numerical Factory
2D Elements Assembly
The stiff matrix is a 6x6 matrix
Each row is associated to the corresponding node: row 1 with node 1 We will fill the matrix row by row
© Numerical Factory
2D Elements Assembly
First row:The 𝑘11 element is the relation of global node 1 with itself
this means the relationship between:
local node 1 of the element Ω1 and itself: 𝑘111
Row 1 :
𝐾 =
𝑘111
© Numerical Factory
2D Elements Assembly
First row:The 𝑘12 element is the relation of global node 1 with node 2
this means the relationship between:
local node 1 of Ω1 and local node 2 of Ω1: 𝑘121
Row 1 :
𝐾 =
𝑘111 𝑘12
1
© Numerical Factory
2D Elements Assembly
First row:The 𝑘13 element is the relation of global node 1 with node 3
this means the relationship between:
local node 1 of Ω1 and local node 3 of Ω1: 𝑘131
Row 1 :
𝐾 =
𝑘111 𝑘12
1 𝑘131
© Numerical Factory
2D Elements Assembly
First row:The 𝑘14 element is the relation of global node 1 with node 4
No connection through an element exist !!
The same happens with nodes 5 and 6
Row 1 :
𝐾 =
𝑘111 𝑘12
1 𝑘131 0
9/29/2021
10
© Numerical Factory
2D Elements Assembly
First row:The 𝑘14 element is the relation of global node 1 with node 4
No connection through an element exist !!
The same happens with nodes 5 and 6
Row 1 :
𝐾 =
𝑘111 𝑘12
1 𝑘131 0 0 0
© Numerical Factory
2D Elements Assembly
Symmetries:
Because of stiff matrix symmetries, we can fill the first column.
col 1 :
𝐾 =
𝑘111 𝑘12
1 𝑘131
𝑘211
𝑘311
0 0 0
000
© Numerical Factory
2D Elements AssemblySecond row:
The 𝑘22 element is the relation of global node 2 with itself:
local node 2 of the element Ω1 and itself: 𝑘221
local node 3 of the element Ω2 and itself: 𝑘332
local node 1 of the element Ω3 and itself: 𝑘113
Row 2 :
𝐾 =
𝑘111 𝑘12
1 𝑘131
𝑘211 𝑘22𝑘311
0 0 0
000
𝑘22 = 𝑘221 + 𝑘33
2 + 𝑘113
© Numerical Factory
2D Elements AssemblySecond row:
The 𝑘23 element is the relation of global node 2 with node 2:
local node 2 of Ω1 and node 3 of Ω1: 𝑘231
local node 3 of Ω2 and node 2 of Ω2: 𝑘322
Row 2 :
𝐾 =
𝑘111 𝑘12
1 𝑘131
𝑘211 𝑘22 𝑘23𝑘311
0 0 0
000
𝑘23 = 𝑘231 + 𝑘32
2
© Numerical Factory
2D Elements AssemblySecond row:
The 𝑘24 element is the relation of global node 2 with node 4:
local node 1 of Ω3 and node 2 of Ω3: 𝑘123
Row 2 :
𝐾 =
𝑘111 𝑘12
1 𝑘131
𝑘211 𝑘22 𝑘23𝑘311
0 0 0𝑘24
000
𝑘24 = 𝑘123
© Numerical Factory
2D Elements AssemblySecond row:
The 𝑘25 element is the relation of global node 2 with node 5:
local node 3 of Ω2 and node 1 of Ω2: 𝑘312
local node 1 of Ω3 and node 3 of Ω3: 𝑘133
Row 2 :
𝐾 =
𝑘111 𝑘12
1 𝑘131
𝑘211 𝑘22 𝑘23𝑘311
0 0 0𝑘24 𝑘25
000
𝑘25 = 𝑘312 + 𝑘13
3
9/29/2021
11
© Numerical Factory
2D Elements AssemblySecond row:
The 𝑘26 element is the relation of global node 2 with node 6:
No connection exist
Row 2 :
𝐾 =
𝑘111 𝑘12
1 𝑘131
𝑘211 𝑘22 𝑘23𝑘311
0 0 0𝑘24 𝑘25 0
000
𝑘26 = 0
© Numerical Factory
2D Elements Assembly
Symmetries:
Because of stiff matrix symmetries, we can fill the first column.
col 2 :
We left as an exercise to fill all the matrix!!
© Numerical Factory
Mètodes Numèrics: A First Course on Finite Elements
Dept. Matemàtiques ETSEIB - UPC BarcelonaTech
Finite Elements (II)Meshing - Weak Formulation
Following: Curs d’Elements Finits amb Aplicacions (J. Masdemont)http://hdl.handle.net/2099.3/36166
© Numerical Factory
Meshing
© Numerical Factory
Meshing 2D domains
• Meshing a general domain is a difficult problem. We’ll not study it in depth in our course.
• Two main concerns when meshing a domain are:
– Good fitting of the domain
– Good Numerical properties (stability)
© Numerical Factory
Meshing 2D domains
• Classification:
– Structured Mesh:
are identified by regular connectivity
– Unstructured Mesh
9/29/2021
12
© Numerical Factory
Meshing 2D domains
• Classification:
– Structured Mesh:
are identified by regular connectivity
– Unstructured Mesh
© Numerical Factory
Meshing 2D domains
Mesh quality:
– Aspect Ratio: It is the ratio of
longest to the shortest side in an element.
Best = 1
Acceptable < 5
© Numerical Factory
Meshing 2D domains
Mesh quality:
– Skewness:
© Numerical Factory
Meshing 2D domains
Mesh quality:
– Inscribed-Circumscribed ratio:
© Numerical Factory
Meshing 2D domains• Mesh refinement: More elements where
physical features are changing
© Numerical Factory
Model Equation
9/29/2021
13
© Numerical Factory
2D-Model Equation
For 2D problems we will use the model equation. A 2on order PDE for 𝑢 = 𝑢 𝑥, 𝑦 (primary variable)
Defined on a 2-dim domain Ω, with 𝑎𝑖𝑗 𝑥, 𝑦 and 𝑓 𝑥, 𝑦
known functions.
© Numerical Factory
2D-Model Equation
• Notation: In many books you can find the expressions
𝛻 · 𝑢 ≡𝜕𝑢
𝜕𝑥+𝜕𝑢
𝜕𝑦, if 𝑢 = 𝑢 𝑥, 𝑦
𝛻 · 𝑢1, 𝑢2 ≡ 𝑑𝑖𝑣 𝑢 ≡𝜕𝑢1𝜕𝑥
+𝜕𝑢2𝜕𝑦
, if 𝑢 =𝑢1(𝑥, 𝑦)
𝑢2 𝑥, 𝑦
𝛻𝑢 ≡ 𝑔𝑟𝑎𝑑 𝑢 ≡𝜕𝑢
𝜕𝑥,𝜕𝑢
𝜕𝑦, if 𝑢 = 𝑢 𝑥, 𝑦
• Example: Poisson equation−𝛻 · 𝑎𝛻𝑢 = 𝑓
If 𝑎 =const, −𝑎𝛻 · 𝛻𝑢 ≡ −𝑎 𝛻2𝑢 ≡ −𝑎∆𝑢 = 𝑓
Laplacian Operator
© Numerical Factory
2D-Model Equation
• Notation: In many books you can find the expressions
𝛻 · 𝑢 ≡𝜕𝑢
𝜕𝑥+𝜕𝑢
𝜕𝑦, if 𝑢 = 𝑢 𝑥, 𝑦
𝛻 · 𝑢1, 𝑢2 ≡ 𝑑𝑖𝑣 𝑢 ≡𝜕𝑢1𝜕𝑥
+𝜕𝑢2𝜕𝑦
, if 𝑢 =𝑢1(𝑥, 𝑦)
𝑢2 𝑥, 𝑦
𝛻𝑢 ≡ 𝑔𝑟𝑎𝑑 𝑢 ≡𝜕𝑢
𝜕𝑥,𝜕𝑢
𝜕𝑦, if 𝑢 = 𝑢 𝑥, 𝑦
• Example: Poisson equation−𝛻 · 𝑎𝛻𝑢 = 𝑓
If 𝑎 =const, −𝑎𝛻 · 𝛻𝑢 ≡ −𝑎 𝛻2𝑢 ≡ −𝑎∆𝑢 = 𝑓
Laplacian Operator
© Numerical Factory
2D-Model Equation
• Notation: In many books you can find the expressions
𝛻 · 𝑢 ≡𝜕𝑢
𝜕𝑥+𝜕𝑢
𝜕𝑦, if 𝑢 = 𝑢 𝑥, 𝑦
𝛻 · 𝑢1, 𝑢2 ≡ 𝑑𝑖𝑣 𝑢 ≡𝜕𝑢1𝜕𝑥
+𝜕𝑢2𝜕𝑦
, if 𝑢 =𝑢1(𝑥, 𝑦)
𝑢2 𝑥, 𝑦
𝛻𝑢 ≡ 𝑔𝑟𝑎𝑑 𝑢 ≡𝜕𝑢
𝜕𝑥,𝜕𝑢
𝜕𝑦, if 𝑢 = 𝑢 𝑥, 𝑦
• Example: Poisson equation−𝛻 · 𝑎𝛻𝑢 = 𝑓
If 𝑎 =const, −𝑎𝛻 · 𝛻𝑢 ≡ −𝑎 𝛻2𝑢 ≡ −𝑎∆𝑢 = 𝑓
Laplacian Operator
© Numerical Factory
2D-Model Equation
• Notation: In many books you can find the expressions
𝛻 · 𝑢 ≡𝜕𝑢
𝜕𝑥+𝜕𝑢
𝜕𝑦, if 𝑢 = 𝑢 𝑥, 𝑦
𝛻 · 𝑢1, 𝑢2 ≡ 𝑑𝑖𝑣 𝑢 ≡𝜕𝑢1𝜕𝑥
+𝜕𝑢2𝜕𝑦
, if 𝑢 =𝑢1(𝑥, 𝑦)
𝑢2 𝑥, 𝑦
𝛻𝑢 ≡ 𝑔𝑟𝑎𝑑 𝑢 ≡𝜕𝑢
𝜕𝑥,𝜕𝑢
𝜕𝑦, if 𝑢 = 𝑢 𝑥, 𝑦
• Example: Poisson equation−𝛻 · 𝑎𝛻𝑢 = 𝑓
If 𝑎 =const, −𝑎𝛻 · 𝛻𝑢 ≡ −𝑎 𝛻2𝑢 ≡ −𝑎∆𝑢 = 𝑓
Laplacian Operator
© Numerical Factory
• Poisson equation:
It corresponds to the 2D model equation
with
𝑎11 = 𝑎22 = 𝑎, 𝑎12 = 𝑎21 = 𝑎00 = 0
2D-Model Equation
9/29/2021
14
© Numerical Factory
Weak Formulation: intuition
© Numerical Factory
Idea of the Weak Formulation
• We need the solution of the model equation (a PDE equation)
• Instead we use an integral equation:
(1)
(2)
© Numerical Factory
Idea of the Weak Formulation
• We need the solution of the model equation (a PDE equation)
• Instead we use an integral equation:
(1)
(2)That’s hard!!!
© Numerical Factory
Idea of the Weak Formulation
• We need the solution of the model equation (a PDE equation)
• Instead, we use an integral equation:
(1)
(2)
© Numerical Factory
Idea of the Weak Formulation
• We need the solution of the model equation (a PDE equation)
• Instead, we use an integral equation:
If we know how to solve (2) then, what do we know about the solution of (1) ?
(1)
(2)
© Numerical Factory
• We need the solution of the model equation (a PDE equation)
• Instead, we use an integral equation:
Idea of the Weak Formulation
(1)
(2)
𝐹 𝑢, 𝑥, 𝑦 𝑑𝑥𝑑𝑦 = 0If we have
Question:
𝐹 𝑢, 𝑥, 𝑦 = 0
9/29/2021
15
© Numerical Factory
• We need the solution of the model equation (a PDE equation)
• Instead, we use an integral equation:
Idea of the Weak Formulation
(1)
(2)
𝐹 𝑢, 𝑥, 𝑦 𝑑𝑥𝑑𝑦 = 0If we have
Answer: NO!!!
𝐹 𝑢, 𝑥, 𝑦 = 0
© Numerical Factory
• We need the solution of the model equation (a PDE equation)
• Instead, we use an integral equation:
Idea of the Weak Formulation
(1)
(2)
What about if we have?
𝐹 𝑢, 𝑥, 𝑦 = 0
𝐹 𝑢, 𝑥, 𝑦 𝑑𝑥𝑑𝑦 = 0𝜔1 𝑥, 𝑦 ·
⋮
𝐹 𝑢, 𝑥, 𝑦 𝑑𝑥𝑑𝑦 = 0𝜔𝑛 𝑥, 𝑦 ·
⋮
© Numerical Factory
• We need the solution of the model equation (a PDE equation)
• Instead, we use an integral equation:
Idea of the Weak Formulation
(1)
(2)
Answer: ….almost!!!
𝐹 𝑢, 𝑥, 𝑦 = 0
𝐹 𝑢, 𝑥, 𝑦 𝑑𝑥𝑑𝑦 = 0𝜔1 𝑥, 𝑦 ·
⋮
𝐹 𝑢, 𝑥, 𝑦 𝑑𝑥𝑑𝑦 = 0𝜔𝑛 𝑥, 𝑦 ·
⋮
© Numerical Factory
• We need the solution of the model equation (a PDE equation)
• Instead, we use an integral equation:
Idea of the Weak Formulation
(1)
(2)
If the functions 𝜔𝑖 𝑥, 𝑦 are the shape functions (the base of the polynomials) the solution of (2) is a good approximation of the solution of (1).This solution is known as the weak solution of equation (1)
© Numerical Factory
Weak Formulation
© Numerical Factory
Weak Formulation
Using a general weight function 𝜔 = 𝜔(𝑥, 𝑦), we write the integral expression:
In 2D, we have the divergence theorem (from Gauss)
𝜕Ω𝑘 is the boundary of the domain Ω𝑘, and 𝑛 is the normalvector to 𝜕Ω (pointing external)
𝜔(𝑥, 𝑦)(2)
9/29/2021
16
© Numerical Factory
Weak Formulation
Using a general weight function 𝜔 = 𝜔(𝑥, 𝑦), we write the integral expression:
In 2D, we have the divergence theorem (from Gauss)
𝜕Ω𝑘 is the boundary of the domain Ω𝑘, and 𝑛 is the normalvector to 𝜕Ω (pointing external)
(2) 𝜔(𝑥, 𝑦)
© Numerical Factory
𝜔(𝑥, 𝑦)
Weak Formulation
Using a general weight function 𝜔 = 𝜔(𝑥, 𝑦), we write the integral expression:
In 2D, we have the divergence theorem (from Gauss)
𝜕Ω𝑘 is the boundary of the domain Ω𝑘, and 𝑛 is the normal vector to 𝜕Ω (pointing external)
How do we make the divergence appear in the equation (2)?
(2)
© Numerical Factory
Weak Formulation
We need to introduce some notation, let’s say
Deriving now the products and we get:
Then, the first part of the weak form says
𝜔(𝑥, 𝑦)
© Numerical Factory
Weak Formulation
We need to introduce some notation, let’s say
Deriving now the products 𝜔𝐹1 and 𝜔𝐹2 we get:
𝜕
𝜕𝑥𝜔𝐹1 =
𝜕𝜔
𝜕𝑥𝐹1 +𝜔
𝜕𝐹1𝜕𝑥
𝜕
𝜕𝑥𝜔𝐹2 =
𝜕𝜔
𝜕𝑥𝐹2 +𝜔
𝜕𝐹2𝜕𝑥
© Numerical Factory
Weak Formulation
We need to introduce some notation, let’s say
Deriving now the products 𝜔𝐹1 and 𝜔𝐹2 we get:
𝜕
𝜕𝑥𝜔𝐹1 =
𝜕𝜔
𝜕𝑥𝐹1 +𝜔
𝜕𝐹1𝜕𝑥
𝜕
𝜕𝑥𝜔𝐹2 =
𝜕𝜔
𝜕𝑥𝐹2 +𝜔
𝜕𝐹2𝜕𝑥
−𝜔𝜕𝐹1𝜕𝑥
=𝜕𝜔
𝜕𝑥𝐹1 −
𝜕
𝜕𝑥𝜔𝐹1
that we can rewrite
−𝜔𝜕𝐹2𝜕𝑥
=𝜕𝜔
𝜕𝑥𝐹2 −
𝜕
𝜕𝑥𝜔𝐹2
© Numerical Factory
Weak Formulation
We need to introduce some notation, let’s say
Deriving now the products 𝜔𝐹1 and 𝜔𝐹2 we get:
−𝜔𝜕𝐹1𝜕𝑥
=𝜕𝜔
𝜕𝑥𝐹1 −
𝜕
𝜕𝑥𝜔𝐹1 −𝜔
𝜕𝐹2𝜕𝑥
=𝜕𝜔
𝜕𝑥𝐹2 −
𝜕
𝜕𝑥𝜔𝐹2
9/29/2021
17
© Numerical Factory
Weak Formulation
We need to introduce some notation, let’s say
Deriving now the products 𝜔𝐹1 and 𝜔𝐹2 we get:
Then, the first part of the weak form (2) says
𝜔(𝑥, 𝑦)
𝜔(𝑥, 𝑦)
−𝜔𝜕𝐹1𝜕𝑥
=𝜕𝜔
𝜕𝑥𝐹1 −
𝜕
𝜕𝑥𝜔𝐹1 −𝜔
𝜕𝐹2𝜕𝑥
=𝜕𝜔
𝜕𝑥𝐹2 −
𝜕
𝜕𝑥𝜔𝐹2
© Numerical Factory
Weak Formulation
The last two terms are the divergence terms. Therefore,
where .
For a triangle is:Γ𝑘 positive oriented
© Numerical Factory
Weak Formulation
The last two terms are the divergence terms. Therefore,
where .
For a triangle is:Γ𝑘 positive oriented
© Numerical Factory
Weak Formulation
The last two terms are the divergence terms. Therefore,
.
For a triangle is:Γ𝑘 positive oriented
Divergence Theorem
© Numerical Factory
Weak Formulation
The last two terms are the divergence terms. Therefore,
.
For a triangle is:Γ𝑘 positive oriented
Divergence Theorem
where Γ𝑘 = 𝜕Ω𝑘 with positive orientation
© Numerical Factory
Weak FormulationThese last terms, coming from the divergence theorem are related to the boundary and they are denoted by:
Finally using this definition we rewrite the weak form (2) as:
9/29/2021
18
© Numerical Factory
Weak FormulationThese last terms, coming from the divergence theorem are related to the boundary and they are denoted by:
Finally using this definition we rewrite the weak form (2) as:
© Numerical Factory
Weak FormulationThese last terms, coming from the divergence theorem are related to the boundary and they are denoted by:
Finally using this definition we rewrite the weak form (2) as:
2D integral on Ω𝑘
© Numerical Factory
Weak FormulationThese last terms, coming from the divergence theorem are related to the boundary and they are denoted by:
Finally using this definition we rewrite the weak form (2) as:
1D integral on Γ𝑘
© Numerical Factory
Weak FormulationTo solve these integrals:
1. We first substitute 𝜔 = 𝜓𝑖𝑘 𝑥, 𝑦 for 𝑖 = 1…𝑛 (the shape
functions)
2. We interpolate the unknown function and their derivatives
3. Substitute all in equation (2)
𝑢 𝑥, 𝑦 =
𝑗=1
𝑛
𝑢𝑗𝑘𝜓𝑗
𝑘(𝑥, 𝑦)𝜕𝑢
𝜕𝑥=
𝑗=1
𝑛
𝑢𝑗𝑘𝜕𝜓𝑗
𝑘
𝜕𝑥
© Numerical Factory
Weak FormulationTo solve these integrals:
1. We first substitute 𝜔 = 𝜓𝑖𝑘 𝑥, 𝑦 for 𝑖 = 1…𝑛 (the shape
functions)
2. We interpolate the unknown function and their derivatives
𝑢 𝑥, 𝑦 =
𝑗=1
𝑛
𝑢𝑗𝑘𝜓𝑗
𝑘(𝑥, 𝑦)𝜕𝑢
𝜕𝑥=
𝑗=1
𝑛
𝑢𝑗𝑘𝜕𝜓𝑗
𝑘
𝜕𝑥
© Numerical Factory
Weak FormulationTo solve these integrals:
1. We first substitute 𝜔 = 𝜓𝑖𝑘 𝑥, 𝑦 for 𝑖 = 1…𝑛 (the shape
functions)
2. We interpolate the unknown function and their derivatives
𝑢 𝑥, 𝑦 =
𝑗=1
𝑛
𝑢𝑗𝑘𝜓𝑗
𝑘(𝑥, 𝑦)𝜕𝑢
𝜕𝑥=
𝑗=1
𝑛
𝑢𝑗𝑘𝜕𝜓𝑗
𝑘
𝜕𝑥
Fundamental trick!!!!Due to the interpolation, instead of a continuous unknown function
the only unknowns are the values at the nodes. Only few points!!!
9/29/2021
19
© Numerical Factory
Weak FormulationTo solve these integrals:
1. We first substitute 𝜔 = 𝜓𝑖𝑘 𝑥, 𝑦 for 𝑖 = 1…𝑛 (the shape
functions)
2. We interpolate the unknown function and their derivatives
3. Substitute all in equation (2)
𝑢 𝑥, 𝑦 =
𝑗=1
𝑛
𝑢𝑗𝑘𝜓𝑗
𝑘(𝑥, 𝑦)𝜕𝑢
𝜕𝑥=
𝑗=1
𝑛
𝑢𝑗𝑘𝜕𝜓𝑗
𝑘
𝜕𝑥
© Numerical Factory
Weak FormulationGrouping the unknown terms 𝑢𝑗
𝑘
Which is in fact a linear system of equations
© Numerical Factory
Weak FormulationGrouping the unknown terms 𝑢𝑗
𝑘
Which is in fact a linear system of equations
𝑘11𝑘 ⋯ 𝑘1𝑛
𝑘
⋮ ⋱ ⋮𝑘𝑛1𝑘 ⋯ 𝑘𝑛𝑛
𝑘
𝑢1𝑘
⋮𝑢𝑛𝑘
=𝐹1𝑘
⋮𝐹𝑛𝑘
+𝑄1𝑘
⋮𝑄𝑛𝑘
© Numerical Factory
Weak FormulationGrouping the unknown terms 𝑢𝑗
𝑘
Which is in fact a linear system of equations
𝑘11𝑘 ⋯ 𝑘1𝑛
𝑘
⋮ ⋱ ⋮𝑘𝑛1𝑘 ⋯ 𝑘𝑛𝑛
𝑘
𝑢1𝑘
⋮𝑢𝑛𝑘
=𝐹1𝑘
⋮𝐹𝑛𝑘
+𝑄1𝑘
⋮𝑄𝑛𝑘
© Numerical Factory
Weak FormulationGrouping the unknown terms 𝑢𝑗
𝑘
Which is in fact a linear system of equations
𝑘11𝑘 ⋯ 𝑘1𝑛
𝑘
⋮ ⋱ ⋮𝑘𝑛1𝑘 ⋯ 𝑘𝑛𝑛
𝑘
𝑢1𝑘
⋮𝑢𝑛𝑘
=𝐹1𝑘
⋮𝐹𝑛𝑘
+𝑄1𝑘
⋮𝑄𝑛𝑘
© Numerical Factory
Weak FormulationGrouping the unknown terms 𝑢𝑗
𝑘
Which is in fact a linear system of equations
𝑘11𝑘 ⋯ 𝑘1𝑛
𝑘
⋮ ⋱ ⋮𝑘𝑛1𝑘 ⋯ 𝑘𝑛𝑛
𝑘
𝑢1𝑘
⋮𝑢𝑛𝑘
=𝐹1𝑘
⋮𝐹𝑛𝑘
+𝑄1𝑘
⋮𝑄𝑛𝑘
9/29/2021
20
© Numerical Factory
Weak FormulationGrouping the unknown terms 𝑢𝑗
𝑘
Which is in fact a linear system of equations
© Numerical Factory
Weak FormulationThen, for each element you need to compute two terms to build the element linear system:
• The stiff matrix
𝑘11𝑘 ⋯ 𝑘1𝑛
𝑘
⋮ ⋱ ⋮𝑘𝑛1𝑘 ⋯ 𝑘𝑛𝑛
𝑘
𝑢1𝑘
⋮𝑢𝑛𝑘
=𝐹1𝑘
⋮𝐹𝑛𝑘
+𝑄1𝑘
⋮𝑄𝑛𝑘
© Numerical Factory
Weak FormulationThen, for each element you need to compute two terms to build the element linear system:
• The stiff matrix
• The 𝐹’s vector
𝑘11𝑘 ⋯ 𝑘1𝑛
𝑘
⋮ ⋱ ⋮𝑘𝑛1𝑘 ⋯ 𝑘𝑛𝑛
𝑘
𝑢1𝑘
⋮𝑢𝑛𝑘
=𝐹1𝑘
⋮𝐹𝑛𝑘
+𝑄1𝑘
⋮𝑄𝑛𝑘
© Numerical Factory
Weak FormulationThen, for each element you need to compute two terms to build the element linear system:
• The stiff matrix
• The 𝐹’s vector
𝑘11𝑘 ⋯ 𝑘1𝑛
𝑘
⋮ ⋱ ⋮𝑘𝑛1𝑘 ⋯ 𝑘𝑛𝑛
𝑘
𝑢1𝑘
⋮𝑢𝑛𝑘
=𝐹1𝑘
⋮𝐹𝑛𝑘
+𝑄1𝑘
⋮𝑄𝑛𝑘
The Q’s vector depends on the Boundary Conditions and is computed once you assemble the global system
© Numerical Factory
Notation:
𝑢 = 𝑢(𝑥, 𝑦) is named primary variable
is named secondary variable
Boundary Conditions (BC):
𝑢𝐴 = 𝑢(𝑥𝐴) is an essential BC (fix the primary variable)
is a natural BC (fix the secondary variable)
Weak Formulation
Remember
© Numerical Factory
Notation:
𝑢 = 𝑢(𝑥, 𝑦) is named primary variable
is named secondary variable
Boundary Conditions (BC):
𝑢𝐴 = 𝑢(𝑥𝐴) is an essential BC (fix the primary variable)
is a natural BC (fix the secondary variable)
Weak Formulation
Remember
9/29/2021
21
© Numerical Factory
Weak FormulationNotation from the global system of equations:
We will denote by:
© Numerical Factory
Weak FormulationNotation from the global system of equations:
We will denote by:
© Numerical Factory
Weak FormulationNotation from the global system of equations:
We will denote the different terms by:
© Numerical Factory
Weak FormulationNotation from the global system of equations:
We will denote the different terms by:
© Numerical Factory
Weak FormulationNotation from the global system of equations:
We will denote the different terms by:
© Numerical Factory
Weak FormulationNotation from the global system of equations:
We will denote the different terms by:
9/29/2021
22
© Numerical Factory
Weak FormulationNotation from the global system of equations:
We will denote the different terms by:
© Numerical Factory
Weak FormulationNotation from the global system of equations:
We will denote the different terms by:
© Numerical Factory
Computing the integrals
© Numerical Factory
Computing the Integrals
To build the linear system you need to compute terms like these ones:
In general you need to compute numerically these 2D integrals. For that we will use Gauss integration methods that will be introduced later.
For some easy cases there are some explicit formulas that we present next.
© Numerical Factory
Computing the Integrals
To build the linear system you need to compute terms like these ones:
In general you need to compute numerically these 2D integrals. For that we will use Gauss integration methods that will be introduced later.
For some easy cases there are some explicit formulas that we present next.
© Numerical Factory
Triangles
9/29/2021
23
© Numerical Factory
Computing the Integrals: Triangles
• If we consider constant coefficients for the model equation
We have to compute
In the case of a general linear triangular element
𝑲𝑖𝑗𝑘,11 = 𝑎11 ඵ
Ω𝑘
𝜕𝜓𝑖𝑘
𝜕𝑥𝑥, 𝑦
𝜕𝜓𝑗𝑘
𝜕𝑥𝑥, 𝑦 𝑑𝑥𝑑𝑦 = 𝑎11
1
4𝐴𝑘𝛽𝑖𝛽𝑗
𝑣1
𝑣2
𝑣3 Ω𝑘
𝜓𝑖𝑘 𝑥, 𝑦 = 𝑎𝑖 + 𝛽𝑖 𝑥 + 𝛾𝑖 𝑦, 𝑖 = 1,2,3
𝑎𝑖 =𝑥𝑗𝑦𝑘 − 𝑥𝑘𝑦𝑗
2𝐴𝑘
𝛽𝑖 =𝑦𝑗 − 𝑦𝑘
2𝐴𝑘
𝛾𝑖 =𝑥𝑘 − 𝑥𝑗
2𝐴𝑘
𝑲𝑖𝑗𝑘,11 = 𝑎11 ඵ
Ω𝑘
𝜕𝜓𝑖𝑘
𝜕𝑥𝑥, 𝑦
𝜕𝜓𝑗𝑘
𝜕𝑥𝑥, 𝑦 𝑑𝑥𝑑𝑦
𝜕𝜓𝑖𝑘
𝜕𝑥𝑥, 𝑦 = 𝛽𝑖
(𝑖, 𝑗, 𝑘) cyclic permutations
𝜕𝜓𝑖𝑘
𝜕𝑦𝑥, 𝑦 = 𝛾𝑖
© Numerical Factory
Computing the Integrals: Triangles
• If we consider constant coefficients for the model equation
We have to compute
In the case of a general linear triangular element𝑣1
𝑣2
𝑣3 Ω𝑘
𝜓𝑖𝑘 𝑥, 𝑦 =
𝑎𝑖+𝛽𝑖 𝑥+𝛾𝑖 𝑦
2𝐴𝑘, 𝑖 = 1,2,3
𝑎𝑖 = 𝑥𝑗𝑦𝑘 − 𝑥𝑘𝑦𝑗𝛽𝑖 = 𝑦𝑗 − 𝑦𝑘𝛾𝑖 = 𝑥𝑘 − 𝑥𝑗
𝑲𝑖𝑗𝑘,11 = 𝑎11 ඵ
Ω𝑘
𝜕𝜓𝑖𝑘
𝜕𝑥𝑥, 𝑦
𝜕𝜓𝑗𝑘
𝜕𝑥𝑥, 𝑦 𝑑𝑥𝑑𝑦
𝜕𝜓𝑖𝑘
𝜕𝑥𝑥, 𝑦 = 𝛽𝑖
(𝑖, 𝑗, 𝑘) cyclic permutations
𝜕𝜓𝑖𝑘
𝜕𝑦𝑥, 𝑦 = 𝛾𝑖
© Numerical Factory
Computing the Integrals: Triangles
• If we consider constant coefficients for the model equation
We have to compute
In the case of a general linear triangular element
𝑲𝑖𝑗𝑘,11 = 𝑎11 ඵ
Ω𝑘
𝜕𝜓𝑖𝑘
𝜕𝑥𝑥, 𝑦
𝜕𝜓𝑗𝑘
𝜕𝑥𝑥, 𝑦 𝑑𝑥𝑑𝑦 = 𝑎11
1
4𝐴𝑘𝛽𝑖𝛽𝑗
𝑣1
𝑣2
𝑣3 Ω𝑘𝑲𝑖𝑗𝑘,11 = 𝑎11 ඵ
Ω𝑘
𝜕𝜓𝑖𝑘
𝜕𝑥𝑥, 𝑦
𝜕𝜓𝑗𝑘
𝜕𝑥𝑥, 𝑦 𝑑𝑥𝑑𝑦
𝜕𝜓𝑖𝑘
𝜕𝑥𝑥, 𝑦 =
𝛽𝑖2𝐴𝑘
𝜕𝜓𝑖𝑘
𝜕𝑦𝑥, 𝑦 =
𝛾𝑖2𝐴𝑘
𝜓𝑖𝑘 𝑥, 𝑦 =
𝑎𝑖+𝛽𝑖 𝑥+𝛾𝑖 𝑦
2𝐴𝑘, 𝑖 = 1,2,3
𝑎𝑖 = 𝑥𝑗𝑦𝑘 − 𝑥𝑘𝑦𝑗𝛽𝑖 = 𝑦𝑗 − 𝑦𝑘𝛾𝑖 = 𝑥𝑘 − 𝑥𝑗
(𝑖, 𝑗, 𝑘) cyclic permutations
© Numerical Factory
Computing the Integrals: Triangles
• If we consider constant coefficients for the model equation
We have to compute
In the case of a general linear triangular element
𝑲𝑖𝑗𝑘,11 = 𝑎11 ඵ
Ω𝑘
𝜕𝜓𝑖𝑘
𝜕𝑥𝑥, 𝑦
𝜕𝜓𝑗𝑘
𝜕𝑥𝑥, 𝑦 𝑑𝑥𝑑𝑦 = 𝑎11
1
4𝐴𝑘𝛽𝑖𝛽𝑗
𝑣1
𝑣2
𝑣3 Ω𝑘𝑲𝑖𝑗𝑘,11 = 𝑎11 ඵ
Ω𝑘
𝜕𝜓𝑖𝑘
𝜕𝑥𝑥, 𝑦
𝜕𝜓𝑗𝑘
𝜕𝑥𝑥, 𝑦 𝑑𝑥𝑑𝑦
𝜓𝑖𝑘 𝑥, 𝑦 =
𝑎𝑖+𝛽𝑖 𝑥+𝛾𝑖 𝑦
2𝐴𝑘, 𝑖 = 1,2,3
𝑎𝑖 = 𝑥𝑗𝑦𝑘 − 𝑥𝑘𝑦𝑗𝛽𝑖 = 𝑦𝑗 − 𝑦𝑘𝛾𝑖 = 𝑥𝑘 − 𝑥𝑗
(𝑖, 𝑗, 𝑘) cyclic permutations
𝜕𝜓𝑖𝑘
𝜕𝑥𝑥, 𝑦 =
𝛽𝑖2𝐴𝑘
𝜕𝜓𝑖𝑘
𝜕𝑦𝑥, 𝑦 =
𝛾𝑖2𝐴𝑘
© Numerical Factory
Computing the Integrals: Triangles
𝑲𝑖𝑗𝑘,11 = 𝑎11 ඵ
Ω𝑘
𝜕𝜓𝑖𝑘
𝜕𝑥𝑥, 𝑦
𝜕𝜓𝑗𝑘
𝜕𝑥𝑥, 𝑦 𝑑𝑥𝑑𝑦 =
𝑎114𝐴𝑘
𝛽𝑖𝛽𝑗
𝑲𝑖𝑗𝑘,12 = 𝑎12 ඵ
Ω𝑘
𝜕𝜓𝑖𝑘
𝜕𝑥𝑥, 𝑦
𝜕𝜓𝑗𝑘
𝜕𝑦𝑥, 𝑦 𝑑𝑥𝑑𝑦 =
𝑎124𝐴𝑘
𝛽𝑖𝛾𝑗
𝑲𝑖𝑗𝑘,21 =
𝑎214𝐴𝑘
𝛾𝑖𝛽𝑗
𝑲𝑖𝑗𝑘,22 = 𝑎22 ඵ
Ω𝑘
𝜕𝜓𝑖𝑘
𝜕𝑦𝑥, 𝑦
𝜕𝜓𝑗𝑘
𝜕𝑦𝑥, 𝑦 𝑑𝑥𝑑𝑦 =
𝑎224𝐴𝑘
𝛾𝑖𝛾𝑗
𝑲𝑖𝑗𝑘,00 = 𝑎00 ඵ
Ω𝑘
𝜓𝑖𝑘 𝑥, 𝑦 𝜓𝑗
𝑘 𝑥, 𝑦 𝑑𝑥𝑑𝑦 =𝑎00𝐴𝑘12
2 1 11 2 11 1 2
𝐹𝑘 =𝑓𝑘𝐴𝑘3
111
If the vertices of the triangle are 𝑣𝑖 = 𝑥𝑖, 𝑦𝑖 we define:
𝛽𝑖 = 𝑦𝑗 − 𝑦𝑘𝛾𝑖 = − 𝑥𝑗 − 𝑥𝑘
(𝑖, 𝑗, 𝑘) cyclic permutations
𝐴𝑘 is triangle area
𝑣1
𝑣2
𝑣3
Ω𝑘
All together:
© Numerical Factory
Computing the Integrals: Triangles
• In the case of a general linear triangular rectangle element for the Poisson’s Equation
(a11 = a22 = 𝑐, a12 = a21 = a00 = 0)
𝑣1
𝑣2
𝑣3
𝑎
𝑏Ω𝑘
9/29/2021
24
© Numerical Factory
Computing the Integrals: Triangles
• In the case of a general linear triangular rectangle element for the Poisson’s Equation
(a11 = a22 = 𝑐, a12 = a21 = a00 = 0)
𝐾𝑘 =𝑐
2𝑎𝑏
𝑏2 −𝑏2 0−𝑏2 𝑎2 + 𝑏2 −𝑎2
0 −𝑎2 𝑎2
𝑣1
𝑣2
𝑣3
𝑎
𝑏Ω𝑘
𝐹𝑘 =𝑓𝑘𝐴𝑘3
111
=𝑓𝑘𝑎𝑏
6
111
The formula:
Simplifies to:
© Numerical Factory
Rectangles
© Numerical Factory
Computing the Integrals: Rectangles
• If we consider constant coefficients for the model equation
In the case of a rectangular quadrilateral
𝑎
𝑏Ω𝑘
© Numerical Factory
Computing the Integrals: Rectangles
• If we consider constant coefficients for the model equation
In the case of a rectangular quadrilateral
𝑎
𝑏Ω𝑘
© Numerical Factory
Computing the Integrals: Rectangles
• If we consider constant coefficients for the model equation
In the case of a rectangular quadrilateral
𝑎
𝑏Ω𝑘
© Numerical Factory
Mètodes Numèrics: A First Course on Finite Elements
Dept. Matemàtiques ETSEIB - UPC BarcelonaTech
Finite Elements (III)1D Finite Elements
Following: Curs d’Elements Finits amb Aplicacions (J. Masdemont)http://hdl.handle.net/2099.3/36166
9/29/2021
25
© Numerical Factory
1D Finite Elements
© Numerical Factory
The 1D case: Weak Formulation
Similar to the 2D case, the model equation for the 1D case is:
If Ωk = [𝑥𝐴, 𝑥𝐵], the variational formulation gives:
Like in 2D, the term 𝑄 ≡ 𝑎1𝑑𝑢
𝑑𝑥, and because the outer normal orientation, we
have 𝑄𝑖𝑘 = −𝑎1
𝑑𝑢
𝑑𝑥ȁ𝑥=𝑋𝐴 and 𝑄𝑖
𝑘 = 𝑎1𝑑𝑢
𝑑𝑥ȁ𝑥=𝑋𝐵 Notice the minus sign on
the left node.
© Numerical Factory
The 1D case: Weak Formulation
Similar to the 2D case, the model equation for the 1D case is:
For a 1D element Ωk = [𝑥𝐴, 𝑥𝐵], after passing to the integral equation, using the shape 1D functions (Lagrange Polynomials) and interpolate, the weak or variational formulation gives:
© Numerical Factory
The 1D case: Weak Formulation
Similar to the 2D case, the model equation for the 1D case is:
If Ωk = [𝑥𝐴, 𝑥𝐵], the weak or variational formulation gives:
© Numerical Factory
The 1D case: Weak Formulation• As a linear equations system it is written:
© Numerical Factory
The 1D case: Weak Formulation• As a linear equations system it is written:
9/29/2021
26
© Numerical Factory
The 1D case: Weak Formulation• As a linear equations system it is written:
Notice that now these are 1D integrals!!
© Numerical Factory
The 1D case: Weak Formulation• As a linear equations system it is written:
© Numerical Factory
The 1D case: Weak Formulation• As a linear equations system it is written:
Like in 2D, the term 𝑄 ≡ 𝑎1𝑑𝑢
𝑑𝑥· 𝑛 , and because the outer normal orientation,
we have 𝑄𝑖𝑘 = −𝑎1
𝑑𝑢
𝑑𝑥ȁ𝑥=𝑋𝐴 and 𝑄𝑖
𝑘 = 𝑎1𝑑𝑢
𝑑𝑥ȁ𝑥=𝑋𝐵 .
𝑥𝐴
Ω𝑘𝑛
− +
𝑥𝐵
Notice the minus sign on the left node.
𝑛
© Numerical Factory
Computing the integrals
© Numerical Factory
The 1D Linear element
Consider now the linear reference element Ω𝑅 = [−1,1]
The shape functions can be written for 𝜉 ∈ [−1,1]
𝜓1𝑅 𝜉 =
1
21 − 𝜉 𝜓2
𝑅 𝜉 =1
21 + 𝜉
© Numerical Factory
The 1D Linear element
Consider now the linear reference element Ω𝑅 = [−1,1]
The shape functions can be written for 𝜉 ∈ [−1,1]
The idea is to use integral properties to pass every other linear element to the reference one.
𝜓1𝑅 𝜉 =
1
21 − 𝜉 𝜓2
𝑅 𝜉 =1
21 + 𝜉
9/29/2021
27
© Numerical Factory
The 1D Linear element
Consider now the linear reference element Ω𝑅 = [−1,1]
The shape functions can be written for 𝜉 ∈ [−1,1]
The idea is to use integral properties to pass every other linear element to the reference one.
For a general element Ω𝑘 = [𝑥𝐴, 𝑥𝐵] with 𝑥 ∈ [𝑥𝐴, 𝑥𝐵]we have the change of variables with the interval [−1,1] is:
for ℎ𝑘 = 𝑥𝐵 − 𝑥𝐴𝑥 =ℎ𝑘2
𝜉 + 1 + 𝑋𝐴
𝜉 =2
ℎ𝑘𝑥 − 𝑥𝐴 − 1
Or the inverse:
𝜓1𝑅 𝜉 =
1
21 − 𝜉 𝜓2
𝑅 𝜉 =1
21 + 𝜉
© Numerical Factory
The 1D Linear element
• Therefore, the change of variables in the integrals gives:
© Numerical Factory
The 1D Linear element
• Therefore, the change of variables in the integrals gives:
© Numerical Factory
The 1D Linear element
• For the second integral
© Numerical Factory
The 1D Linear element
• For the second integral
with
© Numerical Factory
The 1D Linear element
• Therefore, the change of variables in the integrals gives:
with
9/29/2021
28
© Numerical Factory
The 1D Linear element
• Therefore, the change of variables in the integrals gives:
with
=1
2=1
2
© Numerical Factory
The 1D Linear element
• Therefore, the change of variables in the integrals gives:
with
= ±1
2= ±
1
2
1
© Numerical Factory
The 1D Linear element
• The constant case:
Consider now the case where 𝑎1 𝑥 = 𝑎1𝑘, 𝑎𝑜 𝑥 = 𝑎0
𝑘, =
© Numerical Factory
The 1D Linear element
• The constant case:
Consider now the case where 𝑎1 𝑥 = 𝑎1𝑘, 𝑎𝑜 𝑥 = 𝑎0
𝑘, =
© Numerical Factory
The 1D Linear element
• The constant case:
Consider now the case where 𝑎1 𝑥 = 𝑎1𝑘, 𝑎𝑜 𝑥 = 𝑎0
𝑘, =
© Numerical Factory
The 1D Linear element
• The constant case:
Consider now the case where 𝑎1 𝑥 = 𝑎1𝑘, 𝑎𝑜 𝑥 = 𝑎0
𝑘, =
9/29/2021
29
© Numerical Factory
The 1D Linear element
• The constant case:
Consider now the case where 𝑎1 𝑥 = 𝑎1𝑘, 𝑎𝑜 𝑥 = 𝑎0
𝑘, =
© Numerical Factory
The 1D Linear element
• The constant case:
Consider now the case where 𝑎1 𝑥 = 𝑎1𝑘, 𝑎𝑜 𝑥 = 𝑎0
𝑘, =
© Numerical Factory
The 1D Linear element
• The constant case:
Consider now the case where 𝑎1 𝑥 = 𝑎1𝑘, 𝑎𝑜 𝑥 = 𝑎0
𝑘, =
© Numerical Factory
The 1D Linear element
• The constant case:
collecting all the terms we have
© Numerical Factory
The 1D Quadratic element
• When we consider quadratic elements, the shape functions are
• In the constant coefficient case we obtain:
© Numerical Factory
1D Finite ElementsExamples
9/29/2021
30
© Numerical Factory
Linear Elasticity 1D
Linear Elasticity 1D equation:
with 𝐸 𝑥 the material elasticity function (Young modulus), 𝐴 𝑥the section area and 𝑢 𝑥 the displacement.
© Numerical Factory
Constant Pillar
© Numerical Factory
Linear Elasticity 1D
• Example 1: Constant loaded column
Let’s assume E·A constant (homogeneous column).
11
© Numerical Factory
Linear Elasticity 1D
• This is a particular case of the model equation
with (if the column weight is not consider).
as we learned before, the problem can be stated as
© Numerical Factory
Linear Elasticity 1D
• This is a particular case of the model equation
with (if the column weight is not consider).
as we learned before, the problem can be stated as
© Numerical Factory
Linear Elasticity 1DAfter assembly the system we obtain
Finally, we impose
Solution:
9/29/2021
31
© Numerical Factory
Linear Elasticity 1DAfter assembly the system we obtain
Finally, we impose
Solution:
© Numerical Factory
Linear Elasticity 1DAfter assembly the system we obtain
Finally, we impose
Solution:
© Numerical Factory
Linear Elasticity 1DAfter assembly the system we obtain
Finally, we impose
Solution:
© Numerical Factory
Linear Elasticity 1DAfter assembly the system we obtain
Finally, we impose
Unknowns primary: 𝑈2, 𝑈3 , 𝑈4 , 𝑈5 and also secondary 𝑄11
© Numerical Factory
Linear Elasticity 1DAfter assembly the system we obtain
Finally, we impose
© Numerical Factory
Linear Elasticity 1DAfter assembly the system we obtain
Finally, we impose
Solution:
(Reaction force on the ground)
9/29/2021
32
© Numerical Factory
Variable Pillar
© Numerical Factory
• Example 2: Concrete Pyramidal Column with variable section area
Linear Elasticity 1D
𝑓(𝑥)
© Numerical Factory
• Example 2: Concrete Pyramidal Column with variable
section area
Linear Elasticity 1D
𝑓(𝑥)
Now the inner weight of the column is also taken into account
𝑓 𝑥 = −𝜔𝑑𝑉
𝑑𝑥
𝜔 been the concrete specific weight
© Numerical Factory
• Example 2: Concrete Pyramidal Column with variable
section area
Linear Elasticity 1D
𝑓(𝑥)
Model equation:𝑎1 𝑥 = 𝐸 𝑥 · 𝐴 𝑥 non constant𝑎0 𝑥 = 0
𝑓 𝑥 = −𝜔𝑑𝑉
𝑑𝑥internal weight force
© Numerical Factory
Example 2: Concrete Pyramidal Column
Consider
Linear Elasticity 1D
(concrete specific weight)
© Numerical Factory
Linear Elasticity 1DNow, the section area is not constant
and therefore, the internal forces 𝑓 𝑥 = 𝜔𝑑𝑉
𝑑𝑥for unit
length can be expressed by the product
(Hint: This can be obtained by the derivative of the formula for the volume of column above a level x.
𝑉 𝑥 =1
2𝐴 3 + 𝐴 𝑥 · ℎ
)
Wide value as a function 𝑏(𝑥)𝑥 ȁ 0 3𝑏ȁ 1.5 0.5
9/29/2021
33
© Numerical Factory
Linear Elasticity 1DNow, the section area is not constant
and therefore, the internal forces 𝑓 𝑥 = 𝜔𝑑𝑉
𝑑𝑥for unit
length can be expressed by the product
(Hint: This can be obtained by the derivative of the formula for the volume of column above a level x.
𝑉 𝑥 =1
2𝐴 3 + 𝐴 𝑥 · ℎ
)
𝑏(𝑥) =
𝑥 ȁ 0 3𝑏ȁ 1.5 0.5Wide value as a function 𝑏(𝑥)
© Numerical Factory
Linear Elasticity 1DNow, the section area is not constant
and therefore, the internal forces 𝑓 𝑥 = 𝜔𝑑𝑉
𝑑𝑥for unit
length can be expressed by the product
(Hint: This can be obtained by the derivative of the formula for the volume of column above a level x.
𝑉 𝑥 =1
2𝐴 3 + 𝐴 𝑥 · ℎ
)
𝑏(𝑥) =
𝑥 ȁ 0 3𝑏ȁ 1.5 0.5
𝐴 𝑥 = 0.5 · 𝑏(𝑥)
Each section is a rectangle:
Wide value as a function 𝑏(𝑥)
© Numerical Factory
Linear Elasticity 1DNow, the section area is not constant
and therefore, the internal forces 𝑓 𝑥 = 𝜔𝑑𝑉
𝑑𝑥for unit
length can be expressed by the product
(Hint: This can be obtained by the derivative of the formula for the volume of column above a level x.
𝑉 𝑥 =1
2𝐴 3 + 𝐴 𝑥 · ℎ
)
𝑏(𝑥) =
𝑥 ȁ 0 3𝑏ȁ 1.5 0.5
𝐴 𝑥 = 0.5 · 𝑏(𝑥)
Each section is a rectangle:
Wide value as a function 𝑏(𝑥)
© Numerical Factory
Linear Elasticity 1DThe internal forces corresponding to the pillar weight can be computed from the specific weight
𝑓 𝑥 = −𝜔𝑑𝑉
𝑑𝑥
for unit length can be expressed by the product
(Hint: This can be obtained by the derivative of the formula for the volume of column above a level x.
𝑉 𝑥 =1
2𝐴 3 + 𝐴 𝑥 · ℎ
)
© Numerical Factory
Linear Elasticity 1D
• Here, to obtain the linear system
we need to compute
That gives different values for each element. Considering the first one, , we obtain:
𝜓1𝑘 𝑥 =
𝑥 − 𝑥𝐵𝑥𝐴 − 𝑥𝐵
=𝑥 − 𝑥𝐵−ℎ𝑘
𝜓2𝑘 𝑥 =
𝑥 − 𝑥𝐴𝑥𝐵 − 𝑥𝐴
=𝑥 − 𝑥𝐴ℎ𝑘
© Numerical Factory
Linear Elasticity 1D
• Here, to obtain the linear system
we need to compute
That gives different values for each element. Considering the first one, , we obtain:
𝜓1𝑘 𝑥 =
𝑥 − 𝑥𝐵𝑥𝐴 − 𝑥𝐵
=𝑥 − 𝑥𝐵−ℎ𝑘
𝑑𝜓1𝑘
𝑑𝑥𝑥 =
−1
ℎ𝑘
𝜓2𝑘 𝑥 =
𝑥 − 𝑥𝐴𝑥𝐵 − 𝑥𝐴
=𝑥 − 𝑥𝐴ℎ𝑘
𝑑𝜓2𝑘
𝑑𝑥𝑥 =
1
ℎ𝑘
9/29/2021
34
© Numerical Factory
Linear Elasticity 1D
• Here, to obtain the linear system
we need to compute
That gives different values for each element. Considering the first one, , here ℎ𝑘 = 1,we obtain:
© Numerical Factory
Linear Elasticity 1D
• Here, to obtain the linear system
we need to compute
That gives different values for each element. Considering the first one, , we obtain:
© Numerical Factory
Linear Elasticity 1D
• Here, to obtain the linear system
we need to compute
That gives different values for each element. Considering the first one, , we obtain:
© Numerical Factory
Linear Elasticity 1D
• Here, to obtain the linear system
we need to compute
That gives different values for each element. Considering the first one, , we obtain:
© Numerical Factory
Linear Elasticity 1D
• For the three elements we have:
and next, assembling the system
With BC
Solution:© Numerical Factory
Linear Elasticity 1D
• For the three elements we have:
and next, assemble the system
With BC
Solution:
9/29/2021
35
© Numerical Factory
With BC
Linear Elasticity 1D
essential condition
© Numerical Factory
With BC
Solution:
Linear Elasticity 1D
essential BC:
natural BC:
𝑄1 =𝐸
64𝑈1 − 4𝑈2 +
25𝜔
72= −4.3586𝑒 + 04
© Numerical Factory
Mètodes Numèrics: A First Course on Finite Elements
Dept. Matemàtiques ETSEIB - UPC BarcelonaTech
Finite Elements (IV)Boundary Conditions
Following: Curs d’Elements Finits amb Aplicacions (J. Masdemont)http://hdl.handle.net/2099.3/36166
© Numerical Factory
FEM 2D Natural Boundary Conditions
© Numerical Factory
Boundary Conditions
1 2
𝐿𝑒
1D – Boundary Conditions (BC)
𝑄1𝑘 = −𝑎1
𝑑𝑢
𝑑𝑥𝑄2𝑘 = +𝑎1
𝑑𝑢
𝑑𝑥𝑄𝑖𝑘 = 𝑎1
𝑑𝑢
𝑑𝑥· 𝑛
© Numerical Factory
Boundary Conditions
1 2
𝐿𝑒
1D – Boundary Conditions (BC)
𝑄1𝑘 = −𝑎1
𝑑𝑢
𝑑𝑥𝑄2𝑘 = +𝑎1
𝑑𝑢
𝑑𝑥𝑄𝑖𝑘 = 𝑎1
𝑑𝑢
𝑑𝑥· 𝑛
2D – Boundary Conditions (BC)
𝑄𝑖𝑘 = න
Γ𝑘𝑞𝑛𝜓𝑖 𝑥, 𝑦 𝑑𝑠 where
and Γ𝑘 ≡ 𝜕Ωk is the boundary of the element Ω𝑘 .
9/29/2021
36
© Numerical Factory
Boundary Conditions
1 2
𝐿𝑒
1D – Boundary Conditions (BC)
𝑄1𝑘 = −𝑎1
𝑑𝑢
𝑑𝑥𝑄2𝑘 = +𝑎1
𝑑𝑢
𝑑𝑥𝑄𝑖𝑘 = 𝑎1
𝑑𝑢
𝑑𝑥· 𝑛
2D – Boundary Conditions (BC)
𝑄𝑖𝑘 = න
𝜕Ω
𝑞𝑛𝜓𝑖 𝑥, 𝑦 𝑑𝑠 where
Triangular element
and Γ𝑘 ≡ 𝜕Ωk is the boundary of the element Ω𝑘 .
© Numerical Factory
Boundary Conditions
If we consider a triangular element
Γ1
Γ2
Γ3
1 2
3
© Numerical Factory
Boundary Conditions
If we consider a triangular element
Γ1
Γ2
Γ3
1 2
3
© Numerical Factory
Boundary Conditions
If we consider a triangular element
Γ1
Γ2
Γ3
1 2
3
© Numerical Factory
Boundary Conditions
If we consider a triangular element
Γ1
Γ2
Γ3
1 2
3
© Numerical Factory
Boundary Conditions
If we consider a triangular element
Γ1
Γ2
Γ3
1 2
3
9/29/2021
37
© Numerical Factory
( 𝑄𝑖𝑗𝑘 means the flux on node 𝑖 corresponding to the contribution of edge 𝑗 )
Boundary Conditions
If we consider a triangular element
with
Γ1
Γ2
Γ3
1 2
3
© Numerical Factory
( 𝑄𝑖𝑗𝑘 means the flux on node 𝑖 corresponding to the contribution of edge 𝑗 )
Boundary Conditions
If we consider a triangular element
with
Γ1
Γ2
Γ3
1 2
3
© Numerical Factory
( 𝑄𝑖𝑗𝑘 means the flux on node 𝑖 corresponding to the contribution of edge 𝑗 )
Boundary Conditions
If we consider a triangular element
with
Γ1
Γ2
Γ3
1 2
3
© Numerical Factory
BC on Triangles
© Numerical Factory
Boundary Conditions
Triangular Shape Functions (a plane)
𝜓𝑖𝑘 𝑥, 𝑦 = 𝛼 + 𝛽𝑥 + 𝛾𝑦
© Numerical Factory
Boundary Conditions
(0, 0)
(1, 0.5)
(0.5, 1)
1
2
3Triangular Shape Functions (a plane)
Triangular Element𝜓𝑖𝑘 𝑥, 𝑦 = 𝛼 + 𝛽𝑥 + 𝛾𝑦
9/29/2021
38
© Numerical Factory
Boundary Conditions
(0, 0)
(1, 0.5)
(0.5, 1)
1
2
3Triangular Shape Functions
Triangular Element
𝜓1𝑘(𝑥, 𝑦)
𝜓𝑖𝑘 𝑥, 𝑦 = 𝛼 + 𝛽𝑥 + 𝛾𝑦
© Numerical Factory
Boundary Conditions
(0, 0)
(1, 0.5)
(0.5, 1)
1
2
3Triangular Shape Functions
Triangular Element
𝜓1𝑘(𝑥, 𝑦) 𝜓2
𝑘(𝑥, 𝑦)
𝜓𝑖𝑘 𝑥, 𝑦 = 𝛼 + 𝛽𝑥 + 𝛾𝑦
© Numerical Factory
Boundary Conditions
(0, 0)
(1, 0.5)
(0.5, 1)
1
2
3Triangular Shape Functions
Triangular Element
𝜓1𝑘(𝑥, 𝑦) 𝜓2
𝑘(𝑥, 𝑦) 𝜓3𝑘(𝑥, 𝑦)
𝜓𝑖𝑘 𝑥, 𝑦 = 𝛼 + 𝛽𝑥 + 𝛾𝑦
© Numerical Factory
Boundary Conditions
• Restriction of 𝜓𝑖𝑘(𝑥, 𝑦) to the boundaries
First function: 𝜓1𝑘(𝑥, 𝑦)
𝜓11𝑘 𝑥, 𝑦 ቚ
Γ1= 1 −
𝑠
ℎ1, 𝑠 ∈ [0, ℎ1]
Restriction to Γ1
1
0
ℎ1𝑠 = 0 𝑠 = ℎ1
𝜓1𝑘(𝑥, 𝑦)
© Numerical Factory
Boundary Conditions
• Restriction of 𝜓𝑖𝑘(𝑥, 𝑦) to the boundaries
𝜓12𝑘 𝑥, 𝑦 ቚ
Γ2= 0
Restriction to Γ2
0
ℎ2𝑠 = 0 𝑠 = ℎ2
First function: 𝜓1𝑘(𝑥, 𝑦)
0𝜓1𝑘(𝑥, 𝑦)
© Numerical Factory
Boundary Conditions
• Restriction of 𝜓𝑖𝑘(𝑥, 𝑦) to the boundaries
First function: 𝜓1𝑘(𝑥, 𝑦)
𝜓13𝑘 𝑥, 𝑦 ቚ
Γ3=
𝑠
ℎ3, 𝑠 ∈ [0, ℎ3]
Restriction to Γ3
1
0
ℎ3𝑠 = 0 𝑠 = ℎ3
𝜓1𝑘(𝑥, 𝑦)
9/29/2021
39
© Numerical Factory
Boundary Conditions
• Restriction of 𝜓𝑖𝑘(𝑥, 𝑦) to the boundaries
Second function: 𝜓2𝑘(𝑥, 𝑦)
𝜓21𝑘 𝑥, 𝑦 ቚ
Γ1=
𝑠
ℎ1, 𝑠 ∈ [0, ℎ1]
Restriction to Γ1
1
0
ℎ1𝑠 = 0 𝑠 = ℎ1
© Numerical Factory
Boundary Conditions
• Restriction of 𝜓𝑖𝑘(𝑥, 𝑦) to the boundaries
Second function: 𝜓2𝑘(𝑥, 𝑦)
𝜓22𝑘 𝑥, 𝑦 ቚ
Γ2= 1 −
𝑠
ℎ2, 𝑠 ∈ [0, ℎ2]
Restriction to Γ2
1
0
ℎ2𝑠 = 0 𝑠 = ℎ2
© Numerical Factory
Boundary Conditions
• Restriction of 𝜓𝑖𝑘(𝑥, 𝑦) to the boundaries
Second function: 𝜓2𝑘(𝑥, 𝑦)
𝜓23𝑘 𝑥, 𝑦 ቚ
Γ3= 0
Restriction to Γ3
0
ℎ3𝑠 = 0 𝑠 = ℎ3
0
© Numerical Factory
Boundary Conditions
• Restriction of 𝜓𝑖𝑘(𝑥, 𝑦) to the boundaries
Third function: 𝜓3𝑘(𝑥, 𝑦)
𝜓31𝑘 𝑥, 𝑦 ቚ
Γ1= 0
Restriction to Γ1
𝜓32𝑘 𝑥, 𝑦 ቚ
Γ2=
𝑠
ℎ2, 𝑠 ∈ [0, ℎ2]
Restriction to Γ2
𝜓33𝑘 𝑥, 𝑦 ቚ
Γ3= 1 −
𝑠
ℎ3, 𝑠 ∈ [0, ℎ3]
Restriction to Γ3
© Numerical Factory
Boundary Conditions
• For the shape functions, they can be seen as the 1D Lagrange’s polynomial associated to the edge
ℎ𝑗𝑘 is the length of the j-th edge of the triangle
𝑣3
𝑣1𝑣2𝑒1
𝑒2𝑒3
Edge notation:
© Numerical Factory
Boundary Conditions
• Balance, of course, applies to interior faces
9/29/2021
40
© Numerical Factory
Boundary Conditions
• Balance, of course, applies to interior faces
© Numerical Factory
Boundary Conditions
• Balance, of course, applies to interior faces and only the ones on the boundary have to be consider
© Numerical Factory
Constant BC on Triangles
© Numerical Factory
Constant Boundary Conditions
• Consider the case where a constant BC is applied to one edge of the triangle
2
3
𝑞𝑛𝑘 = ቐ
𝑞0 on Γ10 on Γ20 on Γ3
© Numerical Factory
Constant Boundary Conditions
• Consider the case where a constant BC is applied to one edge of the triangle
2
3
𝑞𝑛𝑘 = ቐ
𝑞0 on Γ10 on Γ20 on Γ3
𝑄1𝑘 = 𝑄11
𝑘 +𝑄13𝑘
Node 1
© Numerical Factory
Constant Boundary Conditions
• Consider the case where a constant BC is applied to one edge of the triangle
2
3
𝑞𝑛𝑘 = ቐ
𝑞0 on Γ10 on Γ20 on Γ3
𝑄1𝑘 = 𝑄11
𝑘 +𝑄13𝑘
Node 1
𝑄11𝑘 = න
Γ1
𝑞𝑛𝜓11𝑘 𝑠 𝑑𝑠 =
9/29/2021
41
© Numerical Factory
Constant Boundary Conditions
• Consider the case where a constant BC is applied to one edge of the triangle
2
3
𝑞𝑛𝑘 = ቐ
𝑞0 on Γ10 on Γ20 on Γ3
𝑄1𝑘 = 𝑄11
𝑘 +𝑄13𝑘
Node 1
𝑄11𝑘 = න
Γ1
𝑞𝑛𝜓11𝑘 𝑠 𝑑𝑠 =
= 𝑞0 0ℎ1 1 −
𝑠
ℎ1𝑑𝑠 =
1
2𝑞0ℎ1
© Numerical Factory
Constant Boundary Conditions
• Consider the case where a constant BC is applied to one edge of the triangle
2
3
𝑞𝑛𝑘 = ቐ
𝑞0 on Γ10 on Γ20 on Γ3
𝑄1𝑘 = 𝑄11
𝑘 +𝑄13𝑘
Node 1
𝑄11𝑘 = න
Γ1
𝑞𝑛𝜓11𝑘 𝑠 𝑑𝑠 =
= 𝑞0 0ℎ1 1 −
𝑠
ℎ1𝑑𝑠 =
1
2𝑞0ℎ1
𝑄13𝑘 = න
Γ3
𝑞𝑛𝜓13𝑘 𝑠 𝑑𝑠 = 0
© Numerical Factory
Constant Boundary Conditions
• Consider the case where a constant BC is applied to one edge of the triangle
2
3
𝑞𝑛𝑘 = ቐ
𝑞0 on Γ10 on Γ20 on Γ3
𝑄2𝑘 = 𝑄21
𝑘 +𝑄22𝑘
Node 2
© Numerical Factory
Constant Boundary Conditions
• Consider the case where a constant BC is applied to one edge of the triangle
2
3
𝑞𝑛𝑘 = ቐ
𝑞0 on Γ10 on Γ20 on Γ3
𝑄2𝑘 = 𝑄21
𝑘 +𝑄22𝑘
Node 2
𝑄21𝑘 = න
Γ1
𝑞𝑛𝜓21𝑘 𝑠 𝑑𝑠 =
© Numerical Factory
Constant Boundary Conditions
• Consider the case where a constant BC is applied to one edge of the triangle
2
3
𝑞𝑛𝑘 = ቐ
𝑞0 on Γ10 on Γ20 on Γ3
𝑄2𝑘 = 𝑄21
𝑘 +𝑄22𝑘
Node 2
𝑄21𝑘 = න
Γ1
𝑞𝑛𝜓21𝑘 𝑠 𝑑𝑠 =
= 𝑞0 0ℎ1 𝑠
ℎ1𝑑𝑠 =
1
2𝑞0ℎ1
© Numerical Factory
Constant Boundary Conditions
• Consider the case where a constant BC is applied to one edge of the triangle
2
3
𝑞𝑛𝑘 = ቐ
𝑞0 on Γ10 on Γ20 on Γ3
𝑄2𝑘 = 𝑄21
𝑘 +𝑄22𝑘
Node 2
𝑄21𝑘 = න
Γ1
𝑞𝑛𝜓21𝑘 𝑠 𝑑𝑠 =
= 𝑞0 0ℎ1 𝑠
ℎ1𝑑𝑠 =
1
2𝑞0ℎ1
𝑄22𝑘 = න
Γ2
𝑞𝑛𝜓22𝑘 𝑠 𝑑𝑠 = 0
9/29/2021
42
© Numerical Factory
Constant Boundary Conditions
• Consider the case where a constant BC is applied to one edge of the triangle
2
3
𝑞𝑛𝑘 = ቐ
𝑞0 on Γ10 on Γ20 on Γ3
𝑄3𝑘 = 𝑄32
𝑘 +𝑄33𝑘
Node 3
© Numerical Factory
Constant Boundary Conditions
• Consider the case where a constant BC is applied to one edge of the triangle
2
3
𝑞𝑛𝑘 = ቐ
𝑞0 on Γ10 on Γ20 on Γ3
𝑄3𝑘 = 𝑄32
𝑘 +𝑄33𝑘
Node 3
𝑄32𝑘 = න
Γ2
𝑞𝑛𝜓32𝑘 𝑠 𝑑𝑠 = 0
© Numerical Factory
Constant Boundary Conditions
• Consider the case where a constant BC is applied to one edge of the triangle
2
3
𝑞𝑛𝑘 = ቐ
𝑞0 on Γ10 on Γ20 on Γ3
𝑄3𝑘 = 𝑄32
𝑘 +𝑄33𝑘
Node 3
𝑄32𝑘 = න
Γ2
𝑞𝑛𝜓32𝑘 𝑠 𝑑𝑠 = 0
𝑄33𝑘 = න
Γ3
𝑞𝑛𝜓33𝑘 𝑠 𝑑𝑠 = 0
© Numerical Factory
Constant Boundary Conditions
• Consider the case where a constant BC is applied to one edge of the triangle
2
3
𝑞𝑛𝑘 = ቐ
𝑞0 on Γ10 on Γ20 on Γ3
𝑄1𝑘
𝑄2𝑘
𝑄3𝑘
=𝑞0ℎ12
110
The constant value is distributed between nodes 1 and 2
© Numerical Factory
Linear BC on Triangles
© Numerical Factory
2
3
Linear Boundary Conditions
• Consider now a linear function applied at edge 1
𝑞𝑛𝑘 =
𝑞0𝑠
ℎ1on Γ1
0 on Γ20 on Γ3
𝑄1𝑘 = 𝑄11
𝑘 +𝑄13𝑘
9/29/2021
43
© Numerical Factory
2
3
Linear Boundary Conditions
• Consider now a linear function applied at edge 1
𝑞𝑛𝑘 =
𝑞0𝑠
ℎ1on Γ1
0 on Γ20 on Γ3
𝑄1𝑘 = 𝑄11
𝑘 +𝑄13𝑘
© Numerical Factory
2
3
Linear Boundary Conditions
• Consider now a linear function applied at edge 1
𝑞𝑛𝑘 =
𝑞0𝑠
ℎ1on Γ1
0 on Γ20 on Γ3
𝑄1𝑘 = 𝑄11
𝑘 +𝑄13𝑘
𝑄13𝑘 = 0
© Numerical Factory
2
3
Linear Boundary Conditions
• Consider now a linear function applied at edge 1
𝑞𝑛𝑘 =
𝑞0𝑠
ℎ1on Γ1
0 on Γ20 on Γ3
𝑄1𝑘 = 𝑄11
𝑘 +𝑄13𝑘
𝑄2𝑘 = 𝑄21
𝑘 +𝑄22𝑘
© Numerical Factory
2
3
Linear Boundary Conditions
• Consider now a linear function applied at edge 1
𝑞𝑛𝑘 =
𝑞0𝑠
ℎ1on Γ1
0 on Γ20 on Γ3
𝑄1𝑘 = 𝑄11
𝑘 +𝑄13𝑘
𝑄2𝑘 = 𝑄21
𝑘 +𝑄22𝑘
© Numerical Factory
2
3
Linear Boundary Conditions
• Consider now a linear function applied at edge 1
𝑞𝑛𝑘 =
𝑞0𝑠
ℎ1on Γ1
0 on Γ20 on Γ3
𝑄1𝑘 = 𝑄11
𝑘 +𝑄13𝑘
𝑄2𝑘 = 𝑄21
𝑘 +𝑄22𝑘
𝑄22𝑘 = 0
© Numerical Factory
2
3
Linear Boundary Conditions
• Consider now a linear function applied at edge 1
𝑞𝑛𝑘 =
𝑞0𝑠
ℎ1on Γ1
0 on Γ20 on Γ3
𝑄1𝑘 = 𝑄11
𝑘 +𝑄13𝑘
𝑄2𝑘 = 𝑄21
𝑘 +𝑄22𝑘
𝑄3𝑘 = 𝑄32
𝑘 +𝑄33𝑘
9/29/2021
44
© Numerical Factory
2
3
Linear Boundary Conditions
• Consider now a linear function applied at edge 1
𝑞𝑛𝑘 =
𝑞0𝑠
ℎ1on Γ1
0 on Γ20 on Γ3
𝑄1𝑘 = 𝑄11
𝑘 +𝑄13𝑘
𝑄2𝑘 = 𝑄21
𝑘 +𝑄22𝑘
𝑄3𝑘 = 𝑄32
𝑘 +𝑄33𝑘
𝑄32𝑘 = 0, 𝑄33
𝑘 = 0
© Numerical Factory
2
3
Linear Boundary Conditions
• Consider now a linear function applied at edge 1
𝑞𝑛𝑘 =
𝑞0𝑠
ℎ1𝑘 on Γ1
0 on Γ20 on Γ3
𝑄1𝑘 = 𝑄11
𝑘 +𝑄13𝑘
𝑄2𝑘 = 𝑄21
𝑘 +𝑄22𝑘
𝑄3𝑘 = 𝑄32
𝑘 +𝑄33𝑘
𝑄32𝑘 = 0, 𝑄33
𝑘 = 0
𝑄1𝑘
𝑄2𝑘
𝑄3𝑘
=𝑞0ℎ1
𝑘
6
120
© Numerical Factory
Different Boundary Conditions
• As a final case now we have de contribution
of the two previous cases. In principle,
2
3
𝑄1𝑘
𝑄2𝑘
𝑄3𝑘
=𝑞1ℎ3
𝑘
2
101
+𝑞0ℎ1
𝑘
6
120
=
𝑞1ℎ3𝑘
2+1
6𝑞0ℎ1
𝑘
1
3𝑞0ℎ1
𝑘
𝑞1ℎ3𝑘
2
𝑞𝑛𝑘 =
𝑞0𝑠
ℎ1𝑘 on Γ1
0 on Γ2𝑞1 on Γ3
© Numerical Factory
Different Boundary Conditions
• As a final case now we have de contribution
of the two previous cases. In principle,
2
3
𝑄1𝑘
𝑄2𝑘
𝑄3𝑘
=𝑞1ℎ3
𝑘
2
101
+𝑞0ℎ1
𝑘
6
120
𝑞𝑛𝑘 =
𝑞0𝑠
ℎ1𝑘 on Γ1
0 on Γ2𝑞1 on Γ3
© Numerical Factory
Different Boundary Conditions
• As a final case now we have de contribution
of the two previous cases. In principle,
2
3
𝑄1𝑘
𝑄2𝑘
𝑄3𝑘
=𝑞1ℎ3
𝑘
2
101
+𝑞0ℎ1
𝑘
6
120
𝑞𝑛𝑘 =
𝑞0𝑠
ℎ1𝑘 on Γ1
0 on Γ2𝑞1 on Γ3
© Numerical Factory
Different Boundary Conditions
• As a final case now we have de contribution
of the two previous cases. In principle,
2
3
𝑄1𝑘
𝑄2𝑘
𝑄3𝑘
=𝑞1ℎ3
𝑘
2
101
+𝑞0ℎ1
𝑘
6
120
=
𝑞1ℎ3𝑘
2+1
6𝑞0ℎ1
𝑘
1
3𝑞0ℎ1
𝑘
𝑞1ℎ3𝑘
2
𝑞𝑛𝑘 =
𝑞0𝑠
ℎ1𝑘 on Γ1
0 on Γ2𝑞1 on Γ3
9/29/2021
45
© Numerical Factory
2D Elements Assembly
• Example of local and global nodes enumeration for linear triangular elements
Connectivity matrix
𝐵 =
1523
2345
3256
Hint: Notice that the local enumeration must becounter-clockwise in order to preserve orientation
© Numerical Factory
2D Elements Assembly
• For linear triangular elements
If 𝒖 𝒙 is a 1D magnitude (temperature)For each element the Stiffness Matrix isa 3x3 matrix
𝐾𝑒 =
𝑘11𝑒 𝑘12
𝑒 𝑘13𝑒
𝑘21𝑒 𝑘22
𝑒 𝑘23𝑒
𝑘31𝑒 𝑘32
𝑒 𝑘33𝑒
, 𝑢 =
𝑢1𝑢2𝑢3
© Numerical Factory
𝐵 =
1523
2345
3256
© Numerical Factory
𝐵 =
1523
2345
3256
© Numerical Factory
𝐵 =
1523
2345
3256
© Numerical Factory
𝐵 =
1523
2345
3256
9/29/2021
46
© Numerical Factory
2D Assembly of mixed elements
• Let’s consider the example:
Although it is not usual,
we can mix different type of
elements:
Triangular + Rectangular
© Numerical Factory
2D Assembly of element equations
• The connectivity matrix in this case is not uniform
𝐾𝑒 =
𝑘11𝑒 𝑘12
𝑒 𝑘13𝑒
𝑘21𝑒 𝑘22
𝑒 𝑘23𝑒
𝑘31𝑒 𝑘32
𝑒 𝑘33𝑒
, e=1,2,3,4𝐾𝑒 =
𝑘11𝑒 𝑘12
𝑒
𝑘21𝑒 𝑘22
𝑒
𝑘13𝑒 𝑘14
𝑒
𝑘23𝑒 𝑘24
𝑒
𝑘31𝑒 𝑘32
𝑒
𝑘41𝑒 𝑘42
𝑒
𝑘33𝑒 𝑘34
𝑒
𝑘43𝑒 𝑘44
𝑒
, e=5,6
TriangularRectangular
© Numerical Factory
2D Assembly of element equations
• The global stiffness matrix is
with
© Numerical Factory
2D Assembly of element equations
• Let’s consider a simple example to explain flux balance and BC for the assembled system
2 2
© Numerical Factory
2D Assembly of element equations
• Here the balance must be imposed on nodes 2 and 4
remember that 𝑄𝑖𝑗𝑘 means
the flux on node 𝑖 corresponding to
the contribution of edge 𝑗
Consider node 2:
by construction we also have therefore
, that have to be defined on the BC of the problem.
© Numerical Factory
2D Assembly of element equations
• Here the balance must be imposed on nodes 2 and 4
remember that 𝑄𝑖𝑗𝑘 means
the flux on node 𝑖 corresponding to
the contribution of edge 𝑗
Consider node 2:
by construction we also have therefore
, that have to be defined on the BC of the problem.
9/29/2021
47
© Numerical Factory
2D Assembly of element equations
• Here the balance must be imposed on nodes 2 and 4
remember that 𝑄𝑖𝑗𝑘 means
the flux on node 𝑖 corresponding to
the contribution of edge 𝑗
Consider node 2:
by construction we also have therefore
, that have to be defined on the BC of the problem.