dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #02304
Re: Dense matrices
Quoting Anders Logg <logg@xxxxxxxxx>:
> On Fri, Mar 31, 2006 at 06:16:51PM +0200, Garth N. Wells wrote:
> > On Fri, 2006-03-31 at 10:10 -0600, Robert C.Kirby wrote:
> > > >
> > > > The more I look at it, the more I like it.
> > > >
> > > > For the benchmarks I made, there was no optimisation (it was
> > > > missing from dolfin-config --cflags). When using optimisation,
> > > > uBlas outperforms the simple functions I wrote for inserting and
> > > > retrieving values from an array. It also provides a LU solver
> > > > (which I need to compute inverses of small matrices).
> > > >
> > > > It compiled fine with the Intel Linux compiler, and I'm testing it
> > > > now under Cygwin.
> > > >
> > >
> > > Can you install just ublas (without the boost build system), or do
> > > you have to go through the whole boost build process?
> > >
> >
> > There is no need build boost when using ublas.
> >
> > If you want to build uBlas, it does have it's own build system but there
> > is also a configure script so you can do the usual ./configure, make
> > install.
> >
> > Garth
>
> It seems obvious we need something other than PETSc for dense linear
> algebra and ublas seems to be a good option.
>
> How do we make it fit into DOLFIN? There are some different options:
>
> 1. Wrap it as we do with most other stuff, so we would create
> something like a class DenseMatrix that wraps a ublas dense matrix.
>
> Then the question is how DenseMatrix interacts with the class Vector
> which is a PETSc vector. Do we also need a DenseVector?
This would be quick, and we wouldn't have wrap many (if any functions) as uBlass
is C++ and the functions are intuitive. If we wrap everthing, what's the point
in using uBlas?
We would need a DenseVector to operate with a dense matrix when taking slices,
solving, mutliplying, etc.
This could be a good start to play around with uBlas and see if it's really what
we want.
>
> Should the assembly routines be able to accept a DenseMatrix etc?
>
I can think of examples where this would be useful for me, but not urgent.
> 2. Use a common interface for all linear algebra: Matrix and Vector
> which can be PETSc or ublas or ... This is similar to what we had
> before with our own implementations in SparseMatrix and DenseMatrix,
> only now we would wrap PETSc and ublas instead. This might impose a
> slight overhead in addressing entries.
>
> We might remove the overhead with a template solution rather than the
> class hierarchy (envelope-letter) we used before.
>
> This way, we would also need to design a common interface for both
> dense and sparse matrices. We could do this, but it would require some
> thought to get it right. (Or we just go ahead and implement it and to
> get something that works...)
>
A truly common interface would be difficult to define as some operations will
differ. We could define a basic set of operations which are common.
Garth
> There is a fairly new project called GLAS for Generic Linear Algebra
> Software that aims at creating a C++ template library for linear
> algebra with multiple backends. I don't think they have anything
> useful yet but they seem to have a plan for handling multiple backends
> while providing a common interface.
>
> 3. Just use ublas from within DOLFIN the way we use STL in some
> places.
>
> I'm very keen on keeping a simple user interface so in my ideal world
> there is just one class Matrix and one class Vector (perhaps with
> multiple backends).
>
> /Anders
>
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev
>
Follow ups
References
-
Re: Dense matrices
From: Garth N. Wells, 2006-03-29
-
Re: Dense matrices
From: Anders Logg, 2006-03-29
-
Re: Dense matrices
From: Garth N. Wells, 2006-03-29
-
Re: Dense matrices
From: Anders Logg, 2006-03-29
-
Re: Dense matrices
From: Garth N. Wells, 2006-03-30
-
Re: Dense matrices
From: Garth N. Wells, 2006-03-31
-
Re: Dense matrices
From: Johan Jansson, 2006-03-31
-
Re: Dense matrices
From: Garth N. Wells, 2006-03-31
-
Re: Dense matrices
From: Robert C . Kirby, 2006-03-31
-
Re: Dense matrices
From: Garth N. Wells, 2006-03-31
-
Re: Dense matrices
From: Anders Logg, 2006-03-31