On a polygonal domain, I have scalar values given in the polygon corners. I would like to linearly interpolate those onto the polygon edges for use as Dirichlet boundary conditions for, say, the heat equation.
A brute-force approach would be to define an Expression that checks whether an input coordinate x
indeed sits on a polygon edge, and return the respective linearly interpolated value. Since I'm planning to solve the heat equation many times though, some way for caching the result would be handy.
How would you do it?