We have some objects in DOLFIN that can contain data or can be a view
into another object, e.g. DofMap, FunctionSpace, Function. It's often
not clear what is what, and it tends to complicate the code for
classes that can either own data or provide a view.
We've settled on adding a MeshView class, and it would nice to extend
this further to other classes and have, for example, DofMapView,
SubFunctionView, SubSpaceView. Objects that own data could be created
from views. For example, in place of the
Function.split(deepcopy=False) functionality, we could have
# Mixed function
W = Function(V)
# u and p a SubFunctionViews into W
u = W.sub_function(0)
p = W.sub_function(1)
# u and p are now Function objects that own their data
u = Function(u)
p = Function(p)
Thoughts on separating out objects that own data and objects that provide views?
Garth
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics