← Back to team overview

dolfin team mailing list archive

Re: Vector assignment / parallel layout

 

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