[petsc-users] Finding which cell an arbitrary point belongs to in DMPlex
Matthew Knepley
knepley at gmail.com
Mon Sep 14 19:28:40 CDT 2020
On Mon, Sep 14, 2020 at 6:15 PM Jeremy Theler <jeremy at seamplex.com> 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/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200914/8ee9531c/attachment.html>
More information about the petsc-users
mailing list