dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #25247
Re: Vector assignment / parallel layout
-
To:
"Garth N. Wells" <gnw20@xxxxxxxxx>
-
From:
Anders Logg <logg@xxxxxxxxx>
-
Date:
Thu, 24 Nov 2011 01:05:39 +0100
-
Cc:
DOLFIN Mailing List <dolfin@xxxxxxxxxxxxxxxxxxx>
-
In-reply-to:
<CAA4C66MmR9qA8ch0A1iXEK18=050kSJkBEyJf9QPMTnTTf1kpA@mail.gmail.com>
-
User-agent:
Mutt/1.5.21 (2010-09-15)
On Wed, Nov 23, 2011 at 11:13:52PM +0000, Garth N. Wells wrote:
> It looks like it will be easy to fix the problem that we have with
> vector assignment in parallel. The solution is
>
> 1. Permit assignment via operator= of equal-length vectors only. It
> will just copy values. I've tested this equal-length restriction, and
> it doesn't affect any DOLFIN tests or demos.
>
> 2. If a user attempts to perform assignment of vectors that have
> different lengths, print an error that recommend using the copy
> constructor, e.g.
>
> y = Vector(x)
>
> This change will also improve performance, since at present we always
> destroy and re-create PETSc vectors when assigning, even when the
> lengths are equal.
>
> Any objections to this going into the 1.0 branch?
Sounds good to me.
--
Anders
Follow ups
References