← Back to team overview

dolfin team mailing list archive

Re: Initializing a Vector from a GenericVector

 

On Wed, Mar 11, 2009 at 11:03 PM, Anders Logg <logg@xxxxxxxxx> wrote:
> On Mon, Mar 09, 2009 at 11:38:38PM +0100, Martin Sandve Alnæs wrote:
>> This doesn't work:
>>
>> Function u(V);
>> ...
>> Vector v(u.vector());
>>
>> since Vector doesn't have any constructor taking a GenericVector.
>
> Should it?
>
> It would require either down-casting or working through the
> GenericVector interface. Should we add a copy constructor in
> GenericVector which uses get/set to assign the values? One could then
> initialize any vector with any vector.

Will it be any slower? An additional copy?
I guess the problem is in parallell.

Downcasting + fallback using get/set would be nice.

Martin


Follow ups

References