How to copy global data to local ?

ming zhu foolishzhu at yahoo.com.cn
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);
Vecset(filter,0);VecSetValue(filter,i,1,INSERT_VALUES);
....MatMult(U, filter,ui);
If I create filter with PETSC_COMM_SELF, it is impossible for U and filter to multiply.






      ___________________________________________________________ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20091201/5d9afdcb/attachment.htm>


More information about the petsc-users mailing list