Hi, So can I use multigrid directly if using matsetvalues stencil?
Thanks Sent using CloudMagic [https://cloudmagic.com/k/d/mailapp?ct=pa&cv=7.2.9&pv=5.0.2] On Tue, Aug 25, 2015 at 10:11 AM, Matthew Knepley < knep...@gmail.com [knep...@gmail.com] > wrote: On Mon, Aug 24, 2015 at 9:01 PM, Wee Beng Tay < zon...@gmail.com [zon...@gmail.com] > wrote: Sent using CloudMagic [https://cloudmagic.com/k/d/mailapp?ct=pa&cv=7.2.9&pv=5.0.2] On Mon, Aug 24, 2015 at 6:21 PM, Matthew Knepley < knep...@gmail.com [knep...@gmail.com] > wrote: On Mon, Aug 24, 2015 at 4:09 AM, Wee-Beng Tay < zon...@gmail.com [zon...@gmail.com] > wrote: Hi, I'm modifying my 3d fortran code from MPI along 1 direction (z) to MPI along 2 directions (y,z) Previously I was using MatSetValues with global indices. However, now I'm using DM and global indices is much more difficult. I come across MatSetValuesStencil or MatSetValuesLocal. So what's the difference bet the one since they both seem to work locally? No. MatSetValuesLocal() takes local indices. MatSetValuesStencil() takes global vertex numbers. So MatSetValuesStencil() takes global vertex numbers. Do you mean the natural or petsc ordering? There is no PETSc ordering for vertices, only the natural ordering. Thanks, Matt Which is a simpler/better option? MatSetValuesStencil() Is there an example in Fortran for MatSetValuesStencil? Timothée Nicolas shows one in his reply. Do I also need to use DMDAGetAO together with MatSetValuesStencil or MatSetValuesLocal? No. Thanks, Matt Thanks! -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener