[petsc-users] Row Orderings of Mat and Vec
Hui Zhang
mike.hui.zhang at hotmail.com
Tue Jan 31 04:11:34 CST 2012
Suppose using MatCreate() and MatSetSizes() we obtain a Mat A, and then
using VecCreate() and VecSetSizes() with the same rows' arguments as A
we obtain a Vec b. Let A_i (b_i) consists of the rows owned by processor i.
Can I believe that under the ordering of petsc, the following equality holds,
A= [A_0
A_1
...
A_N],
b= [b_0
b_1
...
b_N],
i.e. A_i, b_i with smaller i--the processor number goes first?
My question comes from assembly of linear system. Suppose under my application
ordering(AO) the system is Ax=b. I can get an AO from A using
MatGetOwnershipRanges(A,&Istart,&Iend);
AOCreateBasic( -, -,app_ind, Istart..Iend, &ao_1);
and assemble A. Under the petsc ordering, A becomes P_1*A mathematically, with
P_1 the permutation corresponding to ao_1. In a similar way, we have that b
becomes P_2 b under the petsc ordering. I want to make sure P_1 and P_2 are
the same so arises my question.
Thanks a lot!
Hui
More information about the petsc-users
mailing list