<div dir="ltr"><div dir="ltr">On Tue, Aug 13, 2019 at 7:35 PM Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com">stefano.zampini@gmail.com</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 style="word-wrap:break-word"><br><div><br><blockquote type="cite"><div>On Aug 14, 2019, at 1:19 AM, Jed Brown via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank">petsc-dev@mcs.anl.gov</a>> wrote:</div><br class="gmail-m_3046661224718515795Apple-interchange-newline"><div><div>[Cc: petsc-dev]<br><br>Also, why is our current mode of localized coordinates preferred over<br>the coordinate DM being non-periodic?  Is the intent to preserve that<br>for every point in a DM, the point is also valid in the coordinate DM?<br></div></div></blockquote></div></div></blockquote><div>Yes. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div>Can there be "gaps" in a chart?<br></div></div></blockquote></div></div></blockquote><div>Yes. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div>I've been digging around in the implementation because there is no<br>documentation of localized coordinates, but it feels more complicated<br>than I'd have hoped.<br></div></div></blockquote><div><br></div><div>A while ago, “localization” of coordinates was supporting only very simple cases, where periodic points were identified though the ‘maxCell’ parameter (used to compute  the proper cell coordinates). I think this is the reason why you need at least 3 cells to support periodicity, since the BoxMesh constructor uses the maxCell trick.</div></div></div></blockquote><div><br></div><div>This was my original conception since it was the only fully automatic way to apply periodicity on an unstructured mesh that</div><div>was read from a file or generator.</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 style="word-wrap:break-word"><div><div>Now, you can also inform Plex about periodicity without the maxCell trick , see e.g. <a href="https://bitbucket.org/petsc/petsc/src/6a494beb09767ff86fff34131928e076224d7569/src/dm/impls/plex/plexgmsh.c#lines-1468" target="_blank">https://bitbucket.org/petsc/petsc/src/6a494beb09767ff86fff34131928e076224d7569/src/dm/impls/plex/plexgmsh.c#lines-1468</a>. In this case, it is user responsibility to populate the cell part of the coordinate section with the proper localized coordinates.</div></div></div></blockquote><div><br></div><div>This is a great addition from Stefano and Lisandro, but note that it is nontrivial. The user has to identify the</div><div>periodic boundary.</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 style="word-wrap:break-word"><div><div>The DMPlex code fully support coordinates localized only in those cells touching the periodic boundary. (I’m not a fan of this, since it requires a lot of ‘if’ ‘else’ switches )</div></div></div></blockquote><div><br></div><div>I believe that Lisandro wanted this to cut down on redundant storage of coordinates.</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 style="word-wrap:break-word"><div><div>I think domain_box_size 1 is not possible, we can probably allow domain_box_size 2.</div></div></div></blockquote><div><br></div><div>Technically, now a single box is possible with higher order coordinate spaces, but you have to do everything by hand</div><div>and it completely untested.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div><br>Jed Brown <<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>> writes:<br><br><blockquote type="cite">Can this be fixed?  Even better, can we allow -domain_box_size 1?<br><br>$ mpich/tests/dm/impls/plex/examples/tests/ex1 -dim 1 -domain_box_sizes 2 -cell_simplex 0 -x_periodicity periodic<br>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>[0]PETSC ERROR: Invalid argument<br>[0]PETSC ERROR: Mesh cell 1 is inverted, |J| = -0.25<br>[0]PETSC ERROR: See <a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">https://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>[0]PETSC ERROR: Petsc Development GIT revision: v3.11.3-1683-g1ac5c604ca  GIT Date: 2019-08-13 14:39:38 +0000<br>[0]PETSC ERROR: mpich/tests/dm/impls/plex/examples/tests/ex1 on a mpich named <a href="http://joule.cs.colorado.edu" target="_blank">joule.cs.colorado.edu</a> by jed Tue Aug 13 17:11:25 2019<br>[0]PETSC ERROR: Configure options --download-chaco --download-ctetgen --download-exodusii --download-hypre --download-med --download-ml --download-mumps --download-pnetcdf --download-pragmati<br>c --download-scalapack --download-spai --download-sundials --download-superlu --download-superlu_dist --download-triangle --with-c2html --with-eigen-dir=/usr --with-hdf5-dir=/opt/hdf5-mpich -<br>-with-lgrind --with-metis --with-mpi-dir=/home/jed/usr/ccache/mpich/ --download-netcdf --download-conduit --with-parmetis --with-single-library=0 --with-suitesparse --with-yaml --with-zlib -P<br>ETSC_ARCH=mpich COPTFLAGS="-Og -march=native -g" CXXOPTFLAGS="-Og -march=native -g" FOPTFLAGS="-Og -march=native -g"<br>[0]PETSC ERROR: #1 DMPlexCheckGeometry() line 7029 in /home/jed/petsc/src/dm/impls/plex/plex.c<br>[0]PETSC ERROR: #2 CreateMesh() line 412 in /home/jed/petsc/src/dm/impls/plex/examples/tests/ex1.c<br>[0]PETSC ERROR: #3 main() line 426 in /home/jed/petsc/src/dm/impls/plex/examples/tests/ex1.c<br>[0]PETSC ERROR: PETSc Option Table entries:<br>[0]PETSC ERROR: -cell_simplex 0<br>[0]PETSC ERROR: -dim 1<br>[0]PETSC ERROR: -domain_box_sizes 2<br>[0]PETSC ERROR: -malloc_test<br>[0]PETSC ERROR: -x_periodicity periodic<br>[0]PETSC ERROR: ----------------End of Error Message -------send entire error message to <a href="mailto:petsc-maint@mcs.anl.gov" target="_blank">petsc-maint@mcs.anl.gov</a>----------<br>application called MPI_Abort(MPI_COMM_WORLD, 62) - process 0<br>[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=62<br>:<br>system msg for write_line failure : Bad file descriptor<br></blockquote></div></div></blockquote></div><br></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>