[Gmsh] Line loop and Open cascade

Christophe Geuzaine cgeuzaine at uliege.be
Thu Feb 22 17:25:27 CET 2018



> On 22 Feb 2018, at 16:47, Sathyanarayan Rao <sathyanarayan.rao at uclouvain.be> wrote:
> 
> If I put 
> SetFactory("OpenCASCADE");
> 
> in the first line, then it gives me different error saying "unknown line loop with tag1"

Yes, there is no line loop 1 in your geometry... Only a surface 1 ("Rectangle" creates a surface...)

> 
> // mesh size description
> SetFactory("OpenCASCADE");
> 
> cl_1   =  0.3;
> cl_2   =  0.02;
> cl3    =  0.02;
> Mesh.CharacteristicLengthMax = 40;
> extend = 15;
> 
> // define inversion region
> 
> Point(1) = {-0.05, 0.005, 0, cl_2};
> Point(2) = {7.25, 0.005, 0, cl_2};
> Point(3) = {7.25, -1.45, 0, cl_2};
> Point(4) = {-0.05, -1.45, 0, cl_2};
> 
> // define bounding box
> 
> Point(5) = {-0.05-extend, 0.005, 0, cl_1};
> Point(6) = {7.25+extend, 0.005, 0, cl_1};
> Point(7) = {7.25+extend, -1.45-extend, 0, cl_1};
> Point(8) = {-0.05-extend, -1.45-extend, 0, cl_1};
> 
> Line(1) = {1, 2};
> Line(2) = {2, 6};
> Line(3) = {6, 7};
> Line(4) = {7, 8};
> Line(5) = {8, 5};
> Line(6) = {5, 1};
> Line(7) = {1, 4};
> Line(8) = {4, 3};
> Line(9) = {3, 2};
> 
> // Definition of regions
> Line Loop(101) = {2, 3, 4, 5, 6, 7, 8, 9};
> Plane Surface(102) = {101}; // Outer box
> Line Loop(105) = {1, -9, -8, -7};
> 
> 
> // geological body
> 
> Rectangle(1) = {0.1, -0.2, 0, 0.5, 0.1, 0};
> Rectangle(2) = {0.1, -1.0, 0, 0.3, 0.7, 0};
> Rectangle(3) = {3.1, -0.6, 0, 1, 0.5, 0};
> Rectangle(4) = {4.2, -1.2, 0, 1, 0.5, 0};
> Rectangle(5) = {5.6, -0.9, 0, 1, 0.5, 0};
> Plane Surface(110) = {105,1,2,3,4,5}; // Inner box without geological body
> 
> 
> // Definition of boundaries
> Physical Line(1) = {6, 2, 1}; // Free surface
> Physical Line(2) = {3,4, 5}; // Mixed boundary conditions
> 
> // Definition of physical regions
> Physical Surface(1)  = {102}; // No-inversion region
> Physical Surface(2)  = {110}; // Inversion region
> Physical Surface(3)  = {1}; // Geological body 1
> Physical Surface(4)  = {2}; // Geological body 2
> Physical Surface(5)  = {3}; // Geological body 3
> Physical Surface(6)  = {4}; // Geological body 4
> Physical Surface(7)  = {5}; // Geological body 5
> 
> 
> Best Regards,
> 
> Sathyanarayan Rao, PhD student
> Earth and Life Institute/Environmental Sciences (ELI-e)
> Université catholique de Louvain
> c.037, Croix du Sud 2, Louvain-la-Neuve, Belgium
> Phone: 010473827 ( intercom 73827)
> From: Christophe Geuzaine <cgeuzaine at uliege.be>
> Sent: 22 February 2018 16:36:35
> To: Sathyanarayan Rao
> Cc: gmsh at onelab.info
> Subject: Re: [Gmsh] Line loop and Open cascade
>  
> 
> 
>> On 22 Feb 2018, at 12:56, Sathyanarayan Rao <sathyanarayan.rao at uclouvain.be <mailto:sathyanarayan.rao at uclouvain.be>> wrote:
>> 
>> Dear gmsh team,
>> 
>> Is it not possible to use both line loop type surface definition and open cascade rectangle. I always have problem with using both.
> 
> Sure you can: but you need to put SetFactory("OpenCASCADE") at the begining of your file: otherwise you create the first entities with the built-in CAD kernel ; and the rest (after SetFactory) with open cascade.
> 
> 
>>  
>> For example in the below code, surface 105 is unrecognized ! 
>> 
>> // mesh size description
>> 
>> cl_1   =  0.3;
>> cl_2   =  0.02;
>> cl3    =  0.02;
>> Mesh.CharacteristicLengthMax = 40;
>> extend = 15;
>> 
>> // define inversion region
>> 
>> Point(1) = {-0.05, 0.005, 0, cl_2};
>> Point(2) = {7.25, 0.005, 0, cl_2};
>> Point(3) = {7.25, -1.45, 0, cl_2};
>> Point(4) = {-0.05, -1.45, 0, cl_2};
>> 
>> // define bounding box
>> 
>> Point(5) = {-0.05-extend, 0.005, 0, cl_1};
>> Point(6) = {7.25+extend, 0.005, 0, cl_1};
>> Point(7) = {7.25+extend, -1.45-extend, 0, cl_1};
>> Point(8) = {-0.05-extend, -1.45-extend, 0, cl_1};
>> 
>> Line(1) = {1, 2};
>> Line(2) = {2, 6};
>> Line(3) = {6, 7};
>> Line(4) = {7, 8};
>> Line(5) = {8, 5};
>> Line(6) = {5, 1};
>> Line(7) = {1, 4};
>> Line(8) = {4, 3};
>> Line(9) = {3, 2};
>> 
>> // Definition of regions
>> Line Loop(101) = {2, 3, 4, 5, 6, 7, 8, 9};
>> Plane Surface(102) = {101}; // Outer box
>> Line Loop(105) = {1, -9, -8, -7};
>> 
>> 
>> // geological body
>> 
>> SetFactory("OpenCASCADE");
>> Rectangle(1) = {0.1, -0.2, 0, 0.5, 0.1, 0};
>> Rectangle(2) = {0.1, -1.0, 0, 0.3, 0.7, 0};
>> Rectangle(3) = {3.1, -0.6, 0, 1, 0.5, 0};
>> Rectangle(4) = {4.2, -1.2, 0, 1, 0.5, 0};
>> Rectangle(5) = {5.6, -0.9, 0, 1, 0.5, 0};
>> Plane Surface(110) = {105,1,2,3,4,5}; // Inner box without geological body
>> 
>> 
>> // Definition of boundaries
>> Physical Line(1) = {6, 2, 1}; // Free surface
>> Physical Line(2) = {3,4, 5}; // Mixed boundary conditions
>> 
>> // Definition of physical regions
>> Physical Surface(1)  = {102}; // No-inversion region
>> Physical Surface(2)  = {110}; // Inversion region
>> Physical Surface(3)  = {1}; // Geological body 1
>> Physical Surface(4)  = {2}; // Geological body 2
>> Physical Surface(5)  = {3}; // Geological body 3
>> Physical Surface(6)  = {4}; // Geological body 4
>> Physical Surface(7)  = {5}; // Geological body 5
>> 
>> 
>> 
>> Best Regards,
>> 
>> Sathyanarayan Rao, PhD student
>> Earth and Life Institute/Environmental Sciences (ELI-e)
>> Université catholique de Louvain
>> c.037, Croix du Sud 2, Louvain-la-Neuve, Belgium
>> Phone: 010473827 ( intercom 73827)
>> _______________________________________________
>> 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 <http://www.montefiore.ulg.ac.be/~geuzaine>
> 
> Free software: http://gmsh.info | http://getdp.info | http://onelab.info

— 
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/20180222/3cad158b/attachment-0001.html>


More information about the gmsh mailing list