<div dir="ltr"><div dir="ltr">On Thu, Oct 20, 2022 at 9:42 AM Gong Yujie <<a href="mailto:yc17470@connect.um.edu.mo">yc17470@connect.um.edu.mo</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 class="msg-1983190454483559874">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-size:12pt;margin:0px;color:black;background-color:white">Dear development team, </span>
<div style="font-size:12pt;margin:0px;color:black;background-color:white">
<br>
</div>
<div style="font-size:12pt;margin:0px;color:black;background-color:white">
I'm trying to write a code to solve a partial differential equation. I didn't use PETSc's discretization. I have a question about the implementation of the boundary condition (Dirichlet boundary condition). When implementing the Dirichlet boundary condition.
I need to set the corresponding rows in the Jacobian matrix diagonal 1 and others 0. I created the matrix use DMCreateMatrix.</div></div></div></div></blockquote><div><br></div><div>For this, you can use</div><div><br></div><div> <a href="https://petsc.org/main/docs/manualpages/Mat/MatZeroRows/">https://petsc.org/main/docs/manualpages/Mat/MatZeroRows/</a></div><div> <a href="https://petsc.org/main/docs/manualpages/Mat/MatZeroRowsColumns/">https://petsc.org/main/docs/manualpages/Mat/MatZeroRowsColumns/</a></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 class="msg-1983190454483559874"><div dir="ltr"><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<div style="font-size:12pt;margin:0px;color:black;background-color:white">
<span style="font-size:12pt">Can I add the Dirichlet boundary condition to the DMPlex mesh so that the Jacobian matrix won't contain these Dirichlet boundary rows? If yes, is there a function that can set the Dirichlet boundary points' value?</span></div></div></div></div></blockquote><div><br></div><div>If you are not using the PETSc discretization, that means you gave a PetscSection to the DMPlex so that it could make the Mat. You can add</div><div>constraints to that Section in order to eliminate some unknowns.</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 class="msg-1983190454483559874"><div dir="ltr"><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<div style="font-size:12pt;margin:0px;color:black;background-color:white">
Best Regards,<br>
<span style="margin:0px">Jerry</span></div>
<br>
</div>
</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>