If doing low level editing of vector values, yes. Unless we set dirty flags on __setitem__, and call apply elsewhere whenever an updated vector is needed, as discussed before.
There's probably a lot of common operations that we can add high level utility functions for performing without accessing the vector directly, making this issue rarer. Martin On 28 November 2014 at 15:45, Johan Hake <[email protected]> wrote: > Are you saying that apply calls should be up to the user to call? > > Joahn > > On Fri, Nov 28, 2014 at 3:39 PM, Martin Sandve Alnæs <[email protected]> > wrote: > >> I think there's a lot of merit to the concept of using numpy views of the >> local vectors and require apply calls to communicate. >> >> Martin >> 28. nov. 2014 15:04 skrev "Garth N. Wells" <[email protected]>: >> >>> >>> On Thu, 27 Nov, 2014 at 7:38 PM, Johan Hake <[email protected]> wrote: >>> >>>> Hello! >>>> >>>> In some code I have I uses the indices interface to set local dofs in a >>>> vector. It turns out that v[indices] = some_values uses the >>>> GenericVector::set function instead of GenericVector::set_local. This means >>>> that one need to pass global indices. >>>> >>>> I typically use the slicing together with some combination of indices I >>>> got from the vertex_to_dofs functionality. However, now that returns local >>>> dofs and it then makes more sense to switch the behavior of v[indices] to >>>> use local dofs. >>>> >>>> Any objections against switching to local indices in v[indices]? >>>> >>> >>> I don't have any objections, but I also don't have a clear view of how >>> we should interact with distributed vectors from Python re the NumPy >>> wrapping. It's a bigger job, but it would be nice to think this through for >>> a consistent interaction between distributed DOLFIN vectors and wrapping as >>> NumPy objects. >>> >>> Garth >>> >>> >>> Johan >>>> >>>> >>>> >>>> >>>> >>> _______________________________________________ >>> fenics mailing list >>> [email protected] >>> http://fenicsproject.org/mailman/listinfo/fenics >>> >> >
_______________________________________________ fenics mailing list [email protected] http://fenicsproject.org/mailman/listinfo/fenics
