Setting label for Function at creation does not work


138
views
0
9 months ago by

I would like to set the name and label of a Function when I create it instead of renaming it afterwards. See the MWE and corresponding output below:

from fenics import *
from mshr import *

mesh = UnitSquareMesh(10, 10)

V = VectorFunctionSpace(mesh, "P", 1)

u = Function(V, name="u", label="Velocity field")
print(u.name())
print(u.label())

u.rename("u", "Velocity field")
print(u.name())
print(u.label())

 

u 
a Function 
u 
Velocity field


It seems to work for name but not for label. Is this a bug?

note: I am using FEniCS from ppa:fenics-packages/fenics on Ubuntu 16.04.

Community: FEniCS Project
Please login to add an answer/comment or follow this question.

Similar posts:
Search »