On Thu, Feb 19, 2009 at 3:22 PM, Randall Mackie <rlmackie862 at gmail.com>wrote:
> I'm trying to modify my code to use the DMMG routines to solve my system > by multi-grid, instead of the usual krylov solver. In my previous code, > I would set up a DA for my finite difference grid, set the matrix > preallocation using MATCreateMPIAIJ, then fill the matrix, etc. > > In the code I've modified to use DMMG, here is my sequence of routines > so far: > > call DMMGCreate(...) > call DACreate3D(....) ! to set the DA on the finest level > call DMMGSetDM(...) > > > call DMMGSETKSP(...) > > > Questions: > > 1) I want to set the DA on the finest level and use Galerkin to get > the coarser matrices. So, is the DACreate above the way to do this? Unfortunately, the DA has no way to do this right now since it does not know how to coarsen. You tell it the coarse grid and it refines. > > 2) How do I set the matrix preallocation here for use in the DMMG routines? > Would I use the same MATCreateMPIAIJ as before, and if so, where do I > put that? In the routine that fills the Jacobian, or in the main program > someplace? The DA will doe the preallocation by default. Use DAGetMatrix(). Matt > > Thanks, Randy > -- 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090219/2d733ca3/attachment.htm>
