Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to matmult a global IS matrix and a global vector ?

2017-05-21 Thread Stefano Zampini
Franck, PETSc takes care of doing the matrix-vector multiplication properly using MatIS. As Matt said, the layout of the vectors is the usual parallel layout. The local sizes of the MatIS matrix (i.e. the local size of the left and right vectors used in MatMult) are not the sizes of the local s

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to get local matrix (= one domain) before and after assembly ?

2017-05-21 Thread Stefano Zampini
To assemble the operator in aij format, use MatISGetMPIXAIJ http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatISGetMPIXAIJ.html Il 21 Mag 2017 18:43, "Matthew Knepley" ha scritto: > On Sun, May 21, 2017 at 11:23 AM, Franck Houssen > wrote: > >> I have a 3x3 global matrix is bui

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to matmult a global IS matrix and a global vector ?

2017-05-21 Thread Matthew Knepley
On Sun, May 21, 2017 at 11:26 AM, Franck Houssen wrote: > Using PETSc MatIS, how to matmult a global IS matrix and a global vector ? > Example is attached : I don't get what I expect that is a vector such that > proc0 = [1, 2] and proc1 = [2, 1] > 1) I think the global size of your matrix is wro

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to get local matrix (= one domain) before and after assembly ?

2017-05-21 Thread Matthew Knepley
On Sun, May 21, 2017 at 11:23 AM, Franck Houssen wrote: > I have a 3x3 global matrix is built (diag: 1, 2, 1): it's made of 2 > overlapping 2x2 local matrix (diag: 1, 1). > Getting non assembled local matrix is OK with MatISGetLocalMat. > How to get assembled local matrix (initial local matrix +

Re: [petsc-users] Is xout always already zero'ed when being called back on PCShellSetApply ?

2017-05-21 Thread Matthew Knepley
On Sun, May 21, 2017 at 11:11 AM, Franck Houssen wrote: > When using http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/ > PCShellSetApply.html, do I have the guaranty that xout from " > PetscErrorCode >

[petsc-users] Using PETSc MatIS, how to matmult a global IS matrix and a global vector ?

2017-05-21 Thread Franck Houssen
Using PETSc MatIS, how to matmult a global IS matrix and a global vector ? Example is attached : I don't get what I expect that is a vector such that proc0 = [1, 2] and proc1 = [2, 1] Franck // Using PETSc MatIS, how to matmult a global IS matrix and a global vector ? // // A 3x3 global matrix

[petsc-users] Using PETSc MatIS, how to get local matrix (= one domain) before and after assembly ?

2017-05-21 Thread Franck Houssen
I have a 3x3 global matrix is built (diag: 1, 2, 1): it's made of 2 overlapping 2x2 local matrix (diag: 1, 1). Getting non assembled local matrix is OK with MatISGetLocalMat. How to get assembled local matrix (initial local matrix + neigbhor contributions on the borders) ? (expected result is d

[petsc-users] Is xout always already zero'ed when being called back on PCShellSetApply ?

2017-05-21 Thread Franck Houssen
When using http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCShellSetApply.html, do I have the guaranty that xout from " PetscErrorCode apply ( PC pc, Vec xin, Vec xout)" has always been previously filled with zeros ? I may have to fill xout by blocks (I would += several possibly