<< Click to Display Table of Contents >> sine2d |
{ SINE2D.PDE
This problem compares the solution accuracy for four different levels of ERRLIM.
}
title '2D Accuracy Test - Sine'
select
ngrid = 5
errlim = staged(1e-2, 1e-3, 1e-4, 1e-5)
variables
u
definitions
k = 1
h = 0.1
w=0.1
rs = r/w
u0 = sin(rs)/rs
s = -dxx(u0)-dyy(u0)
RMS_error = sqrt(integral((u-u0)^2)/sqrt(integral(u0^2)))
equations
U: div(K*grad(u)) +s = 0
boundaries
Region 1
start(-1,-1) value(u)=u0
line to (1,-1) to (1,1) to (-1,1) to close
monitors
grid(x,y)
contour(u)
plots
grid(x,y)
contour(u)
elevation(u,u0) from(-1,0) to (1,0)
elevation(u-u0) from(-1,0) to (1,0)
elevation(dx(u),dx(u0)) from(-1,0) to (1,0)
elevation(dxx(u),dxx(u0)) from(-1,0) to (1,0)
elevation(dxx(u)+dyy(u),-s) from(-1,0) to (1,0)
contour(dxx(u)) contour(dxy(u)) contour(dyy(u))
histories
history(RMS_error, errlim) LOG
end