Unexpected "curve loop is wrong" error with geo_unrolled but not with initial geo file using OpenCASCADE
The following script ("gaafet.geo") causes me problems.
SetFactory("OpenCASCADE");
// Geometry parameters
L = 10; // Channel length
r0 = 1.5; // Channel radius
tox = 1; // Oxide thickness
Lc = 5; // Source/drain thickness
Mesh.CharacteristicLengthMin = 1.0;
Mesh.CharacteristicLengthMax = 1.0;
// Mesh.CharacteristicLengthMin = 0.2;
// Mesh.CharacteristicLengthMax = 0.2;
Cylinder(1) = {0, 0, 0, 0, 0, L+2*Lc, r0+tox, 2*Pi};
Cylinder(2) = {0, 0, 0, 0, 0, L+2*Lc, r0, 2*Pi};
BooleanFragments{ Volume{2}; Volume{1}; Delete; }{ }
Cylinder(4) = {0, 0, Lc, 0, 0, L, r0+tox, 2*Pi};
Cylinder(5) = {0, 0, Lc, 0, 0, L, r0, 2*Pi};
BooleanFragments{ Volume{2}; Volume{3}; Volume{4}; Volume{5}; Delete; }{ }
//+
Physical Volume("channel", 33) = {5};
//+
Physical Volume("drain", 34) = {6};
//+
Physical Volume("channel_ox", 35) = {9};
//+
Physical Volume("source", 36) = {7};
//+
Physical Volume("source_ox", 37) = {10};
//+
Physical Volume("drain_ox", 38) = {8};
//+
Physical Surface("source_bnd", 39) = {19};
//+
Physical Surface("drain_bnd", 40) = {17};
//+
Physical Surface("gate_bnd", 41) = {23};
Mesh 1;
Mesh 2;
Mesh 3;
Save "gaafet.geo_unrolled";
Save "gaafet.msh2";
Executing the script with "gmsh gaafet.geo" works fine, and produces the .msh2 and geo_unrolled files without problem.
However, subsequently loading the geo_unrolled file in the Python API fails. If I do:
import gmsh
gmsh.initialize()
gmsh.open("gaafet.geo_unrolled")
then I get the following error message:
Info : Reading 'unittests/point_charge/meshes/gaafet_2.geo_unrolled'...
Info : Starting subloop 1 in curve loop 16 (are you sure about this?)
Info : Starting subloop 1 in curve loop 20 (are you sure about this?)
Error : Curve loop 21 is wrong
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\fbeau\miniconda3\envs\poissonfem\lib\site-packages\gmsh.py", line 295, in open
raise Exception(logger.getLastError())
Exception: Curve loop 21 is wrong
I don't understand how a curve loop could be wrong since I am not using any. I am just defining cylinders and then taking Boolean fragments with OpenCASCADE.
I am using Gmsh version 4.10.5.