[Gmsh] Error when switching from Built-In to OpenCascade Factory

Christophe Geuzaine cgeuzaine at uliege.be
Mon Jul 9 21:05:14 CEST 2018


Hi Martin,

"Surface" with OpenCASCADE is a bit tricky - and we are not quite yet happy yet about the implementation. It uses the OpenCASCADE "N-side filling" algorithm to create a BSpline surface using curve and/or point constraints. We could not manage to make this work without applying some fixes (see the addSurfaceFilling function in Geo/GModelIO_OCC.cpp), which (sometimes?) duplicates internal wires.

Any help from OpenCASCADE folks with this would be welcome...

To work around the numbering issues, I would recommend not numbering entities explicitly: in .geo files you can use "newp", "newl", etc.; with the API you would just let the API return a tag for you.

As a side note, you should avoid mixing CAD kernel commands (Line, Surface, ...), model commands (Physical Surface, ...) and mesh constraints (Transfinite Surface, ...) : the last two trigger a synchronization between the CAD kernel and the internal Gmsh model. Doing this repeatedly will degrade performance. It's better to create all CAD entities, then apply model and mesh commands.

Christophe


> On 8 Jul 2018, at 21:18, Martin.Raedel at dlr.de wrote:
> 
> Hello,
>  
> I want to add some information.
>  
> Yes, for the test case I could simply switch to “Plane Surface” and everything is working. But in reality, my models also consist on non-planar surfaces. I added another test as an attachment to this mail.
>  
> I found that if I increment the Line Loop and Surface numbers by 2 instead of 1, e.g. from the attached example:
>  
> Line Loop(1) = {10,2,11,3};
> Surface(1) = {1};
> Transfinite Surface(1) = {};
> Recombine Surface(1) = 60.0;
> Physical Surface(1) = {1};
>  
> Line Loop(3) = {12,4,13,5};
> Surface(3) = {3};
> Transfinite Surface(3) = {};
> Recombine Surface(3) = 60.0;
> Physical Surface(3) = {3};
>  
> no errors occur as well. This matches the error message. It seems that with the OpenCASCADE Factory, additional line loops are created internally. Changing this in my code would be possible but work I would rather avoid.
>  
> Can someone explain to me what where the different treatment of “Plane Surface” and “Surface” with respect to the line loops comes from? The documentation <http://gmsh.info/doc/texinfo/gmsh.html#Surfaces> says “Surface” is a “surface filling”. What does that mean exactly?
>  
> Best regards
> Martin
>  
> Von: gmsh [mailto:gmsh-bounces at ace20.montefiore.ulg.ac.be <mailto:gmsh-bounces at ace20.montefiore.ulg.ac.be>] Im Auftrag von Martin.Raedel at dlr.de <mailto:Martin.Raedel at dlr.de>
> Gesendet: Sonntag, 8. Juli 2018 17:01
> An: gmsh at onelab.info <mailto:gmsh at onelab.info>
> Betreff: [Gmsh] Error when switching from Built-In to OpenCascade Factory
>  
> Hello,
>  
> I just recently tried to switch from the built-in Factory to OpenCascade to use Boolean operations.
>  
> However, all of my tests involving more than one surface crash after the switch with the same error:
>  
> OpenCascade wire or line loop with tag 2 already exists
>  
> The same error occurs for all other surfaces except the first.
>  
> I added a simple brick geometry example. In case I comment out “SetFactory("OpenCASCADE"); “ everything works fine. If I use the line, the errors occur.
>  
> Can someone please point out what causes these errors and how I can fix them?
>  
> Best regards
> Martin Rädel
>  
> ————————————————————————
> Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)
> German Aerospace Center
> Institute of Composite Structures and Adaptive Systems | Structural Mechanics | Lilienthalplatz 7 | 38108 Braunschweig | Germany
>  
> Dipl.-Ing. Martin Rädel
> Telephone +49 (0)531 295-2048 | Telefax +49 (0)531 295-2232 | martin.raedel at dlr.de <mailto:martin.raedel at dlr.de>
> www.DLR.de <http://www.dlr.de/>
>  
> <unplanebrick.geo>_______________________________________________
> gmsh mailing list
> gmsh at onelab.info <mailto:gmsh at onelab.info>
> http://onelab.info/mailman/listinfo/gmsh <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

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


More information about the gmsh mailing list