dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #12630
Re: Initializing a Vector from a GenericVector
On Wed, Mar 11, 2009 at 11:15:56PM +0100, Martin Sandve Alnæs wrote:
> 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
Sounds good. I've added it to the TODO list. Feel free to fix it.
--
Anders
Attachment:
signature.asc
Description: Digital signature
References