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

Oliver Sander sander at igpm.rwth-aachen.de
Wed May 27 09:05:48 CEST 2015


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?

Hi Tobias,

as far as I know you can't do that.  Maybe it can be done with some allocator trickery,
but such a solution would probably be pretty fragile.

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.  I think we may even
consider including such a class in dune-istl, if it is well done.  Alternatively,
you could write an istl vector class that accepts a raw pointer to external storage.
Less pretty, but more flexible.

Out of curiosity: what is your use case?


> I have been looking at block_vector_unmanaged and base_array_unmanaged but
> I guess they're not for general use?

I could never be convinced these things are even helpful for the implementation
of BlockVector.

Cheers,
Oliver



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20150527/3acd03b1/attachment.sig>


More information about the Dune mailing list