<div dir="ltr"><div dir="ltr">On Mon, Nov 4, 2024 at 7:10 PM Aldo Bonfiglioli <<a href="mailto:aldo.bonfiglioli@unibas.it">aldo.bonfiglioli@unibas.it</a>> wrote:</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"><u></u>
<div>
<p>Dear users,</p>
<p>I have been using petsc's KSP for over 20 years and I am
considering using DMPLEX to replace my own data structure in a
mixed FEM/FVM CFD code.</p>
<p>To do so, I am trying to understand DMPLEX by writing a 1D code
that solves u_t = u_xx using PSEUDOTS.</p>
<p>In order to prescribe Dirichlet BCs at the endpoints of the 1D
box, I use PetscSectionSetConstraintDof when building the
PetscSection.<br>
</p>
<p>
</p><blockquote type="cite">A global vector is missing both the shared
dofs which are not owned by this process, as well as <em>constrained</em>
dofs. These constraints represent essential (Dirichlet)
boundary conditions. They are dofs that have a given fixed
value, so they are present in local vectors for assembly
purposes, but absent
from global vectors since they are never solved for during
algebraic solves.</blockquote>
<p></p>
<p>My global Vec has indeed two entries less than the local one.</p>
<p>When initializing the solution or evaluating the rhs function I
transfer data from the global to local representation, do the
calculation, then transfer back.</p>
<p>I am doing something wrong, though, which shows up in the
attached log file.</p>
<p>My simple code is also attached.</p>
<p></p></div></blockquote><div>Hi Aldo,</div><div><br></div><div>I think we are very close to working. The PetscSection only care about the sizes of things, like vectors, and it seems</div><div>like that is right. Now you want the boundary values to be put in your vectors (I think). There needs to be a routine</div><div>to stick in the boundary values, which is DMPlexInsertBoundaryValues(). You can change this function by calling</div><div>PetscObjectFunctionCompose() for "DMPlexInsertBoundaryValues_C".</div><div><br></div><div> Does that make sense?</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><p>Thank you for your advice.</p>
<p>Aldo<br>
</p>
<pre cols="72">--
Dr. Aldo Bonfiglioli
Associate professor of Fluid Machines
Scuola di Ingegneria
Universita' della Basilicata
V.le dell'Ateneo lucano, 10 85100 Potenza ITALY
tel:+39.0971.205203 fax:+39.0971.205215
web: <a href="https://urldefense.us/v3/__http://docenti.unibas.it/site/home/docente.html?m=002423__;!!G_uCfscf7eWS!cWgDpzKW9KGEkqxu775gDU488CBQ5itLl2l_HUsDKcPstbcuSm0_bZPHkMciXajTi3539fuMPe8TD1YZuirDfmSBMSXXxrQZWns$" target="_blank">http://docenti.unibas.it/site/home/docente.html?m=002423</a></pre>
</div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><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="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!Yef4Gll06T0STqTT9tclyiR99EATrA8nCwlcq7LOmCo4TPWg3fYGMZS0Ohp-XcuAHGtnTiIEQOhfmf3oD6xM$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>