diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 7791e6b8a880522fc0be7474292efa3b96957ae8..f2b936ed1ce2066e37aafcf0b7624770fef2202d 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -905,8 +905,12 @@ StringXNumber MeshOptions_Number[] = { "Threshold angle below which normals are not smoothed" }, { F|O, "AllowSwapAngle" , opt_mesh_allow_swap_edge_angle , 10.0 , "Treshold angle (in degrees) between faces normals under which we allow an edge swap" }, + { F|O, "BdfFieldFormat" , opt_mesh_bdf_field_format , 1. , "Field format for Nastran BDF files (0=free, 1=small, 2=large)" }, + + { F|O, "C1Continuity" , opt_mesh_c1 , 0. , + "Impose C1 continuity to high order meshes (only valid in 2D plane and ElemenOrder = 2)" }, { F|O, "CharacteristicLengthFactor" , opt_mesh_lc_factor , 1.0 , "Factor applied to all characteristic lengths" }, { F|O, "CharacteristicLengthMin" , opt_mesh_lc_min, 0.0 , @@ -943,10 +947,6 @@ StringXNumber MeshOptions_Number[] = { { F|O, "ElementOrder" , opt_mesh_order , 1. , // "Order" is a reserved token in the parser "Element order (1=linear elements, N (<6) = elements of higher order)" }, - { F|O, "C1Continuity" , opt_mesh_c1 , 0. , - "Impose C1 continuity to high order meshes, only valid in 2D plane and ElemenOrder = 2 and 3 (todo) (Default : C0 continuity)" }, - { F|O, "SmoothInternalEdges" , opt_mesh_smooth_internal_edges , 0 , - "Number of smoothing steps of internal edges for high order meshes" }, { F|O, "Explode" , opt_mesh_explode , 1.0 , "Element shrinking factor (between 0 and 1)" }, @@ -1053,6 +1053,8 @@ StringXNumber MeshOptions_Number[] = { "Accuracy of evaluation of the LC field for 1D mesh generation" }, { F|O, "Smoothing" , opt_mesh_nb_smoothing , 1. , "Number of smoothing steps applied to the final mesh" }, + { F|O, "SmoothInternalEdges" , opt_mesh_smooth_internal_edges , 0 , + "Number of smoothing steps of internal edges for high order meshes" }, { F|O, "SmoothNormals" , opt_mesh_smooth_normals , 0. , "Smooth the mesh normals?" }, { F|O, "StlBinary" , opt_mesh_stl_binary , 0. , diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp index 32e3b19e7ea4272cc78dcb42543267fb5306d15e..b852c7839bab4609e319922da538e34c72adee2a 100644 --- a/Parser/Gmsh.tab.cpp +++ b/Parser/Gmsh.tab.cpp @@ -324,7 +324,7 @@ /* Copy the first part of user declarations. */ #line 1 "Gmsh.y" -// $Id: Gmsh.tab.cpp,v 1.354 2008-03-21 07:21:05 geuzaine Exp $ +// $Id: Gmsh.tab.cpp,v 1.355 2008-03-21 09:39:39 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp index e68d615e8cfc9c60db8d2ac6723a9d4bd996f687..97d69ab9f3ab7a8943dcd7f85fcfb87437d0b29a 100644 --- a/Parser/Gmsh.yy.cpp +++ b/Parser/Gmsh.yy.cpp @@ -835,7 +835,7 @@ int gmsh_yy_flex_debug = 0; char *gmsh_yytext; #line 1 "Gmsh.l" #line 2 "Gmsh.l" -// $Id: Gmsh.yy.cpp,v 1.354 2008-03-21 07:21:07 geuzaine Exp $ +// $Id: Gmsh.yy.cpp,v 1.355 2008-03-21 09:39:41 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // diff --git a/benchmarks/2d/Square-01.geo b/benchmarks/2d/Square-01.geo index 744b75780fe70211a7a4481d62ae68002207124b..a31a52030be939cdfa67fc015b91fb62ce132f00 100644 --- a/benchmarks/2d/Square-01.geo +++ b/benchmarks/2d/Square-01.geo @@ -1,6 +1,3 @@ -/****************************** -Square uniformly meshed -******************************/ lc = .1; Point(1) = {0.0,0.0,0,lc}; Point(2) = {1,0.0,0,lc}; @@ -12,7 +9,3 @@ Line(3) = {1,4}; Line(4) = {4,3}; Line Loop(5) = {1,2,3,4}; Plane Surface(6) = {5}; -//Attractor Point{2} = {0.05,0.05,2}; -//Mesh.Algorithm = 2; -//Transfinite Line {4,-2} = 130 Using Bump 5; -//Transfinite Line {1,3} = 5 Using Progression 1; diff --git a/benchmarks/2d/Square-Attr1.geo b/benchmarks/2d/Square-Attr1.geo index 1beae2053366da2e396461c40c4cf96f6a0516d4..d039e77cd67e9c41a7638ec2ff1acd896dacc197 100644 --- a/benchmarks/2d/Square-Attr1.geo +++ b/benchmarks/2d/Square-Attr1.geo @@ -1,21 +1,30 @@ -/****************************** -Square uniformly meshed -******************************/ -lc = .1; -lc2 = .1; -Point(1) = {0.0,0.0,0,lc}; -Point(2) = {1,0.0,0,lc}; -Point(3) = {1,1,0,lc}; -Point(4) = {0,1,0,lc}; -Line(1) = {3,2}; -Line(2) = {2,1}; -Line(3) = {1,4}; -Line(4) = {4,3}; -Line Loop(5) = {1,2,3,4}; -Plane Surface(6) = {5}; -Point(11) = {0 ,0.,0,lc}; -Point(22) = {1.,1.,0,lc}; -Line(5) = {11,22}; -//Attractor Point{1,2,3,4,11} = {.0001,.0001,17}; -Attractor Line{3,5} = {.1,lc2/30,lc2,1000,3}; +lc = .1; +Point(1) = {0,0,0,lc}; +Point(2) = {1,0,0,lc/200}; +Point(3) = {1,1,0,lc}; +Point(4) = {0,1,0,lc}; +Line(1) = {3,2}; +Line(2) = {2,1}; +Line(3) = {1,4}; +Line(4) = {4,3}; +Line Loop(5) = {1,2,3,4}; +Plane Surface(6) = {5}; +Point(11) = {0.1, 0.1, 0, lc}; +Point(22) = {0.9, 0.9 ,0, lc}; +Line(5) = {11,22}; +Field[1] = Attractor; +Field[1].NNodesByEdge = 100; +Field[1].EdgesList = {3,5}; + +Field[2] = Threshold; +Field[2].IField = 1; +Field[2].LcMin = lc/10; +Field[2].LcMax = lc; +Field[2].DistMin = 0.15; +Field[2].DistMax = 0.3; + +Background Field = 2; + +// comment this to NOT take into account lc/200 at Point(2): +Mesh.ConstrainedBackgroundMesh = 1; diff --git a/benchmarks/2d/Square-Attr2.geo b/benchmarks/2d/Square-Attr2.geo index 6394cee5b01af9735b907fffb1283d220c843f9a..0a74c8167b7e292d4409df8b61260a030bc0c698 100644 --- a/benchmarks/2d/Square-Attr2.geo +++ b/benchmarks/2d/Square-Attr2.geo @@ -30,6 +30,15 @@ Line(13) = {17,18}; Line(14) = {18,19}; Line(15) = {19,20}; -r_min = 0.03; -r_max = 0.06; -Attractor Line{7,8,9,10,11,12,13,14,15} = {r_min,lc/30,lc,100,r_max/r_min}; +Field[1] = Attractor; +Field[1].NNodesByEdge = 100; +Field[1].EdgesList = {7,8,9,10,11,12,13,14,15}; + +Field[2] = Threshold; +Field[2].IField = 1; +Field[2].LcMin = lc/20; +Field[2].LcMax = lc; +Field[2].DistMin = 0.03; +Field[2].DistMax = 0.06; + +Background Field = 2; diff --git a/benchmarks/2d/Square-Attr3.geo b/benchmarks/2d/Square-Attr3.geo index d6ee2581d387d356082ea0f149fbf0eb504ca8a7..cf8dc8a7315455e231bd5f3559ea1b7a996b3ab7 100644 --- a/benchmarks/2d/Square-Attr3.geo +++ b/benchmarks/2d/Square-Attr3.geo @@ -1,24 +1,21 @@ -/****************************** -Square uniformly meshed -******************************/ -lc = .1; -Point(1) = {0.0,0.0,0,lc}; -Point(2) = {1,0.0,0,lc}; -Point(3) = {1,1,0,lc}; -Point(4) = {0,1,0,lc}; -Line(1) = {3,2}; -Line(2) = {2,1}; -Line(3) = {1,4}; -Line(4) = {4,3}; -Line Loop(5) = {1,2,3,4}; -Plane Surface(6) = {5}; -Line(5) = {3,1}; - -num_pts = 100; -lc_min = 0.005; -lc_max = lc; -r_min = 0.01; -r_max = 0.5; -Attractor Line{5,1,3,2} = {r_min, lc_min, lc_max, num_pts, r_max / r_min}; +lc = .1; +Point(1) = {0,0,0,lc}; +Point(2) = {1,0,0,lc}; +Point(3) = {1,1,0,lc}; +Point(4) = {0,1,0,lc}; +Line(1) = {3,2}; +Line(2) = {2,1}; +Line(3) = {1,4}; +Line(4) = {4,3}; +Line Loop(5) = {1,2,3,4}; +Plane Surface(6) = {5}; +Field[1] = Box; +Field[1].VIn = lc/10; +Field[1].VOut = lc; +Field[1].XMin = 0.2; +Field[1].XMax = 0.6; +Field[1].YMin = 0.2; +Field[1].YMax = 0.6; +Background Field = 1; diff --git a/benchmarks/2d/Square-Attr4.geo b/benchmarks/2d/Square-Attr4.geo index bb8fa75a6f40032225b49ff08306e2be18b2c476..4759cffef2a8f978bad33aed97cfc5fa4cd6b337 100644 --- a/benchmarks/2d/Square-Attr4.geo +++ b/benchmarks/2d/Square-Attr4.geo @@ -11,10 +11,14 @@ Point(55) = {0.2,.5,0,lc}; Line Loop(5) = {1,2,3,4}; Plane Surface(6) = {5}; -num_pts = 100; // number of points on the attractor, unused for points -lc_min = lc/50; // lc inside r_min -lc_max = lc; // lc outside r_max -r_min = 0.05; -r_max = 0.4; -Attractor Point{1,55} = {r_min, lc_min, lc_max, num_pts, r_max / r_min}; -Attractor Line{1} = {r_min, lc_min, lc_max, num_pts, r_max / r_min}; +Field[1] = Attractor; +Field[1].NodesList = {55}; + +Field[2] = Threshold; +Field[2].IField = 1; +Field[2].LcMin = lc/50; +Field[2].LcMax = lc; +Field[2].DistMin = 0.05; +Field[2].DistMax = 0.4; + +Background Field = 2; diff --git a/benchmarks/2d/Square-Emb.geo b/benchmarks/2d/Square-Emb.geo index 996792e424c1d8cdb874b0afe378ab2b6ad714b6..d6d70c7138aed57ca6fd4539fc743d959ca8bd89 100644 --- a/benchmarks/2d/Square-Emb.geo +++ b/benchmarks/2d/Square-Emb.geo @@ -22,5 +22,3 @@ Spline(5) = {11,22,33,44}; Line Loop(5) = {1,2,3,4}; Plane Surface(6) = {5}; Line {5} In Surface {6}; -//Attractor Point{2} = {0.05,0.05,2}; -//Mesh.Algorithm = 2; diff --git a/benchmarks/2d/TieAnchor520.geo b/benchmarks/2d/TieAnchor520.geo index 9f7884219030443f4be2e5de6907b28120977725..a64836ec44528314c27f63373dc3d3222fef76f8 100644 --- a/benchmarks/2d/TieAnchor520.geo +++ b/benchmarks/2d/TieAnchor520.geo @@ -323,13 +323,6 @@ PS122003=news; Plane Surface(PS122003) = {LL122003}; PS122004=news; Plane Surface(PS122004) = {LL122004}; PS122005=news; Plane Surface(PS122005) = {LL122005}; // -// __________ -// ATTRACTORS -// -// Attractor Line{L201100} = {.5, .5, .1}; -// Attractor Line{L201110} = {.5, .5, .1}; -// Attractor Line{L201125} = {.5, .5, .1}; -// // /********************************************************************* * @@ -608,18 +601,7 @@ PS136012=news; Plane Surface(PS136012) = {LL136012}; PS136013=news; Plane Surface(PS136013) = {LL136013}; PS136014=news; Plane Surface(PS136014) = {LL136014}; // -// __________ -// ATTRACTORS -// -// Attractor Line{L202100} = {.5, .5, .1}; -// Attractor Line{L202110} = {.5, .5, .1}; -// Attractor Line{L202210} = {.5, .5, .1}; -// Attractor Line{L202410} = {.5, .5, .1}; -// Attractor Line{L202125} = {.5, .5, .1}; -// -//Attractor Point{L236000} = {.25, .25, .1}; -// -// + // /********************************************************************* * @@ -826,37 +808,6 @@ PS103903=news; Plane Surface(PS103903) = {LL103903}; PS103904=news; Plane Surface(PS103904) = {LL103904}; PS103905=news; Plane Surface(PS103905) = {LL103905}; // -// __________ -// ATTRACTORS -// -// -// Attractor Line{L103100} = {.5, .5, .1}; -// Attractor Line{L103108} = {.5, .5, .1}; -// Attractor Line{L103110} = {.5, .5, .1}; -// Attractor Line{L103112} = {.5, .5, .1}; -// -// Attractor Line{L103400} = {.5, .5, .1}; -// Attractor Line{L103405} = {.5, .5, .1}; -// Attractor Line{L103408} = {.5, .5, .1}; -// Attractor Line{L103410} = {.5, .5, .1}; -// Attractor Line{L103412} = {.5, .5, .1}; -// Attractor Line{L103418} = {.5, .5, .1}; -// -// -//// Attractor Line{L203100} = {.5, .5, .1}; -// Attractor Line{L203200} = {.25, .25, .05}; -//// Attractor Line{L203300} = {.5, .5, .1}; -// Attractor Line{L203205} = {.5, .5, .1}; -// Attractor Line{L203305} = {.5, .5, .1}; -// Attractor Line{L203110} = {.5, .5, .1}; -// Attractor Line{L203210} = {.5, .5, .1}; -// Attractor Line{L203310} = {.5, .5, .1}; -// Attractor Line{L203215} = {.5, .5, .1}; -// Attractor Line{L203315} = {.5, .5, .1}; -//Attractor Line{L203125} = {.5, .5, .1}; -// Attractor Line{L203225} = {.25, .25, .05}; -//Attractor Line{L203325} = {.5, .5, .1}; -// // // /********************************************************************* @@ -1314,39 +1265,6 @@ PS104008=news; Plane Surface(PS104008) = {LL104008}; PS104009=news; Plane Surface(PS104009) = {LL104009}; PS104010=news; Plane Surface(PS104010) = {LL104010}; // -// __________ -// ATTRACTORS -// -// -// Attractor Line{L104100} = {.5, .5, .1}; -// Attractor Line{L104108} = {.5, .5, .1}; -// Attractor Line{L104110} = {.5, .5, .1}; -// Attractor Line{L104112} = {.5, .5, .1}; -// -// Attractor Line{L104400} = {.5, .5, .1}; -// Attractor Line{L104405} = {.5, .5, .1}; -// Attractor Line{L104408} = {.5, .5, .1}; -// Attractor Line{L104410} = {.5, .5, .1}; -// Attractor Line{L104412} = {.5, .5, .1}; -// Attractor Line{L104415} = {.5, .5, .1}; -// Attractor Line{L104420} = {.5, .5, .1}; -// -// -//// Attractor Line{L204100} = {.5, .5, .1}; -// Attractor Line{L204200} = {.25, .25, .05}; -//// Attractor Line{L204300} = {.5, .5, .1}; -// Attractor Line{L204205} = {.5, .5, .1}; -// Attractor Line{L204305} = {.5, .5, .1}; -// Attractor Line{L204110} = {.5, .5, .1}; -// Attractor Line{L204210} = {.5, .5, .1}; -// Attractor Line{L204310} = {.5, .5, .1}; -// Attractor Line{L204220} = {.5, .5, .1}; -// Attractor Line{L204320} = {.5, .5, .1}; -//// Attractor Line{L204125} = {.5, .5, .1}; -// Attractor Line{L204225} = {.25, .25, .05}; -//Attractor Line{L204325} = {.5, .5, .1}; -// -// /********************************************************************* * * FLOORBEAM TOP FLANGE @@ -1524,45 +1442,6 @@ PS106022=news; Plane Surface(PS106022) = {LL106022}; PS106023=news; Plane Surface(PS106023) = {LL106023}; PS106024=news; Plane Surface(PS106024) = {LL106024}; // -// __________ -// ATTRACTORS -// Attractor Line{L106200} = {.5, .5, .1}; -// Attractor Line{L106220} = {.5, .5, .1}; -// Attractor Line{L106300} = {.5, .5, .1}; -// Attractor Line{L106310} = {.5, .5, .1}; -// Attractor Line{L106315} = {.5, .5, .1}; -// Attractor Line{L106320} = {.5, .5, .1}; -// Attractor Line{L106325} = {.5, .5, .1}; -// Attractor Line{L106330} = {.5, .5, .1}; -// Attractor Line{L106400} = {.5, .5, .1}; -// Attractor Line{L106410} = {.5, .5, .1}; -// Attractor Line{L106415} = {.5, .5, .1}; -// Attractor Line{L106420} = {.5, .5, .1}; -// Attractor Line{L106425} = {.5, .5, .1}; -// Attractor Line{L106430} = {.5, .5, .1}; -// Attractor Line{L106500} = {.5, .5, .1}; -// Attractor Line{L106520} = {.5, .5, .1}; -// -// Attractor Line{L206100} = {.5, .5, .1}; -// Attractor Line{L206200} = {.5, .5, .1}; -// Attractor Line{L206300} = {.5, .5, .1}; -// Attractor Line{L206400} = {.5, .5, .1}; -// -// Attractor Line{L206120} = {.5, .5, .1}; -// Attractor Line{L206151} = {.5, .5, .1}; -// Attractor Line{L206220} = {.5, .5, .1}; -// Attractor Line{L206252} = {.5, .5, .1}; -// Attractor Line{L206320} = {.5, .5, .1}; -// Attractor Line{L206352} = {.5, .5, .1}; -// Attractor Line{L206362} = {.5, .5, .1}; -// Attractor Line{L206420} = {.5, .5, .1}; -// -// Attractor Line{L206140} = {.5, .5, .1}; -// Attractor Line{L206240} = {.5, .5, .1}; -// Attractor Line{L206340} = {.5, .5, .1}; -// Attractor Line{L206440} = {.5, .5, .1}; -// -// /********************************************************************* * * FLOORBEAM BOT FLANGE @@ -1668,35 +1547,6 @@ PS107006=news; Plane Surface(PS107006) = {LL107006}; PS107007=news; Plane Surface(PS107007) = {LL107007}; PS107008=news; Plane Surface(PS107008) = {LL107008}; // -// __________ -// ATTRACTORS -// Attractor Line{L107200} = {.5, .5, .1}; -// Attractor Line{L107220} = {.5, .5, .1}; -// Attractor Line{L107300} = {.5, .5, .1}; -// Attractor Line{L107310} = {.5, .5, .1}; -// Attractor Line{L107320} = {.5, .5, .1}; -// Attractor Line{L107330} = {.5, .5, .1}; -// Attractor Line{L107400} = {.5, .5, .1}; -// Attractor Line{L107410} = {.5, .5, .1}; -// Attractor Line{L107420} = {.5, .5, .1}; -// Attractor Line{L107430} = {.5, .5, .1}; -// Attractor Line{L107500} = {.25, .25, .05}; -// Attractor Line{L107520} = {.25, .25, .05}; -// -// Attractor Line{L207100} = {.5, .5, .1}; -// Attractor Line{L207200} = {.5, .5, .1}; -// Attractor Line{L207300} = {.5, .5, .1}; -// Attractor Line{L207400} = {.5, .5, .1}; -// Attractor Line{L207120} = {.5, .5, .1}; -// Attractor Line{L207220} = {.5, .5, .1}; -// Attractor Line{L207320} = {.5, .5, .1}; -// Attractor Line{L207420} = {.5, .5, .1}; -// Attractor Line{L207140} = {.5, .5, .1}; -// Attractor Line{L207240} = {.5, .5, .1}; -// Attractor Line{L207340} = {.5, .5, .1}; -// Attractor Line{L207440} = {.5, .5, .1}; -// -// /********************************************************************* * * FLOORBEAM WEB @@ -1803,25 +1653,6 @@ PS105004=news; Plane Surface(PS105004) = {LL105004}; PS105005=news; Plane Surface(PS105005) = {LL105005}; PS105006=news; Plane Surface(PS105006) = {LL105006}; // -// __________ -// ATTRACTORS -// -// Attractor Line{L105215} = {.5, .5, .1}; -// Attractor Line{L105415} = {.5, .5, .1}; -// -// Attractor Line{L205115} = {.5, .5, .1}; -// Attractor Line{L205215} = {.5, .5, .1}; -// Attractor Line{L205315} = {.5, .5, .1}; -// Attractor Line{L205415} = {.5, .5, .1}; -//Attractor Line{L205220} = {.25, .25, .1}; -//Attractor Line{L205320} = {.25, .25, .1}; -// -// Attractor Line{L205130} = {.5, .5, .1}; -// Attractor Line{L205140} = {.5, .5, .1}; -// Attractor Line{L205150} = {.5, .5, .1}; -// Attractor Line{L303000} = {.5, .5, .1}; -// -// /********************************************************************* * * FLOORBEAM STIFFENERS @@ -1899,14 +1730,6 @@ PS112100=news; Plane Surface(PS112100) = {LL112100}; PS113100=news; Plane Surface(PS113100) = {LL113100}; PS114100=news; Plane Surface(PS114100) = {LL114100}; // -// __________ -// ATTRACTORS -// Attractor Line{L211110} = {.5, .5, .1}; -// Attractor Line{L212110} = {.5, .5, .1}; -// Attractor Line{L213110} = {.5, .5, .1}; -// Attractor Line{L214110} = {.5, .5, .1}; -// -// /********************************************************************* * * LOWER LATERAL BRACING BOT FLANGE @@ -1944,14 +1767,6 @@ LL117100=newl; Line Loop(LL117100) = {L117100,L217200,-L117110,-L217100}; // SURFACES PS117100=news; Plane Surface(PS117100) = {LL117100}; // -// __________ -// ATTRACTORS -// Attractor Line{L117100} = {.25, .25, .15}; -// Attractor Line{L117110} = {.25, .25, .15}; -// Attractor Line{L217100} = {.25, .25, .15}; -// Attractor Line{L217200} = {.25, .25, .15}; -// -// /********************************************************************* * * LOWER LATERAL BRACING TOP FLANGE @@ -1989,14 +1804,6 @@ LL118100=newl; Line Loop(LL118100) = {L118100,L218200,-L118110,-L218100}; // SURFACES PS118100=news; Plane Surface(PS118100) = {LL118100}; // -// __________ -// ATTRACTORS -// Attractor Line{L118100} = {.25, .25, .15}; -// Attractor Line{L118110} = {.25, .25, .15}; -// Attractor Line{L218100} = {.25, .25, .15}; -// Attractor Line{L218200} = {.25, .25, .15}; -// -// /********************************************************************* * * LOWER LATERAL BRACING EAST WEB @@ -2034,11 +1841,6 @@ LL115100=newl; Line Loop(LL115100) = {L115100,L215110,-L115200,-L215100}; // SURFACES PS115100=news; Plane Surface(PS115100) = {LL115100}; // -// __________ -// ATTRACTORS -// Attractor Line{L215100} = {.25, .25, .15}; -// Attractor Line{L215110} = {.25, .25, .15}; -// // /********************************************************************* * @@ -2077,12 +1879,6 @@ LL116100=newl; Line Loop(LL116100) = {L116100,L216110,-L116200,-L216100}; // SURFACES PS116100=news; Plane Surface(PS116100) = {LL116100}; // -// __________ -// ATTRACTORS -// Attractor Line{L216100} = {.25, .25, .15}; -// Attractor Line{L216110} = {.25, .25, .15}; -// -// /********************************************************************* * * GUSSET BOT @@ -2136,14 +1932,6 @@ LL108100=newl; Line Loop(LL108100) = {L108101,L108102,L108103,L108104,L108105,L1 // SURFACES PS108100=news; Plane Surface(PS108100) = {LL108100}; // -// __________ -// ATTRACTORS -// Attractor Line{L108101} = {.5, .5, .1}; -// Attractor Line{L108102} = {.5, .5, .1}; -// Attractor Line{L108105} = {.5, .5, .1}; -// Attractor Line{L108106} = {.5, .5, .1}; -// -// /********************************************************************* * * GUSSET TOP @@ -2191,13 +1979,6 @@ LL109100=newl; Line Loop(LL109100) = {L109101,L109102,L109103,L109104,L109105,L1 // SURFACES PS109100=news; Plane Surface(PS109100) = {LL109100}; // -// __________ -// ATTRACTORS -// Attractor Line{L109101} = {.5, .5, .1}; -// Attractor Line{L109102} = {.5, .5, .1}; -// Attractor Line{L109106} = {.5, .5, .1}; -// Attractor Line{L109107} = {.5, .5, .1}; -// // /********************************************************************* * @@ -2270,22 +2051,6 @@ LL110102=newl; Line Loop(LL110102) = {L110601,L110602,L110603,L110604,L110605,L1 // SURFACES PS110101=news; Plane Surface(PS110101) = {LL110101,LL110102}; // -// __________ -// ATTRACTORS -// Attractor Line{L110102} = {.5, .5, .10}; -// Attractor Line{L110104} = {.5, .5, .10}; -// Attractor Line{L110106} = {.5, .5, .10}; -// Attractor Line{L110109} = {.5, .5, .10}; -// -// Attractor Line{L110601} = {.25, .25, .15}; -// Attractor Line{L110602} = {.25, .25, .15}; -// Attractor Line{L110603} = {.25, .25, .15}; -// Attractor Line{L110604} = {.25, .25, .15}; -// Attractor Line{L110605} = {.25, .25, .15}; -// Attractor Line{L110606} = {.25, .25, .15}; -// Attractor Line{L110607} = {.25, .25, .15}; -// Attractor Line{L110608} = {.25, .25, .15}; -// // /********************************************************************* * @@ -2470,11 +2235,6 @@ PS120103=news; Plane Surface(PS120103) = {LL120103}; PS120104=news; Plane Surface(PS120104) = {LL120104}; PS120105=news; Plane Surface(PS120105) = {LL120105}; // -// __________ -// ATTRACTORS -//Attractor Line{L1201} = {.5, .5, .1}; -//Attractor Point{p110001} = {.4, .4, .2}; // hole at L6U7 -// // /********************************************************************* * @@ -2668,11 +2428,6 @@ PS134103=news; Plane Surface(PS134103) = {LL134103}; PS134104=news; Plane Surface(PS134104) = {LL134104}; PS134105=news; Plane Surface(PS134105) = {LL134105}; // -// __________ -// ATTRACTORS -//Attractor Line{L1201} = {.5, .5, .1}; -//Attractor Point{p110001} = {.4, .4, .2}; // hole at L6U7 -// // /********************************************************************* * @@ -2867,10 +2622,6 @@ PS126103=news; Plane Surface(PS126103) = {LL126103}; PS126104=news; Plane Surface(PS126104) = {LL126104}; PS126105=news; Plane Surface(PS126105) = {LL126105}; // -// __________ -// ATTRACTORS -//Attractor Line{L1201} = {.5, .5, .1}; -//Attractor Point{p110001} = {.4, .4, .2}; // hole at L6U7 // // /********************************************************************* @@ -3066,11 +2817,6 @@ PS140103=news; Plane Surface(PS140103) = {LL140103}; PS140104=news; Plane Surface(PS140104) = {LL140104}; PS140105=news; Plane Surface(PS140105) = {LL140105}; // -// __________ -// ATTRACTORS -//Attractor Line{L1201} = {.5, .5, .1}; -//Attractor Point{p110001} = {.4, .4, .2}; // hole at L6U7 -// // /********************************************************************* * @@ -3151,10 +2897,6 @@ PS128101=news; Plane Surface(PS128101) = {LL128101}; PS129101=news; Plane Surface(PS129101) = {LL129101}; PS130101=news; Plane Surface(PS130101) = {LL130101}; // -// __________ -// ATTRACTORS -//Attractor Line{L1201} = {.5, .5, .1}; -//Attractor Point{p110001} = {.4, .4, .2}; // hole at L6U7 // // /********************************************************************* @@ -3236,11 +2978,6 @@ PS142101=news; Plane Surface(PS142101) = {LL142101}; PS143101=news; Plane Surface(PS143101) = {LL143101}; PS144101=news; Plane Surface(PS144101) = {LL144101}; // -// __________ -// ATTRACTORS -//Attractor Line{L1201} = {.5, .5, .1}; -//Attractor Point{p110001} = {.4, .4, .2}; // hole at L6U7 -// // /********************************************************************* * diff --git a/benchmarks/2d/naca12_2d.geo b/benchmarks/2d/naca12_2d.geo index b2bb3e960d9469329ce9101f208541909dbf1ef4..621cc2dd76ad5225ca78aaf9bfc96a594251ff9b 100644 --- a/benchmarks/2d/naca12_2d.geo +++ b/benchmarks/2d/naca12_2d.geo @@ -225,7 +225,3 @@ Plane Surface(11) = {9,10}; Point(9999) = {0.6,0,0,1}; -//Attractor Point{9999} = {0.2,0.02,lc3*10,2}; - -//Attractor Line{1,2,3,4} = {1,.05,3}; -//Mesh.Algorithm = 2; diff --git a/benchmarks/2d/t7.geo b/benchmarks/2d/t7.geo deleted file mode 100644 index 1e0c05cbfe8cf4e3483f38f92c1063144f10484a..0000000000000000000000000000000000000000 --- a/benchmarks/2d/t7.geo +++ /dev/null @@ -1,39 +0,0 @@ -/********************************************************************* - * - * Gmsh tutorial 7 - * - * Anisotropic meshes, attractors - * - *********************************************************************/ - -lc = .3; - -Point(1) = {0.0,0.0,0,lc}; -Point(2) = {1.2,-0.2,0,lc}; -Point(3) = {1,1,0,lc}; -Point(4) = {0,1,0,lc}; - -Line(1) = {3,2}; -Line(2) = {2,1}; -Line(3) = {1,4}; -Line(4) = {4,3}; - -Line Loop(5) = {1,2,3,4}; -Plane Surface(6) = {5}; - -Point(5) = {0.1,0.2,0,lc}; -Point(11) = {0.4,0.7,-1,lc}; -Point(12) = {0.5,0.5,0,lc}; -Point(22) = {0.9,0.9,1,lc}; - -Line(5) = {11,22}; - -Spline(7) = {4,5,12,2}; - -num_pts = 100; -lc_min = 0.005; -lc_max = lc; -r_min = 0.01; -r_max = 0.5; -Attractor Line{7,5,3,2} = {r_min, lc_min, lc_max, num_pts, r_max / r_min}; - diff --git a/benchmarks/2d/wing-splines.geo b/benchmarks/2d/wing-splines.geo index 83a359af18a664a0d4a263ffaa1f309f4a3bad62..55d9ee96ee923da62e5e15660fd00ced8e713681 100644 --- a/benchmarks/2d/wing-splines.geo +++ b/benchmarks/2d/wing-splines.geo @@ -623,8 +623,3 @@ Circle(408) = {4355,4351,4354}; Circle(409) = {4354,4351,4353}; Circle(410) = {4353,4351,4352}; -// use an embedded curve -//Line {407,408,409,410} In Surface {406}; - -// or an attractor -//Attractor Line {1 ... 12} = {1,lc_wing,lc_box,1000,3}; diff --git a/benchmarks/2d/wing.geo b/benchmarks/2d/wing.geo index e8db8d0c798ab0a316b54f2600f22f8241900625..febf083bd3a23fbcf2f8389d6d62681ccb3d8841 100644 --- a/benchmarks/2d/wing.geo +++ b/benchmarks/2d/wing.geo @@ -1080,4 +1080,3 @@ Line Loop(533) = {446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,46 Line Loop(534) = {41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40}; Plane Surface(535) = {531,532,534,533}; -//Attractor Point{3846} = {0.1,0.1,10}; diff --git a/benchmarks/2d/world.geo b/benchmarks/2d/world.geo index 82db5ecf812e19e50536eddf28d8b2b6b4b3d549..4bcc6d42da83c93ce0fc1522fa4944dc2f6dca1c 100755 --- a/benchmarks/2d/world.geo +++ b/benchmarks/2d/world.geo @@ -674,5 +674,3 @@ CatmullRom (48) = {600, 601, 602, 603, 604, 600}; Line Loop (49) = {48}; Physical Line (1336) = {48}; Plane Surface (3) = {43,5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 45, 47, 49}; -//Plane Surface (3) = {43}; -//Attractor Line (2) = {4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48}; diff --git a/benchmarks/3d/Cube-Attr-01.geo b/benchmarks/3d/Cube-Attr-01.geo index 71f98e23c571c71f6316c1cc597653a8f690f64b..f53c0d858d13203917d7cd0c93a98368a522cc58 100644 --- a/benchmarks/3d/Cube-Attr-01.geo +++ b/benchmarks/3d/Cube-Attr-01.geo @@ -1,11 +1,8 @@ - -Mesh.Algorithm = 2 ; - - -Point(1) = {0.0,0.0,0.0,.2}; -Point(2) = {1,0.0,0.0,.2}; -Point(3) = {1,1,0.0,.2}; -Point(4) = {0,1,0.0,.2}; +lc = 0.2; +Point(1) = {0,0,0,lc}; +Point(2) = {1,0,0,lc}; +Point(3) = {1,1,0,lc}; +Point(4) = {0,1,0,lc}; Line(1) = {4,3}; Line(2) = {3,2}; Line(3) = {2,1}; @@ -15,16 +12,26 @@ Plane Surface(6) = {5}; Extrude Surface {6, {0,0.0,1}}; Surface Loop(29) = {23,6,15,19,28,27}; -Complex Volume(30) = {29}; +Volume(30) = {29}; -Attractor Point{1,4,5,6,10,14} = {0.05,0.05,2} ; - Point(16) = {-.5,.5,.5,1.0}; Point(17) = {1.5,.5,.8,1.0}; Line(30) = {16,17}; -Attractor Line{30} = {0.1,0.1,2}; Point(18) = {-.2,.7,1.3,1.0}; Point(19) = {1.22,.1,-.8,1.0}; Line(31) = {18,19}; -Attractor Line{31} = {0.01,0.01,2}; + +Field[1] = Attractor; +Field[1].NNodesByEdge = 100; +Field[1].NodesList = {1,4,5,6,10,14}; +Field[1].EdgesList = {30,31}; + +Field[2] = Threshold; +Field[2].IField = 1; +Field[2].LcMin = lc/10; +Field[2].LcMax = lc; +Field[2].DistMin = 0.1; +Field[2].DistMax = 0.2; + +Background Field = 2; diff --git a/benchmarks/3d/Cube-Attr-02.geo b/benchmarks/3d/Cube-Attr-02.geo index 17f2b0b8ad20885271cd612be549ff33c36ebb03..bb80965b120570de5574567568a1decd0265277d 100644 --- a/benchmarks/3d/Cube-Attr-02.geo +++ b/benchmarks/3d/Cube-Attr-02.geo @@ -1,13 +1,8 @@ -/***************************** -cube meshed uniformly -*****************************/ - -Mesh.Algorithm = 2; - -Point(1) = {0.0,0.0,0.0,.3}; -Point(2) = {1,0.0,0.0,.3}; -Point(3) = {1,1,0.0,.3}; -Point(4) = {0,1,0.0,.3}; +lc = 0.3; +Point(1) = {0,0,0,lc}; +Point(2) = {1,0,0,lc}; +Point(3) = {1,1,0,lc}; +Point(4) = {0,1,0,lc}; Line(1) = {4,3}; Line(2) = {3,2}; Line(3) = {2,1}; @@ -17,6 +12,18 @@ Plane Surface(6) = {5}; Extrude Surface{6, {0,0.0,1}}; Surface Loop(29) = {23,6,15,19,28,27}; -Complex Volume(30) = {29}; +Volume(30) = {29}; + +Point(55) = {0.3,0.3,0.3,1}; -Attractor Point{1} = {0.1,0.1,2}; +Field[1] = Attractor; +Field[1].NodesList = {55}; + +Field[2] = Threshold; +Field[2].IField = 1; +Field[2].LcMin = lc/20; +Field[2].LcMax = lc; +Field[2].DistMin = 0.3; +Field[2].DistMax = 0.5; + +Background Field = 2; diff --git a/benchmarks/3d/Revolve2-Attr.geo b/benchmarks/3d/Revolve2-Attr.geo deleted file mode 100644 index ed583cb757b3e1dfcc5f37b0d5a078e0eea1cfbb..0000000000000000000000000000000000000000 --- a/benchmarks/3d/Revolve2-Attr.geo +++ /dev/null @@ -1,22 +0,0 @@ - -Mesh.Algorithm = 2; - -lc = .3; -Point(2) = {3.0,-1.0,0.0,lc}; -Point(3) = {1,-1,0.0,lc}; -Point(4) = {3,1,0.0,lc}; -Point(5) = {1,1,0.0,lc}; -Line(1) = {4,2}; -Line(2) = {2,3}; -Line(3) = {3,5}; -Line(4) = {5,4}; -Line Loop(5) = {4,1,2,3}; -Plane Surface(6) = {5}; - -Extrude Surface{6, {0.0,1,0}, {0,0.0,0.0}, 3.14159/2 }; - -Coherence; - -Attractor Line{14} = {.1,.1,1.0} ; -Surface Loop(29) = {15,6,19,23,27,28}; -Complex Volume(30) = {29}; diff --git a/benchmarks/3d/Torus-Attr.geo b/benchmarks/3d/Torus-Attr.geo deleted file mode 100644 index 574164451773a5bed5efe115f1ec7b472f70e83b..0000000000000000000000000000000000000000 --- a/benchmarks/3d/Torus-Attr.geo +++ /dev/null @@ -1,21 +0,0 @@ - -Mesh.Algorithm = 2; - -lc = .2; -Point(1) = {2.0,0.0,0.0,lc}; -Point(2) = {2.0,1,0.0,lc}; -Point(3) = {1,0,0.0,lc}; -Point(4) = {3,0,0.0,lc}; -Point(5) = {2,-1,0.0,lc}; -Circle(1) = {4,1,2}; - -Circle(2) = {2,1,3}; -Circle(3) = {3,1,5}; -Circle(4) = {5,1,4}; -Line Loop(5) = {4,1,2,3}; -Plane Surface(6) = {5}; - -Extrude Surface{ 6, {0.0,1,0}, {0,0.0,0.0}, 1.5*3.14159/2 }; - -Coherence; -Attractor Line {22} = {1,.1,2.0}; diff --git a/benchmarks/3d/cube.geo b/benchmarks/3d/cube.geo deleted file mode 100644 index fb4b6ec267697b25e2cfa92e8acef88f0a6f625d..0000000000000000000000000000000000000000 --- a/benchmarks/3d/cube.geo +++ /dev/null @@ -1,20 +0,0 @@ -/**************************** -cube meshed uniformly -****************************/ -Point(1) = {0.0,0.0,0.0,.4}; -Point(2) = {1,0.0,0.0,.4}; -Point(3) = {1,1,0.0,.4}; -Point(4) = {0,1,0.0,.4}; -Line(1) = {4,3}; -Line(2) = {3,2}; -Line(3) = {2,1}; -Line(4) = {1,4}; -Line Loop(5) = {2,3,4,1}; -Plane Surface(6) = {5}; -Extrude Surface { 6, {0,0.0,1} }; - -Surface Loop(29) = {23,6,15,19,28,27}; -Complex Volume(30) = {29}; - -Mesh.Algorithm = 2; -Attractor Line {1,2,3,4} = {.1,.1,3}; diff --git a/doc/CREDITS b/doc/CREDITS index a176cc25604e8c079899a4411608c769c548c79e..31286365f9e545085608c59052e6a1d0dad8b425 100644 --- a/doc/CREDITS +++ b/doc/CREDITS @@ -1,4 +1,4 @@ -$Id: CREDITS,v 1.50 2008-02-21 15:18:42 geuzaine Exp $ +$Id: CREDITS,v 1.51 2008-03-21 09:39:43 geuzaine Exp $ Gmsh is copyright (C) 1997-2008 @@ -12,7 +12,8 @@ $Id: CREDITS,v 1.50 2008-02-21 15:18:42 geuzaine Exp $ Major code contributions to Gmsh have been provided by Nicolas Tardieu (help with the GSL and Netgen integration), Stephen Guzik (CGNS -integration) and Pascale Noyret (MED integration). +integration), Pascale Noyret (MED integration) and Jonathan Lambrechts +(Fields). Other code contributors include: David Colignon for new colormaps and lots of testing and bug reports; Patrick Dular for transfinite mesh @@ -102,5 +103,4 @@ Dardenne, Christophe Prud'homme, Sebastien.Clerc, Jose Miguel Pasini, Philippe Lussou, Jacques Kools, Bayram Yenikaya, Peter Hornby, Krishna Mohan Gundu, Christopher Stott, Timmy Schumacher, Carl Osterwisch, Bruno Frackowiak, Philip Kelleners, Romuald Conty, Ruth Sabariego, -Renaud Sizaire, Michel Benhamou, Emilie Marchandise, Jonathan -Lambrechts. +Renaud Sizaire, Michel Benhamou, Emilie Marchandise. diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi index 6995314fb9b7e6fd5992808211e617560c407a7e..d1604677c5e6eb044be6362776052d24ced314cf 100644 --- a/doc/texinfo/gmsh.texi +++ b/doc/texinfo/gmsh.texi @@ -1,5 +1,5 @@ \input texinfo.tex @c -*-texinfo-*- -@c $Id: gmsh.texi,v 1.240 2008-02-27 12:39:28 geuzaine Exp $ +@c $Id: gmsh.texi,v 1.241 2008-03-21 09:39:43 geuzaine Exp $ @c @c Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle @c @@ -370,9 +370,10 @@ the discretization of an ``isolated'' (@var{n}-1)-th dimensional entity inside an @var{n}-th dimensional entity does @emph{not} constrain the @var{n}-th dimensional mesh. Every meshing step is constrained by the characteristic length field, which can be uniform, specified by -characteristic lengths associated with elementary geometrical entities, -associated with another mesh (the ``background mesh''), or defined by -point or line ``attractors''. +characteristic lengths associated with points in the geometry, or +defined by general ``fields'' (a scalar field defined on another mesh +using post-processing view, threshold fields associated with point or +line ``attractors'', etc.). For each meshing step, all structured mesh directives are executed first, and serve as additional constraints for the unstructured parts @@ -450,8 +451,8 @@ algorithms is pretty good; the 3D algorithm is still experimental and slow @item specify target element sizes accurately. Gmsh provides several mechanisms to control the size of the elements in the final mesh: -through interpolation from sizes specified at geometry points or on a -background mesh, or using attractors (@pxref{Mesh commands}); +through interpolation from sizes specified at geometry points or using +flexible mesh size fields (@pxref{Mesh commands}); @item create simple extruded geometries and meshes (see @ref{Geometry commands}, and @ref{Mesh commands}); @@ -1939,10 +1940,8 @@ either in the GUI or on the command line (see @ref{Running Gmsh}, and @cindex Mesh, background @cindex Background mesh -The `size' of a mesh element is defined as the length of the segment for a -line segment, the radius of the circumscribed circle for a triangle and the -radius of the circumscribed sphere for a tetrahedron. There are three main -ways to specify the size of the mesh elements for a given geometry: +There are two ways to specify the size of the mesh elements for a given +geometry: @enumerate @item @@ -1959,24 +1958,43 @@ module. The final element sizes are of course constrained by the structured algorithms for which the element sizes are explicitly specified (e.g., transfinite and extruded grids: see @ref{Structured grids}). @item -You can give Gmsh an explicit background mesh in the form of a scalar -post-processing view (see @ref{Post-processing commands}, and @ref{File -formats}) in which the nodal values are the target element sizes. This -method is very general but it requires a first (usually rough) mesh and -a way to compute the target sizes on this mesh (usually through an error -estimation procedure, in an iterative process of mesh adaptation). Note -that the target element sizes can be constrained by the characteristic -lengths defined in the geometrical model if the -@code{Mesh.ConstrainedBackgroundMesh} option is set. To load a -background mesh, you can use the @code{-bgm} command-line option -(@pxref{Command-line options}), select `Apply as background mesh' in the -post-processing view option menu, or use the @code{Background Mesh} -command in a script (@pxref{Post-processing commands}). - -Background meshes are supported by all algorithms except the algorithms -based on Netgen. -@item -You can define point or line attractors. [More to come here later.] +You can specify characteristic lengths using mesh size +``fields''. Various fields exist: +@itemize @bullet +@item +A @code{PostView} field specifies an explicit background mesh in the +form of a scalar post-processing view (see @ref{Post-processing +commands}, and @ref{File formats}) in which the nodal values are the +target element sizes. This method is very general but it requires a +first (usually rough) mesh and a way to compute the target sizes on this +mesh (usually through an error estimation procedure, in an iterative +process of mesh adaptation). + +(Note that you can also load a background mesh directly from the command +line using the @code{-bgm} option (@pxref{Command-line options}), or in +the GUI by selecting `Apply as background mesh' in the post-processing +view option menu.) +@item +A @code{Box} field specifies the size of the elements inside and outside +of a parallelipipedic region. +@item +A @code{Threshold} field specifies the size of the mesh according to the +distance to some geometrical entities. These entities can for example be +geometry points and lines specified by an @code{Attractor} field. +@item +A @code{MathEval} field specifies the size of the mesh using an explicit +mathematical function. +@item +A @code{Min} field specifies the size as the minimum of the sizes +computed using other fields +@item +@dots +@end itemize +All target element sizes specified by fields can also be constrained by +the characteristic lengths defined in the geometrical model if the +@code{Mesh.ConstrainedBackgroundMesh} option is set. + +Fields are supported by all the algorithms except those based on Netgen. @end enumerate Here are the mesh commands that are related to the specification of @@ -1987,10 +2005,9 @@ characteristic lengths: Modifies the characteristic length of the points whose identification numbers are listed in @var{expression-list}. The new value is given by @var{expression}. -@item Attractor Point @{ @var{expression-list} @} = @{ @var{expression-list} @}; -[More to come here later.] -@item Attractor Line @{ @var{expression-list} @} = @{ @var{expression-list} @}; -[More to come here later.] +@item Field[@var{expression}] = @var{string}; +@item Field[@var{expression}].@var{string} = @var{char-expression} | @var{expression} | @var{expression-list}; +@item Background Field = @var{expression}; @end ftable @c .........................................................................