[petsc-users] how to check if cell is local owned in DMPlex

Danyang Su danyang.su at gmail.com
Fri Mar 2 13:06:06 CST 2018


On 18-03-02 10:58 AM, Matthew Knepley wrote:
> On Fri, Mar 2, 2018 at 1:41 PM, Danyang Su <danyang.su at gmail.com 
> <mailto:danyang.su at gmail.com>> wrote:
>
>
>     On 18-02-19 03:30 PM, Matthew Knepley wrote:
>>     On Mon, Feb 19, 2018 at 3:11 PM, Danyang Su <danyang.su at gmail.com
>>     <mailto:danyang.su at gmail.com>> wrote:
>>
>>         Hi Matt,
>>
>>         Would you please let me know how to check if a cell is local
>>         owned? When overlap is 0 in DMPlexDistribute, all the cells
>>         are local owned. How about overlap > 0? It sounds like
>>         impossible to check by node because a cell can be local owned
>>         even if none of the nodes in this cell is local owned.
>>
>>
>>     If a cell is in the PetscSF, then it is not locally owned. The
>>     local nodes in the SF are sorted, so I use
>>     PetscFindInt
>>     (http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscFindInt.html
>>     <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscFindInt.html>).
>     Hi Matt,
>
>     Would you please give me a little more about how to mark the ghost
>     cells when overlap > 0? What do you mean a cell is in the PetscSF?
>     I use PetscSFView to export the graph (original mesh file
>     pile.vtk) and it exports all the cells, including the ghost cells
>     (PETScSFView.txt).
>
>
> Yes, I will send you some sample code when I get time. The first 
> problem is that you are looking at a different PetscSF. This looks 
> like the
> one returned by DMPlexDistribute(). This is mapping the serial mesh to 
> the parallel mesh. You want
>
> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMGetPointSF.html
>
> Then you can look at
>
> https://bitbucket.org/petsc/petsc/src/1788fc36644e622df8cb1a0de85676ccc5af0239/src/dm/impls/plex/plexsubmesh.c?at=master&fileviewer=file-view-default#plexsubmesh.c-683
>
> I get the pointSF, get out the list of leaves, and find points in it 
> using PetscFindInt()
Thanks Matt. I will try to figure it out based on your provided link and 
will let you know if I get it work.

Danyang
>
>   Thanks,
>
>     Matt
>
>     Thanks,
>
>     Danyang
>>
>>       Thanks,
>>
>>         Matt
>>
>>         Thanks,
>>
>>         Danyang
>>
>>     -- 
>>     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.caam.rice.edu/%7Emk51/>
>
>
>
>
> -- 
> 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.caam.rice.edu/%7Emk51/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180302/18c59012/attachment.html>


More information about the petsc-users mailing list