[petsc-dev] 1D heat equation decay and implicit TS results

Chetan Jhurani chetan.jhurani at gmail.com
Mon Oct 1 16:06:16 CDT 2012


Hi,

I'm using petsc-dev to solve the 1D heat equation

	u_t = u_xx in [-1,1]

with zero boundary conditions and u_initial = sin(pi x).
The exact solution decays to 0.  The exact
log10(norm_inf(u)) is a linear function of t.

I use the standard 1D hat basis functions on a uniform
mesh to discretize.  The mass matrix remains tri-diagonal.

When using TS with TSTHETA (or TSBEULER) and exact linear
solves (PCLU), the FEM log10(norm_inf(u)) follows the exact
curve for around 4500 time steps and then gradually,
over a few hundred time-steps, changes slope.

See attached figure.  x axis is step number. The code is
attached too.

The results were obtained using
-ksp_type preonly -pc_type lu -ksp_atol 1e-200 -ksp_rtol 1e-200

The 1e-200 tolerances were added just to be way below the
norm scales in the problem above.

Questions:

Is it a bug in my code or is there another good explanation?

Do I need to turn on some tolerance related option to see
the exact convergence behavior for more time steps?

Chetan

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ts_test.cpp
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20121001/e934fa26/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log_u_inf.png
Type: image/png
Size: 12133 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20121001/e934fa26/attachment.png>


More information about the petsc-dev mailing list