35 integer,
parameter :: verb = 2
41 character(len=150) :: msh_file
57 write(*,*)
'quadMesh_integral: start' 59 write(*,*)
" INTEGRAL COMPITATION ON A MESH OF [0,1]x[0,1]" 60 write(*,*)
" - \Omega = [0,1]x[0,1] " 61 write(*,*)
" - \Gamma = \partial \Omega \cap {x=1} " 62 write(*,*)
" - \Gamma_r = \Gamma \cap {x=1} " 68 msh_file = trim(gmsh_dir)//
"square/square_3.msh" 72 write(*,*)
"================================== ASSEMBLING THE MESH " 73 msh = mesh(trim(msh_file),
"gmsh")
74 if (verb>1)
call print(msh)
77 write(*,*)
"================================== INTEGRAL 1" 79 write(*,*)
"= integration domain = \Omega " 94 if (verb>1)
call print(qdm)
98 int = integ(
func, qdm)
99 print*,
" COMPUTED INTEGRAL = ", int
100 print*,
" NUMERICAL ERROR = ", &
101 & abs(int - 2._rp/3._rp)
106 write(*,*)
"================================== INTEGRAL 2" 108 write(*,*)
"= integration domain = \Gamma " 123 if (verb>1)
call print(qdm)
127 int = integ(
func, qdm)
128 print*,
" COMPUTED INTEGRAL = ", int
129 print*,
" NUMERICAL ERROR = ", &
130 & abs(int - 10._rp/3._rp)
134 write(*,*)
"================================== INTEGRAL 3" 136 write(*,*)
"= integration domain = \Gamma_r = \Gamma \ cap {x >= 1} " 151 if (verb>1)
call print(qdm)
155 int = integ(
func, qdm)
156 print*,
" COMPUTED INTEGRAL = ", int
157 print*,
" NUMERICAL ERROR = ", &
158 & abs(int - 4._rp/3._rp)
162 write(*,*)
"================================== INTEGRAL 4" 164 write(*,*)
"= integration domain = \Gamma_r \cup \Omega " 165 write(*,*)
"= (composite integration domain)" 185 if (verb>1)
call print(qdm)
189 int = integ(
func, qdm)
190 print*,
" COMPUTED INTEGRAL =", int
191 print*,
" NUMERICAL ERROR = ", &
202 real(RP),
dimension(3),
intent(in) :: x
204 func = x(1)**2 + x(2)**2
210 function x_ge_1(x)
result(r)
212 real(RP),
dimension(3),
intent(in) :: x
real(rp) function x_ge_1(x)
To characterise {x=1}.
subroutine, public choral_init(verb)
Initialisation for the CHORAL library
TOP-LEVEL MODULE FOR THE LIBRARY CHORAL
real(rp) function func(x)
integer, parameter quad_gauss_edg_3
integer, parameter quad_gauss_trg_6
program quadmesh_integral
Integration methods on meshes quadMesh: