Hi,
Relying on element numbering for transferring data is not be very reliable because GetFEM may use a different element numbering. I would recommend you to save your values in a text file with 4 columns (or 3 for 2D):
x,y,z,val
where the first 3 columns (2 for 2D) contain the coordinates of the center of the element
Then you can use the following snippet for reading and transferring the values to a model variable/data defined on a discontinuous MeshFem mf:
import numpy as np
from scipy.spatial import KDTree
file = open("source_data.txt", "r") # assuming it contains 4 columns: x,y,z,value
source_data = np.loadtxt(file,dtype=float)
tree = KDTree(source_data[:,0:3])
dd,ii = tree.query(mf.basic_dof_nodes())
md.add_fem_data("source", mf)
md.set_variable("source", source_data[ii,3])
BR
Kostas