[Gmsh] Surface bounded by two arbitrary closed (spline) curves

Mathias Scheunert mathias.scheunert at math.tu-freiberg.de
Wed Aug 7 18:25:08 CEST 2019


Dear developers and users,

**** The problem*
our group wants to use Gmsh for setting up meshes for simulation of 
geophysical data.
Therefore we need to create surfaces which are bounded by a circle or 
rectangular curve and that contain some topographic information (from 
given point cloud) in the “interior” part.
The given points have to be part of the resulting mesh.

Defining a Curve Loop from piece-wise splines (or just Lines) and adding 
all the points to the surface leads to undesired “topographic features” 
in the area between the boundary and the point cloud in the resulting mesh.
/See surface_using_points.geo/

Furthermore, by refining the mesh by splitting, one can see that the 
mesh around the points added is not flat/smooth anymore.
/See mesh_issue.png/

So we separately defined a surface of the interior part by defining a 
surrounding spline curve, which provides a "nice" mesh for that part.
/See surface_splitted.geo/

Now we need to obtain a flat surface that is bounded by the outermost 
rectangular curve and the spline curve to obtain a coherent surface.
We played around with ThruSection (hoping that this is the most 
promising way to go) but facing the following problems:

1)
/Curve Loop(50) = {out_spl[]};//
//Wire(1) = {1};//
//Wire(2) = {30};//
//ThruSections{1, 2}/
→ Here we get an Error, that OpenCASCADE can’t find the Curve Loop from 
splines

So we neglect the request for a rectangular outermost boundary an tried
2)
/Spline(1) = {1:4, 1};//
//Curve Loop(50) = {1};//
//Wire(1) = {1};//
//Wire(2) = {30};//
//ThruSections{1, 2}/
→ now Wire(1) can be created from Spline(1) but the resulting mesh is 
somehow twisted (although enjoyable flat …)


**** The question(s)*
Can our approach be used at all?
→ we definitely want to avoid playing around with meshes externally 
like: http://onelab.info/pipermail/gmsh/2018/012591.html

If so – how?
Or is there a more promising way to attack our problem?

Best regards,
Mathias

ps: We are using Gmsh 4.3.0.

-- 
Dr. Mathias Scheunert
Institute of Geophysics and Geoinformatics, TU Bergakademie Freiberg
Gustav-Zeuner-Str. 12, D-09596 Freiberg
Tel.: +493731393630

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190807/cd6c5444/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mesh_issue.png
Type: image/png
Size: 209936 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20190807/cd6c5444/attachment-0001.png>
-------------- next part --------------
// Gmsh project created on Tue Aug  6 15:23:35 2019
SetFactory("OpenCASCADE");
Mesh.CharacteristicLengthMin = 5;
Mesh.CharacteristicLengthMax = 10;

// domain boundary points
vert_off = 0;
Point(1) = {-20, -20, vert_off, 1.0};
Point(2) = { 20, -20, vert_off, 1.0};
Point(3) = { 20,  20, vert_off, 1.0};
Point(4) = {-20,  20, vert_off, 1.0};
out_pt[] = {1:4};
// curve from domain boundary points
Spline(20) = {1, 2};
Spline(21) = {2, 3};
Spline(22) = {3, 4};
Spline(23) = {4, 1};
out_spl[] = {20:23};

// topography boundary points
Point(5) = {-3.3, 2.9, 0, 1.0};
Point(6) = {1.1, 3.3, -0.5, 1.0};
Point(7) = {2.1, 1.7, -1, 1.0};
Point(8) = {2.6, -1.6, -0.3, 1.0};
Point(9) = {-0.1, -2.1, 0.5, 1.0};
Point(10) = {-2.7, -0.3, 1.2, 1.0};
Point(11) = {-3.3, 1.6, 0.7, 1.0};
in_bnd_pt[] = {5:11};
// topography interior points
Point(12) = {-1.1, 2.3, -0.1, 1.0};
Point(13) = {0.7, 1.6, -1.3, 1.0};
Point(14) = {-0.2, 1.1, -0.1, 1.0};
Point(15) = {-1.3, 0.5, 0.9, 1.0};
Point(16) = {0.1, -0.7, 0.4, 1.0};
Point(17) = {1.7, 0.3, -1.3, 1.0};
in_pt[] = {12:17};

// surface only for the interior part
Spline(30) = {in_bnd_pt[], 5};
Curve Loop(60) = {30};
Surface(10) = {60} Using Point{in_bnd_pt[], in_pt[]};
Point{in_bnd_pt[], in_pt[]} In Surface{10};

// connect domain with interior
//Curve Loop(50) = {out_spl[]};
//Spline(50) = {1:4, 1};

//Wire(1) = {50};
//Wire(2) = {30};
//ThruSections{1, 2}
-------------- next part --------------
// Gmsh project created on Tue Aug  6 15:23:35 2019
SetFactory("OpenCASCADE");
Mesh.CharacteristicLengthMin = 5;
Mesh.CharacteristicLengthMax = 10;

// domain boundary points
vert_off = 0;
Point(1) = {-20, -20, vert_off, 1.0};
Point(2) = { 20, -20, vert_off, 1.0};
Point(3) = { 20,  20, vert_off, 1.0};
Point(4) = {-20,  20, vert_off, 1.0};
out_pt[] = {1:4};
// curve from domain boundary points
Line(20) = {1, 2};
Line(21) = {2, 3};
Line(22) = {3, 4};
Line(23) = {4, 1};
out_spl[] = {20:23};
Curve Loop(50) = {out_spl[]};

// topography boundary points
Point(5) = {-3.3, 2.9, 0, 1.0};
Point(6) = {1.1, 3.3, -0.5, 1.0};
Point(7) = {2.1, 1.7, -1, 1.0};
Point(8) = {2.6, -1.6, -0.3, 1.0};
Point(9) = {-0.1, -2.1, 0.5, 1.0};
Point(10) = {-2.7, -0.3, 1.2, 1.0};
Point(11) = {-3.3, 1.6, 0.7, 1.0};
in_bnd_pt[] = {5:11};
// topography interior points
Point(12) = {-1.1, 2.3, -0.1, 1.0};
Point(13) = {0.7, 1.6, -1.3, 1.0};
Point(14) = {-0.2, 1.1, -0.1, 1.0};
Point(15) = {-1.3, 0.5, 0.9, 1.0};
Point(16) = {0.1, -0.7, 0.4, 1.0};
Point(17) = {1.7, 0.3, -1.3, 1.0};
in_pt[] = {12:17};

// Form surface by just adding all topo points 
// leads to massive overshooting between the domain boundary and the area of given topo points
Surface(100) = {50} Using Point{in_bnd_pt[], in_pt[]};
Point{in_bnd_pt[], in_pt[]} In Surface{100};



More information about the gmsh mailing list