<< Click to Display Table of Contents >> sine1d |
{ SINE1D.PDE
This problem compares the solution accuracy for four different levels of ERRLIM.
}
title '1D Accuracy test - Sine'
select
ngrid=10
errlim = staged(1e-2, 1e-3, 1e-4, 1e-5)
coordinates
cartesian1
variables
u
definitions
k = 1
h = 0.1
w=0.1
rs = abs(x)/w
u0 = sin(rs)/max(rs,1e-18)
s = -dxx(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) point value(u)=u0
line to (1) point value(u)=u0
monitors
elevation(u) from (-1) to (1)
plots
elevation(u,u0) from (-1) to (1)
elevation(u-u0) from (-1) to (1)
elevation(dx(u),dx(u0)) from (-1) to (1)
elevation(-div(grad(u)),s) from (-1) to (1)
histories
history(RMS_error,errlim) LOG
end