# How to assign data only on the edges of a 3D mesh

Dear Freefem team, I hope all of you doing great. I was wondering if there is any way I can only give a number to the points on the edges of a 3D mesh. I noticed that ,in Freefem, we can use ThS= Th.gamma to get the surface of 3D mesh. Then the edges ThL can be get from ThS by ThS.gamma as well. Initially, I attempted interpolate the data from MeshL to 3D mesh. However, it seems doesn’t work. I am attaching the code here, which shows the steps I mentioned above. Thank you so much for you time.
FREE_FEM_01.zip (3.0 MB)

I Sorry a try your exemple, I see not problem,
And I do not understand what you want to do.

Dear frederic, thank you for your time. In the demo, we did not put the interpolation over there. Basically, what am trying to do is:" fespace Vh(Th,P0); Vh ThreeD; fespace VhL(ThL,P0) oneDedge;
oneDedge = 1; ThreeD = oneDedege; " I thought ThreeD will only have 1 on the edges, and any other place will give 0; However, ThreeD has 1 everywhere. Thank you.

OK, the big problem in you all is: the dof of Vh is the barycenter of tet so no way by this way.

You can use P0edge finite element with dof are the barycenter of edge.

Thank you, If there is any example I can find from online?

I will try to fluid a simple example, but a find bug buildBdMesh function
zcwang6.edp (562 Bytes)

I try to correct rapidly

Thank you Frederic !!

I fact, They no error except in my graphic interpretation.

This code build a finite element function on edge U3

value = 1 on edge on edge of the cube
value = 0 on all other edge of the mesh.

zcwang6-v2.edp (740 Bytes)

Thank you so much, sir.