Steady-heat conduction problems

I need to solve a steady-heat conduction problem, where heat source and thermal conductivity are related to coordinates, but I don’t know the specific function expression
-\nabla \cdot (\theta(x) \nabla u(x)) = f(x), \forall x \in \Omega
\theta(x) \nabla u(x) \cdot n(x) = \eta(x), \forall x \in \varGamma_{\eta}
u(x) = 0, \forall x \in \varGamma_{g}
Where I don’t know the specific expression of f and \theta, just knowing values in some points.
So how to solve this problem in FEniCS? Thank you guys!

Some points meaning not all points in the mesh?
You’ll first need to decide how to define the function values on every other point. That decision has to be done on paper, before programming anything. A nearest point interpolation? A polynomial interpolation?

Once you have decided that, look at the links in Interpolating numerical values (2D numpy array) over a mesh for a few suggestions on how to implement that in dolfinx.

For future posts, please read Read before posting: How do I get my question answered? and adhere to those guidelines. In particular, it would have been appreciated if you posted a code with what you attempted to do.

1 Like

Thank you for your suggestion.
Some points meaning that I sample some values of f in a mesh, for example 100 \times 100. But I don’t have the exact or specific expression such as

f = ufl.sin(x[0]) + ufl.sin(x[1])

Well, then looking into the links in the first discussion mentioned above should give you a good starting point.