How to define solution dependable material properties using data points in DOLFINx?

Hi Connor,

many thanks for your answer. The code works as expected. Following your idea I will definitely try to explore more about writing own solvers.

However, since the “polynom” definition of material properties works smoothly with existing solvers, I have a strong feeling that the “interpolation” definition should not require writing a modified solver (perhaps i am not right here). Both functions return the same (or almost the same, see ufl vs numpy). My main idea is to modify the “interpolation function” in a way that the output would be ok for the existing solver (now the solver gives an error: “AttributeError: ‘numpy.ndarray’ object has no attribute ‘subdomain_data’”).

What do you think, would it be possible?

Regards
Anton