[MOAB-dev] get uniquely owned vertices

Nico Schlömer nico.schloemer at gmail.com
Mon Dec 7 07:45:09 CST 2015


Thanks Vijay for the explanation.
So both `get_entities_by_dimension` and `get_shared_entities`  return owned
and ghosted entities?

Cheers,
Nico

On Mon, Dec 7, 2015 at 2:31 PM Vijay S. Mahadevan <vijay.m at gmail.com> wrote:

> Hi Nico,
>
> You can use pstatus tag to filter out [1] your desired entities once
> you have a superset of entities you care about. All calls on MOAB
> Core/Interface return matching entities that are local (owned + shared
> + ghosted) only. So if you want only owned entities, or only ghosted
> ones, you can do something like this:
> ```
>   moab::Range allverts, ownverts, ghostverts;
>   ierr = mb->get_entities_by_dimension(0, 0, allverts);
>   ierr = pcomm->filter_pstatus(allverts, PSTATUS_NOT_OWNED,
> PSTATUS_NOT, -1, &ownverts);
>   ierr = pcomm->filter_pstatus(allverts, PSTATUS_GHOST, PSTATUS_OR,
> -1, &ghostverts);
> ```
>
> Vijay
>
> [1]
> ftp://ftp.mcs.anl.gov/pub/fathom/moab-docs/classmoab_1_1ParallelComm.html#ad151b3b024cfd0ab7adc00f77e2551c2
>
> On Mon, Dec 7, 2015 at 6:25 AM, Nico Schlömer <nico.schloemer at gmail.com>
> wrote:
> > Hi everyone,
> >
> > When reading a mesh in parallel, I would like to get the vertices such
> that
> > every vertex belong to exactly one process. When reading with
> > ```
> >   moab::Range verts;
> >   ierr = mb->get_entities_by_dimension(0, 0, verts);
> > ```
> > the vertices along the process interfaces will be shared, i.e., they
> appear
> > on two processes.
> >
> > I used to believe the above does the right thing and I have to use get
> the
> > shared entities separately
> > ```
> >   moab::Range shared;
> >   ierr = mcomm_->get_shared_entities(-1, shared, 0);
> >   all.merge(shared);
> > ```
> > but it seems I'm on the wrong track.
> >
> > Any hints?
> >
> > Cheers,
> > Nico
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20151207/0b252622/attachment.html>


More information about the moab-dev mailing list