Question #92245 on DOLFIN changed: https://answers.launchpad.net/dolfin/+question/92245
Status: Open => Answered Garth Wells proposed the following answer: There are two ways of creating a sub-function. 1: Function u0 = U[0]; This will make a deep copy of data. The Function u0 will have its own vector which will contain only the coefficients for the first sub- function (sub-function zero). This vector belonging to u0 is independent of that which belongs to U, i.e. if U changes, u0 will not and vice- versa. 2: Function& v0 = U[0]; This will make a shallow copy of some data, i.e. v0 and U will share data. The Function v0 will share the vector belonging to U, and this vector contains all the coefficients for U and not just for v0. The Function u0 will have its own DofMap. If the Function U changes, then so will v0. It is not possible to assign values to a sub-function. You can assign values to u0, because it is effectively a Function, but assigning values to u0 will not change U. You cannot assign values to v0 (or it is a least untested). -- You received this question notification because you are a member of DOLFIN Team, which is an answer contact for DOLFIN. _______________________________________________ Mailing list: https://launchpad.net/~dolfin Post to : dolfin@lists.launchpad.net Unsubscribe : https://launchpad.net/~dolfin More help : https://help.launchpad.net/ListHelp