From 4f64678a203d23f17f674122f2f7ac0b92fab82e Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Fri, 21 Mar 2008 07:21:07 +0000 Subject: [PATCH] small fixes --- Fltk/Callbacks.cpp | 120 +++++----- Geo/GModelIO_Mesh.cpp | 36 ++- Mesh/Field.cpp | 6 +- Mesh/Field.h | 92 +++----- Parser/Gmsh.tab.cpp | 502 +++++++++++++++++++++--------------------- Parser/Gmsh.y | 17 +- Parser/Gmsh.yy.cpp | 2 +- demos/attractors.geo | 28 --- demos/fields.geo | 36 +++ 9 files changed, 436 insertions(+), 403 deletions(-) delete mode 100644 demos/attractors.geo create mode 100644 demos/fields.geo diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 50156fe3d0..60ad1ba975 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.570 2008-03-20 11:44:02 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.571 2008-03-21 07:21:04 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -4515,67 +4515,79 @@ void view_field_cancel_cb(CALLBACK_ARGS) { WID->field_window->hide(); } + void view_field_delete_cb(CALLBACK_ARGS) { - FieldDialogBox *fdb=(FieldDialogBox*)data; - fdb->group->hide(); - delete_field(fdb->current_field->id,CTX.filename); - WID->create_field_window(0); -} -void view_field_set_size_btn_cb(CALLBACK_ARGS){ - FieldDialogBox *fdb=(FieldDialogBox*)data; - fdb->group->hide(); - int v=((Fl_Check_Button*)w)->value(); - if(v) - set_background_field(fdb->current_field->id,CTX.filename); - else - set_background_field(-1,CTX.filename); - WID->create_field_window(fdb->current_field->id); + FieldDialogBox *fdb = (FieldDialogBox*)data; + fdb->group->hide(); + delete_field(fdb->current_field->id, CTX.filename); + WID->create_field_window(0); +} + +void view_field_set_size_btn_cb(CALLBACK_ARGS) +{ + FieldDialogBox *fdb = (FieldDialogBox*)data; + fdb->group->hide(); + int v = ((Fl_Check_Button*)w)->value(); + if(v) + set_background_field(fdb->current_field->id, CTX.filename); + else + set_background_field(-1, CTX.filename); + WID->create_field_window(fdb->current_field->id); } + void view_field_new_cb(CALLBACK_ARGS) { - Fl_Menu_Button* mb=((Fl_Menu_Button*)w); - int id=GModel::current()->getFields()->new_id(); - add_field(id,mb->text(),CTX.filename); - WID->create_field_window(id); + Fl_Menu_Button* mb = ((Fl_Menu_Button*)w); + int id = GModel::current()->getFields()->new_id(); + add_field(id, mb->text(), CTX.filename); + WID->create_field_window(id); } -void view_field_apply_cb(CALLBACK_ARGS){ - FieldDialogBox *fdb=(FieldDialogBox*)data; - fdb->save_values(); - int selected=WID->field_browser->value(); - std::ostringstream sstream(""); - sstream<<fdb->current_field->id; - sstream<<" "<<fdb->current_field->get_name(); - WID->field_browser->text(selected,sstream.str().c_str()); + +void view_field_apply_cb(CALLBACK_ARGS) +{ + FieldDialogBox *fdb = (FieldDialogBox*)data; + fdb->save_values(); + int selected = WID->field_browser->value(); + std::ostringstream sstream(""); + sstream << fdb->current_field->id; + sstream << " " << fdb->current_field->get_name(); + WID->field_browser->text(selected, sstream.str().c_str()); } -void view_field_revert_cb(CALLBACK_ARGS){ - FieldDialogBox *fdb=(FieldDialogBox*)data; - fdb->load_field(fdb->current_field); + +void view_field_revert_cb(CALLBACK_ARGS) +{ + FieldDialogBox *fdb = (FieldDialogBox*)data; + fdb->load_field(fdb->current_field); } + void view_field_browser_cb(CALLBACK_ARGS) { - int selected=WID->field_browser->value(); - if(WID->selected_field_dialog_box){ - WID->selected_field_dialog_box->group->hide(); - } - if(!selected)return; - Field *f=(Field*)WID->field_browser->data(selected); - f->dialog_box()->load_field(f); - WID->selected_field_dialog_box=f->dialog_box(); + int selected = WID->field_browser->value(); + if(WID->selected_field_dialog_box){ + WID->selected_field_dialog_box->group->hide(); + } + if(!selected) return; + Field *f = (Field*)WID->field_browser->data(selected); + f->dialog_box()->load_field(f); + WID->selected_field_dialog_box = f->dialog_box(); f->dialog_box()->group->show(); } -void view_field_put_on_view_cb(CALLBACK_ARGS){ - Fl_Menu_Button* mb=((Fl_Menu_Button*)w); - Field *field=((FieldDialogBox*)data)->current_field; - int iView; - sscanf(mb->text(),"View [%i]",&iView); - field->put_on_view(PView::list[iView]); - Draw(); + +void view_field_put_on_view_cb(CALLBACK_ARGS) +{ + Fl_Menu_Button* mb = ((Fl_Menu_Button*)w); + Field *field = ((FieldDialogBox*)data)->current_field; + int iView; + sscanf(mb->text(), "View [%i]", &iView); + field->put_on_view(PView::list[iView]); + Draw(); } -void view_field_select_node_cb(CALLBACK_ARGS){ - const char *mode="select"; - const char *help="vertices"; +void view_field_select_node_cb(CALLBACK_ARGS) +{ + const char *mode = "select"; + const char *help = "vertices"; CTX.pick_elements = 1; Draw(); std::vector<GVertex*> vertices, vertices_old; @@ -4583,17 +4595,17 @@ void view_field_select_node_cb(CALLBACK_ARGS){ std::vector<GFace*> faces, faces_old; std::vector<GRegion*> regions, regions_old; std::vector<MElement*> elements, elements_old; - opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1); + opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1); while(1) { Msg(ONSCREEN, "Select %s\n[Press %s'q' to abort]", help, mode ? "" : "'u' to undo or "); - + char ib = SelectEntity(ENT_POINT, vertices, edges, faces, regions, elements); - printf("char = %c\n",ib); + printf("char = %c\n", ib); if(ib == 'q'){ - for(std::vector<GVertex*>::iterator it=vertices.begin();it!=vertices.end();it++){ - printf("%i\n",*it); - } + for(std::vector<GVertex*>::iterator it = vertices.begin(); it != vertices.end(); it++){ + printf("%i\n", *it); + } break; } } diff --git a/Geo/GModelIO_Mesh.cpp b/Geo/GModelIO_Mesh.cpp index b9ce716527..9165e18780 100644 --- a/Geo/GModelIO_Mesh.cpp +++ b/Geo/GModelIO_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: GModelIO_Mesh.cpp,v 1.44 2008-03-20 11:44:05 geuzaine Exp $ +// $Id: GModelIO_Mesh.cpp,v 1.45 2008-03-21 07:21:05 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -465,7 +465,7 @@ int GModel::readMSH(const std::string &name) do { if(!fgets(str, sizeof(str), fp) || feof(fp)) - Msg(GERROR, "Prematured end of mesh file"); + break; } while(str[0] != '$'); } @@ -731,6 +731,38 @@ int GModel::writeMSH(const std::string &name, double version, bool binary, fprintf(fp, "$ENDELM\n"); } +#if 0 // test NodeData + std::vector<MVertex*> allVertices; + for(viter it = firstVertex(); it != lastVertex(); ++it) + for(unsigned int i = 0; i < (*it)->mesh_vertices.size(); i++) + allVertices.push_back((*it)->mesh_vertices[i]); + for(eiter it = firstEdge(); it != lastEdge(); ++it) + for(unsigned int i = 0; i < (*it)->mesh_vertices.size(); i++) + allVertices.push_back((*it)->mesh_vertices[i]); + for(fiter it = firstFace(); it != lastFace(); ++it) + for(unsigned int i = 0; i < (*it)->mesh_vertices.size(); i++) + allVertices.push_back((*it)->mesh_vertices[i]); + for(riter it = firstRegion(); it != lastRegion(); ++it) + for(unsigned int i = 0; i < (*it)->mesh_vertices.size(); i++) + allVertices.push_back((*it)->mesh_vertices[i]); + fprintf(fp, "$NodeData\n"); + fprintf(fp, "\"test\"\n"); + fprintf(fp, "0 0 0 0 1 %d\n", allVertices.size()); + for(unsigned int i = 0; i < allVertices.size(); i++){ + int tag = allVertices[i]->getNum(); + double val = allVertices[i]->x() * allVertices[i]->y(); + if(binary){ + fwrite(&tag, sizeof(int), 1, fp); + fwrite(&val, sizeof(double), 1, fp); + } + else{ + fprintf(fp, "%d %.16g\n", tag, val); + } + } + if(binary) fprintf(fp, "\n"); + fprintf(fp, "$EndNodeData\n"); +#endif + fclose(fp); return 1; } diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp index d1154eb2b7..9a289e7c57 100644 --- a/Mesh/Field.cpp +++ b/Mesh/Field.cpp @@ -1,4 +1,4 @@ -// $Id: Field.cpp,v 1.23 2008-03-20 14:55:34 geuzaine Exp $ +// $Id: Field.cpp,v 1.24 2008-03-21 07:21:05 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -340,7 +340,7 @@ class StructuredField : public Field{ } }; -class LonLatField : public Field{ +class LonLatField : public Field { int field_id; public: LonLatField() @@ -439,7 +439,7 @@ class GradientField : public Field { { return "Gradient"; } - GradientField():iField(0), kind(3), delta(CTX.lc / 1e4) + GradientField() : iField(0), kind(3), delta(CTX.lc / 1e4) { options["IField"] = new FieldOptionInt(iField); options["Kind"] = new FieldOptionInt(kind); diff --git a/Mesh/Field.h b/Mesh/Field.h index ab26804c6a..37131ea36c 100644 --- a/Mesh/Field.h +++ b/Mesh/Field.h @@ -26,68 +26,49 @@ #include "PView.h" class Field; -typedef enum -{ FIELD_OPTION_DOUBLE = - 0, FIELD_OPTION_INT, FIELD_OPTION_STRING, FIELD_OPTION_PATH, - FIELD_OPTION_BOOL, FIELD_OPTION_LIST } FieldOptionType; -class FieldOption -{ -protected: - bool * status; + +typedef enum { + FIELD_OPTION_DOUBLE = 0, + FIELD_OPTION_INT, + FIELD_OPTION_STRING, + FIELD_OPTION_PATH, + FIELD_OPTION_BOOL, + FIELD_OPTION_LIST +} FieldOptionType; + +class FieldOption { + protected: + bool *status; inline void modified() { - if(status) - *status = true; + if(status) *status = true; } -public: - FieldOption(bool * _status):status(_status) - { - }; + public: + FieldOption(bool *_status) : status(_status) {} virtual FieldOptionType get_type() = 0; virtual void get_text_representation(std::string & v_str) = 0; - virtual void numerical_value(double val) - { - throw(1); - } - virtual double numerical_value() const - { - throw(1); - } - virtual const std::list < int >&list() const - { - throw(1); - } - virtual std::list < int >&list() - { - throw(1); - } - virtual const std::string & string() const - { - throw(1); - } - virtual std::string & string() - { - throw(1); - } + virtual void numerical_value(double val) { throw(1); } + virtual double numerical_value() const { throw(1); } + virtual const std::list<int> &list() const { throw(1); } + virtual std::list<int> &list() { throw(1); } + virtual const std::string &string() const { throw(1); } + virtual std::string &string() { throw(1); } }; class FieldDialogBox; -class Field -{ - struct lstr - { - bool operator() (const char *s1, const char *s2)const + +class Field { + struct lstr { + bool operator() (const char *s1, const char *s2) const { return strcmp(s1, s2) < 0; } }; -public: + public: int id; - std::map < const char *, FieldOption *, lstr > options; + std::map<const char *, FieldOption *, lstr> options; virtual double operator() (double x, double y, double z) = 0; - virtual ~ Field() - { - } + virtual ~Field() {} bool update_needed; Field(); virtual const char *get_name() = 0; @@ -95,15 +76,14 @@ public: void put_on_view(PView * view, int comp = -1); }; -class FieldFactory -{ -public: +class FieldFactory { + public: virtual Field * operator() () = 0; }; -class FieldManager:public std::map < int, Field * > -{ -public: - std::map < const std::string, FieldFactory * >map_type_name; + +class FieldManager : public std::map<int, Field*> { + public: + std::map<const std::string, FieldFactory*> map_type_name; void reset(); Field *get(int id); Field *new_field(int id, const char *type_name); @@ -112,7 +92,7 @@ public: int max_id(); FieldManager(); int background_field; - /* compatibility with -bgm */ + // compatibility with -bgm void set_background_mesh(int iView); }; diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp index c250e5afa4..32e3b19e7e 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.353 2008-03-20 11:44:09 geuzaine Exp $ +// $Id: Gmsh.tab.cpp,v 1.354 2008-03-21 07:21:05 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -992,29 +992,29 @@ static const yytype_uint16 yyrline[] = 1313, 1339, 1356, 1375, 1393, 1431, 1437, 1443, 1450, 1474, 1498, 1514, 1534, 1551, 1568, 1589, 1594, 1599, 1604, 1609, 1620, 1626, 1635, 1636, 1641, 1644, 1648, 1671, 1694, 1717, - 1745, 1754, 1757, 1770, 1786, 1801, 1815, 1821, 1827, 1836, - 1850, 1898, 1914, 1928, 1947, 1957, 1979, 1983, 1988, 1993, - 2005, 2022, 2039, 2066, 2093, 2124, 2132, 2138, 2145, 2149, - 2158, 2166, 2174, 2183, 2182, 2195, 2194, 2207, 2206, 2219, - 2218, 2230, 2229, 2245, 2252, 2259, 2266, 2273, 2280, 2287, - 2294, 2301, 2309, 2308, 2320, 2319, 2331, 2330, 2342, 2341, - 2353, 2352, 2364, 2363, 2375, 2374, 2386, 2385, 2397, 2396, - 2411, 2414, 2420, 2429, 2449, 2472, 2476, 2500, 2518, 2536, - 2554, 2583, 2618, 2623, 2650, 2664, 2677, 2694, 2700, 2706, - 2709, 2718, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, - 2736, 2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, - 2752, 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, - 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, - 2772, 2773, 2774, 2776, 2777, 2778, 2779, 2780, 2781, 2782, - 2783, 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, - 2793, 2794, 2795, 2796, 2805, 2806, 2807, 2808, 2809, 2810, - 2811, 2815, 2831, 2846, 2866, 2879, 2892, 2915, 2933, 2951, - 2969, 2987, 2995, 2999, 3003, 3007, 3011, 3018, 3022, 3026, - 3030, 3037, 3042, 3050, 3055, 3059, 3064, 3068, 3076, 3087, - 3095, 3103, 3109, 3120, 3140, 3150, 3160, 3177, 3204, 3209, - 3213, 3217, 3230, 3234, 3246, 3253, 3274, 3278, 3293, 3298, - 3305, 3309, 3316, 3320, 3328, 3336, 3350, 3364, 3368, 3387, - 3410 + 1745, 1754, 1758, 1771, 1787, 1802, 1816, 1822, 1828, 1837, + 1851, 1899, 1915, 1929, 1948, 1958, 1980, 1984, 1989, 1994, + 2006, 2023, 2040, 2067, 2094, 2125, 2133, 2139, 2146, 2150, + 2159, 2167, 2175, 2184, 2183, 2196, 2195, 2208, 2207, 2220, + 2219, 2231, 2230, 2246, 2253, 2260, 2267, 2274, 2281, 2288, + 2295, 2302, 2310, 2309, 2321, 2320, 2332, 2331, 2343, 2342, + 2354, 2353, 2365, 2364, 2376, 2375, 2387, 2386, 2398, 2397, + 2412, 2415, 2421, 2430, 2450, 2473, 2477, 2501, 2519, 2537, + 2555, 2584, 2619, 2624, 2651, 2665, 2678, 2695, 2701, 2707, + 2710, 2719, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2736, + 2737, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, + 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, + 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, + 2773, 2774, 2775, 2777, 2778, 2779, 2780, 2781, 2782, 2783, + 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, + 2794, 2795, 2796, 2797, 2806, 2807, 2808, 2809, 2810, 2811, + 2812, 2816, 2832, 2847, 2867, 2880, 2893, 2916, 2934, 2952, + 2970, 2988, 2996, 3000, 3004, 3008, 3012, 3019, 3023, 3027, + 3031, 3038, 3043, 3051, 3056, 3060, 3065, 3069, 3077, 3088, + 3096, 3104, 3110, 3121, 3141, 3151, 3161, 3178, 3205, 3210, + 3214, 3218, 3231, 3235, 3247, 3254, 3275, 3279, 3294, 3299, + 3306, 3310, 3317, 3321, 3329, 3337, 3351, 3365, 3369, 3388, + 3411 }; #endif @@ -4637,8 +4637,8 @@ yyreduce: if(option){ try { option->numerical_value((yyvsp[(8) - (9)].d)); } catch(...){ - yymsg(GERROR, "Cannot assign a numerical value to option '%s' in field %i of type '%s'", - (yyvsp[(6) - (9)].c), (int)(yyvsp[(3) - (9)].d), field->get_name()); + yymsg(GERROR, "Cannot assign a numerical value to option '%s' " + "in field %i of type '%s'", (yyvsp[(6) - (9)].c), (int)(yyvsp[(3) - (9)].d), field->get_name()); } } else @@ -4659,8 +4659,8 @@ yyreduce: if(option){ try { option->string() = (yyvsp[(8) - (9)].c); } catch (...){ - yymsg(GERROR, "Cannot assign a string value to option '%s' in field %i of type '%s'", - (yyvsp[(6) - (9)].c), (int)(yyvsp[(3) - (9)].d), field->get_name()); + yymsg(GERROR, "Cannot assign a string value to option '%s' " + "in field %i of type '%s'", (yyvsp[(6) - (9)].c), (int)(yyvsp[(3) - (9)].d), field->get_name()); } } else @@ -5524,14 +5524,14 @@ yyreduce: break; case 131: -#line 1754 "Gmsh.y" +#line 1755 "Gmsh.y" { - GModel::current()->getFields()->delete_field((int)(yyvsp[(4) - (6)].d)); - ;} + GModel::current()->getFields()->delete_field((int)(yyvsp[(4) - (6)].d)); + ;} break; case 132: -#line 1758 "Gmsh.y" +#line 1759 "Gmsh.y" { if(!strcmp((yyvsp[(2) - (6)].c), "View")){ int index = (int)(yyvsp[(4) - (6)].d); @@ -5547,7 +5547,7 @@ yyreduce: break; case 133: -#line 1771 "Gmsh.y" +#line 1772 "Gmsh.y" { if(!strcmp((yyvsp[(2) - (3)].c), "Meshes") || !strcmp((yyvsp[(2) - (3)].c), "All")){ GModel::current()->destroy(); @@ -5566,7 +5566,7 @@ yyreduce: break; case 134: -#line 1787 "Gmsh.y" +#line 1788 "Gmsh.y" { if(!strcmp((yyvsp[(2) - (4)].c), "Empty") && !strcmp((yyvsp[(3) - (4)].c), "Views")){ for(int i = PView::list.size() - 1; i >= 0; i--) @@ -5579,7 +5579,7 @@ yyreduce: break; case 135: -#line 1802 "Gmsh.y" +#line 1803 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){ Shape TheShape; @@ -5591,7 +5591,7 @@ yyreduce: break; case 136: -#line 1816 "Gmsh.y" +#line 1817 "Gmsh.y" { for(int i = 0; i < 4; i++) VisibilityShape((yyvsp[(2) - (3)].c), i, 1); @@ -5600,7 +5600,7 @@ yyreduce: break; case 137: -#line 1822 "Gmsh.y" +#line 1823 "Gmsh.y" { for(int i = 0; i < 4; i++) VisibilityShape((yyvsp[(2) - (3)].c), i, 0); @@ -5609,7 +5609,7 @@ yyreduce: break; case 138: -#line 1828 "Gmsh.y" +#line 1829 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){ Shape TheShape; @@ -5621,7 +5621,7 @@ yyreduce: break; case 139: -#line 1837 "Gmsh.y" +#line 1838 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){ Shape TheShape; @@ -5633,7 +5633,7 @@ yyreduce: break; case 140: -#line 1851 "Gmsh.y" +#line 1852 "Gmsh.y" { if(!strcmp((yyvsp[(1) - (3)].c), "Include")){ char tmpstring[1024]; @@ -5684,7 +5684,7 @@ yyreduce: break; case 141: -#line 1899 "Gmsh.y" +#line 1900 "Gmsh.y" { if(!strcmp((yyvsp[(1) - (7)].c), "Save") && !strcmp((yyvsp[(2) - (7)].c), "View")){ int index = (int)(yyvsp[(4) - (7)].d); @@ -5703,7 +5703,7 @@ yyreduce: break; case 142: -#line 1915 "Gmsh.y" +#line 1916 "Gmsh.y" { if(!strcmp((yyvsp[(1) - (7)].c), "Background") && !strcmp((yyvsp[(2) - (7)].c), "Mesh") && !strcmp((yyvsp[(3) - (7)].c), "View")){ int index = (int)(yyvsp[(5) - (7)].d); @@ -5720,7 +5720,7 @@ yyreduce: break; case 143: -#line 1929 "Gmsh.y" +#line 1930 "Gmsh.y" { if(!strcmp((yyvsp[(1) - (3)].c), "Sleep")){ SleepInSeconds((yyvsp[(2) - (3)].d)); @@ -5742,7 +5742,7 @@ yyreduce: break; case 144: -#line 1948 "Gmsh.y" +#line 1949 "Gmsh.y" { try { GMSH_PluginManager::instance()->action((yyvsp[(3) - (7)].c), (yyvsp[(6) - (7)].c), 0); @@ -5755,7 +5755,7 @@ yyreduce: break; case 145: -#line 1958 "Gmsh.y" +#line 1959 "Gmsh.y" { if(!strcmp((yyvsp[(2) - (3)].c), "ElementsFromAllViews")) PView::combine(false, 1, CTX.post.combine_remove_orig); @@ -5780,14 +5780,14 @@ yyreduce: break; case 146: -#line 1980 "Gmsh.y" +#line 1981 "Gmsh.y" { exit(0); ;} break; case 147: -#line 1984 "Gmsh.y" +#line 1985 "Gmsh.y" { CTX.forced_bbox = 0; SetBoundingBox(); @@ -5795,7 +5795,7 @@ yyreduce: break; case 148: -#line 1989 "Gmsh.y" +#line 1990 "Gmsh.y" { CTX.forced_bbox = 1; SetBoundingBox((yyvsp[(3) - (15)].d), (yyvsp[(5) - (15)].d), (yyvsp[(7) - (15)].d), (yyvsp[(9) - (15)].d), (yyvsp[(11) - (15)].d), (yyvsp[(13) - (15)].d)); @@ -5803,7 +5803,7 @@ yyreduce: break; case 149: -#line 1994 "Gmsh.y" +#line 1995 "Gmsh.y" { #if defined(HAVE_FLTK) Draw(); @@ -5812,7 +5812,7 @@ yyreduce: break; case 150: -#line 2006 "Gmsh.y" +#line 2007 "Gmsh.y" { LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(3) - (6)].d); LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(5) - (6)].d); @@ -5832,7 +5832,7 @@ yyreduce: break; case 151: -#line 2023 "Gmsh.y" +#line 2024 "Gmsh.y" { LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(3) - (8)].d); LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(5) - (8)].d); @@ -5852,7 +5852,7 @@ yyreduce: break; case 152: -#line 2040 "Gmsh.y" +#line 2041 "Gmsh.y" { LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(5) - (8)].d); LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(7) - (8)].d); @@ -5882,7 +5882,7 @@ yyreduce: break; case 153: -#line 2067 "Gmsh.y" +#line 2068 "Gmsh.y" { LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(5) - (10)].d); LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(7) - (10)].d); @@ -5912,7 +5912,7 @@ yyreduce: break; case 154: -#line 2094 "Gmsh.y" +#line 2095 "Gmsh.y" { if(ImbricatedLoop <= 0){ yymsg(GERROR, "Invalid For/EndFor loop"); @@ -5946,7 +5946,7 @@ yyreduce: break; case 155: -#line 2125 "Gmsh.y" +#line 2126 "Gmsh.y" { if(!FunctionManager::Instance()->createFunction((yyvsp[(2) - (2)].c), gmsh_yyin, gmsh_yyname, gmsh_yylineno)) @@ -5957,7 +5957,7 @@ yyreduce: break; case 156: -#line 2133 "Gmsh.y" +#line 2134 "Gmsh.y" { if(!FunctionManager::Instance()->leaveFunction(&gmsh_yyin, gmsh_yyname, gmsh_yylineno)) @@ -5966,7 +5966,7 @@ yyreduce: break; case 157: -#line 2139 "Gmsh.y" +#line 2140 "Gmsh.y" { if(!FunctionManager::Instance()->enterFunction((yyvsp[(2) - (3)].c), &gmsh_yyin, gmsh_yyname, gmsh_yylineno)) @@ -5976,20 +5976,20 @@ yyreduce: break; case 158: -#line 2146 "Gmsh.y" +#line 2147 "Gmsh.y" { if(!(yyvsp[(3) - (4)].d)) skip_until("If", "EndIf"); ;} break; case 159: -#line 2150 "Gmsh.y" +#line 2151 "Gmsh.y" { ;} break; case 160: -#line 2159 "Gmsh.y" +#line 2160 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(TRANSLATE, (yyvsp[(4) - (5)].l), @@ -6000,7 +6000,7 @@ yyreduce: break; case 161: -#line 2167 "Gmsh.y" +#line 2168 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(ROTATE, (yyvsp[(10) - (11)].l), @@ -6011,7 +6011,7 @@ yyreduce: break; case 162: -#line 2175 "Gmsh.y" +#line 2176 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(TRANSLATE_ROTATE, (yyvsp[(12) - (13)].l), @@ -6022,14 +6022,14 @@ yyreduce: break; case 163: -#line 2183 "Gmsh.y" +#line 2184 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 164: -#line 2187 "Gmsh.y" +#line 2188 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(TRANSLATE, (yyvsp[(4) - (7)].l), @@ -6040,14 +6040,14 @@ yyreduce: break; case 165: -#line 2195 "Gmsh.y" +#line 2196 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 166: -#line 2199 "Gmsh.y" +#line 2200 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(ROTATE, (yyvsp[(10) - (13)].l), @@ -6058,14 +6058,14 @@ yyreduce: break; case 167: -#line 2207 "Gmsh.y" +#line 2208 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 168: -#line 2211 "Gmsh.y" +#line 2212 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(TRANSLATE_ROTATE, (yyvsp[(12) - (15)].l), @@ -6076,14 +6076,14 @@ yyreduce: break; case 169: -#line 2219 "Gmsh.y" +#line 2220 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 170: -#line 2223 "Gmsh.y" +#line 2224 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(BOUNDARY_LAYER, (yyvsp[(3) - (6)].l), 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., @@ -6093,14 +6093,14 @@ yyreduce: break; case 171: -#line 2230 "Gmsh.y" +#line 2231 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 172: -#line 2234 "Gmsh.y" +#line 2235 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); extr.mesh.ViewIndex = (int)(yyvsp[(4) - (10)].d); @@ -6113,7 +6113,7 @@ yyreduce: break; case 173: -#line 2246 "Gmsh.y" +#line 2247 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_POINT, (int)(yyvsp[(4) - (8)].d), @@ -6123,7 +6123,7 @@ yyreduce: break; case 174: -#line 2253 "Gmsh.y" +#line 2254 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (8)].d), @@ -6133,7 +6133,7 @@ yyreduce: break; case 175: -#line 2260 "Gmsh.y" +#line 2261 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (8)].d), @@ -6143,7 +6143,7 @@ yyreduce: break; case 176: -#line 2267 "Gmsh.y" +#line 2268 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_POINT, (int)(yyvsp[(4) - (12)].d), @@ -6153,7 +6153,7 @@ yyreduce: break; case 177: -#line 2274 "Gmsh.y" +#line 2275 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (12)].d), @@ -6163,7 +6163,7 @@ yyreduce: break; case 178: -#line 2281 "Gmsh.y" +#line 2282 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (12)].d), @@ -6173,7 +6173,7 @@ yyreduce: break; case 179: -#line 2288 "Gmsh.y" +#line 2289 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_POINT, (int)(yyvsp[(4) - (14)].d), @@ -6183,7 +6183,7 @@ yyreduce: break; case 180: -#line 2295 "Gmsh.y" +#line 2296 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (14)].d), @@ -6193,7 +6193,7 @@ yyreduce: break; case 181: -#line 2302 "Gmsh.y" +#line 2303 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (14)].d), @@ -6203,14 +6203,14 @@ yyreduce: break; case 182: -#line 2309 "Gmsh.y" +#line 2310 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 183: -#line 2313 "Gmsh.y" +#line 2314 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_POINT, (int)(yyvsp[(4) - (12)].d), @@ -6220,14 +6220,14 @@ yyreduce: break; case 184: -#line 2320 "Gmsh.y" +#line 2321 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 185: -#line 2324 "Gmsh.y" +#line 2325 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (12)].d), @@ -6237,14 +6237,14 @@ yyreduce: break; case 186: -#line 2331 "Gmsh.y" +#line 2332 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 187: -#line 2335 "Gmsh.y" +#line 2336 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (12)].d), @@ -6254,14 +6254,14 @@ yyreduce: break; case 188: -#line 2342 "Gmsh.y" +#line 2343 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 189: -#line 2346 "Gmsh.y" +#line 2347 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_POINT, (int)(yyvsp[(4) - (16)].d), @@ -6271,14 +6271,14 @@ yyreduce: break; case 190: -#line 2353 "Gmsh.y" +#line 2354 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 191: -#line 2357 "Gmsh.y" +#line 2358 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (16)].d), @@ -6288,14 +6288,14 @@ yyreduce: break; case 192: -#line 2364 "Gmsh.y" +#line 2365 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 193: -#line 2368 "Gmsh.y" +#line 2369 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (16)].d), @@ -6305,14 +6305,14 @@ yyreduce: break; case 194: -#line 2375 "Gmsh.y" +#line 2376 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 195: -#line 2379 "Gmsh.y" +#line 2380 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_POINT, (int)(yyvsp[(4) - (18)].d), @@ -6322,14 +6322,14 @@ yyreduce: break; case 196: -#line 2386 "Gmsh.y" +#line 2387 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 197: -#line 2390 "Gmsh.y" +#line 2391 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (18)].d), @@ -6339,14 +6339,14 @@ yyreduce: break; case 198: -#line 2397 "Gmsh.y" +#line 2398 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 199: -#line 2401 "Gmsh.y" +#line 2402 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (18)].d), @@ -6356,19 +6356,19 @@ yyreduce: break; case 200: -#line 2412 "Gmsh.y" +#line 2413 "Gmsh.y" { ;} break; case 201: -#line 2415 "Gmsh.y" +#line 2416 "Gmsh.y" { ;} break; case 202: -#line 2421 "Gmsh.y" +#line 2422 "Gmsh.y" { extr.mesh.ExtrudeMesh = true; extr.mesh.NbLayer = 1; @@ -6380,7 +6380,7 @@ yyreduce: break; case 203: -#line 2430 "Gmsh.y" +#line 2431 "Gmsh.y" { double d; extr.mesh.ExtrudeMesh = true; @@ -6403,7 +6403,7 @@ yyreduce: break; case 204: -#line 2450 "Gmsh.y" +#line 2451 "Gmsh.y" { yymsg(GERROR, "Explicit region numbers in layers are deprecated"); double d; @@ -6429,14 +6429,14 @@ yyreduce: break; case 205: -#line 2473 "Gmsh.y" +#line 2474 "Gmsh.y" { extr.mesh.Recombine = true; ;} break; case 206: -#line 2477 "Gmsh.y" +#line 2478 "Gmsh.y" { int num = (int)(yyvsp[(3) - (9)].d); if(FindSurface(num)){ @@ -6458,7 +6458,7 @@ yyreduce: break; case 207: -#line 2501 "Gmsh.y" +#line 2502 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){ double d; @@ -6479,7 +6479,7 @@ yyreduce: break; case 208: -#line 2519 "Gmsh.y" +#line 2520 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (9)].l)); i++){ double d; @@ -6500,7 +6500,7 @@ yyreduce: break; case 209: -#line 2537 "Gmsh.y" +#line 2538 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (9)].l)); i++){ double d; @@ -6521,7 +6521,7 @@ yyreduce: break; case 210: -#line 2555 "Gmsh.y" +#line 2556 "Gmsh.y" { Surface *s = FindSurface((int)(yyvsp[(4) - (8)].d)); if(!s) @@ -6553,7 +6553,7 @@ yyreduce: break; case 211: -#line 2584 "Gmsh.y" +#line 2585 "Gmsh.y" { Surface *s = FindSurface((int)(yyvsp[(4) - (9)].d)); if(!s) @@ -6591,7 +6591,7 @@ yyreduce: break; case 212: -#line 2619 "Gmsh.y" +#line 2620 "Gmsh.y" { yymsg(WARNING, "Elliptic Surface is deprecated: use Transfinite instead (with smoothing)"); List_Delete((yyvsp[(7) - (8)].l)); @@ -6599,7 +6599,7 @@ yyreduce: break; case 213: -#line 2624 "Gmsh.y" +#line 2625 "Gmsh.y" { Volume *v = FindVolume((int)(yyvsp[(4) - (8)].d)); if(!v) @@ -6629,7 +6629,7 @@ yyreduce: break; case 214: -#line 2651 "Gmsh.y" +#line 2652 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){ double d; @@ -6646,7 +6646,7 @@ yyreduce: break; case 215: -#line 2665 "Gmsh.y" +#line 2666 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){ double d; @@ -6662,7 +6662,7 @@ yyreduce: break; case 216: -#line 2678 "Gmsh.y" +#line 2679 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){ double d; @@ -6676,7 +6676,7 @@ yyreduce: break; case 217: -#line 2695 "Gmsh.y" +#line 2696 "Gmsh.y" { Surface *s = FindSurface((int)(yyvsp[(8) - (10)].d)); if(s) @@ -6685,7 +6685,7 @@ yyreduce: break; case 218: -#line 2701 "Gmsh.y" +#line 2702 "Gmsh.y" { Surface *s = FindSurface((int)(yyvsp[(8) - (10)].d)); if(s) @@ -6694,66 +6694,66 @@ yyreduce: break; case 219: -#line 2707 "Gmsh.y" +#line 2708 "Gmsh.y" { ;} break; case 220: -#line 2710 "Gmsh.y" +#line 2711 "Gmsh.y" { ;} break; case 221: -#line 2719 "Gmsh.y" +#line 2720 "Gmsh.y" { ReplaceAllDuplicates(); ;} break; case 222: -#line 2728 "Gmsh.y" +#line 2729 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (1)].d); ;} break; case 223: -#line 2729 "Gmsh.y" +#line 2730 "Gmsh.y" { (yyval.d) = (yyvsp[(2) - (3)].d); ;} break; case 224: -#line 2730 "Gmsh.y" +#line 2731 "Gmsh.y" { (yyval.d) = -(yyvsp[(2) - (2)].d); ;} break; case 225: -#line 2731 "Gmsh.y" +#line 2732 "Gmsh.y" { (yyval.d) = (yyvsp[(2) - (2)].d); ;} break; case 226: -#line 2732 "Gmsh.y" +#line 2733 "Gmsh.y" { (yyval.d) = !(yyvsp[(2) - (2)].d); ;} break; case 227: -#line 2733 "Gmsh.y" +#line 2734 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) - (yyvsp[(3) - (3)].d); ;} break; case 228: -#line 2734 "Gmsh.y" +#line 2735 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) + (yyvsp[(3) - (3)].d); ;} break; case 229: -#line 2735 "Gmsh.y" +#line 2736 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) * (yyvsp[(3) - (3)].d); ;} break; case 230: -#line 2737 "Gmsh.y" +#line 2738 "Gmsh.y" { if(!(yyvsp[(3) - (3)].d)) yymsg(GERROR, "Division by zero in '%g / %g'", (yyvsp[(1) - (3)].d), (yyvsp[(3) - (3)].d)); @@ -6763,307 +6763,307 @@ yyreduce: break; case 231: -#line 2743 "Gmsh.y" +#line 2744 "Gmsh.y" { (yyval.d) = (int)(yyvsp[(1) - (3)].d) % (int)(yyvsp[(3) - (3)].d); ;} break; case 232: -#line 2744 "Gmsh.y" +#line 2745 "Gmsh.y" { (yyval.d) = pow((yyvsp[(1) - (3)].d), (yyvsp[(3) - (3)].d)); ;} break; case 233: -#line 2745 "Gmsh.y" +#line 2746 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d); ;} break; case 234: -#line 2746 "Gmsh.y" +#line 2747 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) > (yyvsp[(3) - (3)].d); ;} break; case 235: -#line 2747 "Gmsh.y" +#line 2748 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) <= (yyvsp[(3) - (3)].d); ;} break; case 236: -#line 2748 "Gmsh.y" +#line 2749 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) >= (yyvsp[(3) - (3)].d); ;} break; case 237: -#line 2749 "Gmsh.y" +#line 2750 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) == (yyvsp[(3) - (3)].d); ;} break; case 238: -#line 2750 "Gmsh.y" +#line 2751 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) != (yyvsp[(3) - (3)].d); ;} break; case 239: -#line 2751 "Gmsh.y" +#line 2752 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) && (yyvsp[(3) - (3)].d); ;} break; case 240: -#line 2752 "Gmsh.y" +#line 2753 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) || (yyvsp[(3) - (3)].d); ;} break; case 241: -#line 2753 "Gmsh.y" +#line 2754 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (5)].d)? (yyvsp[(3) - (5)].d) : (yyvsp[(5) - (5)].d); ;} break; case 242: -#line 2754 "Gmsh.y" +#line 2755 "Gmsh.y" { (yyval.d) = exp((yyvsp[(3) - (4)].d)); ;} break; case 243: -#line 2755 "Gmsh.y" +#line 2756 "Gmsh.y" { (yyval.d) = log((yyvsp[(3) - (4)].d)); ;} break; case 244: -#line 2756 "Gmsh.y" +#line 2757 "Gmsh.y" { (yyval.d) = log10((yyvsp[(3) - (4)].d)); ;} break; case 245: -#line 2757 "Gmsh.y" +#line 2758 "Gmsh.y" { (yyval.d) = sqrt((yyvsp[(3) - (4)].d)); ;} break; case 246: -#line 2758 "Gmsh.y" +#line 2759 "Gmsh.y" { (yyval.d) = sin((yyvsp[(3) - (4)].d)); ;} break; case 247: -#line 2759 "Gmsh.y" +#line 2760 "Gmsh.y" { (yyval.d) = asin((yyvsp[(3) - (4)].d)); ;} break; case 248: -#line 2760 "Gmsh.y" +#line 2761 "Gmsh.y" { (yyval.d) = cos((yyvsp[(3) - (4)].d)); ;} break; case 249: -#line 2761 "Gmsh.y" +#line 2762 "Gmsh.y" { (yyval.d) = acos((yyvsp[(3) - (4)].d)); ;} break; case 250: -#line 2762 "Gmsh.y" +#line 2763 "Gmsh.y" { (yyval.d) = tan((yyvsp[(3) - (4)].d)); ;} break; case 251: -#line 2763 "Gmsh.y" +#line 2764 "Gmsh.y" { (yyval.d) = atan((yyvsp[(3) - (4)].d)); ;} break; case 252: -#line 2764 "Gmsh.y" +#line 2765 "Gmsh.y" { (yyval.d) = atan2((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d));;} break; case 253: -#line 2765 "Gmsh.y" +#line 2766 "Gmsh.y" { (yyval.d) = sinh((yyvsp[(3) - (4)].d)); ;} break; case 254: -#line 2766 "Gmsh.y" +#line 2767 "Gmsh.y" { (yyval.d) = cosh((yyvsp[(3) - (4)].d)); ;} break; case 255: -#line 2767 "Gmsh.y" +#line 2768 "Gmsh.y" { (yyval.d) = tanh((yyvsp[(3) - (4)].d)); ;} break; case 256: -#line 2768 "Gmsh.y" +#line 2769 "Gmsh.y" { (yyval.d) = fabs((yyvsp[(3) - (4)].d)); ;} break; case 257: -#line 2769 "Gmsh.y" +#line 2770 "Gmsh.y" { (yyval.d) = floor((yyvsp[(3) - (4)].d)); ;} break; case 258: -#line 2770 "Gmsh.y" +#line 2771 "Gmsh.y" { (yyval.d) = ceil((yyvsp[(3) - (4)].d)); ;} break; case 259: -#line 2771 "Gmsh.y" +#line 2772 "Gmsh.y" { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;} break; case 260: -#line 2772 "Gmsh.y" +#line 2773 "Gmsh.y" { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;} break; case 261: -#line 2773 "Gmsh.y" +#line 2774 "Gmsh.y" { (yyval.d) = sqrt((yyvsp[(3) - (6)].d)*(yyvsp[(3) - (6)].d)+(yyvsp[(5) - (6)].d)*(yyvsp[(5) - (6)].d)); ;} break; case 262: -#line 2774 "Gmsh.y" +#line 2775 "Gmsh.y" { (yyval.d) = (yyvsp[(3) - (4)].d)*(double)rand()/(double)RAND_MAX; ;} break; case 263: -#line 2776 "Gmsh.y" +#line 2777 "Gmsh.y" { (yyval.d) = exp((yyvsp[(3) - (4)].d)); ;} break; case 264: -#line 2777 "Gmsh.y" +#line 2778 "Gmsh.y" { (yyval.d) = log((yyvsp[(3) - (4)].d)); ;} break; case 265: -#line 2778 "Gmsh.y" +#line 2779 "Gmsh.y" { (yyval.d) = log10((yyvsp[(3) - (4)].d)); ;} break; case 266: -#line 2779 "Gmsh.y" +#line 2780 "Gmsh.y" { (yyval.d) = sqrt((yyvsp[(3) - (4)].d)); ;} break; case 267: -#line 2780 "Gmsh.y" +#line 2781 "Gmsh.y" { (yyval.d) = sin((yyvsp[(3) - (4)].d)); ;} break; case 268: -#line 2781 "Gmsh.y" +#line 2782 "Gmsh.y" { (yyval.d) = asin((yyvsp[(3) - (4)].d)); ;} break; case 269: -#line 2782 "Gmsh.y" +#line 2783 "Gmsh.y" { (yyval.d) = cos((yyvsp[(3) - (4)].d)); ;} break; case 270: -#line 2783 "Gmsh.y" +#line 2784 "Gmsh.y" { (yyval.d) = acos((yyvsp[(3) - (4)].d)); ;} break; case 271: -#line 2784 "Gmsh.y" +#line 2785 "Gmsh.y" { (yyval.d) = tan((yyvsp[(3) - (4)].d)); ;} break; case 272: -#line 2785 "Gmsh.y" +#line 2786 "Gmsh.y" { (yyval.d) = atan((yyvsp[(3) - (4)].d)); ;} break; case 273: -#line 2786 "Gmsh.y" +#line 2787 "Gmsh.y" { (yyval.d) = atan2((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d));;} break; case 274: -#line 2787 "Gmsh.y" +#line 2788 "Gmsh.y" { (yyval.d) = sinh((yyvsp[(3) - (4)].d)); ;} break; case 275: -#line 2788 "Gmsh.y" +#line 2789 "Gmsh.y" { (yyval.d) = cosh((yyvsp[(3) - (4)].d)); ;} break; case 276: -#line 2789 "Gmsh.y" +#line 2790 "Gmsh.y" { (yyval.d) = tanh((yyvsp[(3) - (4)].d)); ;} break; case 277: -#line 2790 "Gmsh.y" +#line 2791 "Gmsh.y" { (yyval.d) = fabs((yyvsp[(3) - (4)].d)); ;} break; case 278: -#line 2791 "Gmsh.y" +#line 2792 "Gmsh.y" { (yyval.d) = floor((yyvsp[(3) - (4)].d)); ;} break; case 279: -#line 2792 "Gmsh.y" +#line 2793 "Gmsh.y" { (yyval.d) = ceil((yyvsp[(3) - (4)].d)); ;} break; case 280: -#line 2793 "Gmsh.y" +#line 2794 "Gmsh.y" { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;} break; case 281: -#line 2794 "Gmsh.y" +#line 2795 "Gmsh.y" { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;} break; case 282: -#line 2795 "Gmsh.y" +#line 2796 "Gmsh.y" { (yyval.d) = sqrt((yyvsp[(3) - (6)].d)*(yyvsp[(3) - (6)].d)+(yyvsp[(5) - (6)].d)*(yyvsp[(5) - (6)].d)); ;} break; case 283: -#line 2796 "Gmsh.y" +#line 2797 "Gmsh.y" { (yyval.d) = (yyvsp[(3) - (4)].d)*(double)rand()/(double)RAND_MAX; ;} break; case 284: -#line 2805 "Gmsh.y" +#line 2806 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (1)].d); ;} break; case 285: -#line 2806 "Gmsh.y" +#line 2807 "Gmsh.y" { (yyval.d) = 3.141592653589793; ;} break; case 286: -#line 2807 "Gmsh.y" +#line 2808 "Gmsh.y" { (yyval.d) = ParUtil::Instance()->rank(); ;} break; case 287: -#line 2808 "Gmsh.y" +#line 2809 "Gmsh.y" { (yyval.d) = ParUtil::Instance()->size(); ;} break; case 288: -#line 2809 "Gmsh.y" +#line 2810 "Gmsh.y" { (yyval.d) = Get_GmshMajorVersion(); ;} break; case 289: -#line 2810 "Gmsh.y" +#line 2811 "Gmsh.y" { (yyval.d) = Get_GmshMinorVersion(); ;} break; case 290: -#line 2811 "Gmsh.y" +#line 2812 "Gmsh.y" { (yyval.d) = Get_GmshPatchVersion(); ;} break; case 291: -#line 2816 "Gmsh.y" +#line 2817 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (1)].c); @@ -7079,7 +7079,7 @@ yyreduce: break; case 292: -#line 2832 "Gmsh.y" +#line 2833 "Gmsh.y" { char tmpstring[1024]; sprintf(tmpstring, "%s_%d", (yyvsp[(1) - (5)].c), (int)(yyvsp[(4) - (5)].d)) ; @@ -7097,7 +7097,7 @@ yyreduce: break; case 293: -#line 2847 "Gmsh.y" +#line 2848 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (4)].c); @@ -7120,7 +7120,7 @@ yyreduce: break; case 294: -#line 2867 "Gmsh.y" +#line 2868 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(2) - (4)].c); @@ -7136,7 +7136,7 @@ yyreduce: break; case 295: -#line 2880 "Gmsh.y" +#line 2881 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (2)].c); @@ -7152,7 +7152,7 @@ yyreduce: break; case 296: -#line 2893 "Gmsh.y" +#line 2894 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (5)].c); @@ -7175,7 +7175,7 @@ yyreduce: break; case 297: -#line 2916 "Gmsh.y" +#line 2917 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -7196,7 +7196,7 @@ yyreduce: break; case 298: -#line 2934 "Gmsh.y" +#line 2935 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -7217,7 +7217,7 @@ yyreduce: break; case 299: -#line 2952 "Gmsh.y" +#line 2953 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -7238,7 +7238,7 @@ yyreduce: break; case 300: -#line 2970 "Gmsh.y" +#line 2971 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -7259,7 +7259,7 @@ yyreduce: break; case 301: -#line 2988 "Gmsh.y" +#line 2989 "Gmsh.y" { (yyval.d) = GetValue((yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].d)); Free((yyvsp[(3) - (6)].c)); @@ -7267,70 +7267,70 @@ yyreduce: break; case 302: -#line 2996 "Gmsh.y" +#line 2997 "Gmsh.y" { memcpy((yyval.v), (yyvsp[(1) - (1)].v), 5*sizeof(double)); ;} break; case 303: -#line 3000 "Gmsh.y" +#line 3001 "Gmsh.y" { for(int i = 0; i < 5; i++) (yyval.v)[i] = -(yyvsp[(2) - (2)].v)[i]; ;} break; case 304: -#line 3004 "Gmsh.y" +#line 3005 "Gmsh.y" { for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(2) - (2)].v)[i]; ;} break; case 305: -#line 3008 "Gmsh.y" +#line 3009 "Gmsh.y" { for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(1) - (3)].v)[i] - (yyvsp[(3) - (3)].v)[i]; ;} break; case 306: -#line 3012 "Gmsh.y" +#line 3013 "Gmsh.y" { for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(1) - (3)].v)[i] + (yyvsp[(3) - (3)].v)[i]; ;} break; case 307: -#line 3019 "Gmsh.y" +#line 3020 "Gmsh.y" { (yyval.v)[0] = (yyvsp[(2) - (11)].d); (yyval.v)[1] = (yyvsp[(4) - (11)].d); (yyval.v)[2] = (yyvsp[(6) - (11)].d); (yyval.v)[3] = (yyvsp[(8) - (11)].d); (yyval.v)[4] = (yyvsp[(10) - (11)].d); ;} break; case 308: -#line 3023 "Gmsh.y" +#line 3024 "Gmsh.y" { (yyval.v)[0] = (yyvsp[(2) - (9)].d); (yyval.v)[1] = (yyvsp[(4) - (9)].d); (yyval.v)[2] = (yyvsp[(6) - (9)].d); (yyval.v)[3] = (yyvsp[(8) - (9)].d); (yyval.v)[4] = 1.0; ;} break; case 309: -#line 3027 "Gmsh.y" +#line 3028 "Gmsh.y" { (yyval.v)[0] = (yyvsp[(2) - (7)].d); (yyval.v)[1] = (yyvsp[(4) - (7)].d); (yyval.v)[2] = (yyvsp[(6) - (7)].d); (yyval.v)[3] = 0.0; (yyval.v)[4] = 1.0; ;} break; case 310: -#line 3031 "Gmsh.y" +#line 3032 "Gmsh.y" { (yyval.v)[0] = (yyvsp[(2) - (7)].d); (yyval.v)[1] = (yyvsp[(4) - (7)].d); (yyval.v)[2] = (yyvsp[(6) - (7)].d); (yyval.v)[3] = 0.0; (yyval.v)[4] = 1.0; ;} break; case 311: -#line 3038 "Gmsh.y" +#line 3039 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(List_T*)); List_Add((yyval.l), &((yyvsp[(1) - (1)].l))); @@ -7338,14 +7338,14 @@ yyreduce: break; case 312: -#line 3043 "Gmsh.y" +#line 3044 "Gmsh.y" { List_Add((yyval.l), &((yyvsp[(3) - (3)].l))); ;} break; case 313: -#line 3051 "Gmsh.y" +#line 3052 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); List_Add((yyval.l), &((yyvsp[(1) - (1)].d))); @@ -7353,14 +7353,14 @@ yyreduce: break; case 314: -#line 3056 "Gmsh.y" +#line 3057 "Gmsh.y" { (yyval.l) = (yyvsp[(1) - (1)].l); ;} break; case 315: -#line 3060 "Gmsh.y" +#line 3061 "Gmsh.y" { // creates an empty list (yyval.l) = List_Create(2, 1, sizeof(double)); @@ -7368,14 +7368,14 @@ yyreduce: break; case 316: -#line 3065 "Gmsh.y" +#line 3066 "Gmsh.y" { (yyval.l) = (yyvsp[(2) - (3)].l); ;} break; case 317: -#line 3069 "Gmsh.y" +#line 3070 "Gmsh.y" { (yyval.l) = (yyvsp[(3) - (4)].l); for(int i = 0; i < List_Nbr((yyval.l)); i++){ @@ -7386,7 +7386,7 @@ yyreduce: break; case 318: -#line 3077 "Gmsh.y" +#line 3078 "Gmsh.y" { (yyval.l) = (yyvsp[(4) - (5)].l); for(int i = 0; i < List_Nbr((yyval.l)); i++){ @@ -7397,7 +7397,7 @@ yyreduce: break; case 319: -#line 3088 "Gmsh.y" +#line 3089 "Gmsh.y" { (yyval.l) = (yyvsp[(2) - (2)].l); for(int i = 0; i < List_Nbr((yyval.l)); i++){ @@ -7408,7 +7408,7 @@ yyreduce: break; case 320: -#line 3096 "Gmsh.y" +#line 3097 "Gmsh.y" { (yyval.l) = (yyvsp[(3) - (3)].l); for(int i = 0; i < List_Nbr((yyval.l)); i++){ @@ -7419,7 +7419,7 @@ yyreduce: break; case 321: -#line 3104 "Gmsh.y" +#line 3105 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); for(double d = (yyvsp[(1) - (3)].d); ((yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d)) ? (d <= (yyvsp[(3) - (3)].d)) : (d >= (yyvsp[(3) - (3)].d)); ((yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d)) ? (d += 1.) : (d -= 1.)) @@ -7428,7 +7428,7 @@ yyreduce: break; case 322: -#line 3110 "Gmsh.y" +#line 3111 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); if(!(yyvsp[(5) - (5)].d) || ((yyvsp[(1) - (5)].d) < (yyvsp[(3) - (5)].d) && (yyvsp[(5) - (5)].d) < 0) || ((yyvsp[(1) - (5)].d) > (yyvsp[(3) - (5)].d) && (yyvsp[(5) - (5)].d) > 0)){ @@ -7442,7 +7442,7 @@ yyreduce: break; case 323: -#line 3121 "Gmsh.y" +#line 3122 "Gmsh.y" { // Returns the coordinates of a point and fills a list with it. // This allows to ensure e.g. that relative point positions are @@ -7465,7 +7465,7 @@ yyreduce: break; case 324: -#line 3141 "Gmsh.y" +#line 3142 "Gmsh.y" { (yyval.l) = List_Create(List_Nbr((yyvsp[(1) - (1)].l)), 1, sizeof(double)); for(int i = 0; i < List_Nbr((yyvsp[(1) - (1)].l)); i++){ @@ -7478,7 +7478,7 @@ yyreduce: break; case 325: -#line 3151 "Gmsh.y" +#line 3152 "Gmsh.y" { (yyval.l) = List_Create(List_Nbr((yyvsp[(1) - (1)].l)), 1, sizeof(double)); for(int i = 0; i < List_Nbr((yyvsp[(1) - (1)].l)); i++){ @@ -7491,7 +7491,7 @@ yyreduce: break; case 326: -#line 3161 "Gmsh.y" +#line 3162 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); Symbol TheSymbol; @@ -7511,7 +7511,7 @@ yyreduce: break; case 327: -#line 3178 "Gmsh.y" +#line 3179 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); Symbol TheSymbol; @@ -7538,7 +7538,7 @@ yyreduce: break; case 328: -#line 3205 "Gmsh.y" +#line 3206 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); List_Add((yyval.l), &((yyvsp[(1) - (1)].d))); @@ -7546,21 +7546,21 @@ yyreduce: break; case 329: -#line 3210 "Gmsh.y" +#line 3211 "Gmsh.y" { (yyval.l) = (yyvsp[(1) - (1)].l); ;} break; case 330: -#line 3214 "Gmsh.y" +#line 3215 "Gmsh.y" { List_Add((yyval.l), &((yyvsp[(3) - (3)].d))); ;} break; case 331: -#line 3218 "Gmsh.y" +#line 3219 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (3)].l)); i++){ double d; @@ -7572,21 +7572,21 @@ yyreduce: break; case 332: -#line 3231 "Gmsh.y" +#line 3232 "Gmsh.y" { (yyval.u) = CTX.PACK_COLOR((int)(yyvsp[(2) - (9)].d), (int)(yyvsp[(4) - (9)].d), (int)(yyvsp[(6) - (9)].d), (int)(yyvsp[(8) - (9)].d)); ;} break; case 333: -#line 3235 "Gmsh.y" +#line 3236 "Gmsh.y" { (yyval.u) = CTX.PACK_COLOR((int)(yyvsp[(2) - (7)].d), (int)(yyvsp[(4) - (7)].d), (int)(yyvsp[(6) - (7)].d), 255); ;} break; case 334: -#line 3247 "Gmsh.y" +#line 3248 "Gmsh.y" { int flag; (yyval.u) = Get_ColorForString(ColorString, -1, (yyvsp[(1) - (1)].c), &flag); @@ -7596,7 +7596,7 @@ yyreduce: break; case 335: -#line 3254 "Gmsh.y" +#line 3255 "Gmsh.y" { unsigned int (*pColOpt)(int num, int action, unsigned int value); StringXColor *pColCat; @@ -7617,14 +7617,14 @@ yyreduce: break; case 336: -#line 3275 "Gmsh.y" +#line 3276 "Gmsh.y" { (yyval.l) = (yyvsp[(2) - (3)].l); ;} break; case 337: -#line 3279 "Gmsh.y" +#line 3280 "Gmsh.y" { (yyval.l) = List_Create(256, 10, sizeof(unsigned int)); GmshColorTable *ct = Get_ColorTable((int)(yyvsp[(3) - (6)].d)); @@ -7639,7 +7639,7 @@ yyreduce: break; case 338: -#line 3294 "Gmsh.y" +#line 3295 "Gmsh.y" { (yyval.l) = List_Create(256, 10, sizeof(unsigned int)); List_Add((yyval.l), &((yyvsp[(1) - (1)].u))); @@ -7647,35 +7647,35 @@ yyreduce: break; case 339: -#line 3299 "Gmsh.y" +#line 3300 "Gmsh.y" { List_Add((yyval.l), &((yyvsp[(3) - (3)].u))); ;} break; case 340: -#line 3306 "Gmsh.y" +#line 3307 "Gmsh.y" { (yyval.c) = (yyvsp[(1) - (1)].c); ;} break; case 341: -#line 3310 "Gmsh.y" +#line 3311 "Gmsh.y" { Msg(WARNING, "Named string expressions not implemented yet"); ;} break; case 342: -#line 3317 "Gmsh.y" +#line 3318 "Gmsh.y" { (yyval.c) = (yyvsp[(1) - (1)].c); ;} break; case 343: -#line 3321 "Gmsh.y" +#line 3322 "Gmsh.y" { (yyval.c) = (char *)Malloc(32*sizeof(char)); time_t now; @@ -7686,7 +7686,7 @@ yyreduce: break; case 344: -#line 3329 "Gmsh.y" +#line 3330 "Gmsh.y" { (yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (6)].c))+strlen((yyvsp[(5) - (6)].c))+1)*sizeof(char)); strcpy((yyval.c), (yyvsp[(3) - (6)].c)); @@ -7697,7 +7697,7 @@ yyreduce: break; case 345: -#line 3337 "Gmsh.y" +#line 3338 "Gmsh.y" { (yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (4)].c))+1)*sizeof(char)); int i; @@ -7714,7 +7714,7 @@ yyreduce: break; case 346: -#line 3351 "Gmsh.y" +#line 3352 "Gmsh.y" { (yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (4)].c))+1)*sizeof(char)); int i; @@ -7731,14 +7731,14 @@ yyreduce: break; case 347: -#line 3365 "Gmsh.y" +#line 3366 "Gmsh.y" { (yyval.c) = (yyvsp[(3) - (4)].c); ;} break; case 348: -#line 3369 "Gmsh.y" +#line 3370 "Gmsh.y" { char tmpstring[1024]; int i = PrintListOfDouble((yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].l), tmpstring); @@ -7760,7 +7760,7 @@ yyreduce: break; case 349: -#line 3388 "Gmsh.y" +#line 3389 "Gmsh.y" { const char* (*pStrOpt)(int num, int action, const char *value); StringXString *pStrCat; @@ -7786,7 +7786,7 @@ yyreduce: break; case 350: -#line 3411 "Gmsh.y" +#line 3412 "Gmsh.y" { const char* (*pStrOpt)(int num, int action, const char *value); StringXString *pStrCat; @@ -8027,7 +8027,7 @@ yyreturn: } -#line 3435 "Gmsh.y" +#line 3436 "Gmsh.y" void DeleteSymbol(void *a, void *b) diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y index 9187308f6a..e88819f6e5 100644 --- a/Parser/Gmsh.y +++ b/Parser/Gmsh.y @@ -1,5 +1,5 @@ %{ -// $Id: Gmsh.y,v 1.305 2008-03-19 17:26:53 geuzaine Exp $ +// $Id: Gmsh.y,v 1.306 2008-03-21 07:21:07 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -974,8 +974,8 @@ Affectation : if(option){ try { option->numerical_value($8); } catch(...){ - yymsg(GERROR, "Cannot assign a numerical value to option '%s' in field %i of type '%s'", - $6, (int)$3, field->get_name()); + yymsg(GERROR, "Cannot assign a numerical value to option '%s' " + "in field %i of type '%s'", $6, (int)$3, field->get_name()); } } else @@ -993,8 +993,8 @@ Affectation : if(option){ try { option->string() = $8; } catch (...){ - yymsg(GERROR, "Cannot assign a string value to option '%s' in field %i of type '%s'", - $6, (int)$3, field->get_name()); + yymsg(GERROR, "Cannot assign a string value to option '%s' " + "in field %i of type '%s'", $6, (int)$3, field->get_name()); } } else @@ -1751,9 +1751,10 @@ Delete : } List_Delete($3); } - | tDelete tField '[' FExpr ']' tEND{ - GModel::current()->getFields()->delete_field((int)$4); - } + | tDelete tField '[' FExpr ']' tEND + { + GModel::current()->getFields()->delete_field((int)$4); + } | tDelete tSTRING '[' FExpr ']' tEND { if(!strcmp($2, "View")){ diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp index 9183b16d12..e68d615e8c 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.353 2008-03-20 11:44:12 geuzaine Exp $ +// $Id: Gmsh.yy.cpp,v 1.354 2008-03-21 07:21:07 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // diff --git a/demos/attractors.geo b/demos/attractors.geo deleted file mode 100644 index 78d148a193..0000000000 --- a/demos/attractors.geo +++ /dev/null @@ -1,28 +0,0 @@ -lc = .15; -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}; -Point(55) = {0.2,.5,0,lc}; -Line Loop(5) = {1,2,3,4}; -Plane Surface(6) = {5}; - -// Point and line attractors (shortcuts for Threshold fields, -// automatically added to the list of char length fields) - -num_pts = 100; // number of points on the attractor, unused for points -lc_min = lc/20; // lc inside r_min -lc_max = lc; // lc outside r_max -r_min = 0.15; -r_max = 0.5; -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}; - -// Function field - -Function Field(1) = "Cos(4*3.14*x) * Sin(4*3.14*y) / 10 + 0.101"; -Characteristic Length Field{1}; diff --git a/demos/fields.geo b/demos/fields.geo new file mode 100644 index 0000000000..8e18afe984 --- /dev/null +++ b/demos/fields.geo @@ -0,0 +1,36 @@ +lc = .15; +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}; +Point(55) = {0.2,.5,0,lc}; +Line Loop(5) = {1,2,3,4}; +Plane Surface(6) = {5}; + +// Attractors field on points 1 and 55, and on line 1 +Field[1] = Attractor; +Field[1].NNodesByEdge = 100; +Field[1].NodesList = {1,55}; +Field[1].EdgesList = {1}; + +// Threshold field defined on the attractors +Field[2] = Threshold; +Field[2].IField = 1; +Field[2].LcMin = lc/20; +Field[2].LcMax = lc; +Field[2].DistMin = 0.15; +Field[2].DistMax = 0.5; + +// Function field +Field[3] = MathEval; +Field[3].F = "Cos(4*3.14*x) * Sin(4*3.14*y) / 10 + 0.101"; + +// Use minimum of threshold and function field as background field +Field[4] = Min; +Field[4].FieldsList = {2, 3}; + +Background Field = 4; -- GitLab