← Back to team overview

dolfin team mailing list archive

Re: reset_tensor in assemble

 

On ti., 2009-09-01 at 17:16 +0100, Garth N. Wells wrote:
> 
> Kent Andre wrote:
> > Hi, 
> > A.zero() is called both when reset_tensor is true and false
> > in Assembler::init_global_tensor. 
> > 
> > The code is as follows: 
> > 
> > void Assembler::init_global_tensor(GenericTensor& A,
> >                                    const Form& a,
> >                                    UFC& ufc, bool reset_tensor)
> > {
> >   if (reset_tensor)
> >   {
> >     ... 
> >   }
> >   else 
> >     A.zero();
> > }
> > 
> > Is this on purpose or is it a bug ? 
> 
> The code is correct. 'A.zero()' zeroes the entries but preserves the 
> non-zero structure of the matrix.
> 
> Garth
> 

Then maybe reset_sparsity_pattern is a better name ? 

(I would like to not zero out the matrix before assembly, 
but I guess I can do this by some backend-spesific code where
I add the matrices together afterwords.) 


Kent



Follow ups

References