← Back to team overview

dolfin team mailing list archive

Re: Assembly [was: Re: RefCount news!]

 

On 12/21/06, Anders Logg <logg@xxxxxxxxx> wrote:
Interesting. We are just about to reimplement the assembly in DOLFIN
for UFC and I've been thinking about adding a common interface for
global tensors.

How about

  virtual void add(const real block[],
                   const unsigned int * const * dofs,
                   const unsigned int * num_dofs) = 0;

?

dofs[i] would correspond to the same name in the UFC interface and
rank is not needed since the GenericTensor object knows its rank.

Good.

What about initialization? We need to be able to specify the nonzero
pattern of the tensor (matrix).

I'm not sure how easy initialization is to generalize independently of
the format. In particular because it can be important to reuse the
nonzero pattern to save memory, and f.ex. in Epetra this pattern is
stored in a specific object (Epetra_CRSGraph) which in a parallel
setting also depends on a partition (Epetra_Map). Often, a matrix will
be reassembled, and the sparsity pattern is then already present. In
my case, I do initialization separately because of this, and hide the
specifics behind a factory interface (something like mat =
matfac->create_matrix(mesh, dof_map, dof_map)).

martin


References