SlideShare a Scribd company logo
UNIVERSITÀ DEGLI STUDI DI ROMA
TOR VERGATA
Dipartimento di Matematica
Laurea in Matematica pura e applicata
Laurea in Mathematical Engineering
Laboratorio di calcolo
Finite Element Method with Freefem++
Filingeri Giuseppe
Peluso Fabio
Zenelanska Alexandra
Prof.ssa Pelosi Francesca
Prof. Baldi Paolo
1
Contents
1 Introduction 3
2 Case study 4
2.1 Poisson problem in (0, 1)2
. . . . . . . . . . . . . . . . . . . . 4
2.2 Poisson problem in the circle . . . . . . . . . . . . . . . . . . . 6
2
1 Introduction
In mathematics, a partial dierential equation (PDE) is a dierential
equation that contains unknown multivariable functions and their partial
derivatives. (A special case are ordinary dierential equations (ODEs), which
deal with functions of a single variable and their derivatives.) PDEs are used
to formulate problems involving functions of several variables, and are either
solved by hand, or used to create a relevant computer model. In this paper
we will consider a time independent PDE given by a 2-dimensional Poisson
problem with Dirichlet boundary condition.
−∆u = f on Ω
u = g on ∂Ω
where as usually we denote ∆ the Laplacian operator and f ∈ L2
(Ω). In
most general case a PDE closed form solution in not quite easy to obtain.
For this reason several discretization method were developed such as Finite
Dierence Method (FDM) and Finite Element one (FEM). According to
FEM, strong formulation could be redened weakly applying test functions
in Sobolev space. Thanks to Divergence Theorem and Green one thus we
obtain weak formulation for our problem:
Ω
u · vdΩ = Ω
fvdΩ
with test function v choosen in {v : Ω → R|v, ∂v
∂xi
∈ L2
(Ω), v = 0 su ∂Ω}.
The above term, seen as bilinear form a(u, v) and a linear function F(v)
can be espressed as
a(u, v) = F(v)
Thus, considering the approximated solution as the right solution for
every basis function in the space ϕi, we obtain
a(ui, ϕi) = F(ϕi)
from which we obtain the linear system
Au = f
for every v belonging to the space above dened where u is still the
solution we are looking for.
3
2 Case study
Using Freefem++ to approximate the Poisson problem according to Galerkin
method with C0
the space of linear stepwise function. In our case, recalling
that in
−∆u = f on Ω
u = g on ∂Ω
the equation is not homogeneus, the formulation becomes:
Ω
u · vdΩ − dΩ
∂u
∂n
vdγ = Ω
fvdΩ
2.1 Poisson problem in (0, 1)2
let us dene Ω = (0, 1)2
, g(x, y) = y cos(2πx) on ∂Ω as the right solution
u(x, y). f(x, y) = 4(π2
)y cos(2πx) as −∆U(x, y)
In this case the set Ω is the square (0, 1)2
thus boundaries are splitted
in four region. In the Freefem++ code we use triangulated mesh with poly-
nomials P1. Then, setting laplace in the source code the program solves
weak formulation problem generating u function isovalued plot and its trian-
gulated domain Th. Finally, we obtain the discretized surface for dierent
number of points discretization.
The error behaviour in L2
norm and the order of convergence are the
following:
4
(a) n = 4 (b) n = 8.
(c) n = 16. (d) n = 32.
Figure 1: Poisson discretization for dierent number of mesh points
5
2.2 Poisson problem in the circle
let us dene Ω = (x, y) ∈ R2
: x2
+ y2
 9, g(x, y) = x2
+ y2
− 9 on ∂Ω as
the right solution u(x, y), f(x, y) = −4 as −∆U(x, y) In this case the set Ω
is the circle of radius 3 thus boundaries are equal. In the Freefem++ code
we use triangulated mesh with polynomials P1. Then, setting laplace in
the source code the program solves weak formulation problem generating u
function isovalued plot and its triangulated domain Th. Finally, we obtain
the discretized surface for dierent number of points discretization.
Per il problema i) b otteniamo i risultati seguenti. In questo caso, essendo
il bordo un cerchio, viene parametrizzato.
The error behaviour in L2
norm and the order of convergence are the fol-
lowing:
6
(a) n = 4 (b) n = 8.
(c) n = 16. (d) n = 32.
Figure 2: Poisson discretization for dierent number of mesh points
7
Considering another polynomial space for basis function with another one
of higher order we expect a higher order of accuracy and a lower error in L2
norm for xed number of discretization points. Using polynomial belong-
ing to P2, thus the error decrease for xed mesh points. Note that in the
second case the error does not decrease since we are near to the maximum
representation error in C++.
8

More Related Content

PPT
Unit i ppt (1)
PDF
Free Ebooks Download ! Edhole
PPS
M1 unit ii-jntuworld
PPTX
Constant-Coefficient Linear Differential Equations
PDF
Mac331 complex analysis_mfa_week6_16-10-20 (1)
PPT
Linear differential equation with constant coefficient
DOCX
Unit i ppt (1)
Free Ebooks Download ! Edhole
M1 unit ii-jntuworld
Constant-Coefficient Linear Differential Equations
Mac331 complex analysis_mfa_week6_16-10-20 (1)
Linear differential equation with constant coefficient

What's hot (20)

PPTX
Finite difference method
PPT
1st order differential equations
PPTX
Lecture 02
PPTX
Automobile 3rd sem aem ppt.2016
PPTX
Exact & non differential equation
PPT
System of linear equations and their solution
PPTX
Differential equations of first order
PPTX
formulation of first order linear and nonlinear 2nd order differential equation
PPTX
Second order homogeneous linear differential equations
PPTX
Differential equations
PPT
Functions limits and continuity
PPTX
First order ordinary differential equations and applications
PPTX
Systems of equations
PDF
umerical algorithm for solving second order nonlinear fuzzy initial value pro...
PPTX
Solution of system of linear equations by elimination
PPTX
Edexcel Maths – Core 2 – Algebraic Division and Remainder Theorem
PDF
Engr 213 sample midterm 2b sol 2010
PPTX
Partial differential equations
PPT
Ch03 1
Finite difference method
1st order differential equations
Lecture 02
Automobile 3rd sem aem ppt.2016
Exact & non differential equation
System of linear equations and their solution
Differential equations of first order
formulation of first order linear and nonlinear 2nd order differential equation
Second order homogeneous linear differential equations
Differential equations
Functions limits and continuity
First order ordinary differential equations and applications
Systems of equations
umerical algorithm for solving second order nonlinear fuzzy initial value pro...
Solution of system of linear equations by elimination
Edexcel Maths – Core 2 – Algebraic Division and Remainder Theorem
Engr 213 sample midterm 2b sol 2010
Partial differential equations
Ch03 1
Ad

Similar to progfree++ (20)

DOCX
Digital Text Book :POTENTIAL THEORY AND ELLIPTIC PARTIAL DIFFERENTIAL EQUATIONS
PDF
Numerical_PDE_Paper
PDF
590-Article Text.pdf
PDF
590-Article Text.pdf
DOCX
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
DOCX
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
PDF
Numerical solution of linear volterra fredholm integro-
PPT
first order ode with its application
PDF
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
PDF
Introduction To Partial Differential Equations Mit 18152 Course Notes Jared S...
PDF
A Fast Numerical Method For Solving Calculus Of Variation Problems
PDF
Lecture_Slides_Mathematics_06_Optimization.pdf
PDF
PDF
Amity university sem ii applied mathematics ii lecturer notes
PDF
Lectures on analytic differential equations Yulij Ilyashenko
PDF
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
PDF
engineeringmathematics-iv_unit-iv
PPTX
Differential Equations Assignment Help
PDF
Reciprocity Law For Flat Conformal Metrics With Conical Singularities
Digital Text Book :POTENTIAL THEORY AND ELLIPTIC PARTIAL DIFFERENTIAL EQUATIONS
Numerical_PDE_Paper
590-Article Text.pdf
590-Article Text.pdf
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
Numerical solution of linear volterra fredholm integro-
first order ode with its application
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
Introduction To Partial Differential Equations Mit 18152 Course Notes Jared S...
A Fast Numerical Method For Solving Calculus Of Variation Problems
Lecture_Slides_Mathematics_06_Optimization.pdf
Amity university sem ii applied mathematics ii lecturer notes
Lectures on analytic differential equations Yulij Ilyashenko
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
engineeringmathematics-iv_unit-iv
Differential Equations Assignment Help
Reciprocity Law For Flat Conformal Metrics With Conical Singularities
Ad

progfree++

  • 1. UNIVERSITÀ DEGLI STUDI DI ROMA TOR VERGATA Dipartimento di Matematica Laurea in Matematica pura e applicata Laurea in Mathematical Engineering Laboratorio di calcolo Finite Element Method with Freefem++ Filingeri Giuseppe Peluso Fabio Zenelanska Alexandra Prof.ssa Pelosi Francesca Prof. Baldi Paolo 1
  • 2. Contents 1 Introduction 3 2 Case study 4 2.1 Poisson problem in (0, 1)2 . . . . . . . . . . . . . . . . . . . . 4 2.2 Poisson problem in the circle . . . . . . . . . . . . . . . . . . . 6 2
  • 3. 1 Introduction In mathematics, a partial dierential equation (PDE) is a dierential equation that contains unknown multivariable functions and their partial derivatives. (A special case are ordinary dierential equations (ODEs), which deal with functions of a single variable and their derivatives.) PDEs are used to formulate problems involving functions of several variables, and are either solved by hand, or used to create a relevant computer model. In this paper we will consider a time independent PDE given by a 2-dimensional Poisson problem with Dirichlet boundary condition. −∆u = f on Ω u = g on ∂Ω where as usually we denote ∆ the Laplacian operator and f ∈ L2 (Ω). In most general case a PDE closed form solution in not quite easy to obtain. For this reason several discretization method were developed such as Finite Dierence Method (FDM) and Finite Element one (FEM). According to FEM, strong formulation could be redened weakly applying test functions in Sobolev space. Thanks to Divergence Theorem and Green one thus we obtain weak formulation for our problem: Ω u · vdΩ = Ω fvdΩ with test function v choosen in {v : Ω → R|v, ∂v ∂xi ∈ L2 (Ω), v = 0 su ∂Ω}. The above term, seen as bilinear form a(u, v) and a linear function F(v) can be espressed as a(u, v) = F(v) Thus, considering the approximated solution as the right solution for every basis function in the space ϕi, we obtain a(ui, ϕi) = F(ϕi) from which we obtain the linear system Au = f for every v belonging to the space above dened where u is still the solution we are looking for. 3
  • 4. 2 Case study Using Freefem++ to approximate the Poisson problem according to Galerkin method with C0 the space of linear stepwise function. In our case, recalling that in −∆u = f on Ω u = g on ∂Ω the equation is not homogeneus, the formulation becomes: Ω u · vdΩ − dΩ ∂u ∂n vdγ = Ω fvdΩ 2.1 Poisson problem in (0, 1)2 let us dene Ω = (0, 1)2 , g(x, y) = y cos(2πx) on ∂Ω as the right solution u(x, y). f(x, y) = 4(π2 )y cos(2πx) as −∆U(x, y) In this case the set Ω is the square (0, 1)2 thus boundaries are splitted in four region. In the Freefem++ code we use triangulated mesh with poly- nomials P1. Then, setting laplace in the source code the program solves weak formulation problem generating u function isovalued plot and its trian- gulated domain Th. Finally, we obtain the discretized surface for dierent number of points discretization. The error behaviour in L2 norm and the order of convergence are the following: 4
  • 5. (a) n = 4 (b) n = 8. (c) n = 16. (d) n = 32. Figure 1: Poisson discretization for dierent number of mesh points 5
  • 6. 2.2 Poisson problem in the circle let us dene Ω = (x, y) ∈ R2 : x2 + y2 9, g(x, y) = x2 + y2 − 9 on ∂Ω as the right solution u(x, y), f(x, y) = −4 as −∆U(x, y) In this case the set Ω is the circle of radius 3 thus boundaries are equal. In the Freefem++ code we use triangulated mesh with polynomials P1. Then, setting laplace in the source code the program solves weak formulation problem generating u function isovalued plot and its triangulated domain Th. Finally, we obtain the discretized surface for dierent number of points discretization. Per il problema i) b otteniamo i risultati seguenti. In questo caso, essendo il bordo un cerchio, viene parametrizzato. The error behaviour in L2 norm and the order of convergence are the fol- lowing: 6
  • 7. (a) n = 4 (b) n = 8. (c) n = 16. (d) n = 32. Figure 2: Poisson discretization for dierent number of mesh points 7
  • 8. Considering another polynomial space for basis function with another one of higher order we expect a higher order of accuracy and a lower error in L2 norm for xed number of discretization points. Using polynomial belong- ing to P2, thus the error decrease for xed mesh points. Note that in the second case the error does not decrease since we are near to the maximum representation error in C++. 8