[Gmsh] Converting a 2D "H" domain into a structured grid

Nicholas Danes ndanes at mymail.mines.edu
Thu Sep 21 20:03:49 CEST 2017


Someone gave me a response to this email shortly after posting this and 
I think I accidentallydeleted their answer. Could this person respond again?

Best,

Nick

On 6/12/2017 4:34 PM, Nicholas Danes wrote:
> I currently have a grid that works fine with the unstructured 
> algorithms in Gmsh to build a "H" shaped grid.
>
> I know the transfinite algorithm does not work with a grid with more 
> than 4 corners, but is there a way to make this grid structured (with 
> triangular elements)?
>
> I have tried extracting out grids as well as piecing 3 rectangular 
> grids together without much success.
>
> The source code for my grid is given below.
>
> Thanks,
>
> Nick
>
>
> // Inputs
> xchar = 3.0;
> l_injury = 100.0;
> w_injury = 20.0;
> boxdimx = (200+l_injury)/xchar;
> boxdimy = (150+w_injury)/xchar;
> gridsize = 1.8/xchar;
> gridsize2 = 1.8/(1.0*xchar);
>
> //Create "H" mesh basis points
> Point(1) = {0,0,0,gridsize};
> Point(2) = {0,boxdimy,0,gridsize};
> Point(3) = {100.0/xchar,boxdimy,0,gridsize};
> Point(4) = {100.0/xchar,(boxdimy/2.0) + 
> w_injury/(2.0*xchar),0,gridsize2};
> Point(5) = {(100.0+l_injury)/xchar,(boxdimy/2.0) + 
> w_injury/(2.0*xchar),0,gridsize2};
> Point(6) = {(100.0+l_injury)/xchar,boxdimy,0,gridsize2};
> Point(7) = {boxdimx,boxdimy,0,gridsize2};
> Point(8) = {boxdimx,0.0,0,gridsize};
> Point(9) = {boxdimx-100.0/xchar,0.0,0,gridsize2};
> Point(10) = {boxdimx-100.0/xchar,(boxdimy/2.0) - 
> w_injury/(2.0*xchar),0,gridsize2};
> Point(11) = {100/xchar,(boxdimy/2.0) - w_injury/(2.0*xchar),0,gridsize2};
> Point(12) = {100/xchar,0.0,0,gridsize2};
>
> Line(71) = {1,2};
> Line(72) = {2,3};
> Line(73) = {3,4};
> Line(74) = {4,5};
> Line(75) = {5,6};
> Line(76) = {6,7};
> Line(77) = {7,8};
> Line(78) = {8,9};
> Line(79) = {9,10};
> Line(80) = {10,11};
> Line(81) = {11,12};
> Line(82) = {12,1};
>
> // Connect lines into a loop
> Line Loop(100) = {71,72,73,74,75,76,77,78,79,80,81,82};
> Plane Surface(101) = 100;
>
> // Boundaries
> Physical Line(1) = {71,73,74,75,77,79,80,81}; // no-slip boundaries
> Physical Line(2) = {72};
> Physical Line(3) = {76};
> Physical Line(4) = {82};
> Physical Line(5) = {78};
> Physical Surface(102) = {101};
>

-- 
Thank you,

Nicholas A. Danes
PhD Candidate  | Computational & Applied Math | Colorado School of Mines
me at nicholasdanes.com | www.nicholasdanes.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20170921/5e0f6d01/attachment-0001.html>


More information about the gmsh mailing list