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