← Back to team overview

dolfin team mailing list archive

Re: GenericVector and PyDOLFIN

 



Johan Hake wrote:
On Wednesday 19 August 2009 17:29:52 Garth N. Wells wrote:
What's going on behind the scene when I copy one vector to another in
PyDOLFIN using

     u0.vector()[:] = u.vector()[:]

When I add:

u2 = Function(V)
u2.vector()[:] = u.vector()[:]

# Plot solution
plot(u2)

In a the Poisson demo it works fine.


In parallel?

This type of slice only uses the assignment operator.

The GenericVector assignment operator?

I delved into the problem and the program ends up in the function _compare_vector_with_vector from dolfin_la_get_set_items.i. It uses GenericVector::get and GenericVector::set. These need to be used with caution in parallel.

Garth

Other slices might not
work. Have not checked.

Johan

? The issue is that it doesn't work in parallel.

Garth
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev




Follow ups

References