Unintuitive way to assign tensor components

Issue #364 new
Gabriel Balaban created an issue

If ones wants to assign components of a tensor function to a scalar function the intuitive way to do it would be

mesh = UnitCubeMesh(2,2,2) 
VVV = TensorFunctionSpace(mesh, "DG", 0) 
V = FunctionSpace(mesh, "DG", 0)

fff = Function(VVV)
f = Function(V)
assign(f, fff[0, 1])

This however doesn't work. Instead one must do

assign(f, fff.sub(3))

which leaves the user to guess as to how the entries of the matrix are ordered. Would it be possible to have the assign procedure support the standard row, column matrix notation?

Comments (3)

  1. Log in to comment