<div dir="ltr"><div dir="ltr">On Mon, May 2, 2022 at 12:23 PM Matteo Semplice <<a href="mailto:matteo.semplice@uninsubria.it">matteo.semplice@uninsubria.it</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div>Thanks!</div>
<div><br>
</div>
<div>On 02/05/2022 18:07, Matthew Knepley
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">On Mon, May 2, 2022 at 11:25 AM Matteo Semplice
<<a href="mailto:matteo.semplice@uninsubria.it" target="_blank">matteo.semplice@uninsubria.it</a>>
wrote:<br>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi.<br>
<br>
I am facing a PDE with 2 dofs per node in which one dof has
periodic <br>
b.c. in the x direction and the other one periodic b.c. in
the y <br>
direction. Is there a (possibly quick-and-dirty) solution to
represent <br>
this in a DM (not necessarily a DMDA)?<br>
</blockquote>
<div><br>
</div>
<div>I am trying to understand what this means. </div>
</div>
</div>
</blockquote>
<p>It comes from a toy model for more complicated quantum field
theory model that's hard for me to understand.<br>
</p>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_quote">
<div>Usually we think of periodicity as arising from the
domain, not the field.</div>
<div><br>
</div>
<div>I think it would be easiest to:</div>
<div><br>
</div>
<div> a) Use two different DMDA for the fields that "match
up" where needed</div>
<div><br>
</div>
</div>
</div>
</blockquote>
<p>This is kind of what I was thinking at. So I would create two
DMDA, then a DMComposite with the two and finally create Vecs and
Matrices from the DMComposite?<br>
</p>
<p></p></div></blockquote><div>Yes. The drawback here is that DMDA will not help you make the proper Jacobian. I'm not sure how important this is to you. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><p>If so, then how do I assemble matrices for linear systems? If I
extract submatrices, I could use MatSetValuesStencil on diagonal
blocks, but how about the off-diagonal ones? These latter would
have rows/cols indexed by different DMDAs.<br>
</p>
<p></p></div></blockquote><div>Yes, you would need to manage it. Here is an example doing this: <a href="https://petsc.org/main/src/snes/tutorials/ex28.c.html">https://petsc.org/main/src/snes/tutorials/ex28.c.html</a></div><div>I have never loved it, but sometimes it makes the most sense.</div><div><br></div><div>As a third option, you could manually construct the local to global map. Periodicity is encoded here. However, this is pretty</div><div>intrusive.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><p>Matteo<br>
</p>
<p><br>
</p>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_quote">
<div>or</div>
<div><br>
</div>
<div> b) Use a DMStag since it sounds like these should live
on horizontal and vertical edges</div>
<div><br>
</div>
<div> Thanks,</div>
<div><br>
</div>
<div> Matt</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I understand the request it's strange, but I should add that
we are <br>
experimenting numerically with this toy model, so in fact
the b.c. may <br>
change in the future... just to stress once more that I am
not after a <br>
perfect solution, but anything that would at least allow
parallel runs <br>
with few processors would do for now.<br>
<br>
Thanks in advance<br>
<br>
Matteo<br>
<br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>What most experimenters take for granted before
they begin their experiments is infinitely more
interesting than any results to which their
experiments lead.<br>
-- Norbert Wiener</div>
<div><br>
</div>
<div><a href="https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cse.buffalo.edu%2F~knepley%2F&data=05%7C01%7Cmatteo.semplice%40uninsubria.it%7Cba6f4499929f45d75a5f08da2c55e259%7C9252ed8bdffc401c86ca6237da9991fa%7C0%7C0%7C637871044633599928%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DRvIjjr1cjHWdoSpQJr9UkIWVxlopKbKt%2BW5sQBvQE4%3D&reserved=0" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<pre cols="72">--
Prof. Matteo Semplice
Università degli Studi dell’Insubria
Dipartimento di Scienza e Alta Tecnologia – DiSAT
Professore Associato
Via Valleggio, 11 – 22100 Como (CO) – Italia
tel.: +39 031 2386316</pre>
</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>