<div dir="ltr"><div dir="ltr">On Sun, Dec 6, 2020 at 1:46 PM Alexis Marboeuf <<a href="mailto:alexis.marboeuf@hotmail.fr">alexis.marboeuf@hotmail.fr</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 dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hello,</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I intend to contribute to the Petsc documentation, especially on PetscSF and PetscSection objects. I'm writing an example where I solve a linear elasticity problem in parallel on unstructured meshes. I discretize the system with a finite element method and
 P1 Lagrange base functions. I only use Petsc basics such as PetscSF, PetscSection, Mat, Vec and SNES objects and I need to implement Dirichlet and/or Neuman boundary conditions. PetscSectionSetConstraintDof and related routines allow to define which dofs are
 removed from the global system but are kept in local Vec. I don't find much more information about constraint dofs. Can someone explain me how it works? In particular, do I have to manually add terms related to inhomogeneous Dirichlet boundary condition in
 the RHS? Am I missing something?</div></div></blockquote><div><br></div><div>The way this mechanism is intended to work is to support removal of constrained dofs from the global system. This means it solves for only</div><div>unconstrained dofs and no modification of the system is necessary. However, you would be responsible for putting the correct boundary values into</div><div>any local vector you use. Note that this mechanism is really only effective when you can constrain a dof itself, not a linear combination. For that, we</div><div>do something more involved.</div><div><br></div><div>Operationally, SetConstraintDof() keeps track of how many dofs are constrained on each point. Then SetConstraintIndices() tells us which dofs on that</div><div>point are constrained, where the indices are in [0, n) if there are n dofs on that point. If you make a global Section, constrained dofs have negative offsets,</div><div>just like ghost dofs.</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 dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Regards,</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Alexis Marboeuf</div></div></blockquote></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>