On 25/02/16 06:19, Rongliang Chen wrote: > Dear All, > > In my application, I need an overlapping partition of the mesh, that is > to set the overlapping size in DMPlexDistribute(*dm, partitioner, > overlap, NULL, &distributedMesh) to be nonzero (overlap=1). > > At the same time, I want to use the DMRefine to refine the distributed > mesh. I found that the refined mesh obtained by DMRefine is totally > wrong.
What do you mean by "totally wrong"? Is it just that the overlapped region on the coarse mesh is also refined (such that rather than being one level deep, it is 2**nrefinements deep)? > But if I set the overlapping size in DMPlexDistribute to be zero, > then the refined mesh is correct. Please let me know if you have any > ideas to use the DMRefine for a distributed mesh with nonzero > overlapping size. I do this as follows: - Create the initial DM. - Distribute with zero overlap DMPlexDistribute(..., overlap=0, ...); - Refine the distributed DM as many times as you want. - Grow the overlap on the refined DM: DMPlexDistributeOverlap(refined_dm, 1, &pointsf, &overlapped_dm); Now the overlapped_dm is refined and has a 1-deep overlap. The only thing that, AFAIK, doesn't work out of the box with this scheme is the automatic computation of multigrid restriction and interpolation. The reason for this is that the code currently assumes that, given a coarse DM point, it can compute the corresponding fine DM cells by using: for r in range(num_sub_cells): fine_cell = coarse_cell*num_sub_cells + r There is a TODO comment in plex.c (in DMPlexMatSetClosureRefined): for (r = 0, q = 0; r < numSubcells; ++r) { /* TODO Map from coarse to fine cells */ ierr = DMPlexGetTransitiveClosure(dmf, point*numSubcells + r, PETSC_TRUE, &numFPoints, &fpoints);CHKERRQ(ierr); The two-step refine then grow the overlap method I outlined above destroys this mapping. Hence the approach currently coded in plex.c will not work. This is for regular refinement. For non-nested refinement, I think you're good because the computation of the interpolator spins over the fine cells and searches for the coarse cells. Hope that helps! Lawrence
signature.asc
Description: OpenPGP digital signature