<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 25, 2017 at 9:27 AM, Lawrence Mitchell <span dir="ltr"><<a href="mailto:lawrence.mitchell@imperial.ac.uk" target="_blank">lawrence.mitchell@imperial.<wbr>ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear petsc-users,<br>
<br>
I am trying to distribute a triangle mesh with a cell halo defined by<br>
FVM adjacency (i.e. if I have a facet in the initial (0-overlap)<br>
distribution, I want the cell on the other side of it).<br>
<br>
Reading the documentation, I think I do:<br>
<br>
DMPlexSetAdjacencyUseCone(PETS<wbr>C_TRUE)<br>
DMPlexSetAdjacencyUseClosure(P<wbr>ETSC_FALSE)<br>
<br>
and then<br>
DMPlexDistribute(..., ovelap=1)<br>
<br>
If I do this for a simple mesh and then try and do anything on it, I<br>
run into all sorts of problems because I have a plex where I have some<br>
facets, but not even one cell in the support of the facet. Is this to<br>
be expected?<br></blockquote><div><br></div><div>Hmm. I don't think so. You should have at least one cell in the support of every facet.</div><div>TS ex11 works exactly this way.</div><div><br></div><div>When using that adjacency, the overlap cells you get will not have anything but the</div><div>facet connecting them to that partition. Although, if you have adjacent cells in that overlap layer,</div><div>you can get ghost faces between those.</div><div><br></div><div>With the code below, do you get an interpolated mesh when you create it there. That call in C</div><div>has another argument</div><div><br></div><div> <a href="http://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/DMPLEX/DMPlexCreateFromCellList.html">http://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/DMPLEX/DMPlexCreateFromCellList.html</a></div><div><br></div><div>If its just cells and vertices, you could get some bizarre things like you see.</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">
For example the following petsc4py code breaks when run on 3 processes:<br>
<br>
$ mpiexec -n 3 python bork.py<br>
[1] DMPlexGetOrdering() line 133 in<br>
/data/lmitche1/src/deps/petsc/<wbr>src/dm/impls/plex/plexreorder.<wbr>c<br>
[1] DMPlexCreateOrderingClosure_St<wbr>atic() line 41 in<br>
/data/lmitche1/src/deps/petsc/<wbr>src/dm/impls/plex/plexreorder.<wbr>c<br>
[1] Petsc has generated inconsistent data<br>
[1] Number of depth 2 faces 34 does not match permuted nubmer 29<br>
: error code 77<br>
[2] DMPlexGetOrdering() line 133 in<br>
/data/lmitche1/src/deps/petsc/<wbr>src/dm/impls/plex/plexreorder.<wbr>c<br>
[2] DMPlexCreateOrderingClosure_St<wbr>atic() line 41 in<br>
/data/lmitche1/src/deps/petsc/<wbr>src/dm/impls/plex/plexreorder.<wbr>c<br>
[2] Petsc has generated inconsistent data<br>
[2] Number of depth 2 faces 33 does not match permuted nubmer 28<br>
: error code 77<br>
[0] DMPlexGetOrdering() line 133 in<br>
/data/lmitche1/src/deps/petsc/<wbr>src/dm/impls/plex/plexreorder.<wbr>c<br>
[0] DMPlexCreateOrderingClosure_St<wbr>atic() line 41 in<br>
/data/lmitche1/src/deps/petsc/<wbr>src/dm/impls/plex/plexreorder.<wbr>c<br>
[0] Petsc has generated inconsistent data<br>
[0] Number of depth 2 faces 33 does not match permuted nubmer 31<br>
<br>
$ cat > bork.py<<\EOF<br>
from petsc4py import PETSc<br>
import numpy as np<br>
Lx = Ly = 1<br>
nx = ny = 4<br>
<br>
xcoords = np.linspace(0.0, Lx, nx + 1, dtype=PETSc.RealType)<br>
ycoords = np.linspace(0.0, Ly, ny + 1, dtype=PETSc.RealType)<br>
coords = np.asarray(np.meshgrid(xcoords<wbr>, ycoords)).swapaxes(0,<br>
2).reshape(-1, 2)<br>
<br>
# cell vertices<br>
i, j = np.meshgrid(np.arange(nx, dtype=PETSc.IntType), np.arange(ny,<br>
dtype=PETSc.IntType))<br>
cells = [i*(ny+1) + j, i*(ny+1) + j+1, (i+1)*(ny+1) + j+1,<br>
(i+1)*(ny+1) + j]<br>
cells = np.asarray(cells, dtype=PETSc.IntType).swapaxes(<wbr>0,<br>
2).reshape(-1, 4)<br>
idx = [0, 1, 3, 1, 2, 3]<br>
cells = cells[:, idx].reshape(-1, 3)<br>
<br>
comm = PETSc.COMM_WORLD<br>
if comm.rank == 0:<br>
dm = PETSc.DMPlex().createFromCellL<wbr>ist(2, cells, coords, comm=comm)<br>
else:<br>
dm = PETSc.DMPlex().createFromCellL<wbr>ist(2, np.zeros((0, 4),<br>
dtype=PETSc.IntType),<br>
np.zeros((0, 2),<br>
dtype=PETSc.RealType),<br>
comm=comm)<br>
<br>
dm.setAdjacencyUseClosure(Fals<wbr>e)<br>
dm.setAdjacencyUseCone(True)<br>
<br>
dm.distribute(overlap=1)<br>
<br>
dm.getOrdering(PETSc.Mat.Order<wbr>ingType.RCM)<br>
<br>
dm.view()<br>
EOF<br>
<br>
Am I doing something wrong? Is this not expected to work?<br>
<br>
Cheers,<br>
<br>
Lawrence<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail-m_4189781797598714013gmail_signature"><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.caam.rice.edu/~mk51/" target="_blank">http://www.caam.rice.edu/~<wbr>mk51/</a><br></div></div></div>
</div></div>