← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] Reset local tensor A^K before call to tabulate_tensor ()

 

On Tuesday 10 June 2008 13:23:45 Anders Logg wrote:
> On Tue, Jun 10, 2008 at 09:55:51AM +0200, Martin Sandve Alnæs wrote:
> > 2008/6/9 DOLFIN <dolfin@xxxxxxxxxx>:
> > > One or more new changesets pushed to the primary dolfin repository.
> > > A short summary of the last three changesets is included below.
> > >
> > > changeset:   4282:5f6759a7460d81435abf4d67911667e3e628e164
> > > tag:         tip
> > > user:        Anders Logg <logg@xxxxxxxxx>
> > > date:        Mon Jun 09 23:06:51 2008 +0200
> > > files:       dolfin/fem/Assembler.cpp dolfin/fem/UFC.cpp
> > > dolfin/fem/UFC.h description:
> > > Reset local tensor A^K before call to tabulate_tensor()
> >
> > Why? This is the job of tabulate_tensor, which can do it much more
> > efficiently?
>
> I added this for convenience. It is used when assembling forms over
> subdomains and the form compiler needs to generate code for zero
> contributions from other domains, for example when integrating
>
>   M = f*ds(5)
>
> Then the compiler needs to add zero integrals for ds([0-4]).
> Then this code just needs to be empty.

It would be great to be able to integrate the above mentioned form. It took me 
some time to realise that you could only assemble subdomains that was 
contiguously numbered from 0 and up.

But is this implementation the most logical? What if I think it is natural to 
mark a subdomain with "100"? Then 100 empty integrals would be created? Is it 
possible to store the integrals in a map, with markers as keys. Or store the 
integrals in a contiguous array, and then map these to markers? 

This would add flexibility for assigning a form integral an arbitrary number, 
but it also introduce a map lookup overhead that would slow down the 
assembly. The latter could be solved with an inverse MeshFunction, which map 
values to cells/facets.

It would also be nice to separate a facet MeshFunction in one only for 
interior facets and one only for the exterior ones. This would fit nicely in 
to the above mentioned procedure. I do not know how to do this nicely 
though...

A note related to this issue:
A typical small mesh I generate have 23K vertices, and 86K tetrahedrons, it 
takes ~0.3 s to load. The boundary mesh have 35K facets but the whole mesh 
have 190K facets, including the interior facets. This takes ~5s to load, 
almost 20 times more time than the mesh, and it loads information about 160K 
facets that is not needed.


Johan

> I'm not sure that the overhead is big, but I've removed it. I agree
> it's the job of the form compiler to generate the code that zeros the
> tensor, even if it would be nice to assume that the argument that
> comes in to tabulate_tensor is always zero.




Follow ups

References