Hello,
I just installed the FreeFem++ v4.11 on Linux Mint 20.3 on my new machine.
I was testing the codes in the examples and encountered segfault with plotting on a square mesh.
For example, this code produces segfault when it comes to the plot line:
mesh Th = square(150, 50, [3x, y]);
plot(Th,wait=1);
fespace Vh(Th, P1);
Vh u;
u = cos(2.0pixy);
plot(u,wait=1,cmm=“initial field”);
However, if I set u = const, then there is no segfault.
On the other hand, this code goes through fine:
border C(t=0, 2pi){x=cos(t); y=sin(t);}
mesh Th = buildmesh(C(50));
fespace Vh(Th, P1);
Vh u;
u = cos(2.0pixy);
plot(u,wait=1,cmm=“initial field”);
Any ideas on what could be going wrong?
Do you have old version of freefem installed
Check with
which freefem++
which ffglut
If the paths are not the same then you have two version so remote thé old one
You can try to create a file of the plot
FreeFem++ script.edp -fglut script.fglut
to see the plot
ffglut -vvv script.fglut
And the have an idea of the problem!
Thank you for your suggestion. I tried what you said and here is what I’m getting. If I use
mesh Th = square(15,15);
then ffglut plots it without an issue. But with
mesh Th = square(20,20);
I get the following error message:
out.pdf (76.3 KB)
Can you sent the file script.fglut ?
I have try the glut file is ok for my version of FreeFem
the output is :
MBP-M1-FH:Downloads hecht$ ffglut -v Heat1.fglut
glutscreenscale 1 1152 744 1728 1117
ffglut : 10
fopen :Heat1.fglut 0x1ee0c4d50
mode read = r
GRead : nv 441 800 80
-- End of read: mesure = 1 border mesure 4
-- BuildAdj:0x600000618e60 nb Elememt 800 nb vertices 441
: nb adj = 1240 on border 80 nea = 3 nva = 2 nb no manifold border 0
-- Mesh2 (File *), d 2, n Tet 800, n Vtx 441 n Bord 80
next is build 0x13ee0efa0 wait :1 -> 1 gwait = 0
on a lue le premier plot next plot: 0x13ee0efa0
pView 0 0 1153 745 kscreenscale= 1
DefaultView 2 0 theplot 0x0
change current plot to: 0x13ee0efa0 et Lock Plot . winnum 0
OneWindow:: add 0 -> 0
OneWindow:: set 0 -> 0
DefaultView 2 0 theplot 0x13ee0efa0
We Read a plot : 1 0x0 -1
ThePlot::Plot 1 0x13ee0efa0 win 0x13ef60170 01
DefaultView 0 0 theplot 0x13ee0efa0
ThePlot::Plot 1 0x13ee0efa0 win 0x13ef60170 11
ThePlot::Plot 1 0x13ee0efa0 win 0x13ef60170 11
Key winnum: 0
send signal For Next plot, skip: No More Plot !
ThePlot::Plot 1 0x13ee0efa0 win 0x13ef60170 11
ThePlot::Plot 1 0x13ee0efa0 win 0x13ef60170 11
Key winnum: 0
send signal For Next plot, skip: No More Plot !
ThePlot::Plot 1 0x13ee0efa0 win 0x13ef60170 11
ThePlot::Plot 1 0x13ee0efa0 win 0x13ef60170 11
Key winnum: 0
send signal For Next plot, skip: No More Plot !
ThePlot::Plot 1 0x13ee0efa0 win 0x13ef60170 11
ThePlot::Plot 1 0x13ee0efa0 win 0x13ef60170 11
Key winnum: 0
MBP-M1-FH:Downloads hecht$
The only way is to recompile ffglut and reinstall.
remove ffglut
MBP-M1-FH:~ hecht$ cd ff/ff-10/
MBP-M1-FH:ff-10 hecht$ rm src/nw/ffglut
make
/Library/Developer/CommandLineTools/usr/bin/make all-am
make[4]: Nothing to be done for `all-am'.
Making all in nw
g++ -Wno-undefined-var-template -m64 -fPIC -DNDEBUG -O3 -O3 -O3 -std=c++14 -DBAMG_LONG_LONG -DNCHECKPTR -fPIC -o ffglut ../femlib/Drawing.o ../femlib/fem.o ../fflib/ffapi.o ../femlib/FQuadTree.o ../femlib/GQuadTree.o ../femlib/Mesh1dn.o ../femlib/Mesh2dn.o ../femlib/Mesh3dn.o ../femlib/MeshSn.o ../femlib/MeshLn.o ../femlib/mshptg.o ../Graphics/ffglut.o ../Graphics/ffthreads.o ../Graphics/gggg.o ../libMesh/libMesh.a -framework GLUT -framework OpenGL -framework Cocoa -lpthread
Making all in mpi
make[3]: Nothing to be done for `all'.
make install
I reinstalled Linux 20.2 and then everything worked.
Thank you for your help!
Very good, I close this plotting issue.