Add a spatial parameter field

Hello everyone,

I have to use a spatial distribution to define a parameter of my equation. For example for a 2D Darcy equation, the permeability is not constant, it is defined in a text file according to the spatial coordinates X and Y.
Is it possible to import this file and use it as a permeability in the equation weak form? If it is possible, the X Y coordinates of the file and the mesh nodes coordinates should be mixed up or we can use any X Y grid and Freefem will interpolate it?

Thank you.

Yes Thérese is an exemple to build this see of this example

To buil a mesh and thé function.

Thank you Mr Hecht, I will try to do so.

I sorry I make a mistake in the name the function it is:
to build a 2d mesh form a set of point,

and the file xyf is:

and contening at each ile x,y,f(x,y)

Thank you M. Hecht, it works correctly in 2D. However, I didn’t find in the documentation any other function that can do the same job as “triangulate()” but in 3D. Is there a trick or another method to do it ?

Thank you in advance.

the corresponding code in 3d is in exemples/plugin (convex hull)