You are on page 1of 138

Introduction to the Finite Element Method -

Lecture 1

Neela Nataraj

Department of Mathematics,
Indian Institute of Technology Bombay,
Powai, Mumbai 76
neela@math.iitb.ac.in
Adaptive FEM Worshop, IIST, Tvm - March 2012

March 17, 2012

Neela Nataraj IITB


Introduction

The Finite Element Method (FEM) is a numerical techinique


for solving problems which are described by Ordinary
Differential Equations (ODE) /Partial Differential Equations
(PDE) with appropriate boundary/initial conditions;

Neela Nataraj IITB


Introduction

The Finite Element Method (FEM) is a numerical techinique


for solving problems which are described by Ordinary
Differential Equations (ODE) /Partial Differential Equations
(PDE) with appropriate boundary/initial conditions;
or to solve problems that can be formulated as a functional
minimization,

Neela Nataraj IITB


Introduction

The Finite Element Method (FEM) is a numerical techinique


for solving problems which are described by Ordinary
Differential Equations (ODE) /Partial Differential Equations
(PDE) with appropriate boundary/initial conditions;
or to solve problems that can be formulated as a functional
minimization,
introduced by engineers in late 50’s and 60’s.

Neela Nataraj IITB


Why FEM?

Greater flexibility to model complex geometries.

Neela Nataraj IITB


Why FEM?

Greater flexibility to model complex geometries.


Can handle general boundary conditions.

Neela Nataraj IITB


Why FEM?

Greater flexibility to model complex geometries.


Can handle general boundary conditions.
Variable material properties can be handled.

Neela Nataraj IITB


Why FEM?

Greater flexibility to model complex geometries.


Can handle general boundary conditions.
Variable material properties can be handled.
Clear structure and versatility helps to construct general
purpose software for applications.

Neela Nataraj IITB


Why FEM?

Greater flexibility to model complex geometries.


Can handle general boundary conditions.
Variable material properties can be handled.
Clear structure and versatility helps to construct general
purpose software for applications.
Has a solid theoretical foundation which gives added reliability
and makes it possible to mathematically analyze and estimate
the error in the approximate solution.

Neela Nataraj IITB


An Elliptic Model Problem

−∆u + u = f in Ω = (0, 1) × (0, 1) ⊂ R2 ,


" )
(PC ) : ∂u (1)
|Γ = 0, Γ is the square boundary of Ω,
∂n

Neela Nataraj IITB


An Elliptic Model Problem

−∆u + u = f in Ω = (0, 1) × (0, 1) ⊂ R2 ,


" )
(PC ) : ∂u (1)
|Γ = 0, Γ is the square boundary of Ω,
∂n
Here,
∂2u ∂2u
∆u = + ,
∂x 2 ∂y 2

Neela Nataraj IITB


An Elliptic Model Problem

−∆u + u = f in Ω = (0, 1) × (0, 1) ⊂ R2 ,


" )
(PC ) : ∂u (1)
|Γ = 0, Γ is the square boundary of Ω,
∂n
Here,
∂2u ∂2u
∆u = + ,
∂x 2 ∂y 2
∂u
is the normal derivative of 0 u 0 in the direction of the
∂n
exterior normal to Γ,

Neela Nataraj IITB


An Elliptic Model Problem

−∆u + u = f in Ω = (0, 1) × (0, 1) ⊂ R2 ,


" )
(PC ) : ∂u (1)
|Γ = 0, Γ is the square boundary of Ω,
∂n
Here,
∂2u ∂2u
∆u = + ,
∂x 2 ∂y 2
∂u
is the normal derivative of 0 u 0 in the direction of the
∂n
exterior normal to Γ,
u =?? (unknown function).

Neela Nataraj IITB


An Elliptic Model Problem

−∆u + u = f in Ω = (0, 1) × (0, 1) ⊂ R2 ,


" )
(PC ) : ∂u (1)
|Γ = 0, Γ is the square boundary of Ω,
∂n
Here,
∂2u ∂2u
∆u = + ,
∂x 2 ∂y 2
∂u
is the normal derivative of 0 u 0 in the direction of the
∂n
exterior normal to Γ,
u =?? (unknown function).

Neela Nataraj IITB


Ingredients for Galerkin Variational Formulation

• Admissible space : V =

Neela Nataraj IITB


Ingredients for Galerkin Variational Formulation

• Admissible space : V = H 1 (Ω)

Neela Nataraj IITB


Ingredients for Galerkin Variational Formulation

 
1 2 ∂v ∂v
• Admissible space : V = H (Ω) = v : v ∈ L (Ω), , ∈ L2 (Ω)
∂x ∂y

Neela Nataraj IITB


Ingredients for Galerkin Variational Formulation

 
1 2 ∂v ∂v
• Admissible space : V = H (Ω) = v : v ∈ L (Ω), , ∈ L2 (Ω)
∂x ∂y

(derivatives in the distributional sense !)

Neela Nataraj IITB


Ingredients for Galerkin Variational Formulation

 
1 2 ∂v ∂v
• Admissible space : V = H (Ω) = v : v ∈ L (Ω), , ∈ L2 (Ω)
∂x ∂y

(derivatives in the distributional sense !)


• Bilinear form a(·, ·) : V × V → R defined by :

Neela Nataraj IITB


Ingredients for Galerkin Variational Formulation

 
1 2 ∂v ∂v
• Admissible space : V = H (Ω) = v : v ∈ L (Ω), , ∈ L2 (Ω)
∂x ∂y

(derivatives in the distributional sense !)


• Bilinear form a(·, ·) : V × V → R defined by :
Z Z
a(u, v ) = (−∆u+u)v dΩ = (∇u.∇v +uv ) dΩ ∀u, v ∈ V ;
Ω Ω
(2)
is symmetric, continuous and V -elliptic.

Neela Nataraj IITB


Ingredients for Galerkin Variational Formulation

 
1 2 ∂v ∂v
• Admissible space : V = H (Ω) = v : v ∈ L (Ω), , ∈ L2 (Ω)
∂x ∂y

(derivatives in the distributional sense !)


• Bilinear form a(·, ·) : V × V → R defined by :
Z Z
a(u, v ) = (−∆u+u)v dΩ = (∇u.∇v +uv ) dΩ ∀u, v ∈ V ;
Ω Ω
(2)
is symmetric, continuous and V -elliptic.
• Linear form l(·) : V → R defined by :
Z
l(v ) = fv dΩ ∀ v ∈ V (3)

is continuous.
Neela Nataraj IITB
Galerkin Variational Formulation (PG )

The Galerkin Variational Problem (PG ) corresponding to (PC )


can be defined as :

Neela Nataraj IITB


Galerkin Variational Formulation (PG )

The Galerkin Variational Problem (PG ) corresponding to (PC )


can be defined as :
Given f ∈ L2 (Ω),find u ∈ V such that

(PG ) : (4)
a(u, v ) = l(v ) ∀v ∈ V .

Neela Nataraj IITB


Galerkin Variational Formulation (PG )

The Galerkin Variational Problem (PG ) corresponding to (PC )


can be defined as :
Given f ∈ L2 (Ω),find u ∈ V such that

(PG ) : (4)
a(u, v ) = l(v ) ∀v ∈ V .

Since a(·, ·) is a continuous, symmetric, V - elliptic, bilinear form

Neela Nataraj IITB


Galerkin Variational Formulation (PG )

The Galerkin Variational Problem (PG ) corresponding to (PC )


can be defined as :
Given f ∈ L2 (Ω),find u ∈ V such that

(PG ) : (4)
a(u, v ) = l(v ) ∀v ∈ V .

Since a(·, ·) is a continuous, symmetric, V - elliptic, bilinear form


and l(·) is a continuous linear form,

Neela Nataraj IITB


Galerkin Variational Formulation (PG )

The Galerkin Variational Problem (PG ) corresponding to (PC )


can be defined as :
Given f ∈ L2 (Ω),find u ∈ V such that

(PG ) : (4)
a(u, v ) = l(v ) ∀v ∈ V .

Since a(·, ·) is a continuous, symmetric, V - elliptic, bilinear form


and l(·) is a continuous linear form,
using Lax-Milgram lemma, (PG ) is well-posed.

Neela Nataraj IITB


FEM starts here !

Triangulation of Ω̄:

Neela Nataraj IITB


FEM starts here !

Triangulation of Ω̄:
By an admissible triangulation τh of a closed domain Ω̄ ⊂ R2 , we
mean a subdivision of Ω̄ into closed
triangles/rectangles/quadrilaterals denoted by {Ti }NELEM
i=1 such
that

Neela Nataraj IITB


FEM starts here !

Triangulation of Ω̄:
By an admissible triangulation τh of a closed domain Ω̄ ⊂ R2 , we
mean a subdivision of Ω̄ into closed
triangles/rectangles/quadrilaterals denoted by {Ti }NELEM
i=1 such
that

(i) Ω̄ = ∪NELEM
i=1 Ti

Neela Nataraj IITB


FEM starts here !

Triangulation of Ω̄:
By an admissible triangulation τh of a closed domain Ω̄ ⊂ R2 , we
mean a subdivision of Ω̄ into closed
triangles/rectangles/quadrilaterals denoted by {Ti }NELEM
i=1 such
that

(i) Ω̄ = ∪NELEM
i=1 Ti

 φ
(ii) Ti ∩ Tj =

Neela Nataraj IITB


FEM starts here !

Triangulation of Ω̄:
By an admissible triangulation τh of a closed domain Ω̄ ⊂ R2 , we
mean a subdivision of Ω̄ into closed
triangles/rectangles/quadrilaterals denoted by {Ti }NELEM
i=1 such
that

(i) Ω̄ = ∪NELEM
i=1 Ti

 φ
(ii) Ti ∩ Tj = common vertex for i 6= j

Neela Nataraj IITB


FEM starts here !

Triangulation of Ω̄:
By an admissible triangulation τh of a closed domain Ω̄ ⊂ R2 , we
mean a subdivision of Ω̄ into closed
triangles/rectangles/quadrilaterals denoted by {Ti }NELEM
i=1 such
that

(i) Ω̄ = ∪NELEM
i=1 Ti

 φ
(ii) Ti ∩ Tj = common vertex for i 6= j (5)
common side

Neela Nataraj IITB


FEM starts here !

Triangulation of Ω̄:
By an admissible triangulation τh of a closed domain Ω̄ ⊂ R2 , we
mean a subdivision of Ω̄ into closed
triangles/rectangles/quadrilaterals denoted by {Ti }NELEM
i=1 such
that

(i) Ω̄ = ∪NELEM
i=1 Ti

 φ
(ii) Ti ∩ Tj = common vertex for i 6= j (5)
common side

◦ ◦
(iii) Ti ∩ Tj = φ for i 6= j

Neela Nataraj IITB


Discretization parameter

Remark: For simplicity, we shall assume that ∂Ω = Γ is a


polygonal curve, i.e., Ω is a polygonal domain. If Γ is curved, we
may first approximate Γ with a polygonal curve.

Neela Nataraj IITB


Discretization parameter

Remark: For simplicity, we shall assume that ∂Ω = Γ is a


polygonal curve, i.e., Ω is a polygonal domain. If Γ is curved, we
may first approximate Γ with a polygonal curve.

We introduce the mesh parameter

Neela Nataraj IITB


Discretization parameter

Remark: For simplicity, we shall assume that ∂Ω = Γ is a


polygonal curve, i.e., Ω is a polygonal domain. If Γ is curved, we
may first approximate Γ with a polygonal curve.

We introduce the mesh parameter

h = max (diam T ), diam(T ) = longest side of T .


T ∈τh

Neela Nataraj IITB


Finite dimensional subspace

To the triangulation τh of Ω̄, we associate a finite dimensional


linear space Vh of continuous piecewise polynomials of degree ≤ 1
in each triangle T of τh , i.e.,

Neela Nataraj IITB


Finite dimensional subspace

To the triangulation τh of Ω̄, we associate a finite dimensional


linear space Vh of continuous piecewise polynomials of degree ≤ 1
in each triangle T of τh , i.e.,

Vh = {vh : vh ∈ C 0 (Ω̄), vh |T ∈ P1 (T ) ∀ T ∈ τh } (6)

Neela Nataraj IITB


Finite dimensional subspace

To the triangulation τh of Ω̄, we associate a finite dimensional


linear space Vh of continuous piecewise polynomials of degree ≤ 1
in each triangle T of τh , i.e.,

Vh = {vh : vh ∈ C 0 (Ω̄), vh |T ∈ P1 (T ) ∀ T ∈ τh } (6)

Remark: This is the simplest choice for Vh . Other choices of Vh


are possible.

Neela Nataraj IITB


Finite dimensional subspace

To the triangulation τh of Ω̄, we associate a finite dimensional


linear space Vh of continuous piecewise polynomials of degree ≤ 1
in each triangle T of τh , i.e.,

Vh = {vh : vh ∈ C 0 (Ω̄), vh |T ∈ P1 (T ) ∀ T ∈ τh } (6)

Remark: This is the simplest choice for Vh . Other choices of Vh


are possible.
Note that
Vh is finite-dimensional. (dimVh ≤ NELEM ∗ dimP1 (T ))

Neela Nataraj IITB


Finite dimensional subspace

To the triangulation τh of Ω̄, we associate a finite dimensional


linear space Vh of continuous piecewise polynomials of degree ≤ 1
in each triangle T of τh , i.e.,

Vh = {vh : vh ∈ C 0 (Ω̄), vh |T ∈ P1 (T ) ∀ T ∈ τh } (6)

Remark: This is the simplest choice for Vh . Other choices of Vh


are possible.
Note that
Vh is finite-dimensional. (dimVh ≤ NELEM ∗ dimP1 (T ))
Vh is a subspace of V .

Neela Nataraj IITB


Finite dimensional subspace

To the triangulation τh of Ω̄, we associate a finite dimensional


linear space Vh of continuous piecewise polynomials of degree ≤ 1
in each triangle T of τh , i.e.,

Vh = {vh : vh ∈ C 0 (Ω̄), vh |T ∈ P1 (T ) ∀ T ∈ τh } (6)

Remark: This is the simplest choice for Vh . Other choices of Vh


are possible.
Note that
Vh is finite-dimensional. (dimVh ≤ NELEM ∗ dimP1 (T ))
Vh is a subspace of V .
Remark: In fact, in this example, dim Vh = N, where N is the
total number of nodes in the triangulation.

Neela Nataraj IITB


The Galerkin FE problem

The Galerkin finite element problem (PGh ) can be defined as:

Neela Nataraj IITB


The Galerkin FE problem

The Galerkin finite element problem (PGh ) can be defined as:

Given f ∈ L2 (Ω),find uh ∈ Vh such that



(PGh ) :
a(uh , vh ) = l(vh ) ∀ vh ∈ Vh .

Neela Nataraj IITB


The Galerkin FE problem

The Galerkin finite element problem (PGh ) can be defined as:

Given f ∈ L2 (Ω),find uh ∈ Vh such that



(PGh ) : (7)
a(uh , vh ) = l(vh ) ∀ vh ∈ Vh .

Neela Nataraj IITB


The Galerkin FE problem

The Galerkin finite element problem (PGh ) can be defined as:

Given f ∈ L2 (Ω),find uh ∈ Vh such that



(PGh ) : (7)
a(uh , vh ) = l(vh ) ∀ vh ∈ Vh .

Matrix formulation:
First of all, choose an appropriate basis {φih }N
i=1 for Vh

Neela Nataraj IITB


The Galerkin FE problem

The Galerkin finite element problem (PGh ) can be defined as:

Given f ∈ L2 (Ω),find uh ∈ Vh such that



(PGh ) : (7)
a(uh , vh ) = l(vh ) ∀ vh ∈ Vh .

Matrix formulation:
First of all, choose an appropriate basis {φih }N
i=1 for Vh
(the construction of {φih }N
i=1 will be explained with details).

Neela Nataraj IITB


The Galerkin FE problem

The Galerkin finite element problem (PGh ) can be defined as:

Given f ∈ L2 (Ω),find uh ∈ Vh such that



(PGh ) : (7)
a(uh , vh ) = l(vh ) ∀ vh ∈ Vh .

Matrix formulation:
First of all, choose an appropriate basis {φih }N
i=1 for Vh
(the construction of {φih }N
i=1 will be explained with details).

Neela Nataraj IITB


The Galerkin FE problem

The Galerkin finite element problem (PGh ) can be defined as:

Given f ∈ L2 (Ω),find uh ∈ Vh such that



(PGh ) : (7)
a(uh , vh ) = l(vh ) ∀ vh ∈ Vh .

Matrix formulation:
First of all, choose an appropriate basis {φih }N
i=1 for Vh
(the construction of {φih }N
i=1 will be explained with details).
N
X
Let uh = ui φih , where ui0 s need to be determined.
i=1

Neela Nataraj IITB


Reduction of (PGh ) into Matrix Equations (contd..)

We have, a(uh , vh ) = l(vh ) ∀vh ∈ Vh .

Neela Nataraj IITB


Reduction of (PGh ) into Matrix Equations (contd..)

We have, a(uh , ! vh ) = l(vh ) ∀vh ∈ Vh .


N
ui φih , φjh = l(φjh )
X
a 1 ≤ j ≤ N.
i=1

Neela Nataraj IITB


Reduction of (PGh ) into Matrix Equations (contd..)

We have, a(uh , ! vh ) = l(vh ) ∀vh ∈ Vh .


N
ui φih , φjh = l(φjh )
X
a 1 ≤ j ≤ N.
i=1
N
ui a(φih , φjh ) = l(φjh )
X
⇒ 1 ≤ j ≤ N.
i=1

Neela Nataraj IITB


Reduction of (PGh ) into Matrix Equations (contd..)

We have, a(uh , ! vh ) = l(vh ) ∀vh ∈ Vh .


N
ui φih , φjh = l(φjh )
X
a 1 ≤ j ≤ N.
i=1
N
ui a(φih , φjh ) = l(φjh )
X
⇒ 1 ≤ j ≤ N.
i=1
⇒ KU = F

Neela Nataraj IITB


Reduction of (PGh ) into Matrix Equations (contd..)

We have, a(uh , ! vh ) = l(vh ) ∀vh ∈ Vh .


N
ui φih , φjh = l(φjh )
X
a 1 ≤ j ≤ N.
i=1
N
ui a(φih , φjh ) = l(φjh )
X
⇒ 1 ≤ j ≤ N.
i=1
⇒ KU = F
where
• K = [a(φih , φjh )]1≤i,j≤N ,

Neela Nataraj IITB


Reduction of (PGh ) into Matrix Equations (contd..)

We have, a(uh , ! vh ) = l(vh ) ∀vh ∈ Vh .


N
ui φih , φjh = l(φjh )
X
a 1 ≤ j ≤ N.
i=1
N
ui a(φih , φjh ) = l(φjh )
X
⇒ 1 ≤ j ≤ N.
i=1
⇒ KU = F
where
• K = [a(φih , φjh )]1≤i,j≤N , is the global stiffness matrix,

Neela Nataraj IITB


Reduction of (PGh ) into Matrix Equations (contd..)

We have, a(uh , ! vh ) = l(vh ) ∀vh ∈ Vh .


N
ui φih , φjh = l(φjh )
X
a 1 ≤ j ≤ N.
i=1
N
ui a(φih , φjh ) = l(φjh )
X
⇒ 1 ≤ j ≤ N.
i=1
⇒ KU = F
where
• K = [a(φih , φjh )]1≤i,j≤N , is the global stiffness matrix,

• F = (l(φjh ))1≤j≤N

Neela Nataraj IITB


Reduction of (PGh ) into Matrix Equations (contd..)

We have, a(uh , ! vh ) = l(vh ) ∀vh ∈ Vh .


N
ui φih , φjh = l(φjh )
X
a 1 ≤ j ≤ N.
i=1
N
ui a(φih , φjh ) = l(φjh )
X
⇒ 1 ≤ j ≤ N.
i=1
⇒ KU = F
where
• K = [a(φih , φjh )]1≤i,j≤N , is the global stiffness matrix,

• F = (l(φjh ))1≤j≤N is the global load vector,

Neela Nataraj IITB


Reduction of (PGh ) into Matrix Equations (contd..)

We have, a(uh , ! vh ) = l(vh ) ∀vh ∈ Vh .


N
ui φih , φjh = l(φjh )
X
a 1 ≤ j ≤ N.
i=1
N
ui a(φih , φjh ) = l(φjh )
X
⇒ 1 ≤ j ≤ N.
i=1
⇒ KU = F
where
• K = [a(φih , φjh )]1≤i,j≤N , is the global stiffness matrix,

• F = (l(φjh ))1≤j≤N is the global load vector,


• U = [u1 , ..., uN ]t

Neela Nataraj IITB


Reduction of (PGh ) into Matrix Equations (contd..)

We have, a(uh , ! vh ) = l(vh ) ∀vh ∈ Vh .


N
ui φih , φjh = l(φjh )
X
a 1 ≤ j ≤ N.
i=1
N
ui a(φih , φjh ) = l(φjh )
X
⇒ 1 ≤ j ≤ N.
i=1
⇒ KU = F
where
• K = [a(φih , φjh )]1≤i,j≤N , is the global stiffness matrix,

• F = (l(φjh ))1≤j≤N is the global load vector,


• U = [u1 , ..., uN ]t is the unknown vector.

Neela Nataraj IITB


Reduction of (PGh ) into Matrix Equations (contd..)

We have, a(uh , ! vh ) = l(vh ) ∀vh ∈ Vh .


N
ui φih , φjh = l(φjh )
X
a 1 ≤ j ≤ N.
i=1
N
ui a(φih , φjh ) = l(φjh )
X
⇒ 1 ≤ j ≤ N.
i=1
⇒ KU = F
where
• K = [a(φih , φjh )]1≤i,j≤N , is the global stiffness matrix,

• F = (l(φjh ))1≤j≤N is the global load vector,


• U = [u1 , ..., uN ]t is the unknown vector.

Neela Nataraj IITB


Construction of appropriate basis functions {φih }Ni=1 of Vh

Let us choose an example where dim Vh = 9, say.

Neela Nataraj IITB


Construction of appropriate basis functions {φih }Ni=1 of Vh

Let us choose an example where dim Vh = 9, say.


To each global node ai (1 ≤ i ≤ 9), we associate a 0 pyramidal
function0 φih

Neela Nataraj IITB


Construction of appropriate basis functions {φih }Ni=1 of Vh

Let us choose an example where dim Vh = 9, say.


To each global node ai (1 ≤ i ≤ 9), we associate a 0 pyramidal
function0 φih
(that is, the graph of φih is a pyramid of unit height over the
triangles containing the node ai )

Neela Nataraj IITB


Construction of appropriate basis functions {φih }Ni=1 of Vh

Let us choose an example where dim Vh = 9, say.


To each global node ai (1 ≤ i ≤ 9), we associate a 0 pyramidal
function0 φih
(that is, the graph of φih is a pyramid of unit height over the
triangles containing the node ai )
which vanishes in all those triangles T not containing 0 ai0 as one of
its nodes.

Neela Nataraj IITB


Construction of appropriate basis functions {φih }Ni=1 of Vh

Let us choose an example where dim Vh = 9, say.


To each global node ai (1 ≤ i ≤ 9), we associate a 0 pyramidal
function0 φih
(that is, the graph of φih is a pyramid of unit height over the
triangles containing the node ai )
which vanishes in all those triangles T not containing 0 ai0 as one of
its nodes.

(i) φih (ai ) = 1, φih (aj ) = 0 ∀ i 6= j












Neela Nataraj IITB


Construction of appropriate basis functions {φih }Ni=1 of Vh

Let us choose an example where dim Vh = 9, say.


To each global node ai (1 ≤ i ≤ 9), we associate a 0 pyramidal
function0 φih
(that is, the graph of φih is a pyramid of unit height over the
triangles containing the node ai )
which vanishes in all those triangles T not containing 0 ai0 as one of
its nodes.

(i) φih (ai ) = 1, φih (aj ) = 0 ∀ i 6= j




i

 (Height of the pyramid at ai is φh (ai ) = 1)





Neela Nataraj IITB


Construction of appropriate basis functions {φih }Ni=1 of Vh

Let us choose an example where dim Vh = 9, say.


To each global node ai (1 ≤ i ≤ 9), we associate a 0 pyramidal
function0 φih
(that is, the graph of φih is a pyramid of unit height over the
triangles containing the node ai )
which vanishes in all those triangles T not containing 0 ai0 as one of
its nodes.

(i) φih (ai ) = 1, φih (aj ) = 0 ∀ i 6= j




i

 (Height of the pyramid at ai is φh (ai ) = 1)


i
(ii) φh |T ∈ P1 (T ) ∀ T ∈ τh




Neela Nataraj IITB


Construction of appropriate basis functions {φih }Ni=1 of Vh

Let us choose an example where dim Vh = 9, say.


To each global node ai (1 ≤ i ≤ 9), we associate a 0 pyramidal
function0 φih
(that is, the graph of φih is a pyramid of unit height over the
triangles containing the node ai )
which vanishes in all those triangles T not containing 0 ai0 as one of
its nodes.

(i) φih (ai ) = 1, φih (aj ) = 0 ∀ i 6= j




i

 (Height of the pyramid at ai is φh (ai ) = 1)


i
(ii) φh |T ∈ P1 (T ) ∀ T ∈ τh
i
 (iii) Supp φh = ∪ai ∈T T (i.e., union of all triangles T containing ai ).



Neela Nataraj IITB


Construction of appropriate basis functions {φih }Ni=1 of Vh

Let us choose an example where dim Vh = 9, say.


To each global node ai (1 ≤ i ≤ 9), we associate a 0 pyramidal
function0 φih
(that is, the graph of φih is a pyramid of unit height over the
triangles containing the node ai )
which vanishes in all those triangles T not containing 0 ai0 as one of
its nodes.

(i) φih (ai ) = 1, φih (aj ) = 0 ∀ i 6= j


 
 
i
 
 (Height of the pyramid at ai is φh (ai ) = 1)

 


i
(ii) φh |T ∈ P1 (T ) ∀ T ∈ τh
i
 (iii) Supp φh = ∪ai ∈T T (i.e., union of all triangles T containing ai ).

 

 

(iv ) φh ∈ C 0 (Ω̄).
i
 

From (ii) and (iv), we get φih ∈ Vh .


Neela Nataraj IITB
2-simplex
For the explicit construction of φih , we now introduce the
0
Barycentric Co-ordinates0 for a triangle.

Neela Nataraj IITB


2-simplex
For the explicit construction of φih , we now introduce the
0
Barycentric Co-ordinates0 for a triangle.
Definition
The closed convex hull T defined by
3
X 3
X
2
T = {x : x ∈ R , x = λi ai , 0 ≤ λi ≤ 1, λi = 1} (8)
i=1 i=1

2 0 0 3
is  {ai = (ai1 , ai2 )}i=1 .
 called a 2-simplex in R with 3 vertices
a11 a21 a31
such that D3 = a12 a22 a32 6= 0
1 1 1

Neela Nataraj IITB


2-simplex
For the explicit construction of φih , we now introduce the
0
Barycentric Co-ordinates0 for a triangle.
Definition
The closed convex hull T defined by
3
X 3
X
2
T = {x : x ∈ R , x = λi ai , 0 ≤ λi ≤ 1, λi = 1} (8)
i=1 i=1

2 0 0 3
is  {ai = (ai1 , ai2 )}i=1 .
 called a 2-simplex in R with 3 vertices
a11 a21 a31
such that D3 = a12 a22 a32 6= 0
1 1 1

∀(x1 , x2 ) ∈ T̄ , (x1 , x2 ) 7−→ (λ1 , λ2 , λ3 ) is a one-one


correspondence.

Neela Nataraj IITB


2-simplex
For the explicit construction of φih , we now introduce the
0
Barycentric Co-ordinates0 for a triangle.
Definition
The closed convex hull T defined by
3
X 3
X
2
T = {x : x ∈ R , x = λi ai , 0 ≤ λi ≤ 1, λi = 1} (8)
i=1 i=1

2 0 0 3
is  {ai = (ai1 , ai2 )}i=1 .
 called a 2-simplex in R with 3 vertices
a11 a21 a31
such that D3 = a12 a22 a32 6= 0
1 1 1

∀(x1 , x2 ) ∈ T̄ , (x1 , x2 ) 7−→ (λ1 , λ2 , λ3 ) is a one-one


correspondence.
In particular, a1 7−→ (1, 0, 0), a2 7−→ (0, 1, 0), a3 7−→ (0, 0, 1).
Neela Nataraj IITB
Now, x ∈ T ⇒ x = λ1 a1 + λ2 a2 + λ3 a3 such that
3
X
0 ≤ λi ≤ 1, λi = 1.
i=1

Neela Nataraj IITB


Now, x ∈ T ⇒ x = λ1 a1 + λ2 a2 + λ3 a3 such that
3
X
0 ≤ λi ≤ 1, λi = 1.
i=1
       
x1 a11 a21 a31
i.e., = λ1 + λ2 + λ3
x2 a12 a22 a32

Neela Nataraj IITB


Now, x ∈ T ⇒ x = λ1 a1 + λ2 a2 + λ3 a3 such that
3
X
0 ≤ λi ≤ 1, λi = 1.
i=1
       
x1 a11 a21 a31
i.e., = λ1 + λ2 + λ3
x2 a12 a22 a32

i.e., λ1 a11 + λ2 a21 + λ3 a31 = x1

Neela Nataraj IITB


Now, x ∈ T ⇒ x = λ1 a1 + λ2 a2 + λ3 a3 such that
3
X
0 ≤ λi ≤ 1, λi = 1.
i=1
       
x1 a11 a21 a31
i.e., = λ1 + λ2 + λ3
x2 a12 a22 a32

i.e., λ1 a11 + λ2 a21 + λ3 a31 = x1


λ1 a12 + λ2 a22 + λ3 a32 = x2

Neela Nataraj IITB


Now, x ∈ T ⇒ x = λ1 a1 + λ2 a2 + λ3 a3 such that
3
X
0 ≤ λi ≤ 1, λi = 1.
i=1
       
x1 a11 a21 a31
i.e., = λ1 + λ2 + λ3
x2 a12 a22 a32

i.e., λ1 a11 + λ2 a21 + λ3 a31 = x1


λ1 a12 + λ2 a22 + λ3 a32 = x2
with λ1 + λ2 + λ3 = 1

Neela Nataraj IITB


Now, x ∈ T ⇒ x = λ1 a1 + λ2 a2 + λ3 a3 such that
3
X
0 ≤ λi ≤ 1, λi = 1.
i=1
       
x1 a11 a21 a31
i.e., = λ1 + λ2 + λ3
x2 a12 a22 a32

i.e., λ1 a11 + λ2 a21 + λ3 a31 = x1


λ1 a12 + λ2 a22 + λ3 a32 = x2
with λ1 + λ2 + λ3 = 1

a11 a21 a31


This system has a unique solution because a12 a22 a32 6= 0.
1 1 1

Neela Nataraj IITB


Barycentric Coordinates

Definition
Let T be a 2-simplex in R2 with three vertices {ai }3i=1 such that
X 3 3
X
∀ x ∈ T, x = λi ai , 0 ≤ λi ≤ 1, λi = 1. Then (λ1 , λ2 , λ3 )
i=1 i=1
are the barycentric co-ordinates of the point x of the 2 simplex
T ⊂ R2 .

Neela Nataraj IITB


Properties of barycentric co-ordinates :

Barycentric co-ordinates of any point x ∈ T satisfies


λ1 + λ2 + λ3 = 1.

Neela Nataraj IITB


Properties of barycentric co-ordinates :

Barycentric co-ordinates of any point x ∈ T satisfies


λ1 + λ2 + λ3 = 1.
For any x ∈
/ T , a representation of points using barycentric
co-ordinates is NOT possible.

Neela Nataraj IITB


Properties of barycentric co-ordinates :

Barycentric co-ordinates of any point x ∈ T satisfies


λ1 + λ2 + λ3 = 1.
For any x ∈
/ T , a representation of points using barycentric
co-ordinates is NOT possible.
To locate a point x ∈ T , we need

Neela Nataraj IITB


Properties of barycentric co-ordinates :

Barycentric co-ordinates of any point x ∈ T satisfies


λ1 + λ2 + λ3 = 1.
For any x ∈
/ T , a representation of points using barycentric
co-ordinates is NOT possible.
To locate a point x ∈ T , we need
(i) Barycentric co-ordinates (λ1 , λ2 , λ3 ) with
X 3
0 ≤ λi ≤ 1, λi = 1.
i=1

Neela Nataraj IITB


Properties of barycentric co-ordinates :

Barycentric co-ordinates of any point x ∈ T satisfies


λ1 + λ2 + λ3 = 1.
For any x ∈
/ T , a representation of points using barycentric
co-ordinates is NOT possible.
To locate a point x ∈ T , we need
(i) Barycentric co-ordinates (λ1 , λ2 , λ3 ) with
X 3
0 ≤ λi ≤ 1, λi = 1.
i=1
(ii) Cartesian co-ordinates of the vertices of T .

Neela Nataraj IITB


Properties (contd ..)

a11 λ1 + a21 λ2 + a31 λ3 = x


a12 λ1 + a22 λ2 + a32 λ3 = y
λ1 + λ2 + λ3 = 1

Neela Nataraj IITB


Properties (contd ..)

a11 λ1 + a21 λ2 + a31 λ3 = x


a12 λ1 + a22 λ2 + a32 λ3 = y
λ1 + λ2 + λ3 = 1

Using Cramer’s rule, we obtain

Neela Nataraj IITB


Properties (contd ..)

a11 λ1 + a21 λ2 + a31 λ3 = x


a12 λ1 + a22 λ2 + a32 λ3 = y
λ1 + λ2 + λ3 = 1

Using Cramer’s rule, we obtain


x a21 a31
1 α0 + α1 x + α2 y
λ1 = y a22 a32 = ∈ P1 (T )
2(area T ) 2(area T )
1 1 1

Neela Nataraj IITB


Properties (contd ..)

a11 λ1 + a21 λ2 + a31 λ3 = x


a12 λ1 + a22 λ2 + a32 λ3 = y
λ1 + λ2 + λ3 = 1

Using Cramer’s rule, we obtain


x a21 a31
1 α0 + α1 x + α2 y
λ1 = y a22 a32 = ∈ P1 (T )
2(area T ) 2(area T )
1 1 1
where α0 = a21 a32 − a31 a22 , α1 = a22 − a32 , α2 = a31 − a21 .

Neela Nataraj IITB


Properties (contd ..)

a11 λ1 + a21 λ2 + a31 λ3 = x


a12 λ1 + a22 λ2 + a32 λ3 = y
λ1 + λ2 + λ3 = 1

Using Cramer’s rule, we obtain


x a21 a31
1 α0 + α1 x + α2 y
λ1 = y a22 a32 = ∈ P1 (T )
2(area T ) 2(area T )
1 1 1
where α0 = a21 a32 − a31 a22 , α1 = a22 − a32 , α2 = a31 − a21 .
Similarly, we can show that
λ2 (x, y ) ∈ P1 (T ), λ3 (x, y ) ∈ P1 (T ).

Neela Nataraj IITB


Properties (contd..)

Barycentric co-ordinates functions λi (x, y ) 1 ≤ i ≤ 3 form a


canonical nodal basis for P1 (T ).

Neela Nataraj IITB


Properties (contd..)

Barycentric co-ordinates functions λi (x, y ) 1 ≤ i ≤ 3 form a


canonical nodal basis for P1 (T ).
..
( . λi (aj ) = δij , λi (x, y ) ∈ P1 (T ) 1 ≤ i, j ≤ 3,

Neela Nataraj IITB


Properties (contd..)

Barycentric co-ordinates functions λi (x, y ) 1 ≤ i ≤ 3 form a


canonical nodal basis for P1 (T ).
..
( . λi (aj ) = δij , λi (x, y ) ∈ P1 (T ) 1 ≤ i, j ≤ 3,
X3
αi λi = 0 ⇒ αi = 0; hence they form a basis for P1 (T )).
i=1

Neela Nataraj IITB


Properties (contd..)

Barycentric co-ordinates functions λi (x, y ) 1 ≤ i ≤ 3 form a


canonical nodal basis for P1 (T ).
..
( . λi (aj ) = δij , λi (x, y ) ∈ P1 (T ) 1 ≤ i, j ≤ 3,
X3
αi λi = 0 ⇒ αi = 0; hence they form a basis for P1 (T )).
i=1
3
X
p ∈ P1 (T ), p(x, y ) = p(ai )λi (x, y ) ∈ P1 (T ).
i=1

Neela Nataraj IITB


For the reference triangle T
b with vertices
a1 = (1, 0), a2 = (0, 1) and a3 = (0, 0), the barycentric
co-ordinate functions take the following simplified form:

Neela Nataraj IITB


For the reference triangle Tb with vertices
a1 = (1, 0), a2 = (0, 1) and a3 = (0, 0), the barycentric
co-ordinate functions take the following simplified form:

 λ1 (x, y ) = x
λ2 (x, y ) = y
λ3 (x, y ) = 1 − x − y

Neela Nataraj IITB


The barycentric co-ordinates in triangles will be used now to define
global basis functions {φih }N
i=1 for Vh .

Neela Nataraj IITB


The barycentric co-ordinates in triangles will be used now to define
global basis functions {φih }N
i=1 for Vh .
Consider a sample triangulation of Ω̄ for illustration purposes.

Neela Nataraj IITB


The barycentric co-ordinates in triangles will be used now to define
global basis functions {φih }N
i=1 for Vh .
Consider a sample triangulation of Ω̄ for illustration purposes.
We will illustrate the construction of {φih }9i=1 for this case.

Neela Nataraj IITB


The barycentric co-ordinates in triangles will be used now to define
global basis functions {φih }N i=1 for Vh .
Consider a sample triangulation of Ω̄ for illustration purposes.
We will illustrate the construction of {φih }9i=1 for this case.
 T1
λ1 (x, y ) in T1
φ1h (x, y ) =
0 otherwise.

Neela Nataraj IITB


The barycentric co-ordinates in triangles will be used now to define
global basis functions {φih }N i=1 for Vh .
Consider a sample triangulation of Ω̄ for illustration purposes.
We will illustrate the construction of {φih }9i=1 for this case.
 T1
λ1 (x, y ) in T1
φ1h (x, y ) =
0 otherwise.
 T1
λ (x, y ) in T1
 2T2


λ3 (x, y )in T2
φ2h (x, y ) = T3
 λ1 (x, y ) in T3


0 otherwise

Neela Nataraj IITB


 T3
 λ2 (x, y )in T3
φ3h (x, y ) = λT4 (x, y )in T4
 3
0 otherwise
and so on.

Neela Nataraj IITB


 T3
 λ2 (x, y )in T3
φ3h (x, y ) = λT4 (x, y )in T4
 3
0 otherwise
and so on.
Note that a(φih , φjh ) = 0 whenever nodes i and j do not belong to
a same triangle.

Neela Nataraj IITB


 T3
 λ2 (x, y )in T3
φ3h (x, y ) = λT4 (x, y )in T4
 3
0 otherwise
and so on.
Note that a(φih , φjh ) = 0 whenever nodes i and j do not belong to
a same triangle.
This makes K = [a(φih , φjh )]1≤i,j≤N a sparse matrix.

Neela Nataraj IITB


 T3
 λ2 (x, y )in T3
φ3h (x, y ) = λT4 (x, y )in T4
 3
0 otherwise
and so on.
Note that a(φih , φjh ) = 0 whenever nodes i and j do not belong to
a same triangle.
This makes K = [a(φih , φjh )]1≤i,j≤N a sparse matrix.
Also, K is positive definite as a(·, ·) is co-ercive.

Neela Nataraj IITB


 T3
 λ2 (x, y )in T3
φ3h (x, y ) = λT4 (x, y )in T4
 3
0 otherwise
and so on.
Note that a(φih , φjh ) = 0 whenever nodes i and j do not belong to
a same triangle.
This makes K = [a(φih , φjh )]1≤i,j≤N a sparse matrix.
Also, K is positive definite as a(·, ·) is co-ercive.
Now, we will explain how the 0 global stiffness matrix0 K can be
0
assembled0 from 0 element stiffness matrices0 KT and how the
0
global load vector0 F can be assembled using the element load
vectors FT .

Neela Nataraj IITB


The structure of the matrix K

× × 0 × 0 0 0 0 0
 

 × × × × 0 0 0 0 


 × 0 × × 0 0 0 


 × × 0 × 0 0 

K =
 × × × × 0 


 × 0 × × 


 × × 0 

 × × 
× 9×9

Neela Nataraj IITB


Entries in Global Stiffness Matrix

Remark : In actual finite element computations, we need to store


only those elements above the diagonal (including diagonal
elements and below the skyline structure, in case we are using a
“SKYLINE SOLVER”).

Neela Nataraj IITB


Entries in Global Stiffness Matrix

Remark : In actual finite element computations, we need to store


only those elements above the diagonal (including diagonal
elements and below the skyline structure, in case we are using a
“SKYLINE SOLVER”).
Let K = (kij )1≤i,j≤9 .

Neela Nataraj IITB


Entries in Global Stiffness Matrix

Remark : In actual finite element computations, we need to store


only those elements above the diagonal (including diagonal
elements and below the skyline structure, in case we are using a
“SKYLINE SOLVER”).
Let K = (kij )1≤i,j≤9 .

Z " j j
#
∂φih ∂φh ∂φih ∂φh
kij = a(φih , φjh ) = + i j
+ φh φh dΩ
Ω ∂x ∂x ∂y ∂y

Neela Nataraj IITB


Entries in Global Stiffness Matrix

Remark : In actual finite element computations, we need to store


only those elements above the diagonal (including diagonal
elements and below the skyline structure, in case we are using a
“SKYLINE SOLVER”).
Let K = (kij )1≤i,j≤9 .

Z "
j j
#
∂φih ∂φh ∂φih ∂φh
kij = a(φih , φjh )
= + i j
+ φh φh dΩ
Ω ∂x ∂x ∂y ∂y
" #
j j
XZ ∂φih ∂φh ∂φih ∂φh i j
= + + φh φh dΩ
T ∂x ∂x ∂y ∂y
T ∈τh

Neela Nataraj IITB


Entries in Global Stiffness Matrix

Remark : In actual finite element computations, we need to store


only those elements above the diagonal (including diagonal
elements and below the skyline structure, in case we are using a
“SKYLINE SOLVER”).
Let K = (kij )1≤i,j≤9 .

Z "
j j
#
∂φih ∂φh ∂φih ∂φh
kij = a(φih , φjh )
= + i j
+ φh φh dΩ
Ω ∂x ∂x ∂y ∂y
" #
j j
XZ ∂φih ∂φh ∂φih ∂φh i j
= + + φh φh dΩ
T ∂x ∂x ∂y ∂y
T ∈τh

where T ’s are those triangles in τh which have both the nodes ai


and aj .

Neela Nataraj IITB


Calculation of entries of global stiffness matrix (contd..)

For example,
∂φ1h ∂φ1h ∂φ1h ∂φ1h
Z  
a(φ1h , φ1h )
= + 1 2
+ (φh ) dT1 ,
T1 ∂x ∂x ∂y ∂y
since the node a1 is present only in the triangle T1 .

Neela Nataraj IITB


Calculation of entries of global stiffness matrix (contd..)

For example,
∂φ1h ∂φ1h ∂φ1h ∂φ1h
Z  
a(φ1h , φ1h )
= + 1 2
+ (φh ) dT1 ,
T1 ∂x ∂x ∂y ∂y
since the node a1 is present only in the triangle T1 .
But in T1 , we know φ1h = λT 1
1 and hence

Neela Nataraj IITB


Calculation of entries of global stiffness matrix (contd..)

For example,
∂φ1h ∂φ1h ∂φ1h ∂φ1h
Z  
a(φ1h , φ1h )
= + 1 2
+ (φh ) dT1 ,
T1 ∂x ∂x ∂y ∂y
since the node a1 is present only in the triangle T1 .
But in T1 , we know φ1h = λT 1
1 and hence
Z  
1 1 ∂ T1 ∂ T1 ∂ T1 ∂ T1 T1 2
a(φh , φh ) = (λ1 ) (λ1 ) + (λ ) (λ ) + (λ1 ) dxdy .
T1 ∂x ∂x ∂y 1 ∂y 1

Neela Nataraj IITB


Calculation of entries of global stiffness matrix (contd..)

For example,
∂φ1h ∂φ1h ∂φ1h ∂φ1h
Z  
a(φ1h , φ1h )
= + 1 2
+ (φh ) dT1 ,
T1 ∂x ∂x ∂y ∂y
since the node a1 is present only in the triangle T1 .
But in T1 , we know φ1h = λT 1
1 and hence
Z  
1 1 ∂ T1 ∂ T1 ∂ T1 ∂ T1 T1 2
a(φh , φh ) = (λ1 ) (λ1 ) + (λ ) (λ ) + (λ1 ) dxdy .
T1 ∂x ∂x ∂y 1 ∂y 1
Similarly,
Z  
1 2 ∂ T1 ∂ T1 ∂ T1 ∂ T1 T1 T1
a(φh , φh ) = (λ1 ) (λ2 ) + (λ ) (λ ) + λ1 λ2 dxdy .
T1 ∂x ∂x ∂y 1 ∂y 2

Neela Nataraj IITB


Calculation of entries of global stiffness matrix (contd..)

For example,
∂φ1h ∂φ1h ∂φ1h ∂φ1h
Z  
a(φ1h , φ1h )
= + 1 2
+ (φh ) dT1 ,
T1 ∂x ∂x ∂y ∂y
since the node a1 is present only in the triangle T1 .
But in T1 , we know φ1h = λT 1
1 and hence
Z  
1 1 ∂ T1 ∂ T1 ∂ T1 ∂ T1 T1 2
a(φh , φh ) = (λ1 ) (λ1 ) + (λ ) (λ ) + (λ1 ) dxdy .
T1 ∂x ∂x ∂y 1 ∂y 1
Similarly,
Z  
1 2 ∂ T1 ∂ T1 ∂ T1 ∂ T1 T1 T1
a(φh , φh ) = (λ1 ) (λ2 ) + (λ ) (λ ) + λ1 λ2 dxdy .
T1 ∂x ∂x ∂y 1 ∂y 2
a(φ1h , φ3h ) = 0 as a1 and a3 do not belong to the same triangle.

Neela Nataraj IITB


Z  
∂ T1 ∂ T1 ∂ T1 ∂ T1 T1 T1
a(φ1h , φ4h ) = (λ ) (λ ) + (λ ) (λ ) + λ1 λ3 dxdy
T1 ∂x 1 ∂x 3 ∂y 1 ∂y 3

Neela Nataraj IITB


Z  
∂ T1 ∂ T1 ∂ T1 ∂ T1 T1 T1
a(φ1h , φ4h ) = (λ ) (λ ) + (λ ) (λ ) + λ1 λ3 dxdy
T1 ∂x 1 ∂x 3 ∂y 1 ∂y 3

a(φ1h , φjh ) = 0 ∀ j = 5, ..., 9 .

" #
∂ T2 2 ∂ T2 2
Z   
T2 2
a(φ2h , φ2h ) = (λ ) + (λ ) + (λ3 ) dxdy
T2 ∂x 3 ∂y 3

Neela Nataraj IITB


Z  
∂ T1 ∂ T1 ∂ T1 ∂ T1 T1 T1
a(φ1h , φ4h ) = (λ ) (λ ) + (λ ) (λ ) + λ1 λ3 dxdy
T1 ∂x 1 ∂x 3 ∂y 1 ∂y 3

a(φ1h , φjh ) = 0 ∀ j = 5, ..., 9 .

" #
∂ T2 2 ∂ T2 2
Z   
T2 2
a(φ2h , φ2h ) = (λ ) + (λ ) + (λ3 ) dxdy
T2 ∂x 3 ∂y 3
Z " #
∂ T3 2 ∂ T3 2
  
T3 2
+ (λ ) + (λ ) + (λ1 ) dxdy
T3 ∂x 1 ∂y 1

Neela Nataraj IITB


Z  
∂ T1 ∂ T1 ∂ T1 ∂ T1 T1 T1
a(φ1h , φ4h ) = (λ ) (λ ) + (λ ) (λ ) + λ1 λ3 dxdy
T1 ∂x 1 ∂x 3 ∂y 1 ∂y 3

a(φ1h , φjh ) = 0 ∀ j = 5, ..., 9 .

" #
∂ T2 2 ∂ T2 2
Z   
T2 2
a(φ2h , φ2h ) = (λ ) + (λ ) + (λ3 ) dxdy
T2 ∂x 3 ∂y 3
Z " #
∂ T3 2 ∂ T3 2
  
T3 2
+ (λ ) + (λ ) + (λ1 ) dxdy
T3 ∂x 1 ∂y 1

Neela Nataraj IITB


Thus, [a(φih , φjh )] can be assembled from suitable element
contributions of integrals

Neela Nataraj IITB


Thus, [a(φih , φjh )] can be assembled from suitable element
contributions
Z  of integrals of the kind 
∂ Tk ∂ Tk ∂ Tk ∂ Tk Tk Tk
(λi ) (λj ) + [ (λi ) (λj ) + λi λj dT .
Tk ∂x ∂x ∂y ∂y

Neela Nataraj IITB


Thus, [a(φih , φjh )] can be assembled from suitable element
contributions
Z  of integrals of the kind 
∂ Tk ∂ Tk ∂ Tk ∂ Tk Tk Tk
(λi ) (λj ) + [ (λi ) (λj ) + λi λj dT .
Tk ∂x ∂x ∂y ∂y
Similarly, F = [l(φjh )]1≤j≤N can be also assembled by adding up
suitable element contributions (from triangles which contain the
node aj ).

Neela Nataraj IITB


Thus, [a(φih , φjh )] can be assembled from suitable element
contributions
Z  of integrals of the kind 
∂ Tk ∂ Tk ∂ Tk ∂ Tk Tk Tk
(λi ) (λj ) + [ (λi ) (λj ) + λi λj dT .
Tk ∂x ∂x ∂y ∂y
Similarly, F = [l(φjh )]1≤j≤N can be also assembled by adding up
suitable element contributions (from triangles which contain the
node aj ).
In the implementation, we first compute the element stiffness
matrices (kijT ) ∀ T ∈ τh and the element load vectors

(f )T ∀ T ∈ τh .

Neela Nataraj IITB


Thus, [a(φih , φjh )] can be assembled from suitable element
contributions
Z  of integrals of the kind 
∂ Tk ∂ Tk ∂ Tk ∂ Tk Tk Tk
(λi ) (λj ) + [ (λi ) (λj ) + λi λj dT .
Tk ∂x ∂x ∂y ∂y
Similarly, F = [l(φjh )]1≤j≤N can be also assembled by adding up
suitable element contributions (from triangles which contain the
node aj ).
In the implementation, we first compute the element stiffness
matrices (kijT ) ∀ T ∈ τh and the element load vectors

(f )T ∀ T ∈ τh .
Then we assemble these element matrices to obtain the 0 global
stiffness matrix0 K and the global load vector 0 F 0 .

Neela Nataraj IITB


Thus, [a(φih , φjh )] can be assembled from suitable element
contributions
Z  of integrals of the kind 
∂ Tk ∂ Tk ∂ Tk ∂ Tk Tk Tk
(λi ) (λj ) + [ (λi ) (λj ) + λi λj dT .
Tk ∂x ∂x ∂y ∂y
Similarly, F = [l(φjh )]1≤j≤N can be also assembled by adding up
suitable element contributions (from triangles which contain the
node aj ).
In the implementation, we first compute the element stiffness
matrices (kijT ) ∀ T ∈ τh and the element load vectors

(f )T ∀ T ∈ τh .
Then we assemble these element matrices to obtain the 0 global
stiffness matrix0 K and the global load vector 0 F 0 .
We will illustrate this 0 assembly procedure0 for our example:

Neela Nataraj IITB


For each triangle T ∈ τh , we compute the element stiffness matrix
and the element load vector as follows:

Neela Nataraj IITB


For each triangle T ∈ τh , we compute the element stiffness matrix
and the element load vector as follows:
 T T T 
k11 k12 k13
k T = (kijT )3x3 =  T
k22 T 
k23
T
symmetric k33

Neela Nataraj IITB


For each triangle T ∈ τh , we compute the element stiffness matrix
and the element load vector as follows:
 T T T 
k11 k12 k13
k T = (kijT )3x3 =  T
k22 T 
k23
T
symmetric k33
and
f1T
 

f T = (fjT )1≤j≤3 =  f2T  .


f3T

Neela Nataraj IITB


For each triangle T ∈ τh , we compute the element stiffness matrix
and the element load vector as follows:
 T T T 
k11 k12 k13
k T = (kijT )3x3 =  T
k22 T 
k23
T
symmetric k33
and
f1T
 

f T = (fjT )1≤j≤3 =  f2T  .


f3T
Local canonical basis functions in T are λT T T
1 , λ2 , λ3 .

Neela Nataraj IITB


For each triangle T ∈ τh , we compute the element stiffness matrix
and the element load vector as follows:
 T T T 
k11 k12 k13
k T = (kijT )3x3 =  T
k22 T 
k23
T
symmetric k33
and
f1T
 

f T = (fjT )1≤j≤3 =  f2T  .


f3T
Local canonical basis functions in T are λT T T
1 , λ2 , λ3 .

Z  
∂ T ∂ T ∂ T ∂ T
kijT = (λ ) (λ ) + T T
(λ ) (λ ) + λi λj dT 1 ≤ i, j ≤ 3
T ∂x i ∂x j ∂y i ∂y j
.

Neela Nataraj IITB


For each triangle T ∈ τh , we compute the element stiffness matrix
and the element load vector as follows:
 T T T 
k11 k12 k13
k T = (kijT )3x3 =  T
k22 T 
k23
T
symmetric k33
and
f1T
 

f T = (fjT )1≤j≤3 =  f2T  .


f3T
Local canonical basis functions in T are λT T T
1 , λ2 , λ3 .

Z  
∂ T ∂ T ∂ T ∂ T
kijT = (λ ) (λ ) + T T
(λ ) (λ ) + λi λj dT 1 ≤ i, j ≤ 3
T ∂x i ∂x j ∂y i ∂y j
. Z
T
fi = f λT
i dT 1 ≤ i ≤ 3.
T

Neela Nataraj IITB


For each triangle T ∈ τh , we compute the element stiffness matrix
and the element load vector as follows:
 T T T 
k11 k12 k13
k T = (kijT )3x3 =  T
k22 T 
k23
T
symmetric k33
and
f1T
 

f T = (fjT )1≤j≤3 =  f2T  .


f3T
Local canonical basis functions in T are λT T T
1 , λ2 , λ3 .

Z  
∂ T ∂ T ∂ T ∂ T
kijT = (λ ) (λ ) + T T
(λ ) (λ ) + λi λj dT 1 ≤ i, j ≤ 3
T ∂x i ∂x j ∂y i ∂y j
. Z
T
fi = f λT
i dT 1 ≤ i ≤ 3.
T

Neela Nataraj IITB


Now, K =
 T1 T T 
k11 k121 0 k131 0 0 0 0 0
T T
k221
+ k332 T T T T T
 T3 k123 k231 + k232 k132 + k133 0 0 0 0 
 +k11 
T T T T T
k223 + k334 k233 + k234 k134
 0 0 0 0

 T T

 k331 + k222 T T T 
 T k122 + k125 0 k135 0 0 
 +k115 
T T
 k 2 +k 3 
11 33
T4 T
+k 5
 +k T T T T T T

 22 22 k124 + k127 k235 + k236 k136 + k137 0 
T T
+k336 + k117
 
T T
 
 k114 + k222 T T T 
T 0 k237 + k238 k138
+k338
 
 T T T

 k335 + k226 k126 0 
T T
k116 + k337
 
T
 T k128 
+k228
T
k119 9×9

Neela Nataraj IITB


 
f1T1

 f2T1 + f3T2 + f1T3 

f2T3 + f3T4
 
 
f3T1 + f2T2 + f1T5
 
 
f1T2 + f3T3 + f2T4 + f2T5 + f3T6 + f1T7
 
F =




 f2T7 + f3T8 

f3T5 + f2T6
 
 
f1T6 + f3T7
 
 
f1T9 9×1

Neela Nataraj IITB


 
f1T1

 f2T1 + f3T2 + f1T3 

f2T3 + f3T4
 
 
f3T1 + f2T2 + f1T5
 
 
f1T2 + f3T3 + f2T4 + f2T5 + f3T6 + f1T7
 
F =




 f2T7 + f3T8 

f3T5 + f2T6
 
 
f1T6 + f3T7
 
 
f1T9 9×1

K U = F is now solved using direct/iterative methods.

Neela Nataraj IITB


 
f1T1

 f2T1 + f3T2 + f1T3 

f2T3 + f3T4
 
 
f3T1 + f2T2 + f1T5
 
 
f1T2 + f3T3 + f2T4 + f2T5 + f3T6 + f1T7
 
F =




 f2T7 + f3T8 

f3T5 + f2T6
 
 
f1T6 + f3T7
 
 
f1T9 9×1

K U = F is now solved using direct/iterative methods.


U gives the solution uh at the nodal points (which are vertices of
the triangles in the triangulation).

Neela Nataraj IITB

You might also like