Note that your function, k_f
, takes an input that is an array of numbers, you are passing in a dolfin.Function
.
What I suggest you do then, is the following:
k_new_array = k_f(T.vector().get_local())
Similarly, your project of k_f(T)
, an numpy array, is not an operation supported by dolfin. You need to either use setValuesLocal
, as shown in
How to modify the value of a Function object? - #2 by dokken or
k_new = Function(Space)
k_new.vector()[:] = k_new_array