← Back to team overview

dolfin team mailing list archive

Re: [FFC-dev] dof locations

 

On 12/4/06, Garth N. Wells <g.n.wells@xxxxxxxxxx> wrote:
Anders Logg wrote:
> On Mon, Dec 04, 2006 at 02:14:51PM +0100, Garth N. Wells wrote:
>> Could we add something to FFC to describe where the various degrees of
>> freedom live (on vertices, edges, internal)?
>>
>> Garth
>
> Yes we could, but I'd rather not. Why do we need it? I'd prefer if
> DOLFIN did not know anything about dofs, other than how to reorder
> them.
>

Not sure that it's this simple if you want to assemble some terms
block-wise. Also, for parallel assembly we might need to know where dofs
lie. I'm still thinking about this so I can't be concrete in what's
needed just yet.

I've just done some work on parallell assembly for PyCC, using the UFC
interface. This is basically how I make the node partition:

 // fill index_set with all global dofs used by elements in the local
grid partition
 std::set<int> index_set;

 // iterate over all mesh cells in local mesh partition
 pycc::UfcCellIterator *iter = mesh_iter_fac.create_cell_iterator();
 for(; !iter->end(); iter->next())
 {
   const ufc::cell & ufc_cell = iter->get_cell();

   // get loc2glob from nm
   ufc_node_map.tabulate_nodes(rows, ufc_mesh, ufc_cell);

   // insert loc2glob entries into index_set
   for(int i=0; i<row_size; i++)
   {
     index_set.insert(rows[i]);
   }
 }
 delete iter;


Here the mesh iterator knows the local partition of mesh cells, and
the ufc_node_map knows the local to global mapping of nodes for a
given cell, so I simply insert the nodes for each cell into a sorted
set. Then I extract the node indices of the local node partition from
index_set afterwards.

This set of nodes will be overlapping on the inner boundaries, but if
that isn't what you want you could iterate over the inner boundary and
call ufc_node_map.tabulate_nodes(...) on the cell at each side of the
boundary facet to find common nodes.

This is completely independent on the type of element (except perhaps
the rare elements that Rob mentioned in Delft, but I think that's a
small extension).

martin


Follow ups

References