← Back to team overview

dolfin team mailing list archive

Re: Tabulating methods for Meshes

 

On 08/31/2012 09:11 AM, Garth N. Wells wrote:
> On 31 August 2012 07:31, Johan Hake <hake.dev@xxxxxxxxx> wrote:
>> Hello!
>>
>> Once in a while (quite often) we get questions about dof management
>> based on Mesh subdomains. There are different approaches to handle this.
>> Some less robust than others.
>>
>> I wonder if it would be a good idea to add:
>>
>>    /// Tabulate all dofs
>>    DofMap::tabulate_dofs(Array<uint>& dofs, const& Mesh mesh)
>>
> 
> It's not clear to me what the above does. Why is the Mesh an argument?

Mesh could be skipped, I guess. But one still need to iterate over all
dofs and collect them.

>>    /// Tabulate dofs related to a MeshDomain
>>    DofMap::tabulate_dofs(Array<uint>& dofs,
>>                          const& MeshFunction domains, uint domain)
>>
> 
> I don't mind the above, 

!!

> but I think the name could be changed.
> 
> I'm really coming around to the syntax
> 
>     std::vector<uint> DofMap::tabulate_dofs(......)
> 
> In most cases it has negligible performance impact. It's much easier
> to wrap in Python!

Sure!

>> Then we could iterate over the mesh collect dofs, sort them and last but
>> most important make sure they are all local (to processor) dofs.
> 
> It's more subtle than just local - on a process there are 'owned' and
> 'shared but not owned' dofs.

I really meant owned. Because this is done within the DofMap where we
have control of owned vs shared dofs we can filter out the shared one.

Johan

> Garth
> 
>> This
>> would also just work for SubDofMaps.
>>
>> For safety we could move the method to FunctionSpace, and remove Mesh
>> from the top method, so we can make sure the correct Mesh is used.
>>
>> Johan
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dolfin
>> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dolfin
>> More help   : https://help.launchpad.net/ListHelp



References