This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Potential problem with operator += in 1.5.0

+1 vote

This is not a question, just a word of advice on 1.5.0 in python.

My code returns wrong results in 1.5.0 when using a line like this:
u.vector()[:] += (W * b*vector()).array()
This works on 1.3.0 though.
However everything works fine if I use axpy,
u.vector().axpy(1.0, W * b.vector())

I won't submit a bug report as I was not able to reproduce this in a simple example but other people in my lab mentioned that they observed funky behaviours when using the operator += in 1.5.0.

asked Apr 14, 2015 by BC FEniCS Novice (790 points)
...