[Gmsh] BooleanFragments
Karin&NiKo
niko.karin at gmail.com
Thu Jul 4 09:59:59 CEST 2019
Hi,
At least, it works when using the Crack Plugin from the GUI. But how can it
be used from the script?
[image: image.png]
Le jeu. 4 juil. 2019 à 09:35, Karin&NiKo <niko.karin at gmail.com> a écrit :
> Dear All,
>
> After defining the mesh, I would like to use the Crack plugin. Here's what
> I write in my .opt file :
> ---------------
> Plugin(Crack).Dimension=1;
> Plugin(Crack).PhysicalGroup=4;
> Plugin(Crack).OpenBoundaryPhysicalGroup=0;
> Plugin(Crack).NormalX=0;
> Plugin(Crack).NormalY=0;
> Plugin(Crack).NormalZ=1;
> Plugin(Crack).Run;
> ----------------
>
> But I cannot see the nodes duplication in the final mesh obtained by :
> "gmsh -2 myCrack.geo -format med -o myCrack.med ".
>
> What am I missing?
> Thanks,
> Nicolas
>
> Le mer. 3 juil. 2019 à 21:01, Karin&NiKo <niko.karin at gmail.com> a écrit :
>
>> Christophe, you are reading my mind! I was looking at this solution using
>> fields but I couldn't find an example.
>> Thanks
>>
>> Le mer. 3 juil. 2019 20:16, Christophe Geuzaine <cgeuzaine at uliege.be> a
>> écrit :
>>
>>>
>>> Hi guys,
>>>
>>> All 3 cases work for me with Gmsh 4.4... (Some earlier versions had
>>> indeed an issue with preseance of mesh size specs on points with OCC.)
>>>
>>> Here is a 4th method, which IMHO gives an even nicer result:
>>>
>>> // **************
>>> SetFactory("OpenCASCADE");
>>> Rectangle(1) = {-0.7, -0.2, 0, 1, 0.5, 0.1};
>>>
>>> Point(9) = {-0.39, 0.21, 0, 1.0};
>>> Point(10) = {-0.25, 0.14, 0, 1.0};
>>> Point(11) = {-0.12, -0.05, 0, 1.0};
>>> Point(12) = {-0.03, 0.12, 0, 1.0};
>>> Point(13) = {0.14, 0.12, 0, 1.0};
>>> Spline(9) = {9, 10, 11, 12, 13};
>>>
>>> BooleanFragments{ Surface{1}; Delete; }{ Curve{9}; Delete; }
>>>
>>> Field[1] = Distance;
>>> Field[1].NNodesByEdge = 200;
>>> Field[1].EdgesList = {9};
>>>
>>> Field[2] = Threshold;
>>> Field[2].IField = 1;
>>> Field[2].LcMin = 0.005;
>>> Field[2].LcMax = 0.05;
>>> Field[2].DistMin = 0.01;
>>> Field[2].DistMax = 0.1;
>>>
>>> Background Field = 2;
>>>
>>> Mesh.Algorithm = 6;
>>> Mesh.CharacteristicLengthExtendFromBoundary = 0;
>>> // **************
>>>
>>> Christophe
>>>
>>> > On 3 Jul 2019, at 19:41, Max Orok <morok at mevex.com> wrote:
>>> >
>>> > Hi there,
>>> >
>>> > I was able to get your script to work using the PointsOf function with
>>> the curve to specify the characteristic length. I also was able to directly
>>> list the tags in the characteristic length call, but only after removing
>>> the 1.0 characteristic length parameter that was the fourth argument to the
>>> Point initialization calls. In contrast, PointsOf seems to work even when
>>> the length is specified earlier. Perhaps there is a subtle difference
>>> somewhere between PointsOf and directly listing tags for this command? I've
>>> named the two working cases A (using PointsOf) and B (directly specifying
>>> the tags without setting the characteristic length earlier).
>>> >
>>> > Here is the modified script with the other cases commented out in case
>>> you'd like to try them:
>>> >
>>> > // --
>>> >
>>> > SetFactory("OpenCASCADE");
>>> > Rectangle(1) = {-0.7, -0.2, 0, 1, 0.5, 0.1};
>>> >
>>> >
>>> //------------------------------------------------------------------------------
>>> >
>>> >
>>> > // case A: specify a value, only to be changed later
>>> > Point(9) = {-0.39, 0.21, 0, 1.0};
>>> > Point(10) = {-0.25, 0.14, 0, 1.0};
>>> > Point(11) = {-0.12, -0.05, 0, 1.0};
>>> > Point(12) = {-0.03, 0.12, 0, 1.0};
>>> > Point(13) = {0.14, 0.12, 0, 1.0};
>>> >
>>> > Spline(9) = {9, 10, 11, 12, 13};
>>> >
>>> > // works even if the characteristic length was set initialization ^
>>> > Characteristic Length { PointsOf{ Curve{9}; } } = 0.01;
>>> >
>>> >
>>> >
>>> //------------------------------------------------------------------------------
>>> >
>>> > /*
>>> > // case B: don't specify the characteristic lengths
>>> > Point(9) = {-0.39, 0.21, 0};
>>> > Point(10) = {-0.25, 0.14, 0};
>>> > Point(11) = {-0.12, -0.05, 0};
>>> > Point(12) = {-0.03, 0.12, 0};
>>> > Point(13) = {0.14, 0.12, 0};
>>> >
>>> > Spline(9) = {9, 10, 11, 12, 13};
>>> >
>>> > // only works if the characteristic length wasn't set on initialization
>>> > Characteristic Length { 9,10,11,12,13 } = 0.01;
>>> > */
>>> >
>>> > // maybe a subtle difference between PointsOf and directly specifying
>>> tags?
>>> >
>>> >
>>> //------------------------------------------------------------------------------
>>> >
>>> > /*
>>> > // case C: specify the characteristic lengths then use the tags
>>> directly
>>> > // DOESN'T WORK
>>> > Point(9) = {-0.39, 0.21, 0, 1.0};
>>> > Point(10) = {-0.25, 0.14, 0, 1.0};
>>> > Point(11) = {-0.12, -0.05, 0, 1.0};
>>> > Point(12) = {-0.03, 0.12, 0, 1.0};
>>> > Point(13) = {0.14, 0.12, 0, 1.0};
>>> >
>>> > Spline(9) = {9, 10, 11, 12, 13};
>>> >
>>> > // only works if the characteristic length wasn't set on initialization
>>> > Characteristic Length { 9,10,11,12,13 } = 0.01;
>>> > */
>>> >
>>> >
>>> //------------------------------------------------------------------------------
>>> >
>>> > BooleanFragments{ Surface{1}; Delete; }{ Curve{9}; Delete; }
>>> >
>>> > // --
>>> >
>>> > This probably wasn't your issue, but I had also forgotten about
>>> setting a minimum characteristic length option, which stopped me from
>>> manually setting the characteristic lengths at first.
>>> >
>>> > Sincerely,
>>> > Max
>>> >
>>> > p.s. here are pictures of each case:
>>> >
>>> > Case A:
>>> > <image.png>
>>> >
>>> > Case B (looks the same as Case A to me):
>>> > <image.png>
>>> >
>>> > Case C (broken):
>>> > <image.png>
>>> >
>>> >
>>> > On Wed, Jul 3, 2019 at 12:30 PM Karin&NiKo <niko.karin at gmail.com>
>>> wrote:
>>> > Dear Gmsh Gurus,
>>> >
>>> > I would like to define a 1D crack in a planar surface. To this end, I
>>> use the attached script.
>>> > 1. When I specify the mesh size at the curve point *in the script* and
>>> then load the script, it does not work aka the mesh haven't the right size
>>> > 2. When I load the script and then specify the mesh size at the curve
>>> point *in the GUI*, it works (and it is beautiful!)
>>> >
>>> > Am I missing something? Is it a bug (NO????)?
>>> >
>>> > Thanks in advance,
>>> > Your oldest fan
>>> > _______________________________________________
>>> > gmsh mailing list
>>> > gmsh at onelab.info
>>> > http://onelab.info/mailman/listinfo/gmsh
>>> >
>>> >
>>> > --
>>> > Max Orok
>>> > Contractor
>>> > www.mevex.com
>>> >
>>> >
>>> > <myCrack-fixed.geo>_______________________________________________
>>> > gmsh mailing list
>>> > gmsh at 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
>>>
>>>
>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190704/476e3384/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 194721 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20190704/476e3384/attachment-0001.png>
More information about the gmsh
mailing list