Choral
|
Go to the source code of this file.
Functions/Subroutines | |
program | poisson_2d |
SOLVES THE POISSON PROBLEM with homogeneous Neumann boundary conditions More... | |
real(rp) function | f (x) |
Right hand side 'f'. More... | |
real(rp) function | u (x) |
Exact solution 'u'. More... | |
real(rp) function, dimension(3) | grad_u (x) |
Gradient of the exact solution. More... | |
real(rp) function poisson_2d::f | ( | real(rp), dimension(3), intent(in) | x | ) |
Right hand side 'f'.
Definition at line 248 of file poisson_2d.f90.
real(rp) function, dimension(3) poisson_2d::grad_u | ( | real(rp), dimension(3), intent(in) | x | ) |
Gradient of the exact solution.
Definition at line 273 of file poisson_2d.f90.
program poisson_2d | ( | ) |
SOLVES THE POISSON PROBLEM with homogeneous Neumann boundary conditions
\(~~~~~~~~~ -\Delta u + u = f ~~~\) on \(~~~ \Omega= [0,1]^2 \)
\(~~~~~~~~~~ \nabla u.n = 0 ~~~\) on \(~~~\Gamma = \partial \Omega ~~~\)
VARIATIONAL FORMULATION (Numerical probelm)
\[ \int_\Omega \nabla u\cdot\nabla v \,\dx ~+~ \int_\Omega u\, v \,\dx ~=~ \int_\Omega f \, v \,\dx \]
NUMERICAL RESOLUTION
The basis functions are \( (v_i)_{1\le i\le N} \) (basis of \(X_h\)).
\[ S =[s_{i,\,j}]_{1\le i,\,j\le N}, \quad \quad s_{i,\,j} = \int_\Omega \nabla v_i\cdot\nabla v_j \,\dx \]
\[ M =[s_{i,\,j}]_{1\le i,\,j\le N}, \quad \quad m_{i,\,j} = \int_\Omega v_i\, v_j \,\dx \]
\[ F = (f_i)_{1\le i\le N}, \quad \quad f_i = \int_\Omega f \, v_i \,\dx \]
\[ (M+S) U_h = F \]
POST TREATMENT
\[ \int_\Omega |u-u_h|^2 \dx~,\quad\quad \int_\Omega |\nabla u-\nabla u_h|^2 \dx \]
Charles PIERRE, September 2020
Definition at line 62 of file poisson_2d.f90.
real(rp) function poisson_2d::u | ( | real(rp), dimension(3), intent(in) | x | ) |
Exact solution 'u'.
Definition at line 261 of file poisson_2d.f90.