<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Sat, Feb 23, 2019 at 10:48 AM Blaise A Bourdin via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</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 class="gmail-m_193371271850283721BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="gmail-m_193371271850283721PlainText">Hi,<br>
<br>
My student Alex and I are trying to build an example combining natural to global ordering and constraints.<br>
Constraints information do not seem to be distributed,</div></span></font></div></div></blockquote><div><br></div><div>Well dang. That is true. I never considered doing it the other way since all my specifications come from compact things</div><div>like an FEM discretization and BC labels, which get distributed. But yes, this is a big hole. I think it could be fixed without</div><div>too much work since the constraints are just another section+IS to distribute, and the IS does not even have to be renumbered.</div><div>I think we can just call <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexDistributeFieldIS.html">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexDistributeFieldIS.html</a> on it. </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"><div><div class="gmail-m_193371271850283721BodyFragment"><font size="2"><span style="font-size:11pt"><div class="gmail-m_193371271850283721PlainText"> so the most rational thing to do seems to be creating the default section after distribution, then figuring out a way to reconstruct the natural to global stuff.<br></div></span></font></div></div></blockquote><div><br></div><div>That is what I do, but we could do it the other way.</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"><div><div class="gmail-m_193371271850283721BodyFragment"><font size="2"><span style="font-size:11pt"><div class="gmail-m_193371271850283721PlainText">
In the example attached, we do this, then create a global vector, but for some reason that I do not understand, the global vector size is 0 (should be 18) when run on more than 1 CPU. If we make 2 calls to DMGetGlobalVector, we get a vector of the proper size.
What are we doing wrong?<br></div></span></font></div></div></blockquote><div><br></div><div>At the beginning, you turn on </div><div><br></div><div> DMSetUseNatural(dm, PETSC_TRUE);</div><div><br></div><div>so during Distribute() it tries to make the mapping. This process creates a global vector, which has size 0, because</div><div>the Section is empty. The reason it works when you call it again is that it creates a new vector this time, now with</div><div>the new Section. So, to do it this way, don't set this flag at the beginning. You have to setup the GlobalToNatural() afterwards.</div><div><br></div><div>Also, this shows that I should probably invalidate the global/local vector cache after a new Section is set.</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"><div><div class="gmail-m_193371271850283721BodyFragment"><font size="2"><span style="font-size:11pt"><div class="gmail-m_193371271850283721PlainText">
Regards,<br>
Blaise<br>
</div>
</span></font></div>
<div class="gmail-m_193371271850283721BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="gmail-m_193371271850283721PlainText"><br>
<br>
-- <br>
Department of Mathematics and Center for Computation & Technology<br>
Louisiana State University, Baton Rouge, LA 70803, USA<br>
Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 <a href="http://www.math.lsu.edu/~bourdin" target="_blank">
http://www.math.lsu.edu/~bourdin</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</span></font></div>
</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></div></div>