← Back to team overview

dolfin team mailing list archive

Re: [Question #143645]: Parallel mesh representation

 

> On Thu, Feb 03, 2011 at 09:03:58PM +0100, Niclas Jansson wrote:
>> Anders Logg <logg@xxxxxxxxx> writes:
>>
>>> On Tue, Feb 01, 2011 at 11:57:28AM -0000, Anders Logg wrote:
>>>> Question #143645 on DOLFIN changed:
>>>> https://answers.launchpad.net/dolfin/+question/143645
>>>>
>>>> Anders Logg proposed the following answer:
>>>> On Tue, Feb 01, 2011 at 11:50:37AM -0000, Garth Wells wrote:
>>>>> Question #143645 on DOLFIN changed:
>>>>> https://answers.launchpad.net/dolfin/+question/143645
>>>>>
>>>>>     Status: Open => Answered
>>>>>
>>>>> Garth Wells proposed the following answer:
>>>>> I don't think so.
>>>>
>>>> I think it should be possible, at least "in principle". I'll comment
>>>> more later. I'm in a meeting now.
>>>
>>> Sorry for my late reply.
>>>
>>> What you can do is to get the "overlap":
>>>
>>> std::map<uint, std::vector<uint> >* overlap = mesh.data().vector_mapping("overlap");
>>>
>>> This gives you a mapping for each shared vertex to its neighboring
>>> processes (the processes it's shared with).
>>>
>>> You can check if a vertex is shared by
>>>
>>>   overlap->find(i) != overlap->end()
>>>
>>> There is no functionality for checking edges, cells etc. Such
>>> operations must be expressed in terms of their vertices.
>>>
>>> It would be easy to add some shortcuts like
>>>
>>>   bool Vertex::is_ shared() const;
>>>
>>> and even
>>>
>>>   bool MeshEntity::is_shared() const;
>>>
>>> etc if that helps. They could just look at the overlap.
>>>
>>> If that is costly, we could store another MeshFunction that holds the
>>> appropriate data (or add as part of ParallelData).
>>>
>>>
>>
>> Perfect! That should be enough to get me started porting some code.
> 
> Great!
> 
>> How about owners of mesh entities? If I remember correctly mesh entities
>> were not owned by a specific rank. If one could determine if a vertex
>> is owned, ghosted or shared, it would make life much simpler when
>> implementing various parallel mesh algorithms.
> 
> Isn't the rule that when a vertex is shared, it's owned by the lowest
> rank process?
> 

We don't need to designate an owner for mesh entities.

> I don't know how we handle ghosted entities (or if we even have
> ghosted entities). We have ghosted dofs stored in Vectors (handled by
> PETSc/Epetra) but I'm not sure how it's handled. Garth knows a great
> deal more about that.
> 

Dof ownership is handled via the dof map. When creating a vector, we
have a constructor that takes the local size, plus a list of ghost
entries. We use built-in PETSc functionality for PETScVector, and
home-baked ghosting for EpetraVector.

Ownership of mesh entities is not important (at least for the current
functionality, integration over interior facets will be different).

Garth

> --
> Anders
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp



References