Hello,
I would like to know whether there is a straightforward way to define ufl expressions from interpolated data (e.g. using numpy.interp
).
My goal is adapt the tutorial Optimal control in DOLFINx by replacing
by
where g is a function of f, approximating somehow g_samples
at f_samples
.
For forward evaluation, g = numpy.interp(f.x.array, f_samples, g_samples)
should do the trick.
But what about the sensitivity w.r.t f
?
Thanks in advance for your time and advice.