How do I use a Python function to define Dirichlet boundary conditions which are not known in closed form?

Have a look at UserExpressions, for instance:

Here, you can substitute self.T with your function, which has to be evaluated at x[0],x[1],x[2]

3 Likes