[petsc-users] Convergence of different fields/equations

Barry Smith bsmith at mcs.anl.gov
Thu Oct 9 13:24:53 CDT 2014


   If your fields are nicely organized you can use VecStrideNorm() or VecStrideNormAll() to get the norms of particular fields of your residual. If they are not simply organized by stride you can use VecGetArrayRead()/VecRestoreArrayRead() to access all the fields directly and then compute the norms yourself (doing the MPI_Allreduce() to accumulate over the processes) by pulling out the entries of the vector that you need.

   Barry

On Oct 9, 2014, at 12:25 PM, Carles Bona <carlesbona at gmail.com> wrote:

> Hi all,
> 
> I am currently running petsc to solve a time-dependent nonlinear system with default options (NewtonLS, etc.). I have a question regarding convergence. My application evolves different fields and equations, which might be in different units (like temperature and velocity) and might not involve the same order of derivatives (for example second derivatives, scaling as ~1/dx^2 or first derivatives, scaling as ~1/dx). My application also has a handicap: the tangent matrix is cumbersome to calculate. 
> 
> From what I understand and I see in the source code, convergence norms are performed on the whole residual, that is, including all fields/equations. Am I wrong?
> 
> My concern is, if I am using a relative convergence criteria for the residual norm, it might happen that I am solving one of my equations very nicely and another equation shouldn't be converging yet... But just because it's dealing with a much smaller residual than the other equation from the very beginning, the residual norm is not caring about it and it's showing convergence too early (specially if I don't run with the default parameters anymore and I ask for a relative convergence of 10^-3, for example).
> 
> I have been looking at the documentation and mailing list and I haven't been able to find if there is a specific petsc option to prevent this from happening (other than setting a very restrictive relative convergence, which is painful for me as I don't have a nice tangent matrix) or if I should implement a convergence criteria myself, probably something like what has been suggested here: http://lists.mcs.anl.gov/pipermail/petsc-users/2014-August/022577.html
> 
> Thanks in advance,
> 
> Carles



More information about the petsc-users mailing list