← Back to team overview

dolfin team mailing list archive

Re: More linear algebra...

 

On Mon, Aug 14, 2006 at 03:00:20PM +0200, Garth N. Wells wrote:
> Anders Logg wrote:
> > Some more inconsistencies in the linear algebra interface:
> > 
> > 1. In GenericVector, there's an operator() but not in GenericMatrix.
> > Should we add one to GenericMatrix?
> >
> 
> This is used in applying Dirichlet boundary conditions. Rather than 
> adding operator() to GenericMatrix, I would consider removing it from 
> GenericVector (and making some changes in the class FEM for applying 
> Dirichlet boundary conditions).

ok, let's remove it for now.

> > 2. Should we make it assignable? This would require the
> > GenericMatrix::Element trick. Maybe it's ok since this is just a fix
> > for the C++ interface? Indexing in the Python interface is handled
> > differently anyway.
> > 
> > 3. Are all the functions in GenericMatrix/Vector necessary? Could some
> > be removed? 
> 
> At a glance, I'd say that they are all necessary for assmebly.

ok, let's keep the current interface.

> Also, there are plenty of functions in PETScMatrix/Vector
> > and uBlasMatrix/Vector that are not in GenericMatrix/Vector. Should we
> > make sure that the interface stays the same for all linear algebra
> > types so for example only GenericMatrix functions are present in the
> > public interface of PETScMatrix?
> 
> It could be expanded (particularly GenericVector), but I would still try 
> to keep it compact. Some basic algebra operations would be good (+, +=, 
> -, -=, *=). They are used at least in src/modules/elasticity.

ok. Maybe we can wait until after the release. The GenericMatrix/Vector
interfaces look pretty clean now.

Should we try to put the finishing touches to the linear algebra and
make a new release now? Or should we try to clean up the linear
algebra further and remove the special functions that are not in the
generic interface after the release?

> Ideally, if a Matrix/Vector is created all the members functions which 
> are called should be in GenericMatrix/Vector, and if specialised 
> functions are required, a PETScMatrix/Vector or uBlasMatrix/Vector 
> should be created. Is it possible somehow to "hide" member functions of 
> PETScMatrix/uBlasMatrix which are not in GenericMatrix/Vector when using 
> a Matrix/Vector?

Don't know if this is possible. One argument would be that a function
is either important enough to be placed in the Generic interface, or
it is not so important, in which case one needs to call vec() or mat()
to get the underlying data structure.

/Anders


> Garth
> 
> > 
> > 4. Indexing in a PETSc matrix does not work as expected:
> > 
> >   >>> from dolfin import *
> >   >>> A = Matrix(10, 10)
> >   >>> print A[(5,5)]
> >   [0]PETSC ERROR: MatGetValues() line 1324 in src/mat/interface/matrix.c
> >   [0]PETSC ERROR: Object is in wrong state!
> >   [0]PETSC ERROR: Not for unassembled matrix!
> >   1.27319747458e-313
> > 
> > The natural would be for this to return zero.
> > 
> > /Anders
> > _______________________________________________
> > DOLFIN-dev mailing list
> > DOLFIN-dev@xxxxxxxxxx
> > http://www.fenics.org/mailman/listinfo/dolfin-dev
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev


Follow ups

References