Mmg3d does not work in Ubuntu 20.04 but works in Mac and Windows

Dear all,

I did mesh adaption by mmg3d, the same code has different results on different PCs. In windows with FreeFem v4.10 and Mac with v4.12,
the mesh can be adapted, be refined near the edge (y==0);
but in Ubuntu 20.04 with ff v4.12, the mmg3d did not change the mesh.
One of my colleague also checked in his Linux with v4.12, the mesh was not changed.

The following is my simple example:

load "msh3"
load "medit"
load "aniso"
load "mmg"
load "mshmet"
include "cube.idp"

int[int] Nxyz=[10,10,3];
real [int,int] Bxyz=[[0.,0.06],[0.,0.06],[0.,0.0015]];
int [int,int] Lxyz=[[1,1],[2,2],[2,2]];
mesh3 Th=Cube(Nxyz,Bxyz,Lxyz);
fespace Ph6(Th,[P1,P1,P1,P1,P1,P1]);
Ph6 [m11,m21,m22,m31,m32,m33];

real errh,hmax,hmin,adaptratio;
errh = 1e-3; hmax = 0.01; hmin =1e-7 ;adaptratio = 1.5;
real epsilon = 0.002; 

fespace Ph(Th,P1);
Ph p = -(2*tanh(y/(epsilon))-1);
real[int] hmetric(6*Th.nv);

hmetric=mshmet(Th,p,normalization=1,aniso=1,nbregul=1,hmax=hmax,hmin=hmin,err=errh);
boundaniso(6,hmetric,40);
m11[]=hmetric;

mesh3 Th3=mmg3d(Th,mem=10000,metric=m11[],hmax = hmax,hmin = hmin);
medit("init",Th);
medit("after",Th3);

Thanks!
Y.H.
Examplemmg.edp (728 Bytes)

Can you include it as an attachment? The copy/paste has been corrupting files
for me ( Ubuntu 15 or so lol ).

I upload an attachement of this example.

In Windows, the 2nd image is adapted like that.

 cat  /proc/version
Linux version 4.15.0-142-generic (buildd@lgw01-amd64-039) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)) #146~16.04.1-Ubuntu SMP Tue Apr 13 09:27:15 UTC 2021
marchywka@happy:/home/documents/cpp/proj/freefem/play$ FreeFem++ 
FreeFem++ - version 4.12 (Sun Jan 22 17:51:12 EST 2023 - git no git) 64bits
License: LGPL 3+ (https://www.gnu.org/licenses/lgpl-3.0.en.html)

`ldd `which FreeFem++`
	linux-vdso.so.1 =>  (0x00007fff155a6000)
	libumfpack.so.5 => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/libumfpack.so.5 (0x00007f8fec4b4000)
	libcholmod.so.3 => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/libcholmod.so.3 (0x00007f8fec1a9000)
	liblapack.so.3 => /usr/lib/liblapack.so.3 (0x00007f8feb9b1000)
	libblas.so.3 => /usr/lib/libblas.so.3 (0x00007f8feb773000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f8feb56f000)
	libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007f8feb244000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8feaf3b000)
	libhdf5_serial.so.10 => /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.10 (0x00007f8feaa9d000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8fea880000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8fea4fe000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8fea2e8000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8fe9f1e000)
	libamd.so.2 => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/libamd.so.2 (0x00007f8fe9d14000)
	libsuitesparseconfig.so.5 => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/libsuitesparseconfig.so.5 (0x00007f8fe9b11000)
	libcolamd.so.2 => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/libcolamd.so.2 (0x00007f8fe9909000)
	libccolamd.so.2 => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/libccolamd.so.2 (0x00007f8fe96fc000)
	libcamd.so.2 => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/libcamd.so.2 (0x00007f8fe94f0000)
	libmetis.so => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/libmetis.so (0x00007f8fe927e000)
	libatlas.so.3 => /usr/lib/libatlas.so.3 (0x00007f8fe8ce0000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f8fec77c000)
	libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f8fe8aa1000)
	libsz.so.2 => /usr/lib/x86_64-linux-gnu/libsz.so.2 (0x00007f8fe889e000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f8fe8684000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f8fe847c000)
	libaec.so.0 => /usr/lib/x86_64-linux-gnu/libaec.so.0 (0x00007f8fe8274000)
`

Here is what I get with Linux. You should consider trying out the develop branch with the latest available PETSc (which will get you the latest available Mmg).

In Windows, the mmg version is 5.5.2 ,
and in Linux with mmg 5.6.0, is it the latest ?

Not at all. This is what you’ll get with a proper installation (on both Linux/macOS/Windows).

$ FreeFem-sources-linux/src/nw/FreeFem++ Examplemmg.edp -v 0 -nw

  ## Warning: MMG5_memOption_memSet: asking for 10000 MB of memory when only 3966 available.

  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
   MODULE MMG3D: 5.7.1 (Dec. 20, 2022)
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
     git branch: HEAD
     git commit: 9bd0023fe5f4a7de55d2959dd8dd4bf5d6929a36
     git date:   2022-12-22 08:56:26 +0100
[...]