<div dir="ltr"><div dir="ltr">On Mon, Nov 7, 2022 at 1:15 PM Nicholas Arnold-Medabalimi <<a href="mailto:narnoldm@umich.edu">narnoldm@umich.edu</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">Hi Petsc Users,<br><br><br>I am working on setting up the star forest to connect my meshes on different processors. <br><br>For a 2-processor example, I have set up a dmplex object and read in the coordinates nodes and cell2node charts on each one. But right now they are independent effectively.<br><br>For simplicity lets just say each process has 4 cells. <br><br><img src="cid:ii_la73euyu0" alt="image.png" width="511" height="115"><br><br>I'm trying to build the star forest that sets the edge between the two partitions. (see fig)<br><br>To my understanding, I do this using PetscSFSetGraph. I choose either 9-10 on rank 0 or 1-2 on rank 1 to be the "roots". For simplicity lets say the 1-2 on rank 1 are roots. <br><br>(also for the rest of the discussion I'm switching 1 and 2 to be 0 and 1 and 9 and 10 to be 8 9 ) (the figure is 1 indexed but for the code below it will be 0)<div><br>So on rank 0 I would set <br><br>nleaves=2<br>nroots= 8+c1  (graph is only cells and verts so its 8 verts plus the cell count(c1)<br><br><div>remote[0].rank=1<br>remote[0].index=0+(cell count on rank1) <br>leaf[0]=8+c1<div><br></div><div>remote[1].rank=1</div><div>remote[1].index=0+(cell count on rank1) <br></div></div></div></div></blockquote><div><br></div><div>I think this is wrong, instead you want</div><div><br></div><div>  remote[1].index=1+(cell count on rank1) </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><div><div>leaf[1]=9+c1</div><div><br><br>and on rank 1 we would set <br><br>nroots= ncells+nverts<br>nleaves=0 <br><br>Since its all roots I don't think I need to set anything else?<br><br><br><br>PetscSFSetGraph(sf,nroots,nleaves,leaves,PETSC_COPY_VALUES,remote,PETSC_COPY_VALUES)<br><br>I am certain I am making a mistake somewhere since I get an error when I then call PetscSFSetup. I am working in C++ right now but this is just testing out before implementation in fortran which is why I am using PETSC_COPY. <br></div></div></div></div></blockquote><div><br></div><div>You could also probably use</div><div><br></div><div>  <a href="https://petsc.org/main/docs/manualpages/DMPlex/DMPlexCreateFromCellListParallelPetsc/">https://petsc.org/main/docs/manualpages/DMPlex/DMPlexCreateFromCellListParallelPetsc/</a></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><div><div>Any help and clarification would be appreciated.<br><br><br>Sincerely <br>Nicholas<br><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div style="font-family:arial;font-size:small"><font color="#000000">Nicholas Arnold-Medabalimi<br><br></font><span style="font-family:sans-serif;font-size:14px">Ph.D. Candidate</span><font color="#000000"><br>Computational Aeroscience Lab<br>University of Michigan</font></div></div></div></div></div></div></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>