[petsc-users] Advice for implementing multigrid with fully coupled variable

Smith, Barry F. bsmith at mcs.anl.gov
Wed Jun 5 19:35:52 CDT 2019


   Hmm, DMComposite already has almost all the functionality you need. Take a look in src/dm/impls/composite/pack.c there is a DMRefine_Composite(), DMCoarse_Composite() and DMCreateInterpolation_Composite(). They work by call the routines on each of the DMs that make up the DMComposite. Note that DMRedundant similarly has these methods (for rundundant it just keeps on the information on each level).

   Please send use all the error messages for what goes wrong. Unfortunately we don't have an example that demonstrates all this.

  Barry

  No need for DMSHELL, composite has the needed functionality built in.



> On Jun 5, 2019, at 6:05 PM, zakaryah via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> I am trying to solve a system of nonlinear equations in many variables which are sparsely coupled and represent a field on a structured grid, and one variable which is coupled to all variables.  I've been using a DMRedundant for the fully-coupled variable, a DMDA for the other variables, and a DMComposite to combine the two and create the matrices and vectors for the nonlinear solver.  This works, but I am having difficulty improving the performance.
> 
> My question concerns using multigrid methods with such a setup.  The problem can be formulated so that it coarsens properly, i.e. the function can be written so that it meets the Galerkin condition, and I can calculate the Jacobian for the coarse grid, etc.  My issue is that I don't see how to tell PETSc how to actually perform the coarsening.  If I just use SNESSetDM with the DMComposite, then I can't use FAS for the SNES or MG for the PC because PETSc doesn't know how to coarsen the DM.  I'm hoping there is some way to get this to work, perhaps using a shell - any tips?
> 



More information about the petsc-users mailing list