[Gmsh] Crash in Delaunay Quad 2d mesh using the Gmsh-api

Konstantinos Iatridis k.iatridis at itech-soft.com
Wed Jun 13 15:12:10 CEST 2018


Hello gmsh developers and community

 

First of all "thank you" to the developers and researchers of gmsh for this
great project.

 

I have built gmsh 3.0.6 as windows DLL and use it to generate 2d quad meshes
from a C++ test application.

I create programmatically a .geo file and send it for meshing using the gmsh
API.

All 2d mesh algorithms are working (BAMG produces bad results but it doesn't
crash) with the exception of DelQuad which crashes in function:

backgroundMesh::updateSizes() in these lines:

      if (s0->second < s1->second)s1->second =
std::min(s1->second,_beta*s0->second);

      else s0->second = std::min(s0->second,_beta*s1->second);

Following the debugger I realized that backgroundMesh is called only for
DelQuad algorithm.

However, the same .geo file, is meshed correctly using the gmsh stand-alone
application with DelQuad enabled and produces a very good result.

I would appreciate any help on how to achieve the same result using DelQuad
from the own test application.

 

The code used to mesh the geo file is:

 

std::string geofile; //..

std::string mshfile; //..

GmshInitialize();

GmshSetOption("General", "Verbosity", 100.);

//(1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7 = BAMG, 8 = DelQuad)

GmshSetOption("Mesh", "Algorithm", 8.0);

GmshSetOption("Mesh", "RecombineAll", 1.0);

GmshSetOption("Mesh", "RecombinationAlgorithm", 1.0);

GModel *m = new GModel();

if (m->readGEO(geofile.c_str()) == 1) {

    m->mesh(2);

    m->indexMeshVertices(true);

    m->writeMSH(mshfile.c_str());

}

delete m;

GmshFinalize();

 

An example Geo file as produced by my program is:

 

Point(1) = {2.0000000000, 3.0000000000, 0.0000000000} ;

Point(2) = {1.0000000000, 3.0000000000, 0.0000000000} ;

Point(3) = {0.0000000000, 3.0000000000, 0.0000000000} ;

Point(4) = {0.0000000000, 1.5000000000, 0.0000000000} ;

Point(5) = {0.0000000000, 0.0000000000, 0.0000000000} ;

Point(6) = {1.0000000000, 0.0000000000, 0.0000000000} ;

Point(7) = {2.0000000000, 0.0000000000, 0.0000000000} ;

Point(8) = {2.0000000000, 1.5000000000, 0.0000000000} ;

Line(1) = {1, 2} ;

Line(2) = {2, 3} ;

Line(3) = {3, 4} ;

Line(4) = {4, 5} ;

Line(5) = {5, 6} ;

Line(6) = {6, 7} ;

Line(7) = {7, 8} ;

Line(8) = {8, 1} ;

Line Loop(1) = { 1,2,3,4,5,6,7,8} ;

Plane Surface(1) = {1} ;

Transfinite Line {1} = 2 Using Progression 1 ;

Transfinite Line {2} = 2 Using Progression 1 ;

Transfinite Line {3} = 2 Using Progression 1 ;

Transfinite Line {4} = 2 Using Progression 1 ;

Transfinite Line {5} = 2 Using Progression 1 ;

Transfinite Line {6} = 2 Using Progression 1 ;

Transfinite Line {7} = 2 Using Progression 1 ;

Transfinite Line {8} = 2 Using Progression 1 ;

 

Thank you in advance

 

Konstantinos Iatridis

-itech-

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20180613/d6db2e8e/attachment.html>


More information about the gmsh mailing list