dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #14771
SubFunctions
Please send any comments on how a SubFunction should work as I'm going
to work on it soon (the Cahn-Hilliard demo runs in parallel(!) ;) with
the exception of the extraction of sub-Functions for output). I'm
inlined to change a sub function such that for
Function u0 = u[0]
the Function u0 will only point the vector belonging to u rather than
creating a new vector. The advantages are:
- No need to copy a vector
- DofMap will not require 'is_view'
- Possible to do things like
u0 = 0.0;
u1 += v;
u0.interpolate();
Disadvantages are:
- It may be unclear that u0 and u share data.
- If u goes out of scope, u0 is will keep the vector belonging to u
alive (only an issue if the vector is very large compared to that
required by u0).
Garth
Follow ups