← Back to team overview

dolfin team mailing list archive

Re: [HG] Remove const from uBlasLUSolver::solve(...) to match the virtual function LinearSolver::solve(...).

 


On Thu, 2006-07-13 at 11:41 +0200, Anders Logg wrote: 
> Why is the argument uBlasMatrix<ublas_sparse_matrix> instead of uBlasSparseMatrix?
> 

This is to allow forward declarations of uBlasMatrix. Typedefs can't be
used as forward declarations, so we were including the header file
uBlasSparseMatrix.h instead of using a forward declaration. I ran into
trouble on this point when moving the implementation of solve() and
invert from uBlasMatrix to uBlasLUSolver. I left the functions solve()
and invert() in uBlasMatrix, but now they call the appropriate solver
from uBlasLUSolver. Problem was that uBlasMatrix needs to know about
uBlasLUSolver, and uBlasLUSolver needs to know about uBlasMatrix, hence
the need for forward declarations. To be consistent, I changed all
uBlasSparseMatrix in src/kernel/la to uBlasMatrix<ublas_sparse_matrix>.

The other option is to derive a class uBlasSparseMatrix from uBlasMatrix
(and for uBlasDenseMatrix), then forward declarations of
uBlasSparseMatrix can be used. Disadvantage is that the the constructors
must be supplied which is duplicating what is already in uBlasMatrix. 

I don't have a strong preference for either solution.

Garth  



> /Anders
> 
> On Thu, Jul 13, 2006 at 11:30:34AM +0200, DOLFIN wrote:
> > One or more new changesets pushed to the primary DOLFIN repository.
> > A short summary of the last three changesets is included below.
> > 
> > changeset:   2059:33d11e5be12229651799b60fd86a039ca5a64bb5
> > tag:         tip
> > user:        "Garth N. Wells <g.n.wells@xxxxxxxxxx>"
> > date:        Thu Jul 13 11:28:48 2006 +0200
> > files:       src/kernel/la/dolfin/uBlasLUSolver.h src/kernel/la/uBlasLUSolver.cpp
> > description:
> > Remove const from uBlasLUSolver::solve(...) to match the virtual function LinearSolver::solve(...).
> > 
> > 
> > changeset:   2058:eb001996f5a27db0bd200be704246174cbddedc0
> > user:        "Garth N. Wells <g.n.wells@xxxxxxxxxx>"
> > date:        Thu Jul 13 10:27:34 2006 +0200
> > files:       TODO src/demo/pde/stokes/taylor-hood/main.cpp src/kernel/la/dolfin/uBlasKrylovSolver.h src/kernel/la/uBlasKrylovSolver.cpp src/kernel/ode/Homotopy.cpp src/kernel/ode/MonoAdaptiveNewtonSolver.cpp src/kernel/ode/dolfin/Homotopy.h src/kernel/ode/dolfin/MonoAdaptiveNewtonSolver.h
> > description:
> > Use ILU as default preconditioner for uBlas sparse matrices.
> > 
> > 
> > changeset:   2057:990b9f539231e2405b7b7d161472d8ae38a077e1
> > user:        "Garth N. Wells <g.n.wells@xxxxxxxxxx>"
> > date:        Wed Jul 12 14:14:52 2006 +0200
> > files:       ChangeLog TODO src/kernel/la/LinearSolver.cpp src/kernel/la/PETScKrylovSolver.cpp src/kernel/la/PETScLU.cpp src/kernel/la/PETScSparseMatrix.cpp src/kernel/la/dolfin/DenseVector.h src/kernel/la/dolfin/EigenvalueSolver.h src/kernel/la/dolfin/LinearSolver.h src/kernel/la/dolfin/PETScKrylovSolver.h src/kernel/la/dolfin/PETScLU.h src/kernel/la/dolfin/PETScSparseMatrix.h src/kernel/la/dolfin/PETScVector.h src/kernel/la/dolfin/Preconditioner.h src/kernel/la/dolfin/VirtualMatrix.h src/kernel/la/dolfin/uBlasILUPreconditioner.h src/kernel/la/dolfin/uBlasKrylovMatrix.h src/kernel/la/dolfin/uBlasKrylovSolver.h src/kernel/la/dolfin/uBlasLUSolver.h src/kernel/la/dolfin/uBlasMatrix.h src/kernel/la/uBlasILUPreconditioner.cpp src/kernel/la/uBlasKrylovMatrix.cpp src/kernel/la/uBlasKrylovSolver.cpp src/kernel/la/uBlasLUSolver.cpp src/kernel/ode/dolfin/Homotopy.h src/test/main.cpp
> > description:
> > Move implementation of uBlasMatrix::solve() and uBlasMatrix::invert() to uBlasLUSolver.
> > 
> > Replace #include's with forward declarations where possible in src/kernel/la.
> > 
> > Update ChangeLog and TODO.
> > 
> > 
> > -------------------------------------------------------
> > For more details, visit http://www.fenics.org/hg/dolfin
> > _______________________________________________
> > 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



References