[petsc-users] syntax for routine in PCMGSetResidual

Matthew Knepley knepley at gmail.com
Thu Nov 12 19:38:00 CST 2015


On Thu, Nov 12, 2015 at 6:47 PM, Timothée Nicolas <
timothee.nicolas at gmail.com> wrote:

> Hi all,
>
> In the manual and the documentation, the syntax for the routine to be
> given as argument of PCMGSetResidual:
>
> PCMGSetResidual <http://www.mcs.anl.gov/petsc/petsc-3.6/docs/manualpages/PC/PCMGSetResidual.html#PCMGSetResidual>(PC pc,PetscInt <http://www.mcs.anl.gov/petsc/petsc-3.6/docs/manualpages/Sys/PetscInt.html#PetscInt> l,PetscErrorCode <http://www.mcs.anl.gov/petsc/petsc-3.6/docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode> (*residual)(Mat <http://www.mcs.anl.gov/petsc/petsc-3.6/docs/manualpages/Mat/Mat.html#Mat>,Vec <http://www.mcs.anl.gov/petsc/petsc-3.6/docs/manualpages/Vec/Vec.html#Vec>,Vec <http://www.mcs.anl.gov/petsc/petsc-3.6/docs/manualpages/Vec/Vec.html#Vec>,Vec <http://www.mcs.anl.gov/petsc/petsc-3.6/docs/manualpages/Vec/Vec.html#Vec>),Mat <http://www.mcs.anl.gov/petsc/petsc-3.6/docs/manualpages/Mat/Mat.html#Mat> mat)
>
>
> is not specified. I mean that the order of the vectors is not specified. I
> suppose it is something like
> residual(Mat,b,x,r) with r = b - Mat*x, but it could as well be any
> combination like residual(Mat,r,x,b). There is no example in the
> documentation of the usage so I am confused. Does it absolutely need to be
> set ? I find the manual a bit confusing on this point. Is it only if
> matrix-free matrices are used ?
>
> In the present situation, I use matrix-free operators in a multigrid
> preconditioner (but the interpolation and restriction are not matrix free)
> and have not set this residual function yet. I get the following error:
>

Always always always give the entire error message. We want the stack.

The problem here looks like the preconditioner is reporting -1 rows for
process 13.

  Matt


> [13]PETSC ERROR: Preconditioner number of local rows -1 does not equal
> resulting vector number of rows 67584
>
> Could this be related ? By the way, I don't understand what is meant by
> the "preconditioner number of local rows". I have separately tested the
> operators at each level and they are fine.
>
> Best
>
> Timothee
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20151112/9fa15632/attachment.html>


More information about the petsc-users mailing list