Re: [petsc-users] How to create a local to global mapping and construct matrix correctly

2016-09-16 Thread Barry Smith
> On Sep 16, 2016, at 9:00 PM, Ji Zhang wrote: > > Thanks for your previous suggestion and the construction from little m to big > M have accomplished. > > For a MPI program, a arbitrary matrix is been shorted in different cups (i.e. > 3), and each cup only contain part of then. So I think t

Re: [petsc-users] How to create a local to global mapping and construct matrix correctly

2016-09-16 Thread Ji Zhang
Thanks for your previous suggestion and the construction from little m to big M have accomplished. For a MPI program, a arbitrary matrix is been shorted in different cups (i.e. 3), and each cup only contain part of then. So I think the matrix have two kinds of indexes, a local one indicate the loc

Re: [petsc-users] How to create a local to global mapping and construct matrix correctly

2016-09-16 Thread Barry Smith
> On Sep 16, 2016, at 7:52 PM, Ji Zhang wrote: > > Sorry. What I mean is that, for example, I have a matrix > [a1, a2, a3] > mij = [b1, b2, b3] , > [c1, c2, c3] > and using 3 cups. Thus, mij in cpu 2 is > mij_2 = [b1, b2, b3] . > > The local index of element b

Re: [petsc-users] How to create a local to global mapping and construct matrix correctly

2016-09-16 Thread Ji Zhang
Sorry. What I mean is that, for example, I have a matrix [a1, a2, a3] mij = [b1, b2, b3] , [c1, c2, c3] and using 3 cups. Thus, mij in cpu 2 is mij_2 = [b1, b2, b3] . The local index of element b1 is (1, 1) and it's global index is (2, 1). How can I get the global i

Re: [petsc-users] How to create a local to global mapping and construct matrix correctly

2016-09-16 Thread Barry Smith
"Gives wrong answers" is not very informative. What answer do you expect and what answer do you get? Note that each process is looping over mSizes? for i in range(len(mSizes)): for j in range(len(mSizes)): Is this what you want? It doesn't seem likely that you want all processes to