Choral
Functions/Subroutines
elasticity_Neumann_2D.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

program elasticity_neumann_2d
  SOLVES THE LINEAR ELASTICITY PROBLEM with Neumann boundary conditions More...
 
real(rp) function lambda (x)
 Lame coefficient 'lambda'. More...
 
real(rp) function mu (x)
 Lame coefficient 'mu'. More...
 
real(rp) function u_1 (x)
 exact solution u=(u_1, u_2) More...
 
real(rp) function u_2 (x)
 
real(rp) function, dimension(3) grad_u1 (x)
 gradient of the exact solution More...
 
real(rp) function, dimension(3) grad_u2 (x)
 
real(rp) function f_1 (x)
 right hand side 'f'= =(f_1, f_2) More...
 
real(rp) function f_2 (x)
 
real(rp) function x_le_0 (x)
 To characterise {x=0}. More...
 
real(rp) function x_ge_1 (x)
 To characterise {x=1}. More...
 
real(rp) function y_le_0 (x)
 To characterise {x=0}. More...
 
real(rp) function y_ge_1 (x)
 To characterise {x=1}. More...
 
real(rp) function g_1_x_0 (x)
 g(x) on {x=0}, first component More...
 
real(rp) function g_2_x_0 (x)
 g(x) on {x=0}, second component More...
 
real(rp) function g_1_x_1 (x)
 g(x) on {x=1}, first component More...
 
real(rp) function g_2_x_1 (x)
 g(x) on {x=1}, second component More...
 
real(rp) function g_1_y_0 (x)
 g(x) on {y=0}, first component More...
 
real(rp) function g_2_y_0 (x)
 g(x) on {y=0}, second component More...
 
real(rp) function g_1_y_1 (x)
 g(x) on {y=1}, first component More...
 
real(rp) function g_2_y_1 (x)
 g(x) on {y=1}, second component More...
 

Function/Subroutine Documentation

◆ elasticity_neumann_2d()

program elasticity_neumann_2d ( )

SOLVES THE LINEAR ELASTICITY PROBLEM with Neumann boundary conditions

Search for \(u:~\Omega \mapsto \R^2\) with \( \Omega= [0,1]^2 \) that satisfies

\(~~~~~~~~~ -\dv(A(x) e(u)) = f ~~~\) on \(~~~ \Omega \)

\(~~~~~~~~~~ A(x) e(u) n = g ~~~\) on \(~~~\Gamma = \partial \Omega ~~~\) with

  • \( f:~\Omega\mapsto \R^2\)
  • \( g:~\Gamma\mapsto \R^2\) given on each side of \(\Omega\): \( \left\{\begin{array}{c} g = \text{ g_x_0 on } \Gamma \cap \{x=0\} \\ g = \text{ g_x_1 on } \Gamma \cap \{x=1\} \\ g = \text{ g_y_0 on } \Gamma \cap \{y=0\} \\ g = \text{ g_y_1 on } \Gamma \cap \{y=1\} \end{array}\right.\)


HOOKE TENSOR \( A(x)\xi = \lambda(x) Tr(\xi) Id + 2 \mu(x)\xi \) with \( \lambda,~\mu~: \Omega \mapsto \R \)


SYMMETRISED GRADIENT \( e(u) = (\nabla u + ^T\nabla u)/2 \)


PROBLEM DATA See choral/maple/example_elasticity_Neumann.mw
for the computation of the problem data.



VARIATIONAL FORMULATION find \(u\in \Hu^2\) such that \( ~~~~\forall ~v \in \Hu^2, ~~~~ \)

\[ \int_\Omega A(x) e(u):e(v) \,\dx ~=~ \int_\Omega f \cdot v \,\dx ~+~ \int_\Gamma g \cdot v \,\dx \]

with \( \xi:\zeta = \sum_{1\le i,j \le 2} \xi_{ij}\zeta_{ij}\) for the 2 matrices \( \xi~, \zeta \in \R^{2\times 2}\).



NUMERICAL RESOLUTION

  • Definition of a finite element space \( X_h \subset \Hu \)
  • Definition of the finite element space \( Y = [X_h]^2 \)
    and of the associated basis functions \( (v_i)_{1\le i\le N} \)
  • Computation of the stiffness matrix \( S =[s_{i,\,j}]_{1\le i,\,j\le N}\)

    \[ s_{i,\,j} = \int_\Omega A(x) e(v_i):e(v_j)\,\dx \]

  • Computation of the right hand side \( F = (f_i)_{1\le i\le N} \)

    \[ f_i = \int_\Omega f \cdot v_i \,\dx \]

  • Computation of the right hand side \( G = (g_i)_{1\le i\le N} \)

    \[ g_i = \int_\Gamma g \cdot v_i \,\dx \]

  • Resolution of the (non-symmetric) system

    \[ S U_h = F + G \]



POST TREATMENT

  • Computation of the numerical error between the exact solution \(u\) and the numerical solution \(u_h\),

    \[ \int_\Omega |u-u_h|^2 \dx~,\quad\quad \int_\Omega |\nabla u-\nabla u_h|^2 \dx \]

  • Graphical display of the numerical solution with gmsh

Charles PIERRE, November 2019

Definition at line 81 of file elasticity_Neumann_2D.f90.

Here is the call graph for this function:

◆ f_1()

real(rp) function elasticity_neumann_2d::f_1 ( real(rp), dimension(3), intent(in)  x)

right hand side 'f'= =(f_1, f_2)

Definition at line 373 of file elasticity_Neumann_2D.f90.

Here is the call graph for this function:

◆ f_2()

real(rp) function elasticity_neumann_2d::f_2 ( real(rp), dimension(3), intent(in)  x)

Definition at line 380 of file elasticity_Neumann_2D.f90.

Here is the call graph for this function:

◆ g_1_x_0()

real(rp) function elasticity_neumann_2d::g_1_x_0 ( real(rp), dimension(3), intent(in)  x)

g(x) on {x=0}, first component

Definition at line 434 of file elasticity_Neumann_2D.f90.

◆ g_1_x_1()

real(rp) function elasticity_neumann_2d::g_1_x_1 ( real(rp), dimension(3), intent(in)  x)

g(x) on {x=1}, first component

Definition at line 454 of file elasticity_Neumann_2D.f90.

◆ g_1_y_0()

real(rp) function elasticity_neumann_2d::g_1_y_0 ( real(rp), dimension(3), intent(in)  x)

g(x) on {y=0}, first component

Definition at line 474 of file elasticity_Neumann_2D.f90.

◆ g_1_y_1()

real(rp) function elasticity_neumann_2d::g_1_y_1 ( real(rp), dimension(3), intent(in)  x)

g(x) on {y=1}, first component

Definition at line 494 of file elasticity_Neumann_2D.f90.

◆ g_2_x_0()

real(rp) function elasticity_neumann_2d::g_2_x_0 ( real(rp), dimension(3), intent(in)  x)

g(x) on {x=0}, second component

Definition at line 444 of file elasticity_Neumann_2D.f90.

◆ g_2_x_1()

real(rp) function elasticity_neumann_2d::g_2_x_1 ( real(rp), dimension(3), intent(in)  x)

g(x) on {x=1}, second component

Definition at line 464 of file elasticity_Neumann_2D.f90.

◆ g_2_y_0()

real(rp) function elasticity_neumann_2d::g_2_y_0 ( real(rp), dimension(3), intent(in)  x)

g(x) on {y=0}, second component

Definition at line 484 of file elasticity_Neumann_2D.f90.

◆ g_2_y_1()

real(rp) function elasticity_neumann_2d::g_2_y_1 ( real(rp), dimension(3), intent(in)  x)

g(x) on {y=1}, second component

Definition at line 504 of file elasticity_Neumann_2D.f90.

◆ grad_u1()

real(rp) function, dimension(3) elasticity_neumann_2d::grad_u1 ( real(rp), dimension(3), intent(in)  x)

gradient of the exact solution

Definition at line 351 of file elasticity_Neumann_2D.f90.

◆ grad_u2()

real(rp) function, dimension(3) elasticity_neumann_2d::grad_u2 ( real(rp), dimension(3), intent(in)  x)

Definition at line 360 of file elasticity_Neumann_2D.f90.

◆ lambda()

real(rp) function elasticity_neumann_2d::lambda ( real(rp), dimension(3), intent(in)  x)

Lame coefficient 'lambda'.

Definition at line 312 of file elasticity_Neumann_2D.f90.

◆ mu()

real(rp) function elasticity_neumann_2d::mu ( real(rp), dimension(3), intent(in)  x)

Lame coefficient 'mu'.

Definition at line 322 of file elasticity_Neumann_2D.f90.

◆ u_1()

real(rp) function elasticity_neumann_2d::u_1 ( real(rp), dimension(3), intent(in)  x)

exact solution u=(u_1, u_2)

Definition at line 332 of file elasticity_Neumann_2D.f90.

◆ u_2()

real(rp) function elasticity_neumann_2d::u_2 ( real(rp), dimension(3), intent(in)  x)

Definition at line 339 of file elasticity_Neumann_2D.f90.

◆ x_ge_1()

real(rp) function elasticity_neumann_2d::x_ge_1 ( real(rp), dimension(3), intent(in)  x)

To characterise {x=1}.

Definition at line 402 of file elasticity_Neumann_2D.f90.

◆ x_le_0()

real(rp) function elasticity_neumann_2d::x_le_0 ( real(rp), dimension(3), intent(in)  x)

To characterise {x=0}.

Definition at line 391 of file elasticity_Neumann_2D.f90.

◆ y_ge_1()

real(rp) function elasticity_neumann_2d::y_ge_1 ( real(rp), dimension(3), intent(in)  x)

To characterise {x=1}.

Definition at line 423 of file elasticity_Neumann_2D.f90.

◆ y_le_0()

real(rp) function elasticity_neumann_2d::y_le_0 ( real(rp), dimension(3), intent(in)  x)

To characterise {x=0}.

Definition at line 412 of file elasticity_Neumann_2D.f90.