[petsc-users] 1. Using petsc with an existing domain decomposition. petsc-users Digest, Vol 130, Issue 43

Patrick Sanan patrick.sanan at gmail.com
Sun Oct 13 15:33:23 CDT 2019


Hi Pierre - there's still development going on with DMStag and block PCs,  so if you don't find the example you're looking for, please let me know.

Best,
Patrick

> Am 13.10.2019 um 20:11 schrieb Pierre Gubernatis via petsc-users <petsc-users at mcs.anl.gov>:
> 
> Thanks Matt, I Hope I can find a simple example of these DMStags...
> I'll start with the linear stage of our algorithm (a Newton iteration used for minimizing a residual). Next I will consider giving the whole non linear problem to petsc...
> Regards.
> 
> Le dim. 13 oct. 2019 à 19:00, <petsc-users-request at mcs.anl.gov <mailto:petsc-users-request at mcs.anl.gov>> a écrit :
> Send petsc-users mailing list submissions to
>         petsc-users at mcs.anl.gov <mailto:petsc-users at mcs.anl.gov>
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.mcs.anl.gov/mailman/listinfo/petsc-users <https://lists.mcs.anl.gov/mailman/listinfo/petsc-users>
> or, via email, send a message with subject or body 'help' to
>         petsc-users-request at mcs.anl.gov <mailto:petsc-users-request at mcs.anl.gov>
> 
> You can reach the person managing the list at
>         petsc-users-owner at mcs.anl.gov <mailto:petsc-users-owner at mcs.anl.gov>
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of petsc-users digest..."
> 
> 
> Today's Topics:
> 
>    1.  Using petsc with an existing domain decomposition.
>       (Pierre Gubernatis)
>    2. Re:  Using petsc with an existing domain decomposition.
>       (Matthew Knepley)
>    3. Re:  Using petsc with an existing domain decomposition.
>       (Mark Adams)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sun, 13 Oct 2019 11:24:04 +0200
> From: Pierre Gubernatis <pierre.gubernatis at gmail.com <mailto:pierre.gubernatis at gmail.com>>
> To: petsc-users at mcs.anl.gov <mailto:petsc-users at mcs.anl.gov>
> Subject: [petsc-users] Using petsc with an existing domain
>         decomposition.
> Message-ID:
>         <CAAiXahKb8tQ1csBd0nkVXfJzZcDsJfWJ9ir=S3htogCzCwmTVw at mail.gmail.com <mailto:S3htogCzCwmTVw at mail.gmail.com>>
> Content-Type: text/plain; charset="utf-8"
> 
> Hello all,
> 
> It souds that the best way to introduce petsc in a code is not to introduce
> it, but develop the code over the petsc structure.
> 
> It is probably true but my problem is that my existing code already is
> equipped with a domain decomposition based on MPI (a typical themal
> hydraulic with cartesian staggered mesh)
> 
> The user can slice the domain in sub-domains and construct a linear problem
> by block: each sub-domain assembles its part of the operator and its part
> of the RHS.
> 
> I am wondering what is the best way now to introduce petsc (considering
> that I don?t want to assemble a global operator on a given proc). Is there
> an example that would show how to introduce petsc in this situation ?
> Thank you, Pierre
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191013/d7d41233/attachment-0001.html <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191013/d7d41233/attachment-0001.html>>
> 
> ------------------------------
> 
> Message: 2
> Date: Sun, 13 Oct 2019 07:22:27 -0400
> From: Matthew Knepley <knepley at gmail.com <mailto:knepley at gmail.com>>
> To: Pierre Gubernatis <pierre.gubernatis at gmail.com <mailto:pierre.gubernatis at gmail.com>>
> Cc: PETSc <petsc-users at mcs.anl.gov <mailto:petsc-users at mcs.anl.gov>>
> Subject: Re: [petsc-users] Using petsc with an existing domain
>         decomposition.
> Message-ID:
>         <CAMYG4G=nxz+=2Cs26wNrX3eyqEznCVkfx7Yctr_dKGFsKQR7gA at mail.gmail.com <mailto:2Cs26wNrX3eyqEznCVkfx7Yctr_dKGFsKQR7gA at mail.gmail.com>>
> Content-Type: text/plain; charset="utf-8"
> 
> Without having seen your code, it sounds to me like the best strategy here
> is to:
> 
>   1) Produce a mirror of your mesh using DMStag
> 
>   2) Use that DM to construct the linear block problems, which can then be
> solved by PETSc
> 
>       Since the PETSc grid matches your own, you can share the solution
> vectors between your code and PETSc,
>       so it will fit nicely into your existing structure.
> 
> Once that works, if the entire mesh is Cartesian, you could use DMStag to
> model that and let PETSc handle parallel
> decomposition. At the same stage, you could decide to let PETSc SNES handle
> the nonlinear problem, rather than
> just the linear parts.
> 
>   Thanks,
> 
>     Matt
> 
> On Sun, Oct 13, 2019 at 5:25 AM Pierre Gubernatis via petsc-users <
> petsc-users at mcs.anl.gov <mailto:petsc-users at mcs.anl.gov>> wrote:
> 
> > Hello all,
> >
> > It souds that the best way to introduce petsc in a code is not to
> > introduce it, but develop the code over the petsc structure.
> >
> > It is probably true but my problem is that my existing code already is
> > equipped with a domain decomposition based on MPI (a typical themal
> > hydraulic with cartesian staggered mesh)
> >
> > The user can slice the domain in sub-domains and construct a linear
> > problem by block: each sub-domain assembles its part of the operator and
> > its part of the RHS.
> >
> > I am wondering what is the best way now to introduce petsc (considering
> > that I don?t want to assemble a global operator on a given proc). Is there
> > an example that would show how to introduce petsc in this situation ?
> > Thank you, Pierre
> >
> 
> 
> -- 
> 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
> 
> https://www.cse.buffalo.edu/~knepley/ <https://www.cse.buffalo.edu/~knepley/> <http://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191013/59f371e0/attachment-0001.html <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191013/59f371e0/attachment-0001.html>>
> 
> ------------------------------
> 
> Message: 3
> Date: Sun, 13 Oct 2019 09:56:58 -0400
> From: Mark Adams <mfadams at lbl.gov <mailto:mfadams at lbl.gov>>
> To: Pierre Gubernatis <pierre.gubernatis at gmail.com <mailto:pierre.gubernatis at gmail.com>>
> Cc: PETSc users list <petsc-users at mcs.anl.gov <mailto:petsc-users at mcs.anl.gov>>
> Subject: Re: [petsc-users] Using petsc with an existing domain
>         decomposition.
> Message-ID:
>         <CADOhEh7PhC+SG_kDYd2gdPMMuvHacYBx+nGt=EN0WGESoLfdUA at mail.gmail.com <mailto:EN0WGESoLfdUA at mail.gmail.com>>
> Content-Type: text/plain; charset="utf-8"
> 
> On Sun, Oct 13, 2019 at 5:25 AM Pierre Gubernatis via petsc-users <
> petsc-users at mcs.anl.gov <mailto:petsc-users at mcs.anl.gov>> wrote:
> 
> > Hello all,
> >
> > It souds that the best way to introduce petsc in a code is not to
> > introduce it, but develop the code over the petsc structure.
> >
> 
> All things being equal, yes, but few users start with PETSc from scratch.
> You situation is normal and Matt's suggestion of mirroring your mesh in
> PETSc mesh object (DM) is a common approach.
> 
> 
> > It is probably true but my problem is that my existing code already is
> > equipped with a domain decomposition based on MPI (a typical themal
> > hydraulic with cartesian staggered mesh)
> >
> > The user can slice the domain in sub-domains and construct a linear
> > problem by block: each sub-domain assembles its part of the operator and
> > its part of the RHS.
> >
> > I am wondering what is the best way now to introduce petsc (considering
> > that I don?t want to assemble a global operator on a given proc). Is there
> > an example that would show how to introduce petsc in this situation ?
> > Thank you, Pierre
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191013/f9219b2b/attachment-0001.html <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191013/f9219b2b/attachment-0001.html>>
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> petsc-users mailing list
> petsc-users at mcs.anl.gov <mailto:petsc-users at mcs.anl.gov>
> https://lists.mcs.anl.gov/mailman/listinfo/petsc-users <https://lists.mcs.anl.gov/mailman/listinfo/petsc-users>
> 
> 
> ------------------------------
> 
> End of petsc-users Digest, Vol 130, Issue 43
> ********************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191013/63a4d956/attachment-0001.html>


More information about the petsc-users mailing list