<div dir="ltr"><div dir="ltr">On Wed, Nov 18, 2020 at 2:19 PM Lawrence Mitchell <<a href="mailto:wence@gmx.li">wence@gmx.li</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">> On 18 Nov 2020, at 15:26, Zhang, Hong via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank">petsc-dev@mcs.anl.gov</a>> wrote:<br>
> <br>
> Matt or Jed,<br>
> Can I call PetscSectionAddDof(s,p,ndof) at a shred 'p' by more than one processors? For example,<br>
> if (rank == 0) {<br>
>     PetscSectionAddDof(s,p,1) ;<br>
> } else if (rank == 1) {<br>
>     PetscSectionAddDof(s,p,2) ;<br>
> } <br>
> Then, at shared 'p', section 's' has dof=3?<br>
<br>
Sections are "local" objects that are tied together by an SF that describes point ownership.<br>
<br>
So I think that the only thing you need is that if two processes set a dof on what is globally the same point, they should agree on how many dofs live there.<br>
<br>
I wonder if PetscSectionAddDof (etc...) should be marked as logically collective.<br></blockquote><div><br></div><div>Right now, what you want is handled by creating a global Section from a local Section:</div><div><br></div><div>  <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PetscSection/PetscSectionCreateGlobalSection.html">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PetscSection/PetscSectionCreateGlobalSection.html</a></div><div><br></div><div>The global Section contains global offsets for all local points, and the ghost points have negative offsets.</div><div><br></div><div>There is no facility for combining dofs. The idea is that you know the number of dofs on each local point. If you change that</div><div>interpretation, you could easily use SF to add them up and broadcast the sum.</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">
Lawrence</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>