Hi Susana,
you clear the vector by:
'
u.components[0].vec[:] = 0
'
With
'
u.componetns[0].data = 0
'
you have added an object named data to the GridFunction, but you did not clear the vector. Now, we have already an object 'data' within the GridFunction which you are not allowed to overwrite.
best, Joachim