[petsc-users] Vec Set DM and Mat Set DM
Sun, Hui
hus003 at ucsd.edu
Sat Jun 21 13:25:28 CDT 2014
I'm thinking about defining a distributed Vec using grid information. The usual way to do that is to call VecCreateMPI, or VecCreate and VecSetSizes. However, that does not necessarily distribute Vec according to the grid information, DM. I'm thinking of doing something like:
ierr = DMDAGetInfo(da,0,&mx,&my,0,0,0,0,0,0,0,0,0,0);CHKERRQ(ierr);
ierr = DMDAGetCorners(da,&xs,&ys,NULL,&xm,&ym,NULL);
and then define the Vec according to (xs,ys,xm,ym). But I'm not sure what exactly should I do. There are functions KSPSetDM and SNESSetDM that allows one to pass the DM information into the KSP and SNES. Are there some functions that allow one to pass DM info to a Vec or Mat?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140621/32221d77/attachment.html>
More information about the petsc-users
mailing list