On Mon, Sep 14, 2020 at 6:15 PM Jeremy Theler <[email protected]> wrote:
> Hello all > > Say I have a fully-interpolated 3D DMPlex and a point with arbitrary > coordinates x,y,z. What's the most efficient way to know which cell > this point belongs to in parallel? Cells can be either tets or hexes. > I should make a tutorial on this, but have not had time so far. The intention is that you use https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMLocatePoints.html This will just brute force search unless you also give -dm_plex_hash_location which builds a grid hash to accelerate it. I should probably expose DMPlexLocatePoint_Internal() which handles the single cell queries. If you just had one point, that might make it simpler, although you would still write your own loop. If your intention is to interpolate a field at these locations, I created https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/DMInterpolationCreate.html which no one but me uses so far, but I think it is convenient. Thanks, Matt > Regards > -- > jeremy theler > www.seamplex.com > > > -- 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/>
