[petsc-users] Debugging failed solve (what's an acceptable upper bound to the condition number?)

Alex Lindsay adlinds3 at ncsu.edu
Mon Nov 23 12:29:07 CST 2015


On 11/20/2015 02:33 PM, Jed Brown wrote:
> Alex Lindsay <adlinds3 at ncsu.edu> writes:
>> I'm almost ashamed to share my condition number because I'm sure it must
>> be absurdly high. Without applying -ksp_diagonal_scale and
>> -ksp_diagonal_scale_fix, the condition number is around 1e25. When I do
>> apply those two parameters, the condition number is reduced to 1e17.
>> Even after scaling all my variable residuals so that they were all on
>> the order of unity (a suggestion on the Moose list), I still have a
>> condition number of 1e12.
> Double precision provides 16 digits of accuracy in the best case.  When
> you finite difference, the accuracy is reduced to 8 digits if the
> differencing parameter is chosen optimally.  With the condition numbers
> you're reporting, your matrix is singular up to available precision.
>
>> I have no experience with condition numbers, but knowing that perfect
>> condition number is unity, 1e12 seems unacceptable. What's an
>> acceptable upper limit on the condition number?  Is it problem
>> dependent? Having already tried scaling the individual variable
>> residuals, I'm not exactly sure what my next method would be for
>> trying to reduce the condition number.
> Singular operators are often caused by incorrect boundary conditions.
> You should try a small and simple version of your problem and find out
> why it's producing a singular (or so close to singular we can't tell)
> operator.
Could large variable values also create singular operators? I'm 
essentially solving an advection-diffusion-reaction problem for several 
species where the advection is driven by an electric field. The species 
concentrations are in a logarithmic form such that the true 
concentration is given by exp(u). With my current units (# of particles 
/ m^3) exp(u) is anywhere from 1e13 to 1e20, and thus the initial 
residuals are probably on the same order of magnitude. After I've 
assembled the total residual for each variable and before the residual 
is passed to the solver, I apply scaling to the residuals such that the 
sum of the variable residuals is around 1e3. But perhaps I lose some 
accuracy during the residual assembly process?

I'm equating "incorrect" boundary conditions to "unphysical" or 
"unrealistic" boundary conditions. Hopefully that's fair.


More information about the petsc-users mailing list