How can we print (plot,show) coordinate values to the corners of the mesh?

Hello all,

I would like to name the corners of the mesh and print something (point name or coordinates) like the image below (marked yellow). Is it possible? How can I do that?

Thank you.

1 // Parameters
 2 real error = 0.1;
 3 
 4 // Mesh
 5 border ba(t=0, 1){x=t; y=0; label=1;}
 6 border bb(t=0, 0.5){x=1; y=t; label=1;}
 7 border bc(t=0, 0.5){x=1-t; y=0.5; label=1;}
 8 border bd(t=0.5, 1){x=0.5; y=t; label=1;}
 9 border be(t=0.5, 1){x=1-t; y=1; label=1;}
10 border bf(t=0, 1){x=0; y=1-t; label=1;}
11 mesh Th = buildmesh(ba(6) + bb(4) + bc(4) + bd(4) + be(4) + bf(6));
12 
13 // Fespace
14 fespace Vh(Th, P1);
15 Vh u, v;
16 
17 // Function
18 func f = 1;
19 
20 // Problem
21 problem Poisson(u, v, solver=CG, eps=1.e-6)
22    = int2d(Th)(
23         dx(u)*dx(v)
24       + dy(u)*dy(v)
25    )
26    - int2d(Th)(
27         f*v
28    )
29    + on(1, u=0);
30 
31 // Adaptmesh loop
32 for (int i = 0; i < 4; i++){
33    Poisson;
34    Th = adaptmesh(Th, u, err=error);
35    error = error/2;
36 }
37 
38 // Plot
39 plot(u);

Sorry, not to day. the graphic part of freefem is very very tiny.

1 Like

So I can not do that in freefem. Thank you sir for the information and reply. :pray: