How to copy global data to local ?

ming zhu foolishzhu at
Mon Nov 30 23:21:54 CST 2009

HiI have a huge matrix U for all processors (PETSC_COMM_WORLD). I only want to copy only two rows (i,j) for each local processor. i,j is different for each processor and not related to rank.  I was trying to use a vector filter (like, 00000010000). However, if the vector is PETSC_COMM_WORLD, it will be changed by different processor. So, how to make it ?Thank you
My original code is 
Vec filterVecCreate(PETSC_COMM_WORLD,&filter);VecSetsizes(filter,PETSC_DECIDE,m);VecSetFromOptions(filter);
....MatMult(U, filter,ui);
If I create filter with PETSC_COMM_SELF, it is impossible for U and filter to multiply.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the petsc-users mailing list