EF2-M2 New 2
EF2-M2 New 2
∗
Ioan R. Ionescu
Contents
1 Basics in finite elements method 4
1.1 FreeFem++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Mesh generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1 2D meshes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.2 3D meshes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Finite element spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3.1 Introducing finite element spaces . . . . . . . . . . . . . . . . . . 7
1.3.2 Finite element functions . . . . . . . . . . . . . . . . . . . . . . . 8
1.3.3 Finite element basis . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3.4 Finite element interpolation . . . . . . . . . . . . . . . . . . . . . 8
1.4 Visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4.1 FreeFem++ Visualization . . . . . . . . . . . . . . . . . . . . . . 9
1.4.2 VTK visualization . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1
2.2.3 Cisaillement anti-plan d’un carré fissuré (mode III) . . . . . . . . 23
2.2.4 Déformation (anti-plane) d’une demi-disque . . . . . . . . . . . . 25
2.2.5 Déformation anti-plane d’un écrou épais . . . . . . . . . . . . . . 26
2.3 Vectorial two dimensional problems . . . . . . . . . . . . . . . . . . . . . 28
2.3.1 Assumptions in two spatial dimensions . . . . . . . . . . . . . . . 28
2.3.2 Model problem: Ecrasement d’un lopin . . . . . . . . . . . . . . 29
2.3.3 Piéce suspendue . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3.4 Traction d’un carré fissuré (mode II) . . . . . . . . . . . . . . . . 35
2.3.5 Different treatment of displacement boundary conditions . . . . . 37
2.3.6 Visser un écrou épais . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.3.7 Poinçonnement d’un demi disque . . . . . . . . . . . . . . . . . . 40
2.4 Axi-symmetric problems . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.4.1 Ecrasement d’un tube . . . . . . . . . . . . . . . . . . . . . . . . 42
2.4.2 Compression triaxiale d’un cylindre creux . . . . . . . . . . . . . 43
2.5 Three dimensional problems . . . . . . . . . . . . . . . . . . . . . . . . . 43
2
4 Appendix 62
4.1 Macros for Nonlinear elasticity . . . . . . . . . . . . . . . . . . . . . . . . 62
4.1.1 General Macros in 2D . . . . . . . . . . . . . . . . . . . . . . . . 62
4.1.2 Macros for Saint-Venant-Kirchhoff model . . . . . . . . . . . . . . 63
3
1 Basics in finite elements method
1.1 FreeFem++
FreeFEM is a partial differential equation solver for non-linear multi-physics systems
in 2D and 3D.Problems involving partial differential equations from several branches
of physics, such as fluid-structure interactions, require interpolations of data on several
meshes and their manipulation within one program. FreeFEM includes a fast interpola-
tion algorithm and a language for the manipulation of data on multiple meshes. FreeFEM
is written in C++ and its language is a C++ idiom.
To use FreeFEM, two installation methods are available: user access (binary package)
and access developers (from the source code). Follow the section corresponding to your
type of installation. For the installation details and the FreeFEM documentation please
visit https://freefem.org/.
General information
• Th.nt = Nt number of triangles
• Th.nv = Nv number of vertexes
• Th.ne = Ne number of edges
• Th.measure = A aria
• Th.bordermeasure = P perimeter
• N.x, N.y = (nx , ny ) the external normal at the boundary
4
• Th(xx,yy).region = number of the region R such that (xx, yy) ∈ R
Information of a vertex i = 0, ..., Nv − 1:
• Th(i).x Th(i).y = coordinates of i
• Th(i).label = region of i
$! " # $% (
!! " # $ $! " # $
% & % )
$! " # $% '
real x0=1.2,x1=1.8; 5
real y0=0,y1=1;
int n=5,m=20;
mesh Th=square(n,m,[x0+(x1-x0)*x,y0+(y1-y0)*y]);
109
Mesh generation by the border
Boundaries are defined piecewise by parametrized curves. The pieces can only intersect
at their endpoints, but it is possible to join more than two endpoints. The curve C
parametrized through t → (fx (t), fy (t)), with t ∈ (0, 2π) and fx (t) = cos(t), fy (t) =
sin(t), avec le label 1 will be defined by
border C(t=0,2*pi){ x=cos(t); y=sin(t);label=1;}
To plot the curve C with 50 segments
plot(C(50),wait=1,ps="C.eps" ) ;
Define a triangulation with buildmesh
mesh Th= buildmesh(C(50) );
The general expression112to define a triangulation with buildmesh is
CHAPTER 5. MESH GENERATION
!!! "!#
Cj with mj > 0 if the domain is on the left side
% " " ! " ! ' and
" # " ! " ! & mj "! ") !0 if the domain is on the right
!"! "!$
% " " ! " ! ' " #<
% $ ! "% !& ($ !'"$ ! #% !& ($ !& !"! "!#
&
Note 5.3 Borders are evaluated only at the time plot or buildmesh is called so the global
variable are defined at this time andhere since r is changed between the two border calls the
following code will not work because the first border will be computed with r=0.3:
1.2.2 3D meshes
6
1.3 Finite element spaces
1.3.1 Introducing finite element spaces
Vh = {v : D → R ; v ∈ P k (T ), for all T ∈ Th },
c0 c0 +a1x+b1y c0 +a1x+b1y+a2x2+b2y2+d2xy
P1 P2
P0 P1dc P2dc
7
1.3.2 Finite element functions
Introducing a function u ∈ Vh
NameS u;
The value u(x0 , y0 ) of u in (x0 , y0 )
real value=u(x0,y0);
Note that x, y, z are notations reserved for spatial variables.
where M is the number of degree of freedom and any function u ∈ Vh can be written as
M
X
u(x, y, z) = Ui Φi (x, y, z).
i=1
The operator = is the interpolation operator of FreeFem++ , The continuous finite func-
tions are extended by continuity to the outside of the domain.
int n=4;
8
IsoValue IsoValue
-0.0526316 IsoValue -0.169591
0.0263158 -0.0467836 -0.0818713
0.0789474 0.0233918 -0.0233918
0.131579 0.0701754 0.0350877
0.184211 0.116959 0.0935673
0.236842 0.163743 0.152047
0.289474 0.210526 0.210526
0.342105 0.25731 0.269006
0.394737 0.304094 0.327485
0.447368 0.350877 0.385965
0.5 0.397661 0.444444
0.552632 0.444444 0.502924
0.605263 0.491228 0.561404
0.657895 0.538012 0.619883
0.710526 0.584795 0.678363
0.763158 0.631579 0.736842
0.815789 0.678363 0.795322
0.868421 0.725146 0.853801
0.921053 0.77193 0.912281
1.05263 0.818713 1.05848
0.935673
func f=sin(pi*x*n)*sin(pi*y*n);
NameS uh=f;
1.4 Visualization
There are two ways of visualization in FreeFem++ : One, the default view of FreeFem++.
Another method is to use external tools as Paraview which use the .vtk (Visualization
Tool Kit) files.
The FreeFem++ visualization supports the drawing of meshes, iso-values of real FE-
functions and of vector fields, all by the command plot.
plot(Th, ps="Mesh.eps",wait=1);
plot(u, fill=true, value=1, ps="uh.eps", wait=1);
NameS uh=x*x+y*y,vh=-y*y+x*x;
9
10x10 mesh, P0 10x10 mesh, P1 10x10 mesh, P2
Creation of the .vtk file for a surface (x, y) → (x, y, uh (x, y))
fespace Rh(Th,P1dc) ;
Rh Xdes=x, Ydes=y, Zdes=uh, devdes=uh;
int id;
ofstream par("results.vtk"); // nom du fichier .vtk
par «"# vtk DataFile Version 1.0" «endl;
par «"3D Unstructured Grid of Linear Triangles" «endl;
par «"ASCII" «endl;
par «" " «endl;
par «"DATASET UNSTRUCTURED_GRID" «endl;
par «"POINTS " « Rh.ndof« " float" «endl;// Rh.ndof number of degree of
freedom
10
Vec Value
0
0.105269
0.210537
0.315806
0.421075
0.526343
0.631612
0.736881
0.84215
0.947418
1.05269
1.15796
1.26322
1.36849
1.47376
1.57903
1.6843
1.78957
1.89484
2.00011
11
Figure 7: Representation ParaView of the surface x, y, z = sin(4πx) sin(4πy) on the
square (0, 1) × (0, 1) on the mesh 100 × 100 for the P1dc finite element space.
12
2 Static problems in linear elasticity
1
ε(u) = (∇u + ∇T u) in D, (small perturbations assumption)
2
−divσ(u) = ρb in D, (equilibrium)
u=U on Γd , σ(u) · n = F on Γc ,
un = Un , στ = Fτ on Γ1m , uτ = Uτ , σn = Fn on Γ2m
Gm 2
Gc
Gd
D
Gm 1
13
2.1.1 Variational problem
Let
U ad = {v : Dd → Rd ; v = U on Γd , vn = Un on Γ1m , vτ = Uτ on Γ2m , }
V = {v : Dd → Rd ; v = 0 on Γd , vn = 0 on Γ1m , vτ = 0 on Γ2m , }
where a and l are the bilinear and the linear forms given by
Z
a(v, w) = λtrace(ε(v))trace(ε(w)) + 2µε(v) : ε(w) dx,
D
Z Z Z Z
l(w) = b · w dx + F · w da + Fτ · wτ da + Fn wn da.
D Γc Γ1m Γ2m
If we denote by J(v) = 21 a(v, v)−l(v) the elastic energy functional then the variational
problem (V P ) is equivalent with the following minimum problem for the energy
R = {r(x) = t + ω ∧ x ; t ∈ R3 , ω ∈ R3 }, for d = 3.
The dimension of this space is finite: dim(R) = 3 for d = 2 and dim(R) = 6 for d = 3.
14
In what it follows we denote by R0 = R ∩ V. Then we have
(V Ph ) uh ∈ U ad
h , a(uh , vh ) − l(vh ) = 0, for all vh ∈ Vh ,
which is equivalent with the minimization problem for the energy functional
(M Ph ) uh ∈ U ad
h , J(uh ) ≤ J(vh ), for all vh ∈ U ad
h .
Then we have the following error estimation: there exists a constant C such that
15
A = (Aij )i,j=1,M the rigidity matrix, and by L = (L1 , .., LM ) the loading term (or right-
side vector) given by
(LSh ) uh ∈ U ad
h , AU = L.
D
Gc
W
x
Gd
16
2.2.1 Boundary value problem
Let ∂Ω = Γd ∪ Γc and let consider the boundary value problem: find u : Ω → R (the
anti-plane displacement) solution of
Variational problem
Let
U ad = {v : Ω → R ; v = U on Γd }, V = {v : Ω → R ; v = 0 on Γd }
be the set of admissible functions (displacements) and its associated vectorial space.
The variational formulation of the boundary value problem : find u solution of
where a and l are the bilinear and the linear forms given by
Z Z Z
a(v, w) = µ∇v · ∇w dx, l(w) = ρbw dx + f w da.
Ω Ω Γc
If we denote by
1 1
Z Z Z
2
J(v) = a(v, v) − l(v) = µ|∇v| dx − ρbv dx − f v da
2 2 Ω Ω Γc
the elastic energy functional then the variational problem (V P ) is equivalent with the
following minimum problem for the energy
17
Existence and unicity of the solution
Let R = {r : Ω → R ; a(r, r) = 0} be the kernel of the bilinear form a, then the set
of anti-plane rigid motions:
R = {r : Ω → R ; r ≡ const}.
Theorem. If Ω is smooth enough and the input data ρb, U, f are regular then we
have:
and we have the following error estimation: there exists a constant C such that
On se propose d’étudier la déformation statique d’une pièce entre deux plaques parallèles
planes et rigides. La pièce, qui est rapportée à un système d’axes orthonormés Oxyz,
est infinie dans la direction verticale Ox3 et a une section rectangulaire Ω =]0, a[×]0, b[
dans le plan Oxy. Les faces x = 0, x = a sont en contact sans frottement avec deux
plaques parallèles rigides (déplacement normal nul et contraintes tangentielles nulles).
18
x
3
a
B
B
z
0 b y
1) Mise en équation - Il s’agit d’écrire les équations, leur interprétation physique, leurs
limites d’applicabilité et les conditions aux bords.
1
ε(u) = (∇u + ∇T u) in D, (small perturbations assumption)
2
−divσ(u) = 0 in D, (equilibrium)
u = 0 on y = 0, u = (0, 0, B(x)) on y = b, un = 0, στ = 0 on x = 0, a.
19
Find u : Ω → R (the out of plane displacement) solution of
div(µ∇u) = 0, in D
πx πy πb
u(x, y) = cos( )sinh( )/sinh( )
a a a
U ad = {v ∈ H 1 (Ω) ; v = B on y = b, v = 0 on y = 0},
V = {v ∈ H 1 (Ω) ; v = 0 on y = 0, b}
5a) Mesh.
//DEFORMATION ANTI-PLANE
verbosity=1;
//CONSTRUCTION du DOMAINE
20
real a=1,b=1.;
border gama4(t=0,a){x=t;y=0.; label=4;};
border gama3(t=0.,b){x=a;y=t; label=3;};
border gama2(t=a,0.){x=t;y=b; label=2;};
border gama1(t=b,0.){x=0.;y=t; label=1;};
//MAILLAGE
int n1=40,n2=40, n3=40,n4=40;// nombre des segments sur les frontières
mesh Th=buildmesh(gama1(n1)+gama2(n2)+gama3(n3)+gama4(n4)); // construc-
tion
plot(Th,ps="mesh.eps", wait=1);
//CONSTANTES DE MATERIAU
real mu=1;
//CONDITIONS aux limites en Déplacement
func real B(real tx) return cos(pi*tx/a);
Visualisation FreeFem++
21
plot(Th,dev, fill=true, value=1, ps="Deviator.eps", wait=1);
Visualisation ParaView
fespace Rh(Th,P1dc) ;
Rh Xdes=x, Ydes=y, Zdes=uh, devdes=dev;
int id;
ofstream par("piece.vtk"); //nom du fichier .vtk
par <<"# vtk DataFile Version 1.0" <<endl;
par <<"3D Unstructured Grid of Linear Triangles"<<endl; //triangle à
trois noeuds
par <<"ASCII" «endl;
par <<" " <<endl;
par<<"DATASET UNSTRUCTURED_GRID" «endl;
par «"POINTS " « Rh.ndof« " float" «endl; // Rh.ndof number of degree
of freedom
for (id=0;id<Rh.ndof;id++){par<<Xdes[][id]<<" "<< Ydes[][id]<<" "<<Zdes[][id]<<en
}
par<<"CELLS " << Rh.nt<< " " << (Rh.ndofK+1)*Rh.nt<<endl; //
Rh.nt number of triangles
for (id=0;id<Rh.nt;id++) {par<<"3 "<< Rh(id,0) <<" "<<Rh(id,1)<<"
"<<<Rh(id,2)<<endl; }
par <<" " <<endl;
par <<"CELL_TYPES "<< Rh.nt«endl;
for (id=0;id<Rh.nt;id++){pa<<"5"<<endl; }
par <<" " <<endl;
par <<"POINT_DATA " << Rh.ndof«endl;
par <<"SCALARS Deviator float"<<endl;
par <<"LOOKUP_TABLE default " <<endl;
for (id=0;id<Rh.ndof;id++) {par<< devdes[][id]<<endl; }
func u=cos(pi*x/a)*sinh(pi*y/a)/sinh(pi*b/a);
Vh error=u-uh;
plot(Th,error, fill=true, value=1, ps="Error.eps", wait=1);
22
Figure 11: The anti-plane deformation of a square: visualization FreeFe++ (left) and
ParaView (right) of the numerical solution.
23
y
3
a
F
-F
b
z F
4 6 5 2
x
-F -a
a F
F
-b
-F
-F
1
Figure 13: Computed anti-plane deformation of a cracked square. In color scale the stress
deviator.
24
σxz(x,y)
uz(0+,y) σxz(0+,y)
σyz(0+,y)
σyz(x,y)
Figure 14: Anti-plane cracked square. Left: computed stress distributions (x, y) →
σxz (x, y) and (x, y) → σyz (x, y). Right: computed stress distributions y → σxz (0+, y)
and y → σyz (0+, y) and displacement distribution y → uz (0+, y).
25
y
F
F F
4 2
-R -a a R
3 x
Figure 16: Computed anti-plane deformation of a half disque. In color scale the stress
deviator.
26
y
F
F
2a 4 F
F
5 F
3
x
-2a 2a
6 7 2
1
-2a
Figure 18: Computed anti-plane deformation of a thick nut. In color scale the stress
deviator.
27
2.3 Vectorial two dimensional problems
2.3.1 Assumptions in two spatial dimensions
We will suppose that the elastic coefficients λ, µ depends only on the first two variables,
i.e.
λ = λ(x, y), µ = µ(x, y).
Plain-strain assumption
σxx = σxx (x, y), σxy = σxy (x, y), σyy = σyy (x, y), σxz = σyz = 0.
Since the stress σzz can be computed from the in-plane stresses or strains
λ
σzz = (σxx + σyy ) = λ(xx + yy ),
2(λ + µ)
we deduce that the plain-strain assumption can be easily handled by considering only the
unknowns acting in the plane Oxy (i.e. in-plane displacements, strains and stresses) which
depends only on the in-plane, variables x and y. Indeed, if we denote by u2 = (ux , uy )
the in-plane displacement and and by σ2 the in-plane stresses the
1
ε2 (u2 ) = (∇2 u2 + ∇T2 u2 ) in Ω, (small perturbations assumption)
2
Since these last equations could also be recovered by considering d = 2 in the formulation
of the boundary value problem, we will drop off the subscript 2 in the above notations.
Plane-stress assumption
(plain-stress) σxx = σxx (x, y), σxy = σxy (x, y), σyy = σyy (x, y), σxz = σyz = σzz = 0.
28
From the Hooke law we deduce
xx = xx (x, y), xy = xy (x, y), yy = yy (x, y), xz = yz = 0,
λ ν
zz = − (xx + yy ) = − (σxx + σyy ).
(λ + 2µ) E
The plain-stress assumption can be easily handled by considering only the unknowns
acting in the plane Oxy (i.e. in-plane displacements, strains and stresses) which depends
only on the in-plane, variables x and y. Indeed, if we denote by u2 = (ux , uy ) the in-plane
displacement and and by σ2 the in-plane stresses the
1
ε2 (u2 ) = (∇2 u2 + ∇T2 u2 ) in Ω, (small perturbations assumption)
2
On se propose d’étudier la déformation d’une pièce élastique (lopin) entre deux presses
parallèles planes et rigide. Le lopin, qui est rapporté à un système d’axes orthonormés
Oxyz, est infini dans la direction Oz et a une section rectangulaire ] − a, a[×] − b, b[ dans
le plan Oxy. La pièce est supposée homogène et isotrope. Les faces x = ± a sont libres
de contraintes. On impose à la face y = b (resp. y = −b) un déplacement (0, −U, 0)
(resp. (0, U, 0)) où U est donné. On néglige les forces volumiques (le pesenteur).
1) Mise en équation - Il s’agit d’écrire les équations, leur interprétation physique, leurs
limites d’applicabilité et les conditions aux bords.
29
y
3
-U -U b
-U -U -U -U
4 2
-a a x
U U U U U
U -b
1
1
ε(u) = (∇u + ∇T u) in D, (small perturbations assumption)
2
−divσ(u) = 0 in D, (equilibrium)
We denote by u = u(x, y) = (ux (x, y), uy (x, y) the in-plane displacement and by σ
the in-plane 2 × 2 stress tensor .
1
ε(u) = (∇u + ∇T u) in Ω, (small perturbations assumption)
2
−divσ(u) = 0 in Ω, (equilibrium)
30
3) Formulation variationnelle. Il s’agit te trouver la formulation variationnelle en
déformations planes.
Let
U ad = {v ∈ H 1 (Ω)2 ; v = (0, U ) on 1, v = (0, −U ) on 3}
V = {v ∈ H 1 (Ω)2 ; v = 0 on 1, 3}
Since R0 = R ∩ V = {0} then there exists a solution of the variational problem and
it is unique.
(V Ph ) uh ∈ U ad
h , a(uh , vh ) = 0, for all vh ∈ V h ,
5a) Mesh.
//DEFORMATION PLANE
verbosity=1;
//CONSTRUCTION du DOMAINE
real a=1,b=1.;
border gam1(t=-a,a){x=t;y=-b; label =1;};
border gam2(t=-b,b){x=a;y=t; label =2;};
border gam3(t=a,-a){x=t;y=b; label =3;};
border gam4(t=b,-b){x=-a;y=t; label =4;};
31
//MAILLAGE
int nh=40;// nombre des segments sur les frontières
mesh Th=buildmesh(gama1(nh)+gama2(nh)+gama3(nh)+gama4(nh)); // construc-
tion
plot(Th,ps="mesh.eps", wait=1);
//CONSTANTES DE MATERIAU
real lambda=1., mu=1.;
//CONDITIONS aux limites en Déplacement
real U=0.5;
sxx=lambda*(dx(ux)+dy(uy))+2*mu*dx(ux);
syy=lambda*(dx(ux)+dy(uy))+2*mu*dy(uy);
sxy=mu*(dx(uy)+dy(ux));
szz=lambda*(dx(ux)+dy(uy));
pres=-(sxx+syy+szz)/3.;
dev=sqrt(2*sxy∧2+(sxx +pres)∧2+(syy +pres)∧2+(szz +pres)∧2); // compute the
stresses
Visualisation FreeFem++
32
plot(Th,[ux,uy], fill=true, value=1, ps="Displacement.eps", wait=1);
plot(Th,dev, fill=true, value=1, ps="Deviator.eps", wait=1);
Visualisation ParaView
fespace Rh(Th,P1dc) ;
real mag=1; // the magnification coefficient
Rh Xdes=x+mag*ux, Ydes=y+mag*uy, Zdes=0, devdes=dev;
int id;
ofstream par("Lopin.vtk"); //nom du fichier .vtk
par <<"# vtk DataFile Version 1.0" <<endl;
par <<"3D Unstructured Grid of Linear Triangles"<<endl; //triangle à
trois noeuds
par <<"ASCII" «endl;
par <<" " <<endl;
par<<"DATASET UNSTRUCTURED_GRID" «endl;
par «"POINTS " « Rh.ndof« " float" «endl; // Rh.ndof number of degree
of freedom
for (id=0;id<Rh.ndof;id++){par<<Xdes[][id]<<" "<< Ydes[][id]<<" "<<Zdes[][id]<<en
}
par<<"CELLS " << Rh.nt<< " " << (Rh.ndofK+1)*Rh.nt<<endl; //
Rh.nt number of triangles
for (id=0;id<Rh.nt;id++) {par<<"3 "<< Rh(id,0) <<" "<<Rh(id,1)<<"
"<<<Rh(id,2)<<endl; }
par <<" " <<endl;
par <<"CELL_TYPES "<< Rh.nt«endl;
for (id=0;id<Rh.nt;id++){pa<<"5"<<endl; }
par <<" " <<endl;
par <<"POINT_DATA " << Rh.ndof«endl;
par <<"SCALARS Deviator float"<<endl;
par <<"LOOKUP_TABLE default " <<endl;
for (id=0;id<Rh.ndof;id++) {par<< devdes[][id]<<endl; }
33
Figure 20: The plane deformation of a square: visualization FreeFe++ (left) and Par-
aView (right) of the numerical solution.
-a a x
−ρg
-b
z
On se propose d’étudier la déformation d’une pièce élastique sous son propre poids.
La pièce, qui est supposée homogène et isotrope, est rapportée à un système d’axes
orthonormés Oxyz. Elle est infinie dans la direction Oz et a une section rectangulaire
] − a, a[×] − b, b[ dans le plan Oxy. Les faces x = a, y = ±b sont libres de contraintes
et la face x = −a est fixée (déplacement nul). Les forces volumiques (le pesenteur) sont
(0, −ρg, 0).
34
Figure 21: Computed plane deformation of a heavy square. In color scale the stress
deviator.
y
3
-F F
a
-F b F
z
4 6 5 2
x
-a
a
-F F
-b
-F F
35
ux=ux-(ax-omega*y); uy=uy-(ay+omega*x); // solution choice
36
2.3.5 Different treatment of displacement boundary conditions
Let
ad
Ũ = {v : D → R2 continuous ; v = U on Γd }
the set of admissible in-plane displacements without the displacement boundary condi-
tions on Γ1m and Γ2m and let
Ṽ = {v : D → R continuous ; v = 0 on Γd }
The variational formulation of the penalized boundary value problem: find uδ solution of
ad
(V P )δ uδ ∈ Ũ , ãδ (uδ , v) − ˜lδ (v) = 0, for all v ∈ Ṽ,
uδ −→ u, for δ → 0.
37
+int1d(Th,4)( 1/eps*(-ux*N.y+uy*N.x)*(-vx*N.y+vy*N.x))
// linear form ˜lδ
-int2d(Th)(bx*vx+by*vy)-int1d(Th,2)(Fx*vx+Fy*vy)
+int1d(Th,3)( -1/eps*Un*(vx*N.x+vy*N.y))
+int1d(Th,4)( -1/eps*Ut*(-vx*N.y+vy*N.x))
// essential boundary conditions
+on(1,ux=Uxd, uy=Uyd) ;
ãL ([v, p], [w, q]) = a(v, w) + L(v, q) − L(w, p), ˜lL ([w, q]) = l(w) + G(q).
The Lagrange variational formulation of the boundary value problem: find [u, p] solution
of
ad
(V P )L [u, p] ∈ Ũ × L, ãL ([u, p], [v, q]) − ˜lL ([v, q]) = 0, for all [v, q] ∈ Ṽ × L,
p = σn on Γ1m , p = στ on Γ2m .
38
// linear form ˜lL
-int2d(Th)(bx*vx+by*vy)-int1d(Th,2)(Fx*vx+Fy*vy)
-int1d(Th,3)( q*Un) -int1d(Th,4)( q*Ut)
// essential boundary conditions
+on(1,ux=Uxd, uy=Uyd) ;
2a
4
5
F 3
x
2a
U
6 7 2
z
1
2a
39
Figure 23: Computed plane deformation of a thick nut. In color scale the stress deviator.
4 -a 3 a 2
-R R x
-U -U -U
f f
z
1
40
4 sur le dessin) est libre de contraintes (vecteur contrainte nul). Les forces volumiques (le
pesenteur) sont négligeables. Calculer la résultante des forces exercés sur la face y = 0.
Figure 24: Computed deformation of a half-disk : the initial mesh, the penalized solution
in wireframe and the Lagrangian solution with the stress deviator in color scale.
1) Mise en équation - Il s’agit d’écrire les équations, leur interprétation physique, leurs
limites d’applicabilité et les conditions aux bords.
2)Simplification du problème - Il s’agit d’utiliser l’hypothèse ur = ur (r, z), uθ =
0, uz = uz (r, z) et d’écrire le problème simplifié.
3) Formulation variationnelle. Montrer que (ur , uz ) : Ω → R+ × R est solution
d’un problème variationnel. Trouver la fonctionnelle d’energie et étudier l’unicité de la
solution.
4) Approximation par la méthode des éléments finis. Il s’agit d’utiliser la méthode de
Galerkin et un espace de dimension finie construit avec la méthode des éléments finis P2.
Utilisation d’un code FreeFem++ afin d’obtenir la solution approximative.
5) Présentation des résultats numériques - Il s’agit d’une présentation graphique des
déplacements, des déformations, des contraintes et du module de leur déviateur.
41
2.4.1 Ecrasement d’un tube
3
H
pe pi
kH kH kH
pe
pi 4 2
pe pi
pe Ω
pi
pe
0 r
1
Ri
Re
On se propose d’étudier la déformation statique d’un tube entre deux plaques par-
allèles planes et rigides. La pièce, qui est rapportée à un système d’axes orthonormés
Oxyz, est definie dans les coordonnées cylindriques par {(r, z) ∈ Ω; θ ∈ [0, 2π[}, avec
Ω =]Ri , Re [×]0, H[ ooù Ri , Re sont les rayons intérieur et extérieur du cylindre et H est
sa hauteur. Les faces z = 0 et z = H sont en contact sans frottement (contraintes tan-
gentielles nulles) avec deux plaques parallèles rigides (pas de variation de déplacement
normal entre la pièce et les plaques). La plaque z = 0 est fixée et la plaque z = H a un
déplacement −hkez . Sur les parois intérieur (r = Ri ) et extérieur (r = Re ) s’exercent les
pressions pi et pe . Les forces volumiques (le pesanteur) sont négligeables et le matériau
est supposée élastique linéaire, homogène et isotrope.
iii) Supposons que pi = pe = 0. Calculer T > 0 le plus grand pour lequel pour
0 < k < T le comportement du materiau reste élastique suivant le critére de von Mises
(|σ D | < τ0 ).
42
2.4.2 Compression triaxiale d’un cylindre creux
F F
F H
F 3
4
p
2
p
p Rs r
0
p
p 5 Ω
p
F 6
F -H 1 F R
c
F
Calculer T > 0 le plus grand pour lequel pour 0 < t < T le comportement du materiau
reste élastique suivant le critére de von Mises (|σ D | < τ0 ).
......................................................................
43
3 Static problems in nonlinear elasticity
D n
x
da
N
c
dA
X
Euler configuration
D0
Lagrange configuration
The deformation gradient tensor is F = F (χ), its Jacobien will be denote by J = J(χ),
and the right and left Cauchy-Green tensors will be denoted by C, B while the (large)
deformation is denoted by E, i.e.
1
F (χ) = ∇X χ, J = det(F ), C = FTF, B = FFT, E(χ) = (F T F − I),
2
∂
where ∇X = ⊗ cK is the gradient operator with respect to the Lagrangian config-
∂XK
uration. The Nanson formulae reads
where we have denoted by dv, dV the volume, by da, dA the aria elements and by n, N
44
the unit exterior normals, in Eulerian and Lagrangian configurations respectively.
C (right Cauchy-Green)
Lagrange configuration E (deformation tensor) Lagrange configuration
F (d
efor
mat
ion
grad
ient
)
Euler configuration B (left Cauchy-Green) Euler configuration
J(X)ρ(x) = ρ0 (X),
Π = JσF −T , σn da = ΠN dA,
and the equilibrium equations (momentum balance law) in Lagrange variables reads
divX Π + ρ0 b = 0,
45
∂
where divX (·) = (·cK ) is the divergence in the Lagrangian variables.
∂XK
Finally let S : D0 → Rd×d be the second Piola-Kirchhoff (PK2) stress tensor which is
symmetric (S = S T ) and is related to the other two stress tensors through
S = JF −1 σF −T = F −1 Π, Π = F S.
S (PK2)
Lagrange configuration Lagrange configuration
P (P K
1)
Euler configuration
s (Cauchy) Euler configuration
Figure 27: Diagram of stress tensors as linear applications from a configuration to another
one.
A material is said to be elastic if the the second Piola-Kirchhoff (PK2) stress tensor S
at any particle X is a function of the deformation tensor E associated to this particle,
i.e. there exists A : D0 × Rd×d → Rd×d such that
If in addition to the elasticity assumption we suppose that the material does dot dissipate
energy during cyclic deformations we find the class of hyper-elastic materials for which
there exits an elastic (energy) potential W : D0 × Rd×d → R such that
∂W
A(X, E) = .
∂E
For isotropic hyper-elastic materials the energy depends only on three scalars IE =
1
trace(E), IIE = (|E|2 − IE2 ) and IIIE = det E, the three invariants of E, i.e.
2
46
and after some computation we find that
A(E) = c0 (IE , IIE , IIIE )I + c1 (IE , IIE , IIIE )S + c2 (IE , IIE , IIIE )S 2 ,
∂W ∂W ∂W ∂W ∂W ∂W
c0 = − IE − IIE , c1 = − IE , c2 = .
∂IE ∂IIE ∂IIIE ∂IIE ∂IIIE ∂IIIE
1
W (E) = (λ + 2µ)IE2 + 2µIIE , A(E) = λIE I + 2µE,
2
1 l + 2m 3
W (E) = (λ + 2µ)IE2 + 2µIIE + IE + 2mIE IIE + nIIIE ,
2 3
Let ∂D0 = Γd ∪ Γc and let consider the boundary value problem: find χ : D0 → Rd (the
Eulerian position) solution of
1
E(χ) = (F (χ)T F (χ) − I) in D0 , (nonlinear deformation operator)
2
where N is the exterior unit normal on ∂D0 . The functions b (body forces), ρ0 (the mass
density), χ0 (imposed positions), and f (imposed stresses, dead loads) are given.
47
3.2.2 Variational formulation
Let
U ad = {v : D → Rd continuous ; v = χ0 on Γd }
V = {v : D → Rd continuous ; v = 0 on Γd }
To formulate the finite element approximation of the above problem let Vh be the finite
element space and let U ad ad
h = Vh ∩ U , V h = Vh ∩ V. Then the Galerkin (internal)
approximation of (P V ) is
For the simplicity we will use in the next the notations χ, v instead of χh , vh .
48
where the bilinear and linear forms aχ , lχ are given by
χn+1 = χn + un .
d
where A0 (E)A = A(E + tA)|t=0 is the derivative of A(E) with respect to E while
dt
E (χ)(w) is the derivative of E(χ) with respect to χ is given by
0
1
E 0 (χ)(w) = (∇TX wF (χ) + F T (χ)∇X w).
2
Let us suppose in the following that boundary conditions and the external forces are
depending on parameter t. This parameter could be the time (quasi-static evolution) or
an artificial loading parameter. In the later case it is related to a computing strategy
which will provides a good initial to assure the convergence of the Newton algorithm.
We are looking for χ : [0, T ]×D0 → Rd (the Eulerian position at any "time" ) solution
of
1
E(χ(t)) = (F (χ(t))T F (χ(t)) − I) in D0 , (nonlinear deformation operator)
2
The functions b(t) (body forces) abd χ0 (t) (imposed positions), and f (t) (imposed
stresses, dead loads) are given at any "time" t.
49
Let
U ad (t) = {v : D → Rd continuous ; v = χ0 (t) on Γd }
As before we can formulate the finite element approximation of the above problem by
considering U ad
h (t) = Vh ∩ U (t) at any time t. For the simplicity we will use in the next
ad
ad
(dV P )t χ̇(t) ∈ U̇ (t), ˙
F 0 (χ(t))(χ̇(t), v) − l(t)(v) = 0, for all v ∈ V,
ad
U̇ (t) = {v : D → Rd continuous ; v = χ̇0 (t) on Γd },
Z Z
˙
l(t)(v) = ρ0 ḃ(t) · v dV + f˙(t) · v dA.
D0 Γc
Euler discretization. Let us discretize the parameter interval [0, T ] into M subin-
tervals denoted by [tk , tk+1 ] with t0 = 0 and tM = T and let us denote by χk the
"approximation" of χ(tk ). Using the explicit Euler discretization
one can find an excellent guess χ0k+1 for the Newton method which will compute χk+1 ,
the solution at t = tk+1 , by solving the linear equation for χ̇(tk+1 ). To be more precisely,
let first denote by
Z Z
δlk (v) = ρ0 [b(tk ) − (b(tk−1 )] · v dV + [f (tk ) − f (tk−1 )] · v dA.
D0 Γc
50
δU k = {v : D → Rd continuous ; v = χ0 (tk ) − χ0 (tk−1 ) on Γd },
2b) Predict the solution by given an initial guess for the Newton algorithm
χn+1
k = χnk + unk .
2d) Newton Algorithm stops when the relative error enk = ||unk || is sufficiently
small, let say for n = nek .
3) Update the parameter solution
ne
χk = χk k
51
3.3 Two dimensional problems
In we focus here to the plane deformation χx = χx (X, Y ), χy = χy (X, Y ), χz = Z or
plane stress configurations.
3 b
-a a 2
x
4
1 -b
We are modeling the in-plane large deformation of an elastic diving board. The diving
board, which occupies the domain D0 = Ω0 × R is infinite in the OZ direction and has a
rectangular shape Ω0 = (−a, a)×(−b, b) ⊂ R2 in the OXY plane, with a = 5 and b = 0.5.
The elastic material is homogeneous, isotropic and modeled by the Saint-Venant-Kirchoff
constitutive law with E = 1 and ν = 0.36. On the sides y = −b (label 1) and on
x = a (label 2) the loads a vanishing while on the side y = −b (label 3) the load is
f = (0, fy (x), 0), where fy (x) = 0 if x < 0.9a and fy (x) = −f if x > 0.9a, with f = 0.01.
On the side x = −a (label 4) the diving board is the clamped (vanishing displacements).
The body forces b are considered to be negligible.
1) Equation setting. Write the equations, their mechanical interpretation, and the
boundary conditions.
1
E(χ) = (F (χ)T F (χ) − I) in Ω0 , (nonlinear deformation operator)
2
52
Π(χ) = F (χ)(λIE(χ) I + 2µE(χ)) in Ω0 (elastic law)
χ = (X, Y ) on 4,
V = {v : D → R2 continuous ; v = 0 on 4},
Z
l(v) = fy vy dA.
3
53
///////////////////
//Newton parameters
int nN=0,NewtonMax=50;real tol=0.0000001;
/////////External force
real f=0.01;
/////////////Newton problem
problem Newton2D(ux,uy, vx,vy)=
int2d(Th)(TBL(Xix,Xiy,ux,uy, vx,vy))// bilinear term aχ (w, v) in macros
+int2d(Th)(TL(Xix,Xiy,vx,vy)) //linear term F(χ)(v) in macros
-int1d(Th,3)(-f*vy*(x>0.9*a)) // load term l(v)
+on(4,ux=0,uy=0); // boundary conditions included in V
//initialisation
Xix=x;Xiy=y;
///////Begin Newton Loop
for(nN=0;nN<NewtonMax;nN++)
//update
Xixo=Xix;Xiyo=Xiy;
////solve Newton
Newton2D;
////////////Compute the new configuration
Xix=Xixo+ux; Xiy=Xiyo+uy;
////////compute error
real error=sqrt( int2d(Th)(ux*ux+uy*uy)/
(int2d(Th)((Xix-x)*(Xix-x)+(Xiy-y)*(Xiy-y))+0.0000000000000000001));
cout «"iteration="«nN«" error="«error«endl;
///stop criterion
if(error<tol) break;
/////End Newton Loop
//////////////////////////////////
Visualization ParaView
//////////////////////////////////
////////////Final Visualization
pres=(S11(Xix,Xiy)+S22(Xix,Xiy)+S33(Xix,Xiy))/3; // mean stress
54
dev=sqrt((S11(Xix,Xiy)-pres)*(S11(Xix,Xiy)-pres)+
(S22(Xix,Xiy)-pres)*S22(Xix,Xiy)-pres)+(S33(Xix,Xiy)-pres)*(S33(Xix,Xiy)-
pres)+2*S12(Xix,Xiy)*S12(Xix,Xiy)); /// stress deviator
NameFile="Final.ResultsBeam.vtk";
include "VisualizationPlane.edp"
////////////////////////////////////////////
6) Comparison with the linear approach. Compute the solution using the linear model
(small perturbations assumption and Hooke law) and compare it with the solution of the
nonlinear problem.
Figure 29: The plane deformation of a diving board: visualization ParaView of the mesh,
of the solution of the linear model (red) and of the nonlinear model with the deviator of
the PK2 stress tensor in color scale.
Z Z
Rx = (ΠxX NX + ΠxY NY ) dA, Ry = (ΠyX NX + ΠyY NY ) dA,
4 4
55
real Rx=int1d(Th,4)(Pi11(Xix,Xiy)*N.x+Pi12(Xix,Xiy)*N.y);
real Ry=int1d(Th,4)(Pi21(Xix,Xiy)*N.x+Pi22(Xix,Xiy)*N.y);
cout«"Rx="«Rx«" Ry="«Ry«endl;
8) Incremental loading. Use the incremental loading to compute the deformation for
f = 0.02.
3
b
-a a
x
4 2
-b
1
We are modeling the in-plane large deformation of an elastic floor. The floor, which
occupies the domain D0 = Ω0 × R is infinite in the OZ direction and has a rectangular
shape Ω0 = (−a, a)×(−b, b) ∈ R2 in the OXY plane, with a = 10 and b = 0.5. The elastic
material is homogeneous, isotropic and modeled by the Saint-Venant-Kirchoff constitutive
law with E = 1 and ν = 0.36. On the side y = −b (label 1) the loads a vanishing while
on the side y = −b (label 3) the load is non-uniform f = (0, fy (X), 0), where fy (X) = tf ,
if |X| < a/5 (f = 0.1, t ∈ (0, 1)) and fy (X) = 0, if |X| > a/5. On the sides x = −a
and x = a (label 4 and 2) the floor is the clamped (vanishing displacements). The body
forces b are considered to be negligible.
56
Figure 31: The in-plane deformation of a floor with a nonuniform loading: visualization
ParaView of the mesh, of the solution of the nonlinear model with the deviator of the PK2
stress tensor in color scale for different values of the loading parameter t = 1/8, 3/8, 1.
x
4 Ri 2 Re
We are modeling the in-plane folding of a semicircle. The semicircle, which occupies
the domain D0 = Ω0 × R is infinite in the OZ direction and has a shape of half circular
crown Ω0 = {r ∈ (Ri , Re ), θ ∈ (π, 2π)} ⊂ R2 in the OXY plane, with Ri = 1.8 and
Re = 2. The elastic material is homogeneous, isotropic and modeled by the Saint-Venant-
Kirchoff constitutive law with E = 1 and ν = 0.36. On the sides r = Ri (label 1) and
r = Re (label 3) the loads a vanishing . On the side θ = π (label 4) the semicircle is the
57
clamped (vanishing displacements) while the side θ = 0 (label 2) is gradually translated
in the −y direction by assuming that χ0 (t, X) = (X − 2tRi , 0), for t ∈ (0, 1). The body
forces b are considered to be negligible.
58
3.3.4 Squeezing an empty square
42 3
5
5
4 2 x
22
1
We are modeling the in-plane squeezing an empty square. The empty square, which
occupies the domain D0 = Ω0 × R is infinite in the OZ direction and has a shape of
square with a circular hole and without two corners Ω0 = (−a, a) × (−a, a) \ ({|(x, y)| <
R} ∪ {|(x, y) − (−a, a)| < r} ∪ {|(x, y) − (a, −a)| < r}) ⊂ R2 in the OXY plane, with
a = 5, r = 0.5 and R = 4. The elastic material is homogeneous, isotropic and modeled by
the Saint-Venant-Kirchoff constitutive law with E = 1 and ν = 0.36. On all sides (labels
1,2,3,4 and 5) the loads a vanishing . The two corners (label 22 and 42) are gradually
√ √
translated in the (− 2/2, 2/2) direction by assuming that for any t ∈ (0, 0.9R) the
√ √
position is given by χ0 (t, X, Y ) = (X − t 2/2, Y + t 2/2) on 22 and χ0 (t, X, Y ) =
√ √
(X + t 2/2, Y − t 2/2) on 42. The body forces b are considered to be negligible.
59
Figure 35: The in-plane squeezing of an empty square: visualization ParaView of the
mesh, a of the solution at different stages of the loading with the deviator of the PK2
stress tensor in color scale.
We are modeling the in-plane large deformation of an elastic planar sheet to wrap a
cylinder of radius R = 10. The planar sheet, which occupies the domain D0 = Ω0 × R
is infinite in the OZ direction and has a rectangular shape Ω0 = (−a, a) × (−b, b) ∈ R2
in the OXY plane, with a = πR and b = 0.4. The elastic material is homogeneous,
isotropic and modeled by the Saint-Venant-Kirchoff constitutive law with E = 1 and
ν = 0.36. On the side Y = b (label 3) the loads are vanishing while on the side Y = −b
(label 3) the boundary conditions depends on a loading increasing parameter t ∈ (0, 1).
For X < −a + D(t) the planar sheet is clamped (vanishing displacements) while for
X > −a + D(t) the loads are vanishing, where D(t) = 2a(1 − t). On the side X = −a
(label 4 ) the planar sheet is clamped (vanishing displacements) while on the side X = a
(label 2) the position
is imposed to wrap the cylinder. The body forces b are considered to be negligible.
60
y
D(t)
-a b 3 a
x
4 -b 2
1
Figure 36: The in-plane wrapping a cylinder with a planar sheet: schematic representa-
tion.
Figure 37: The in-plane wrapping a cylinder with a planar sheet: visualization ParaView
of the mesh and of the nonlinear model with the deviator of the PK2 stress tensor in
color scale for different values of loading parameter t.
61
4 Appendix
62
macro Ed11(u1,u2,varu1,varu2) (0.5*(FTNv11(u1,u2,varu1,varu2)+FTNv11(u1,u2,varu1,varu2)))//
macro Ed12(u1,u2,varu1,varu2) (0.5*(FTNv12(u1,u2,varu1,varu2)+FTNv21(u1,u2,varu1,varu2)))//
///////////////////////////////////////
macro Ed21(u1,u2,varu1,varu2) (0.5*(FTNv21(u1,u2,varu1,varu2)+FTNv12(u1,u2,varu1,varu2)))//
macro Ed22(u1,u2,varu1,varu2) (0.5*(FTNv22(u1,u2,varu1,varu2)+FTNv22(u1,u2,varu1,varu2)))//
/////////////////////////////////////////////////////////////////////////////
/////////T race(E 0 (u)(w))///////////////
macro TrEd(u1,u2,varu1,varu2) (Ed11(u1,u2,varu1,varu2)+Ed22(u1,u2,varu1,varu2))//
////////////////////////////////////////////////////////////////////
// Macros for the linear form S(u) : (F T (u)∇X v)
//=====================================
macro TL(u1,u2,v1,v2)( S11(u1,u2)*FTNv11(u1,u2,v1,v2)+S12(u1,u2)*FTNv12(u1,u2,v1,v2)+
S21(u1,u2)*FTNv21(u1,u2,v1,v2)+S22(u1,u2)*FTNv22(u1,u2,v1,v2) )//
// Macros for the bilinear form
//========================================
// First term : S(u) : (∇TX w∇X v)
macro TBL1(u1,u2,varu1,varu2,v1,v2)(
S11(u1,u2)*NuTNv11(varu1,varu2,v1,v2) + S12(u1,u2)*NuTNv12(varu1,varu2,v1,v2) +
S21(u1,u2)*NuTNv21(varu1,varu2,v1,v2) + S22(u1,u2)*NuTNv22(varu1,varu2,v1,v2) )//
//=====================================================
// Second term : S 0 (u)E 0 (u)(w) : ∇X v
macro TBL2(u1,u2,varu1,varu2,v1,v2)(
SD11(u1,u2,varu1,varu2)*FTNv11(u1,u2,v1,v2)+SD12(u1,u2,varu1,varu2)*FTNv12(u1,u2,v1,v2)+
SD21(u1,u2,varu1,varu2)*FTNv21(u1,u2,v1,v2)+SD22(u1,u2,varu1,varu2)*FTNv22(u1,u2,v1,v2) )//
// Macros for the bilinear form
macro TBL(u1,u2,varu1,varu2,v1,v2) (TBL1(u1,u2,varu1,varu2,v1,v2)+TBL2(u1,u2,varu1,varu2,v1,v2))//
///////////////// Π(u) = F (u)S(u)
macro Pi11(u1,u2)(F11(u1,u2)*S11(u1,u2)+F12(u1,u2)*S21(u1,u2))//
macro Pi22(u1,u2)(F21(u1,u2)*S12(u1,u2)+F22(u1,u2)*S22(u1,u2))//
macro Pi12(u1,u2)(F11(u1,u2)*S12(u1,u2)+F12(u1,u2)*S22(u1,u2))//
macro Pi21(u1,u2)(F21(u1,u2)*S11(u1,u2)+F22(u1,u2)*S21(u1,u2))//
macro Pi33(u1,u2)(S33(u1,u2))//
63
///////////////////////////////////////////////////////////////////////////////////////////
// tangent operator of SVK : S 0 (u)(E 0 (u)(w)) = λtrace(E 0 (u)(w))I + 2µE 0 (u)(w)
macro SD11(u1,u2,varu1,varu2) (lambda*TrEd(u1,u2,varu1,varu2)+2*mu*Ed11(u1,u2,varu1,varu2))//
macro SD22(u1,u2,varu1,varu2) (lambda*TrEd(u1,u2,varu1,varu2)+2*mu*Ed22(u1,u2,varu1,varu2))//
macro SD12(u1,u2,varu1,varu2) (2*mu*Ed12(u1,u2,varu1,varu2))//
macro SD21(u1,u2,varu1,varu2) (2*mu*Ed21(u1,u2,varu1,varu2))//
64