[Gmsh] BooleanFragments

Max Orok morok at mevex.com
Wed Jul 3 19:41:29 CEST 2019


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: image.png]

Case B (looks the same as Case A to me):
[image: image.png]

Case C (broken):
[image: 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190703/ebd70caa/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 39022 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20190703/ebd70caa/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 59164 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20190703/ebd70caa/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 62398 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20190703/ebd70caa/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: myCrack-fixed.geo
Type: application/octet-stream
Size: 1722 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20190703/ebd70caa/attachment-0001.geo>


More information about the gmsh mailing list