Import field from .vtk file and use it as source in heat equation

Hi all,

I wrote a script that solves heat equation given a certain .msh file. I would like to import the (non-uniform) heat source from a .vtk file generated by another code (on a different mesh). Is there a way to read and use such file in FEniCS v2019.1.0?


If the source is defined on a different mesh, how does it relate to the mesh you use in legacy FEniCS?

You should be able to convert the vtk-file to XDMF with meshio, and read the vertex data in with a MeshFunction("double", ....).

Without a minimal reproducible example, it is hard to give any further guidance.