[Dune] STL vector and CGSolver

Andreas Lauser and at poware.de
Thu Oct 9 13:34:30 CEST 2008


Hi Arne,

On Thursday 09 October 2008 13:00:18 Arne Rekdal wrote:
> Hello all.
>
> I am currently working on implementing a simple FEM solver with DUNE.
> I am solving a problem with only Dirichlet boundaries. Currently I
> mark the vertices which is part of the boundary, and the unknowns are
> all the vertices minus the boundary vertices.
>
> The plan next was to create a linear operator (A*x) so that the global
> matrix is not needed to be formed explicitly, and solve the equation
> system with conjugate gradients method.
>
> I am encountering problems with this approach. The first problem is
> that I try to use vectors of type FieldVector<Type,Size>. In this
> class it is needed to know the size at compilation, but this is not
> available without finding the number of boundary vertices first. I
> have also tried to use std::vector<Type> representation, but this
> class does not have the ::field_type type definition which is used in
> CGSolver. I also see that a preconditioner is required, but I am not
> sure how to create one.

Try to use BlockVector instead. The purpose of the FieldVector is to optimize 
memory use and performance for cases where the number of entries is fixed at 
compile time.

As preconditioner you can use any of those listed here:

http://www.dune-project.org/doc/doxygen/dune-istl-html/group__ISTL__Prec.html

cheers
  Andreas




More information about the Dune mailing list