When defining a DirichletBC
, one might want to access its values after the object has been created (e.g., to alter a parameter in it in case it is an Expression
).
I've always used function_arg
for it, i.e.,
d1 = DirichletBC(V, '0.0', 'on_boundary')
d1.function_arg.t = 42.0
but now I noticed that it just _does not exist_ in some cases. A common example would be
ex1 = Function(V)
d2 = DirichletBC(V, ex1, 'on_boundary')
print(d2.function_arg)
# AttributeError: 'DirichletBC' object has no attribute 'function_arg'
What is the reason for this?