Adaptmesh bamg error

Hello,

I get sometimes a fatal error in the mesh generator using adaptmesh with the following option
iso=false, nbvx = 1e6, maxsubdiv=5
Is there an adaptmesh option for pervent this ?

Best regards.

number of required edges : 0
2938 Problem: insert point 2926([116177873,193304108],[-6.45389,4.95713]{3.52903e-07,1.96232e-07,[0.996706,0.0810952]})3171 tcvj = 0x7fffc490 0
([116177832,193304081],[-6.45389,4.95713]{3.4564e-07,2.37417e-07,[0.999816,0.0192053]})([116178067,193304220],[-6.45389,4.95713]{2.24982e-07,1.94815e-07,[0.516705,-0.856164]})
([116177832,193304081],[-6.45389,4.95713]{3.4564e-07,2.37417e-07,[0.999816,0.0192053]})([116178067,193304220],[-6.45389,4.95713]{2.24982e-07,1.94815e-07,[0.516705,-0.856164]})
Fatal error in the mesh generator 1001
current line = 73
Meshing error: Bamg
number : 1001,
Meshing error: Bamg
number : 1001,
err code 5 , mpirank 0

Yes, and no, you want to build a to fine mesh
one way is to bound hmin= parameter of adapdmesh

1 Like

1 - hmin does the job !
In the source code the default value of hmin is Th.MinimalHmin(), i can’t see where hmin is really updated.
2 - Is that expected adaptmesh works with 3d mesh ?
Best regards.

THe minimal Th.MinimalHmin() is a real min of the algorithm, I think is a bad
idea to change.

the place is

bamglib/Mesh2.h: Real8 MinimalHmin( ) const { return 2.0 / coefIcoor; }
bamglib/Mesh2.h: Real8 MinimalHmin( ) { return 2.0 / coefIcoor; }
you can change 2. in 10.

for the 3d can you can use mmg pluggin . They is an example in FreeFem-sources/Laplace-Adapt-aniso-3d.edp at master · FreeFem/FreeFem-sources · GitHub

Thanks, that makes hmin very clear.

Does mmg compatible with 2d mesh ? Is there an exemple ?

Sorry no example, but is simple to build a 2d example from the 3d example.

mmg seems not to work with 2d mesh.

Hi mrbenson,

I found a tutorial at http://annabellecollin.perso.math.cnrs.fr/TPS/TP_0.pdf (it’s in French sorry). You can download the file at http://annabellecollin.perso.math.cnrs.fr/TPS/Code_TP0.zip . Basically it works the following way:

1.In the folder Mesh/:

g++ -std=c++11 -o run main.cc # compile the gmsh to FreeFem converter
./run Lmesh-2D.mesh # run the converter to create the file freefem-Lmesh-2D.mesh

  1. In the main directory:

FreeFem++ adaptLPoisson.edp

And then

mmg2d freefem-Lmesh-2D.mesh -sol freefem-Lmesh-2D.sol -out freefem-Lmesh-2D.mesh

Best,

Lucas