[petsc-users] KSPBuildSolution

Jed Brown jed at 59A2.org
Wed Feb 16 13:49:33 CST 2011


On Wed, Feb 16, 2011 at 20:39, Juha Jäykkä <juhaj at iki.fi> wrote:

> Which function, F(u) or my u*, which satisfies F(u*)=0? I.e. the unknown or
> the function evaluated by FormFunction?
>
> I find it unlikely that the solution would not be at least twice
> differentiable (apart from the endpoints, where it is not): it is almost
> guaranteed to be since the equation is the Euler-Lagrange equation of a
> well
> behaved action integral.
>
> As for F(u), the function is a polynomial of u and x (x being the
> coordinate),
> so it is smooth, if u is.
>

We just want F(u) to be continuously differentiable as a function from R^n
to R^n (were n is the size of u).


>
> > Unlikely possibility #3:
> >
> >   You have written an equation with no real solutions, meaning there is a
> > mistake in your function.
>
> But my initial guess is an exact solution.
>

So the initial SNES residual is nearly zero? Then the differencing and the
solve could be dominated by rounding error.


> I have two free parameters in the
> equation and for a single choice I can find an exact solution - it happens
> to
> be u(x) = x, so the discrete derivatives are exactly the same as the
> continuous ones (apart from floating point rounding errors, of course).
>
> Now, it is quite possible that my problem is poorly scaled or
> ill-conditioned,
> like Jed Brown suggested. Can I check the eigenvalues of the KSP matrices
> somehow?
>

There are a few ways to do it automatically as part of the solve. These
shows you spectral information for the preconditioned operator so run with
-pc_type none to see the true spectrum. You typically need to use GMRES for
these to work:

  -ksp_monitor_singular_value <stdout>: Monitor singular values
(KSPMonitorSet)
  -ksp_compute_singularvalues: <FALSE> Compute singular values of
preconditioned operator (KSPSetComputeSingularValues)
  -ksp_compute_eigenvalues: <FALSE> Compute eigenvalues of preconditioned
operator (KSPSetComputeSingularValues)
  -ksp_plot_eigenvalues: <FALSE> Scatter plot extreme eigenvalues
(KSPSetComputeSingularValues)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110216/de3e42d0/attachment.htm>


More information about the petsc-users mailing list