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

2018-06-14 Thread Christophe Geuzaine

Can you download the binary SDK from the website and test my python script with 
that?

Christophe

> On 14 Jun 2018, at 16:47, Konstantinos Iatridis  
> wrote:
> 
> Thank you for the fast response!
> I downloaded the current gmsh version from github.
> I build it again as dll.
> Configuring gmsh I changed the following switches to reduce dependencies:
> . ENABLE_ACIS=0
> . ENABLE_BLAS_LAPACK=0
> . ENABLE_FLTK=0
> . ENABLE_OCC=0
> . ENABLE_OCC_CAF=0
> . ENABLE_OPENMP=0
> . ENABLE_OSMESA=0
> . ENABLE_OPTHOME=0
> 
> My compiler is visual studio 2015.
> I modified the code of my app following your Python example. In your example
> you set the Algorithm =5 but as far as I can see the desired algorithm for
> me is =8. I tested both:
> 
> std::string geofile; //..
> std::string mshfile; //..
> gmsh::initialize();
> gmsh::option::setNumber("General.Terminal", 1);
> gmsh::option::setNumber("Mesh.Algorithm", 5); //5: runs ok, 8: crash!
> gmsh::option::setNumber("Mesh.RecombineAll", 1);
> gmsh::option::setNumber("Mesh.RecombinationAlgorithm", 1);
> gmsh::open(geofile.c_str());
> gmsh::model::geo::synchronize();
> gmsh::model::mesh::generate(2);
> gmsh::write(mshfile.c_str());
> gmsh::finalize();
> 
> As in the previous version
> -Algorithm 5 runs ok
> -Algorithm 8 crashes and as I can see from my debugger still in
> backgroundMesh::updateSizes()
> 
> Could the build options or the compiler version affect the Delaunay Quad
> Algorithm?
> Can you verify that the same code runs in your configuration with Algorithm
> =8?
> Any suggestion on what could cause the crash?
> 
> Thank you in advance
> 
> Konstantinos Iatridis
> -itech
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ___
> gmsh mailing list
> gmsh@onelab.info
> http://onelab.info/mailman/listinfo/gmsh

— 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science 
http://www.montefiore.ulg.ac.be/~geuzaine

Free software: http://gmsh.info | http://getdp.info | http://onelab.info

___
gmsh mailing list
gmsh@onelab.info
http://onelab.info/mailman/listinfo/gmsh


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

2018-06-14 Thread Konstantinos Iatridis
Thank you for the fast response!
I downloaded the current gmsh version from github.
I build it again as dll.
Configuring gmsh I changed the following switches to reduce dependencies:
.   ENABLE_ACIS=0
.   ENABLE_BLAS_LAPACK=0
.   ENABLE_FLTK=0
.   ENABLE_OCC=0
.   ENABLE_OCC_CAF=0
.   ENABLE_OPENMP=0
.   ENABLE_OSMESA=0
.   ENABLE_OPTHOME=0

My compiler is visual studio 2015.
I modified the code of my app following your Python example. In your example
you set the Algorithm =5 but as far as I can see the desired algorithm for
me is =8. I tested both:

std::string geofile; //..
std::string mshfile; //..
gmsh::initialize();
gmsh::option::setNumber("General.Terminal", 1);
gmsh::option::setNumber("Mesh.Algorithm", 5); //5: runs ok, 8: crash!
gmsh::option::setNumber("Mesh.RecombineAll", 1);
gmsh::option::setNumber("Mesh.RecombinationAlgorithm", 1);
gmsh::open(geofile.c_str());
gmsh::model::geo::synchronize();
gmsh::model::mesh::generate(2);
gmsh::write(mshfile.c_str());
gmsh::finalize();

As in the previous version
-Algorithm 5 runs ok
-Algorithm 8 crashes and as I can see from my debugger still in
backgroundMesh::updateSizes()

Could the build options or the compiler version affect the Delaunay Quad
Algorithm?
Can you verify that the same code runs in your configuration with Algorithm
=8?
Any suggestion on what could cause the crash?

Thank you in advance

Konstantinos Iatridis
-itech










___
gmsh mailing list
gmsh@onelab.info
http://onelab.info/mailman/listinfo/gmsh


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

2018-06-13 Thread Christophe Geuzaine

I cannot reproduce the crash with the latest snapshot.

Instead of generating a .geo file and using the undocumented private api, I 
would encourage you to try the new stable api - it's available in C++, C, 
Python and Julia.

Here's your example written using the Python api :

*** test.py ***

import gmsh

gmsh.initialize()

gmsh.option.setNumber("General.Terminal", 1)
gmsh.option.setNumber("Mesh.Algorithm", 5) # delquad
gmsh.option.setNumber("Mesh.RecombineAll", 1)

gmsh.model.geo.addPoint(2.0, 3.0, 0.0)
gmsh.model.geo.addPoint(1.0, 3.0, 0.0)
gmsh.model.geo.addPoint(0.0, 3.0, 0.0)
gmsh.model.geo.addPoint(0.0, 1.5, 0.0)
gmsh.model.geo.addPoint(0.0, 0.0, 0.0)
gmsh.model.geo.addPoint(1.0, 0.0, 0.0)
gmsh.model.geo.addPoint(2.0, 0.0, 0.0)
gmsh.model.geo.addPoint(2.0, 1.5, 0.0)
gmsh.model.geo.addLine(1, 2)
gmsh.model.geo.addLine(2, 3)
gmsh.model.geo.addLine(3, 4)
gmsh.model.geo.addLine(4, 5)
gmsh.model.geo.addLine(5, 6)
gmsh.model.geo.addLine(6, 7)
gmsh.model.geo.addLine(7, 8)
gmsh.model.geo.addLine(8, 1)
gmsh.model.geo.addCurveLoop([1, 2, 3, 4, 5, 6, 7, 8])
gmsh.model.geo.addPlaneSurface([1], 1)

gmsh.model.geo.synchronize()

for i in range(1,9):
gmsh.model.mesh.setTransfiniteCurve(i, 2)

gmsh.fltk.run()

gmsh.finalize()

***



> On 13 Jun 2018, at 15:12, Konstantinos Iatridis  
> wrote:
> 
> 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.00, 3.00, 0.00} ;
> Point(2) = {1.00, 3.00, 0.00} ;
> Point(3) = {0.00, 3.00, 0.00} ;
> Point(4) = {0.00, 1.50, 0.00} ;
> Point(5) = {0.00, 0.00, 0.00} ;
> Point(6) = {1.00, 0.00, 0.00} ;
> Point(7) = {2.00, 0.00, 0.00} ;
> Point(8) = {2.00, 1.50, 0.00} ;
> 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-
>  
> ___
> gmsh mailing list
> gmsh@onelab.info 
> http://onelab.info/mailman/listinfo/gmsh 
> 
— 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science 
http://www.montefiore.ulg.ac.be/~geuzaine

Free software: http://gmsh.info | http://getdp.info | http://onelab.info

___
gmsh mailing list
gmsh@onelab.info
http://onelab.info/mailman/listinfo/gmsh