Sudden random deviation of results

Ben Tay zonexo at
Fri Dec 8 01:47:05 CST 2006


I have tested my code again, using the checks suggested by Barry. Using
KSPGetConvergedReason shows that it has converged. Changing the tol from
1.e-5 to -6 or -7 or even -4 eliminated the explosion of value at that
particular time step.

However, that is expected since the values are now different. Moreover,  for
other linear solver package, it does not happen at this particular time step
as well.

Another strange thing is that suppose the explosion of value happen at t=50.
If I store my all my relevent values at t=40 into files and restart my
simulation from t=40(instead of t=1) by reading the stored values from the
files, the explosion will now not happen at t=50. Hence it seems very random

On 12/7/06, Barry Smith <bsmith at> wrote:
> Ben,
>   First make sure that the residual has actually gotten
> to the tolerance you want. PETSc KSP does NOT stop if the
> linear system has not converged; you should call KSPGetConvergedReason()
> after each solve to make sure it has converged (as a quick check
> you can run with -ksp_converged_reason.)
> Next try decreasing the KSP tolerance factor a great deal. Does
> 1) the solution you get for your physics problem look the same for small
>   time (after a few time-steps they will start to drift).
> 2) the residual blow up at the same time, or later?
>   Barry
> On Thu, 7 Dec 2006, Ben Tay wrote:
> > Hi,
> >
> > I have been using a few different Krylov linear solver package such as
> > nspcg,sparsekit and now petsc to solve the linear eqns for my NS solver
> > momentum and poisson eqn. For moving bodies simulation, while solving
> the
> > poisson eqn, sometimes the result suddenly changes drastically, although
> the
> > iterations seems to have converged e.g. at the previous time step,
> > everything is fine, but at the next time step, the velocity suddenly
> > explodes from 2-3 to 20-30+.
> >
> > The strange thing is that this deviation happens at different time step
> for
> > different linear solver package ie for nspcg, it happens at time=20 but
> for
> > petsc, it happens at time=40. It seems "random" in this sense. Changing
> the
> > type of solver such as gmres or bcgs does not change the time of
> deviation.
> >
> > Does anyone know why this is happening? Is it a characteristic of krylov
> > solver to happen once in a while? It does not happen in the stationary
> body
> > simulation though.
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the petsc-users mailing list