[MOAB-dev] get uniquely owned vertices

Vijay S. Mahadevan vijay.m at gmail.com
Mon Dec 7 07:49:30 CST 2015


Actually, there is an example of this usage here [1].

[1] ftp://ftp.mcs.anl.gov/pub/fathom/moab-docs/HelloParMOAB_8cpp-example.html#a15

On Mon, Dec 7, 2015 at 8:47 AM, Vijay S. Mahadevan <vijay.m at gmail.com> wrote:
>> So both `get_entities_by_dimension` and `get_shared_entities`  return owned
>> and ghosted entities?
>
> Yes. The interface routines have no idea about the domain
> decomposition. So they return whatever entities match your query, from
> the set that is locally visible (which typically is
> owned+shared/interface+ghosted).
>
> Vijay
>
> On Mon, Dec 7, 2015 at 8:45 AM, Nico Schlömer <nico.schloemer at gmail.com> wrote:
>> 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


More information about the moab-dev mailing list