[Dune] Initialization of BlockVector with C array or Eigen array

Christian Engwer christian.engwer at uni-muenster.de
Wed May 27 09:49:43 CEST 2015


On Wed, May 27, 2015 at 09:37:32AM +0200, Oliver Sander wrote:
> Am 27.05.2015 um 09:29 schrieb Markus Blatt:
> > On Wed, May 27, 2015 at 09:05:48AM +0200, Oliver Sander wrote:
> >> Am 26.05.2015 um 21:38 schrieb Tobias Ritschel:
> >>> Hi
> >>>
> >>> I would like to use dune-istl to solve linear systems in a fully implicit
> >>> two-phase solver and I use Eigen to generate the Jacobi matrix and
> >>> right-hand-side. Is there a way to initialize a
> >>> BlockVector<FieldVector<double,1>> with a Eigen array or a C array without
> >>> copying?

Depending on the discretization infrastructure you are using it should
not be too complicated to switch to ISTL for matrix/vector. in PDELab
you can just exchange the backend (a parameter of your function space)
and assemble everything into ISTL data structures. As markus pointed
out, there are good reasons not to try to mix different solver
packages.

> >> IMO the most elegant solution would be to write a new istl vector class that behaves
> >> like BlockVector<FieldVector> but uses Eigen under the hood. 
> > 
> > Please be aware that using this appoach some of the more powerful
> > preconditioners might not be usable (e.g. AMG).
> 
> Why not?  Isn't ISTL all duck-typing?

No, in the AMG you have construct coarse matrices and vectors and
therefore you need to know how the construction works, not only the
access.

Christian




More information about the Dune mailing list