[petsc-users] Issue to set values to a matrix in parallel in python

2022-08-09 Thread Thomas Saigre
Hi, I've been trying for a few weeks to construct a matrix from a list of vectors, unsuccessfully. Here is my problem : I have a list l a petsc4py.Vec, each vector has a size n, and I have d vectors. I want to "cast" these vectors to a petsc4py.Mat Z of shape (n,d), where Z[:, i] = l[i] (using

Re: [petsc-users] Issue to set values to a matrix in parallel in python

2022-08-09 Thread Stefano Zampini
PETSc distributes matrices and vectors in parallel. Take a look at https://petsc.org/release/docs/manualpages/Vec/VecGetOwnershipRange.html > On Aug 9, 2022, at 11:21 AM, Thomas Saigre wrote: > > Hi, > > I've been trying for a few weeks to construct a matrix from a list of > vectors, unsucces

Re: [petsc-users] Issue to set values to a matrix in parallel in python

2022-08-09 Thread Matthew Knepley
On Tue, Aug 9, 2022 at 11:12 AM Stefano Zampini wrote: > PETSc distributes matrices and vectors in parallel. Take a look at > https://petsc.org/release/docs/manualpages/Vec/VecGetOwnershipRange.html Longer explanation: Vectors are distributed by giving a stretch of contiguous rows to each proc