[petsc-users] neumann failure in my version of snes ex12

Geoffrey Irving irving at naml.us
Fri Nov 22 18:25:25 CST 2013


On Fri, Nov 22, 2013 at 4:17 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> Geoffrey Irving <irving at naml.us> writes:
>> Here are results with -ksp_monitor_true_residual -pc_type none:
>>
>>     http://naml.us/random/laplace-rtol.txt # with -ksp_rtol 1e-5
>>     http://naml.us/random/laplace-atol.txt # with -ksp_atol 1e-5
>
> Looks like the preconditioner is singular.

The preconditioner is none: -pc_type none.

>> Both versions converge in 3 iterations for the first SNES iteration,
>> but the relative one starts to churn after that since the residual
>> starts very small.  The true residual goes down to 4/3 and stagnates.
>> Is there a convenient way to print out the RHS to see whether it has a
>> component in the nullspace (which seems likely given the true residual
>> stagnation)?
>
> -snes_monitor_residual will plot the solution.  (This option should be
>  upgraded to support arbitrary output formats.)  You can also call
>  VecView from your residual function.
>
>> I suppose I already do print the result of SNESComputeFunction on the
>> zero vec, which is
>>
>>     RHS = [  6.66666667e-01   1.33333333e+00   6.66666667e-01   1.11022302e-16]
>
> Looks like you need to project out the null space.

Yep, I was hallucinating that analytically consistent implies
discretely consistent.

Is there a standard way to do this in the context of an SNES, where
I'm not computing the residual directly myself?  Should I write a
wrapper around DMPlexComputeResidualFEM and pass the wrapper to
DMSNESSetFunctionLocal, or is there a way to tell SNES about the
nullspace directly?  Is such a projection happening somewhere in snes
ex12?

Thanks,
Geoffrey


More information about the petsc-users mailing list