On Mon, Mar 27, 2023 at 6:57 PM Adrian Croucher <a.crouc...@auckland.ac.nz> wrote:
> hi Matt, > On 28/03/23 00:14, Matthew Knepley wrote: > > Yes, it is a new check. I do not expect cells that are shared until we > create an overlap. We > can just put in a flag to shut it off, since otherwise it is a great check > for finding bugs. Can > you show me how you add cells, so we can make a small example that tests > this to go in > PETSc? > > Essentially I'm adding (one or more) cells nested "inside" some of the > original DM cells to simulate dual porosity. As well as new cells I also > create a new face between the original cell and the new one, and a new edge > and point for the face (so the DAG is the same depth everywhere - otherwise > it causes trouble). > > In the code, I create a new DMPlex, figure out the chart including the new > cells etc., set the cone sizes and the cones. I symmetrize it, copy labels > over from the original DM, set cell types (using DM_POLYTOPE_INTERIOR_GHOST > for the new points) and set up the point SF for the new DM. If something is > wrong with that point SF, would it cause the error I'm seeing when I > redistribute? > > Yes, that would cause this. Your routine looks right to me, but it should be easy to find a problem. Put a check in at 3460 that h != dim, and also check that the height of minc_leaves(i) is not 0. Thanks, Matt > The code for setting up the new point SF is here (hope this link works): > > > https://github.com/waiwera/waiwera/blob/55d26483b3392b70985fb25f998fbda3297c6154/src/mesh.F90#L3408 > > - Adrian > > -- > Dr Adrian Croucher > Senior Research Fellow > Department of Engineering Science > University of Auckland, New Zealand > email: a.crouc...@auckland.ac.nz > tel: +64 (0)9 923 4611 > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>