From ae2d1a153140cc59ff57b299612635b9d6ba9dc4 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Tue, 20 Mar 2018 08:29:23 +0100 Subject: [PATCH] up --- Elasticity/wrench2D.geo | 26 +++++++++++--------------- ElectrostaticsFloating/floating.geo | 12 ++++++------ Magnetodynamics/electromagnet.geo | 17 ++++++++--------- Magnetodynamics/transfo.geo | 16 ++++++++-------- Magnetostatics/electromagnet.geo | 17 ++++++++--------- PotentialFlow/magnus.geo | 24 ++++++++---------------- Thermics/brick.geo | 29 ++++++++++++++--------------- 7 files changed, 63 insertions(+), 78 deletions(-) diff --git a/Elasticity/wrench2D.geo b/Elasticity/wrench2D.geo index 782b701..12fdf31 100644 --- a/Elasticity/wrench2D.geo +++ b/Elasticity/wrench2D.geo @@ -3,7 +3,7 @@ Include "wrench2D_common.pro"; Solver.AutoMesh = 2; -lc = Refine; +lc = Refine; lc2 = lc; // nut region lc3 = lc/5; // edge grip region @@ -28,9 +28,9 @@ th3 = th2 - theta; Point(6) = { Re*Cos[th3], Re*Sin[th3], 0, lc}; Point(7) = { (L-LL)*Cos[theta]+F/2.*Sin[theta], -(L-LL)*Sin[theta]+F/2.*Cos[theta], 0, lc}; -Point(8) = { L*Cos[theta]+F/2.*Sin[theta], +Point(8) = { L*Cos[theta]+F/2.*Sin[theta], -L*Sin[theta]+F/2.*Cos[theta], 0, lc}; -Point(9) = { L*Cos[theta]-F/2.*Sin[theta], +Point(9) = { L*Cos[theta]-F/2.*Sin[theta], -L*Sin[theta]-F/2.*Cos[theta], 0, lc}; th4 = -th2 - theta; Point(10) = { Re*Cos[th4], Re*Sin[th4], 0, lc}; @@ -41,32 +41,28 @@ Point(13) = { -Ri + Ri*Cos[th1], -Ri*Sin[th1], 0, lc2}; contour[] = {}; contour[] += newl; Circle(newl) = {1,2,3}; contour[] += newl; Line(newl) = {3,4}; -contour[] += newl; cl1=newl; Line(newl) = {4,5}; +contour[] += newl; cl1=newl; Line(newl) = {4,5}; contour[] += newl; Circle(newl) = {5,1,6}; contour[] += newl; Line(newl) = {6,7}; -contour[] += newl; cl2=newl; Line(newl) = {7,8}; +contour[] += newl; cl2=newl; Line(newl) = {7,8}; contour[] += newl; Line(newl) = {8,9}; contour[] += newl; Line(newl) = {9,10}; contour[] += newl; Circle(newl) = {10,1,11}; -contour[] += newl; cl3=newl; Line(newl) = {11,12}; +contour[] += newl; cl3=newl; Line(newl) = {11,12}; contour[] += newl; Line(newl) = {12,13}; contour[] += newl; Circle(newl) = {13,2,1}; -ll=newll; Line Loop(ll) = { contour[] }; +ll=newll; Curve Loop(ll) = { contour[] }; -wrench=news; Plane Surface(wrench) = {-ll}; +wrench=news; Plane Surface(wrench) = {-ll}; /* Using quadrangular elements instead of triangular elements is pretty simple. You just have to invoke the Recombine command at this place. - GetDP deals will all the rest by itself. + GetDP deals will all the rest by itself. */ If(Recomb==1) Recombine Surface{wrench}; EndIf Physical Surface(1)= wrench; -Physical Line(2)= {cl1, cl3}; -Physical Line(3)= {cl2}; - - - - +Physical Curve(2)= {cl1, cl3}; +Physical Curve(3)= {cl2}; diff --git a/ElectrostaticsFloating/floating.geo b/ElectrostaticsFloating/floating.geo index 88660c6..000b8ca 100644 --- a/ElectrostaticsFloating/floating.geo +++ b/ElectrostaticsFloating/floating.geo @@ -37,11 +37,11 @@ Line(11) = {5,7}; /* Definition of geometrical surfaces */ -Line Loop(12) = {1, 2, -8, -9, 7}; Plane Surface(13) = {12}; -Line Loop(14) = {10,-11,8,3,4,5}; Plane Surface(15) = {14}; +Curve Loop(12) = {1, 2, -8, -9, 7}; Plane Surface(13) = {12}; +Curve Loop(14) = {10,-11,8,3,4,5}; Plane Surface(15) = {14}; /* Definition of Physical entities (surfaces, lines). The definition of - Physical entities (Surfaces and Lines) tells Gmsh the elements and associated + Physical entities (Surfaces and Curves) tells Gmsh the elements and associated region numbers that have to be saved in the mesh file 'microstrip.msh'. For example, Region 111 is made of the triangle elements of the geometric surface 13, whereas Region 121 is made of line elements of the geometric lines 9, 10 @@ -50,6 +50,6 @@ Line Loop(14) = {10,-11,8,3,4,5}; Plane Surface(15) = {14}; Physical Surface ("Air", 101) = {15}; Physical Surface ("Dielectric", 111) = {13}; -Physical Line ("Ground", 120) = {1} ; -Physical Line ("Electrode", 121) = {9,10,11} ; -Physical Line ("Surface infinity", 130) = {2,3,4} ; +Physical Curve ("Ground", 120) = {1} ; +Physical Curve ("Electrode", 121) = {9,10,11} ; +Physical Curve ("Surface infinity", 130) = {2,3,4} ; diff --git a/Magnetodynamics/electromagnet.geo b/Magnetodynamics/electromagnet.geo index 7bd410c..b7938bc 100644 --- a/Magnetodynamics/electromagnet.geo +++ b/Magnetodynamics/electromagnet.geo @@ -11,7 +11,7 @@ xInd = 75.e-3; dxInd = 25.e-3; dyInd = 50.e-3; Include "electromagnet_common.pro"; s = DefineNumber[1, Name "Model parameters/Global mesh size", - Help "Reduce for finer mesh"]; + Help "Reduce for finer mesh"]; p0 = 12.e-3 *s; pCorex = 4.e-3 *s; pCorey0 = 8.e-3 *s; pCorey = 4.e-3 *s; pIndx = 5.e-3 *s; pIndy = 5.e-3 *s; @@ -38,17 +38,16 @@ Line(13) = {8,5}; Circle(14) = {9,1,11}; Circle(15) = {10,1,12}; -Line Loop(16) = {-6,1,9,10}; Plane Surface(17) = {16}; -Line Loop(18) = {11,12,13,3}; Plane Surface(19) = {18}; -Line Loop(20) = {7,-14,-4,11,12,13,-2,9,10}; Plane Surface(21) = {-20}; // "-" for orientation -Line Loop(22) = {8,-15,-5,14}; Plane Surface(23) = {-22}; +Curve Loop(16) = {-6,1,9,10}; Plane Surface(17) = {16}; +Curve Loop(18) = {11,12,13,3}; Plane Surface(19) = {18}; +Curve Loop(20) = {7,-14,-4,11,12,13,-2,9,10}; Plane Surface(21) = {-20}; // "-" for orientation +Curve Loop(22) = {8,-15,-5,14}; Plane Surface(23) = {-22}; Physical Surface(101) = {21}; /* Air */ Physical Surface(102) = {17}; /* Core */ Physical Surface(103) = {19}; /* Ind */ Physical Surface(111) = {23}; /* AirInf */ -Physical Line(1100) = {1,2,3,4,5}; /* Surface ht = 0 */ -Physical Line(1101) = {6,7,8}; /* Surface bn = 0 */ -Physical Line(1102) = {15}; /* Surface Inf */ - +Physical Curve(1100) = {1,2,3,4,5}; /* Surface ht = 0 */ +Physical Curve(1101) = {6,7,8}; /* Surface bn = 0 */ +Physical Curve(1102) = {15}; /* Surface Inf */ diff --git a/Magnetodynamics/transfo.geo b/Magnetodynamics/transfo.geo index 072bc9b..8888afc 100644 --- a/Magnetodynamics/transfo.geo +++ b/Magnetodynamics/transfo.geo @@ -36,7 +36,7 @@ l_Core_Leg_2_Y0[]={}; l_Core_Leg_2_Y0[]+=newl; Line(newl) = {p_Leg_2_L_0, p_Leg_2_R_0}; -ll_Core=newll; Line Loop(newll) = {l_Core_In[], l_Core_Leg_2_Y0[], l_Core_Out[], l_Core_Leg_1_Y0[]}; +ll_Core=newll; Curve Loop(newll) = {l_Core_In[], l_Core_Leg_2_Y0[], l_Core_Out[], l_Core_Leg_1_Y0[]}; s_Core=news; Plane Surface(news) = {ll_Core}; Physical Surface("CORE", CORE) = {s_Core}; @@ -57,7 +57,7 @@ l_Coil_1_p[]+=newl; Line(newl) = {p_Coil_1_p_int_1, p_Coil_1_p_int_0}; l_Coil_1_p_Y0[]={}; l_Coil_1_p_Y0[]+=newl; Line(newl) = {p_Coil_1_p_int_0, p_Coil_1_p_ext_0}; -ll_Coil_1_p=newll; Line Loop(newll) = {l_Coil_1_p[], l_Coil_1_p_Y0[]}; +ll_Coil_1_p=newll; Curve Loop(newll) = {l_Coil_1_p[], l_Coil_1_p_Y0[]}; s_Coil_1_p=news; Plane Surface(news) = {ll_Coil_1_p}; Physical Surface("COIL_1_PLUS", COIL_1_PLUS) = {s_Coil_1_p}; @@ -79,7 +79,7 @@ l_Coil_1_m[]+=newl; Line(newl) = {p_Coil_1_m_int_1, p_Coil_1_m_int_0}; l_Coil_1_m_Y0[]={}; l_Coil_1_m_Y0[]+=newl; Line(newl) = {p_Coil_1_m_int_0, p_Coil_1_m_ext_0}; -ll_Coil_1_m=newll; Line Loop(newll) = {l_Coil_1_m[], l_Coil_1_m_Y0[]}; +ll_Coil_1_m=newll; Curve Loop(newll) = {l_Coil_1_m[], l_Coil_1_m_Y0[]}; s_Coil_1_m=news; Plane Surface(news) = {ll_Coil_1_m}; Physical Surface("COIL_1_MINUS", COIL_1_MINUS) = {s_Coil_1_m}; @@ -101,7 +101,7 @@ l_Coil_2_p[]+=newl; Line(newl) = {p_Coil_2_p_int_1, p_Coil_2_p_int_0}; l_Coil_2_p_Y0[]={}; l_Coil_2_p_Y0[]+=newl; Line(newl) = {p_Coil_2_p_int_0, p_Coil_2_p_ext_0}; -ll_Coil_2_p=newll; Line Loop(newll) = {l_Coil_2_p[], l_Coil_2_p_Y0[]}; +ll_Coil_2_p=newll; Curve Loop(newll) = {l_Coil_2_p[], l_Coil_2_p_Y0[]}; s_Coil_2_p=news; Plane Surface(news) = {ll_Coil_2_p}; Physical Surface("COIL_2_PLUS", COIL_2_PLUS) = {s_Coil_2_p}; @@ -123,7 +123,7 @@ l_Coil_2_m[]+=newl; Line(newl) = {p_Coil_2_m_int_1, p_Coil_2_m_int_0}; l_Coil_2_m_Y0[]={}; l_Coil_2_m_Y0[]+=newl; Line(newl) = {p_Coil_2_m_int_0, p_Coil_2_m_ext_0}; -ll_Coil_2_m=newll; Line Loop(newll) = {l_Coil_2_m[], l_Coil_2_m_Y0[]}; +ll_Coil_2_m=newll; Curve Loop(newll) = {l_Coil_2_m[], l_Coil_2_m_Y0[]}; s_Coil_2_m=news; Plane Surface(news) = {ll_Coil_2_m}; Physical Surface("COIL_2_MINUS", COIL_2_MINUS) = {s_Coil_2_m}; @@ -136,7 +136,7 @@ l_Air_Window_Y0[]+=newl; Line(newl) = {p_Leg_1_R_0, p_Coil_1_p_int_0}; l_Air_Window_Y0[]+=newl; Line(newl) = {p_Coil_1_p_ext_0, p_Coil_2_m_ext_0}; l_Air_Window_Y0[]+=newl; Line(newl) = {p_Coil_2_m_int_0, p_Leg_2_L_0}; -ll_Air_Window=newll; Line Loop(newll) = {-l_Core_In[], -l_Coil_1_p[], l_Coil_2_m[], l_Air_Window_Y0[]}; +ll_Air_Window=newll; Curve Loop(newll) = {-l_Core_In[], -l_Coil_1_p[], l_Coil_2_m[], l_Air_Window_Y0[]}; s_Air_Window=news; Plane Surface(news) = {ll_Air_Window}; Physical Surface("AIR_WINDOW", AIR_WINDOW) = {s_Air_Window}; @@ -166,8 +166,8 @@ l_Air_Ext_Y0[]+=newl; Line(newl) = {p_Air_Ext_1_L_0, p_Coil_1_m_ext_0}; l_Air_Ext_Y0[]+=newl; Line(newl) = {p_Coil_1_m_int_0, p_Leg_1_L_0}; -ll_Air_Ext=newll; Line Loop(newll) = {-l_Core_Out[], -l_Coil_2_p[], l_Coil_1_m[], l_Air_Ext[], l_Air_Ext_Y0[]}; +ll_Air_Ext=newll; Curve Loop(newll) = {-l_Core_Out[], -l_Coil_2_p[], l_Coil_1_m[], l_Air_Ext[], l_Air_Ext_Y0[]}; s_Air_Ext=news; Plane Surface(news) = {ll_Air_Ext}; Physical Surface("AIR_EXT", AIR_EXT) = {s_Air_Ext}; -Physical Line("SUR_AIR_EXT", SUR_AIR_EXT) = {l_Air_Ext[]}; +Physical Curve("SUR_AIR_EXT", SUR_AIR_EXT) = {l_Air_Ext[]}; diff --git a/Magnetostatics/electromagnet.geo b/Magnetostatics/electromagnet.geo index 7bd410c..b7938bc 100644 --- a/Magnetostatics/electromagnet.geo +++ b/Magnetostatics/electromagnet.geo @@ -11,7 +11,7 @@ xInd = 75.e-3; dxInd = 25.e-3; dyInd = 50.e-3; Include "electromagnet_common.pro"; s = DefineNumber[1, Name "Model parameters/Global mesh size", - Help "Reduce for finer mesh"]; + Help "Reduce for finer mesh"]; p0 = 12.e-3 *s; pCorex = 4.e-3 *s; pCorey0 = 8.e-3 *s; pCorey = 4.e-3 *s; pIndx = 5.e-3 *s; pIndy = 5.e-3 *s; @@ -38,17 +38,16 @@ Line(13) = {8,5}; Circle(14) = {9,1,11}; Circle(15) = {10,1,12}; -Line Loop(16) = {-6,1,9,10}; Plane Surface(17) = {16}; -Line Loop(18) = {11,12,13,3}; Plane Surface(19) = {18}; -Line Loop(20) = {7,-14,-4,11,12,13,-2,9,10}; Plane Surface(21) = {-20}; // "-" for orientation -Line Loop(22) = {8,-15,-5,14}; Plane Surface(23) = {-22}; +Curve Loop(16) = {-6,1,9,10}; Plane Surface(17) = {16}; +Curve Loop(18) = {11,12,13,3}; Plane Surface(19) = {18}; +Curve Loop(20) = {7,-14,-4,11,12,13,-2,9,10}; Plane Surface(21) = {-20}; // "-" for orientation +Curve Loop(22) = {8,-15,-5,14}; Plane Surface(23) = {-22}; Physical Surface(101) = {21}; /* Air */ Physical Surface(102) = {17}; /* Core */ Physical Surface(103) = {19}; /* Ind */ Physical Surface(111) = {23}; /* AirInf */ -Physical Line(1100) = {1,2,3,4,5}; /* Surface ht = 0 */ -Physical Line(1101) = {6,7,8}; /* Surface bn = 0 */ -Physical Line(1102) = {15}; /* Surface Inf */ - +Physical Curve(1100) = {1,2,3,4,5}; /* Surface ht = 0 */ +Physical Curve(1101) = {6,7,8}; /* Surface bn = 0 */ +Physical Curve(1102) = {15}; /* Surface Inf */ diff --git a/PotentialFlow/magnus.geo b/PotentialFlow/magnus.geo index c78c6ac..e13fa67 100644 --- a/PotentialFlow/magnus.geo +++ b/PotentialFlow/magnus.geo @@ -21,14 +21,14 @@ Circle(4) = {4,5,1}; // Points to be connected with the outer boundary PtA = 4; -PtB = 2; +PtB = 2; Else // naca airfoil lca = 0.03; Include "nacaAirFoil.geo"; PtA = 121; -PtB = 81; +PtB = 81; EndIf @@ -50,22 +50,14 @@ Line(10) = { 307, 311 }; Line(11) = { 311, 310 }; Line(12) = { 310, 306 }; -Line Loop(21) = { 7, 8, 9, -6, 2, 3, 5 }; // aire a gauche -Line Loop(22) = { 10, 11, 12, -5, 4, 1, 6 }; +Curve Loop(21) = { 7, 8, 9, -6, 2, 3, 5 }; // aire a gauche +Curve Loop(22) = { 10, 11, 12, -5, 4, 1, 6 }; Plane Surface(24) = { 21 }; Plane Surface(25) = { 22 }; Physical Surface("Fluid", 2) = { 24, 25 }; -Physical Line("UpStream", 10) = { 8 }; -Physical Line("DownStream", 11) = { 11 }; -Physical Line("Airfoil", 12) = { 1 ... 4 }; -Physical Line("Wake", 13) = { 5 }; - - - -//Line Loop(20) = {1,2,3,4}; -//Plane Surface(23) = {20}; -//Physical Surface("Cylinder", 1) = {23}; -//Physical Line("Outer", 10) = { 7 ... 12 }; - +Physical Curve("UpStream", 10) = { 8 }; +Physical Curve("DownStream", 11) = { 11 }; +Physical Curve("Airfoil", 12) = { 1 ... 4 }; +Physical Curve("Wake", 13) = { 5 }; diff --git a/Thermics/brick.geo b/Thermics/brick.geo index 0dbaa0e..d3cf283 100644 --- a/Thermics/brick.geo +++ b/Thermics/brick.geo @@ -6,14 +6,14 @@ ------------------------------------------------------------------- */ /* Gmsh options can be set directly in the .geo file. - Setting "Solver.AutoMesh" to 2 ensures that GMSH systematically + Setting "Solver.AutoMesh" to 2 ensures that GMSH systematically regenerates the mesh at each model execution, and does not reuse the mesh on disk if it exists (which is the default option). This option is needed in this model, because the interactive - model parameters "Flag_Regularization" has an effect + model parameters "Flag_Regularization" has an effect on the definition of the regions, which makes remeshing mandatory. */ -Solver.AutoMesh = 2; +Solver.AutoMesh = 2; Include "brick_common.pro"; @@ -34,18 +34,18 @@ l4=newl; Line(newl)={p4,p1}; lines_[] = {l1, l2, l3, l4}; -ll1 = newll; Line Loop(ll1) = {lines_[]}; +ll1 = newll; Curve Loop(ll1) = {lines_[]}; s_ = news; Plane Surface(news) = {ll1, ll_Holes_[]}; Return // end of Function Def_Rectangle -/* Note that the code above is not parsed before it is called. +/* Note that the code above is not parsed before it is called. Good practice for readability (but by no means mandatory) - is to distinguish function variables from other variables. + is to distinguish function variables from other variables. This is done here with a trailing "_" in the variable name. */ // Window 1 (with optional layer of thickness "e_layer") -dx_ = dx_Win1; +dx_ = dx_Win1; dy_ = dy_Win1; lc_ = lc_Win1; xc_ = xc_Win1-dx_/2; yc_=yc_Win1-dy_/2; @@ -58,7 +58,7 @@ If( !Flag_Regularization ) ll_HolesForBrick[] += ll1; Else ll_HolesForLayer[] += ll1; - dx_ = dx_Win1+2*e_layer; + dx_ = dx_Win1+2*e_layer; dy_ = dy_Win1+2*e_layer; lc_ = lc_Win1; xc_ = xc_Win1-dx_/2; yc_=yc_Win1-dy_/2; @@ -71,7 +71,7 @@ Else EndIf // Window 2 -dx_ = dx_Win2; +dx_ = dx_Win2; dy_ = dy_Win2; lc_ = lc_Win2; xc_ = xc_Win2-dx_/2; yc_=yc_Win2-dy_/2; @@ -102,10 +102,9 @@ If( Flag_Regularization ) Physical Surface("LayerWindow1", 115) = {s_Win1_Layer}; EndIf -Physical Line("Surface1", 201) = { l_Brick[{3}] }; -Physical Line("Surface2", 202) = { l_Brick[{1}] }; -Physical Line("Surface3", 203) = { l_Brick[{0}], l_Brick[{2}] }; - -Physical Line("SurfWindow1", 211) = {l_Win1[]}; -Physical Line("SurfWindow2", 212) = {l_Win2[]}; +Physical Curve("Surface1", 201) = { l_Brick[{3}] }; +Physical Curve("Surface2", 202) = { l_Brick[{1}] }; +Physical Curve("Surface3", 203) = { l_Brick[{0}], l_Brick[{2}] }; +Physical Curve("SurfWindow1", 211) = {l_Win1[]}; +Physical Curve("SurfWindow2", 212) = {l_Win2[]}; -- GitLab