Re: [petsc-users] Error with KSPSetUp and MatNest

2019-04-11 Thread Klaij, Christiaan via petsc-users
euvring-vessel-trials-held-on-North-Sea.htm> From: Matthew Knepley Sent: Thursday, April 11, 2019 2:16 PM To: Klaij, Christiaan Cc: petsc-users@mcs.anl.gov Subject: Re: [petsc-users] Error with KSPSetUp and MatNest On Thu, Apr 11, 2019 at 7:51 AM Klaij, Christiaan v

Re: [petsc-users] Error with KSPSetUp and MatNest

2019-04-11 Thread Klaij, Christiaan via petsc-users
Matt, As a happy MATNEST user, I got a bit worried when you wrote "we should remove MatCreateNest() completely". This happened last time I tried to use AIJ instead: https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2016-August/029973.html Has this problem been fixed in the meantime? Chris >

Re: [petsc-users] Error with KSPSetUp and MatNest

2019-04-11 Thread Manuel Colera Rico via petsc-users
OK, many thanks, Manuel --- On 4/11/19 12:07 PM, Matthew Knepley wrote: On Thu, Apr 11, 2019 at 5:57 AM Manuel Colera Rico > wrote: MatCreateLocalRef() seems to be useful to extract submatrices from a global matrix. But how to construct A from the beginning

Re: [petsc-users] Error with KSPSetUp and MatNest

2019-04-11 Thread Manuel Colera Rico via petsc-users
MatCreateLocalRef() seems to be useful to extract submatrices from a global matrix. But how to construct A from the beginning from its submatrices? I.e., with MatNest, I can just do:     Mat A;     Mat matA[] = {A00, A01, NULL, A11};     MatCreateNest(PETSC_COMM_SELF, 2, NULL, 2, NULL, matA,

Re: [petsc-users] Error with KSPSetUp and MatNest

2019-04-11 Thread Smith, Barry F. via petsc-users
Matt, You can't have some functionality in the public API for a library and then criticize someone for using it. I looked at the manual page for MatCreateNest() and it doesn't say in big letters "don't use this", nor does the compiler tell the user "don't use this". Either

Re: [petsc-users] Error with KSPSetUp and MatNest

2019-04-10 Thread Smith, Barry F. via petsc-users
Here is my guess at what is going wrong (and if it is the case we should figure out how to fix it). The KSPSetUp() is triggering the creation of work vectors and the type of work vector created at this point is not compatible with the vectors passed into KSPSolve() thus generating an error.

Re: [petsc-users] Error with KSPSetUp and MatNest

2019-04-10 Thread Matthew Knepley via petsc-users
On Wed, Apr 10, 2019 at 12:49 PM Manuel Colera Rico wrote: > Thank you for your answer, Matt. In the MWE example attached before, both > Nest vectors (the r.h.s. of the system and the vector of unknowns) are > composed of the same number of blocks (2). Indeed, PETSc is able to solve > the system

Re: [petsc-users] Error with KSPSetUp and MatNest

2019-04-10 Thread Manuel Colera Rico via petsc-users
Thank you for your answer, Matt. In the MWE example attached before, both Nest vectors (the r.h.s. of the system and the vector of unknowns) are composed of the same number of blocks (2). Indeed, PETSc is able to solve the system if KSPSetUp() is not called, so the system/MatNest/MatVec's must

[petsc-users] Error with KSPSetUp and MatNest

2019-04-10 Thread Manuel Colera Rico via petsc-users
Hello, I am trying to solve a system whose matrix is of type MatNest. If I don't use KSPSetUp(), everything is fine. However, if I use that routine, I get the following error: 0]PETSC ERROR: - Error Message --