diff --git a/Box/Main.cpp b/Box/Main.cpp index 10c3b7c4bd41e55c61fd2316d520526c36234315..bc8147c09769726f3846ce5b4b685558cc469a6b 100644 --- a/Box/Main.cpp +++ b/Box/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.29 2003-03-21 00:52:34 geuzaine Exp $ +// $Id: Main.cpp,v 1.30 2003-06-14 04:37:41 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -98,7 +98,6 @@ int main(int argc, char *argv[]) Get_Options(argc, argv, &nbf); M.Vertices = NULL; - M.VertexEdges = NULL; M.Simplexes = NULL; M.Points = NULL; M.Curves = NULL; diff --git a/Common/Context.h b/Common/Context.h index 80072e2d251951aa6cf8fbfbc8d22b601f428282..f88d923247c0c6fb473fc3838ef646c1b13eed99 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -206,7 +206,7 @@ public : unsigned int tangents, normals; } geom; struct{ - unsigned int vertex, vertex_supp, line, triangle, quadrangle; + unsigned int vertex, line, triangle, quadrangle; unsigned int tetrahedron, hexahedron, prism, pyramid; unsigned int carousel[10]; unsigned int tangents, normals; diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 6a6b332b47a330b0bbab7549a7e3c9c6f637f342..e4720cd23814d1cf2c4936edd9e3a498783f8eeb 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -1145,11 +1145,6 @@ StringXColor MeshOptions_Color[] = { PACK_COLOR(0 , 123, 59 , 255), PACK_COLOR(0, 0, 0, 255), "Mesh vertex color" }, - { F|O, "PointsSupp" , opt_mesh_color_points_supp , - PACK_COLOR(255, 0, 255, 255), - PACK_COLOR(255, 0, 255, 255), - PACK_COLOR(0, 0, 0, 255), - "Mesh high order vertex color" }, { F|O, "Lines" , opt_mesh_color_lines , PACK_COLOR(0, 255, 0, 255), PACK_COLOR(0, 255, 0, 255), diff --git a/Common/Options.cpp b/Common/Options.cpp index e088560188626a6dcd848fd2612bfa4741315af3..9dd310854a05dccddd6e15432fb04200fec69af6 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.109 2003-06-13 22:41:41 geuzaine Exp $ +// $Id: Options.cpp,v 1.110 2003-06-14 04:37:42 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -4773,17 +4773,6 @@ unsigned int opt_mesh_color_points(OPT_ARGS_COL) #endif return CTX.color.mesh.vertex; } -unsigned int opt_mesh_color_points_supp(OPT_ARGS_COL) -{ - if(action & GMSH_SET) { - CTX.color.mesh.vertex_supp = val; - CTX.mesh.changed = 1; - } -#if defined(HAVE_FLTK) - CCC(CTX.color.mesh.vertex_supp, WID->mesh_col[1]); -#endif - return CTX.color.mesh.vertex_supp; -} unsigned int opt_mesh_color_lines(OPT_ARGS_COL) { if(action & GMSH_SET) { @@ -4791,7 +4780,7 @@ unsigned int opt_mesh_color_lines(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.line, WID->mesh_col[2]); + CCC(CTX.color.mesh.line, WID->mesh_col[1]); #endif return CTX.color.mesh.line; } @@ -4802,7 +4791,7 @@ unsigned int opt_mesh_color_triangles(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.triangle, WID->mesh_col[3]); + CCC(CTX.color.mesh.triangle, WID->mesh_col[2]); #endif return CTX.color.mesh.triangle; } @@ -4813,7 +4802,7 @@ unsigned int opt_mesh_color_quadrangles(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.quadrangle, WID->mesh_col[4]); + CCC(CTX.color.mesh.quadrangle, WID->mesh_col[3]); #endif return CTX.color.mesh.quadrangle; } @@ -4824,7 +4813,7 @@ unsigned int opt_mesh_color_tetrahedra(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.tetrahedron, WID->mesh_col[5]); + CCC(CTX.color.mesh.tetrahedron, WID->mesh_col[4]); #endif return CTX.color.mesh.tetrahedron; } @@ -4835,7 +4824,7 @@ unsigned int opt_mesh_color_hexahedra(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.hexahedron, WID->mesh_col[6]); + CCC(CTX.color.mesh.hexahedron, WID->mesh_col[5]); #endif return CTX.color.mesh.hexahedron; } @@ -4846,7 +4835,7 @@ unsigned int opt_mesh_color_prisms(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.prism, WID->mesh_col[7]); + CCC(CTX.color.mesh.prism, WID->mesh_col[6]); #endif return CTX.color.mesh.prism; } @@ -4857,7 +4846,7 @@ unsigned int opt_mesh_color_pyramid(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.pyramid, WID->mesh_col[8]); + CCC(CTX.color.mesh.pyramid, WID->mesh_col[7]); #endif return CTX.color.mesh.pyramid; } @@ -4868,7 +4857,7 @@ unsigned int opt_mesh_color_tangents(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.tangents, WID->mesh_col[9]); + CCC(CTX.color.mesh.tangents, WID->mesh_col[8]); #endif return CTX.color.mesh.tangents; } @@ -4879,7 +4868,7 @@ unsigned int opt_mesh_color_normals(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.normals, WID->mesh_col[10]); + CCC(CTX.color.mesh.normals, WID->mesh_col[9]); #endif return CTX.color.mesh.normals; } @@ -4890,7 +4879,7 @@ unsigned int opt_mesh_color_1(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.carousel[0], WID->mesh_col[11]); + CCC(CTX.color.mesh.carousel[0], WID->mesh_col[10]); #endif return CTX.color.mesh.carousel[0]; } @@ -4901,7 +4890,7 @@ unsigned int opt_mesh_color_2(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.carousel[1], WID->mesh_col[12]); + CCC(CTX.color.mesh.carousel[1], WID->mesh_col[11]); #endif return CTX.color.mesh.carousel[1]; } @@ -4912,7 +4901,7 @@ unsigned int opt_mesh_color_3(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.carousel[2], WID->mesh_col[13]); + CCC(CTX.color.mesh.carousel[2], WID->mesh_col[12]); #endif return CTX.color.mesh.carousel[2]; } @@ -4923,7 +4912,7 @@ unsigned int opt_mesh_color_4(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.carousel[3], WID->mesh_col[14]); + CCC(CTX.color.mesh.carousel[3], WID->mesh_col[13]); #endif return CTX.color.mesh.carousel[3]; } @@ -4934,7 +4923,7 @@ unsigned int opt_mesh_color_5(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.carousel[4], WID->mesh_col[15]); + CCC(CTX.color.mesh.carousel[4], WID->mesh_col[14]); #endif return CTX.color.mesh.carousel[4]; } @@ -4945,7 +4934,7 @@ unsigned int opt_mesh_color_6(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.carousel[5], WID->mesh_col[16]); + CCC(CTX.color.mesh.carousel[5], WID->mesh_col[15]); #endif return CTX.color.mesh.carousel[5]; } @@ -4956,7 +4945,7 @@ unsigned int opt_mesh_color_7(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.carousel[6], WID->mesh_col[17]); + CCC(CTX.color.mesh.carousel[6], WID->mesh_col[16]); #endif return CTX.color.mesh.carousel[6]; } @@ -4967,7 +4956,7 @@ unsigned int opt_mesh_color_8(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.carousel[7], WID->mesh_col[18]); + CCC(CTX.color.mesh.carousel[7], WID->mesh_col[17]); #endif return CTX.color.mesh.carousel[7]; } @@ -4978,7 +4967,7 @@ unsigned int opt_mesh_color_9(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.carousel[8], WID->mesh_col[19]); + CCC(CTX.color.mesh.carousel[8], WID->mesh_col[18]); #endif return CTX.color.mesh.carousel[8]; } @@ -4989,7 +4978,7 @@ unsigned int opt_mesh_color_10(OPT_ARGS_COL) CTX.mesh.changed = 1; } #if defined(HAVE_FLTK) - CCC(CTX.color.mesh.carousel[9], WID->mesh_col[20]); + CCC(CTX.color.mesh.carousel[9], WID->mesh_col[19]); #endif return CTX.color.mesh.carousel[9]; } diff --git a/Common/Options.h b/Common/Options.h index 882f51841d00b6834a74c6684b6a47865e529846..4e439d0ce1bb3a8175b05d722bc67e83b7e4e1df 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -494,7 +494,6 @@ unsigned int opt_geometry_color_volumes_highlight(OPT_ARGS_COL); unsigned int opt_geometry_color_tangents(OPT_ARGS_COL); unsigned int opt_geometry_color_normals(OPT_ARGS_COL); unsigned int opt_mesh_color_points(OPT_ARGS_COL); -unsigned int opt_mesh_color_points_supp(OPT_ARGS_COL); unsigned int opt_mesh_color_lines(OPT_ARGS_COL); unsigned int opt_mesh_color_triangles(OPT_ARGS_COL); unsigned int opt_mesh_color_quadrangles(OPT_ARGS_COL); diff --git a/Fltk/Main.cpp b/Fltk/Main.cpp index 7b7e136307263a41510db175bec30f6ee40a4b87..3aea18a1b48f41af44ee6a40da68269524172e52 100644 --- a/Fltk/Main.cpp +++ b/Fltk/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.47 2003-04-14 21:34:52 geuzaine Exp $ +// $Id: Main.cpp,v 1.48 2003-06-14 04:37:42 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -101,7 +101,6 @@ int main(int argc, char *argv[]) // Initialize the static Mesh M.Vertices = NULL; - M.VertexEdges = NULL; M.Simplexes = NULL; M.Points = NULL; M.Curves = NULL; diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp index 45af263322cc2b9a2562f1b8508f8f66d82da983..c5c42b86755e41457764223fcc059a6247b683c4 100644 --- a/Graphics/Mesh.cpp +++ b/Graphics/Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Mesh.cpp,v 1.61 2003-06-13 22:41:41 geuzaine Exp $ +// $Id: Mesh.cpp,v 1.62 2003-06-14 04:37:42 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -67,8 +67,6 @@ void ColorSwitch(int i) glColor4ubv((GLubyte *) & CTX.color.mesh.carousel[i % 10]); } -static int DrawVertexSupp; - void Draw_Mesh(Mesh * M) { int i; @@ -156,12 +154,9 @@ void Draw_Mesh(Mesh * M) if(M->status >= 1 && (CTX.mesh.lines || CTX.mesh.lines_num)) { Tree_Action(M->Curves, Draw_Mesh_Curves); - DrawVertexSupp = 1; - Tree_Action(M->VertexEdges, Draw_Mesh_Points); } if(M->status >= 0 && (CTX.mesh.points || CTX.mesh.points_num)) { - DrawVertexSupp = 0; Tree_Action(M->Vertices, Draw_Mesh_Points); } @@ -282,10 +277,7 @@ void Draw_Mesh_Points(void *a, void *b) glPushName(v->Num); } - if(DrawVertexSupp) - glColor4ubv((GLubyte *) & CTX.color.mesh.vertex_supp); - else - glColor4ubv((GLubyte *) & CTX.color.mesh.vertex); + glColor4ubv((GLubyte *) & CTX.color.mesh.vertex); if(CTX.mesh.points) { if(CTX.mesh.point_type) { diff --git a/Mesh/1D_Mesh.cpp b/Mesh/1D_Mesh.cpp index c9f4cb2ee0589a744b75f723a505dd6324a77931..37a360e65c19debf9cf494db1418f3bf10b2dd41 100644 --- a/Mesh/1D_Mesh.cpp +++ b/Mesh/1D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 1D_Mesh.cpp,v 1.33 2003-06-13 22:41:41 geuzaine Exp $ +// $Id: 1D_Mesh.cpp,v 1.34 2003-06-14 04:37:42 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -208,9 +208,7 @@ void Maillage_Curve(void *data, void *dummy) dp = P2.p - P1.p; t = P1.t + dt / dp * (d - P1.p); V = InterpolateCurve(c, t, 0); - pV = - Create_Vertex(++THEM->MaxPointNum, V.Pos.X, V.Pos.Y, V.Pos.Z, V.lc, - t); + pV = Create_Vertex(++THEM->MaxPointNum, V.Pos.X, V.Pos.Y, V.Pos.Z, V.lc, t); pV->w = V.w; pV->ListCurves = List_Create(1, 1, sizeof(Curve *)); List_Add(pV->ListCurves, &c); @@ -251,8 +249,9 @@ void Maillage_Curve(void *data, void *dummy) List_Add(c->TrsfSimplexes, &s); } - if(CTX.mesh.order == 2) - Degre2(THEM->Vertices, THEM->VertexEdges, c->Simplexes, c, NULL); + if(CTX.mesh.order == 2){ + Degre2(c->Simplexes, c, NULL); + } THEM->Statistics[4] += List_Nbr(c->Vertices); diff --git a/Mesh/2D_Mesh.cpp b/Mesh/2D_Mesh.cpp index 585da02d329fa4215dda93f0d1cfdf22b8f60fce..6996f265064b772a1d2f9615bf5fbfc97dd32bb5 100644 --- a/Mesh/2D_Mesh.cpp +++ b/Mesh/2D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Mesh.cpp,v 1.48 2003-06-13 22:41:41 geuzaine Exp $ +// $Id: 2D_Mesh.cpp,v 1.49 2003-06-14 04:37:42 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -947,8 +947,9 @@ void Maillage_Surface(void *data, void *dum) Tree_Action(THEM->Points, PutVertex_OnSurf); Tree_Action(s->Vertices, PutVertex_OnSurf); Tree_Action(s->Vertices, Add_In_Mesh); - if(CTX.mesh.order == 2) - Degre2(THEM->Vertices, s->Vertices, s->Simplexes, NULL, s); + if(CTX.mesh.order == 2){ + Degre2(s->Simplexes, NULL, s); + } THEM->Statistics[5] += Tree_Nbr(THESURFACE->Vertices); THEM->Statistics[7] += Tree_Nbr(THESURFACE->Simplexes); @@ -1020,8 +1021,9 @@ void Maillage_Surface(void *data, void *dum) End_Surface(s->Support); End_Surface(s); - if(CTX.mesh.order == 2) - Degre2(THEM->Vertices, THEM->VertexEdges, s->Simplexes, NULL, THESUPPORT); + if(CTX.mesh.order == 2){ + Degre2(s->Simplexes, NULL, THESUPPORT); + } THEM->Statistics[5] += Tree_Nbr(THESURFACE->Vertices); THEM->Statistics[7] += Tree_Nbr(THESURFACE->Simplexes); // tri+qua diff --git a/Mesh/3D_Mesh.cpp b/Mesh/3D_Mesh.cpp index 1e5ea01b9b578ca6322e26df1ea6795dd1d5131c..582204f31847ff4134b95bd3f56a5169e7034083 100644 --- a/Mesh/3D_Mesh.cpp +++ b/Mesh/3D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_Mesh.cpp,v 1.51 2003-06-13 22:41:41 geuzaine Exp $ +// $Id: 3D_Mesh.cpp,v 1.52 2003-06-14 04:37:42 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -1047,8 +1047,9 @@ void Maillage_Volume(void *data, void *dum) } #endif - if(CTX.mesh.order == 2) - Degre2(THEM->Vertices, THEM->VertexEdges, v->Simplexes, NULL, NULL); + if(CTX.mesh.order == 2){ + Degre2(v->Simplexes, NULL, NULL); + } List_Delete(Simplexes_New); List_Delete(Simplexes_Destroyed); diff --git a/Mesh/3D_Mesh_Old.cpp b/Mesh/3D_Mesh_Old.cpp index 0f5a72050f1b2fbe400ac8e86943e8e33c4406cf..5cafcb9fcfb87c0846bf27073a0e82a11ae4ad38 100644 --- a/Mesh/3D_Mesh_Old.cpp +++ b/Mesh/3D_Mesh_Old.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_Mesh_Old.cpp,v 1.8 2003-06-13 22:41:41 geuzaine Exp $ +// $Id: 3D_Mesh_Old.cpp,v 1.9 2003-06-14 04:37:42 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -906,8 +906,9 @@ void Maillage_Volume(void *data, void *dum) */ } - if(CTX.mesh.order == 2) - Degre2(THEM->Vertices, THEM->VertexEdges, v->Simplexes, NULL, NULL); + if(CTX.mesh.order == 2){ + Degre2(v->Simplexes, NULL, NULL); + } List_Delete(Simplexes_New); List_Delete(Simplexes_Destroyed); diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp index 595e2090fcde0b2869f3644bb606fed5cd13677f..642e32ef54fb5e13cb67d81767b601aad8d712ad 100644 --- a/Mesh/Generator.cpp +++ b/Mesh/Generator.cpp @@ -1,4 +1,4 @@ -// $Id: Generator.cpp,v 1.44 2003-06-13 21:14:20 geuzaine Exp $ +// $Id: Generator.cpp,v 1.45 2003-06-14 04:37:42 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -189,9 +189,6 @@ void Init_Mesh(Mesh * M, int all) Tree_Action(M->Vertices, Free_Vertex); Tree_Delete(M->Vertices); - Tree_Action(M->VertexEdges, Free_Vertex); - Tree_Delete(M->VertexEdges); - Tree_Action(M->Points, Free_Vertex); Tree_Delete(M->Points); @@ -223,7 +220,6 @@ void Init_Mesh(Mesh * M, int all) } M->Vertices = Tree_Create(sizeof(Vertex *), compareVertex); - M->VertexEdges = Tree_Create(sizeof(Vertex *), compareVertex); M->Simplexes = Tree_Create(sizeof(Simplex *), compareSimplex); M->Points = Tree_Create(sizeof(Vertex *), compareVertex); M->Curves = Tree_Create(sizeof(Curve *), compareCurve); diff --git a/Mesh/Mesh.h b/Mesh/Mesh.h index 71e71fd9c21345ef1e2f5b5d85f6e005feccb96a..b2c4b24a3499f2c8fe7d5c4a2b58dbde889e0497 100644 --- a/Mesh/Mesh.h +++ b/Mesh/Mesh.h @@ -430,7 +430,6 @@ struct _Mesh{ Tree_T *SurfaceLoops; /* Surface Loops */ Tree_T *EdgeLoops; /* Edge Loops */ List_T *PhysicalGroups; /* Physical Groups */ - Tree_T *VertexEdges; /* 2nd order Vertices on edges */ Grid_T Grid; /* Grille de recherches rapides */ LcField BGM; /* Background mesh */ double Statistics[50]; /* Mesh statistics */ @@ -502,8 +501,7 @@ void deFreeze_Vertex (void *a, void *b); void crEdges (Tree_T * TreeElem, Tree_T * treeedges); double Lc_XYZ (double X, double Y, double Z, Mesh * m); -void Degre2 (Tree_T * AllNodes, Tree_T * TreeNodes, Tree_T * TreeElm, - Curve * c, Surface * s); +void Degre2 (Tree_T * TreeElm, Curve * c, Surface * s); void Reset_Degre2 (); void ActionLiss (void *data, void *dummy); void ActionLissSurf (void *data, void *dummy); diff --git a/Mesh/Print_Mesh.cpp b/Mesh/Print_Mesh.cpp index ff04765cdf82891aeaf8fdda0aa6cc7e6ce6f34a..4b2dc7720c18363b6e03f422049dcad350cde05b 100644 --- a/Mesh/Print_Mesh.cpp +++ b/Mesh/Print_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Print_Mesh.cpp,v 1.41 2003-03-21 00:52:41 geuzaine Exp $ +// $Id: Print_Mesh.cpp,v 1.42 2003-06-14 04:37:42 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -86,12 +86,11 @@ void process_msh_nodes(Mesh * M) } } - MSH_NODE_NUM = Tree_Nbr(M->Vertices) + Tree_Nbr(M->VertexEdges); + MSH_NODE_NUM = Tree_Nbr(M->Vertices); fprintf(mshfile, "$NOD\n"); fprintf(mshfile, "%d\n", MSH_NODE_NUM); Tree_Action(M->Vertices, print_msh_node); - Tree_Action(M->VertexEdges, print_msh_node); fprintf(mshfile, "$ENDNOD\n"); } @@ -139,14 +138,14 @@ void print_msh_simplex(void *a, void *b) if(!MSH_3D) { if((*S)->VSUP) { type = QUADRANGLE_2; - nbs = 5; + nbs = 4; } else type = QUADRANGLE; } else if((*S)->VSUP) { type = TETRAHEDRON_2; - nbs = 1; + nbs = 6; } else type = TETRAHEDRON; @@ -201,7 +200,7 @@ void print_msh_hexahedron(void *a, void *b) nbn = 8; if((*H)->VSUP) { type = HEXAHEDRON_2; - nbs = 19; + nbs = 12; } else type = HEXAHEDRON; @@ -238,7 +237,7 @@ void print_msh_prism(void *a, void *b) nbn = 6; if((*P)->VSUP) { type = PRISM_2; - nbs = 12; + nbs = 9; } else { type = PRISM; @@ -276,7 +275,7 @@ void print_msh_pyramid(void *a, void *b) nbn = 5; if((*P)->VSUP) { type = PYRAMID_2; - nbs = 10; + nbs = 8; } else { type = PYRAMID; @@ -540,19 +539,6 @@ void process_unv_nodes(Mesh * M) } List_Delete(Nodes); - Nodes = Tree2List(M->VertexEdges); - nbnod = List_Nbr(Nodes); - - for(i = 0; i < nbnod; i++) { - List_Read(Nodes, i, &v); - idnod = v->Num; - x = v->Pos.X * CTX.mesh.scaling_factor; - y = v->Pos.Y * CTX.mesh.scaling_factor; - z = v->Pos.Z * CTX.mesh.scaling_factor; - fprintf(unvfile, "%10d%10d%10d%10d\n", idnod, 1, 1, 11); - fprintf(unvfile, "%21.16fD+00 %21.16fD+00 %21.16fD+00\n", x, y, z); - } - fprintf(unvfile, "%6d\n", -1); } @@ -983,7 +969,7 @@ int process_Gref_nodes(FILE * fGref, Mesh * M, ListCurves = Tree2List(M->Curves); for(i = 0; i < List_Nbr(ListCurves); i++) { List_Read(ListCurves, i, &c); - Degre2(M->Vertices, M->VertexEdges, c->Simplexes, c, NULL); + Degre2(c->Simplexes, c, NULL); } List_Delete(ListCurves); @@ -991,7 +977,7 @@ int process_Gref_nodes(FILE * fGref, Mesh * M, nbtri = 0; for(i = 0; i < List_Nbr(ListSurfaces); i++) { List_Read(ListSurfaces, i, &s); - Degre2(M->Vertices, M->VertexEdges, s->Simplexes, NULL, s); + Degre2(s->Simplexes, NULL, s); nbtri += Tree_Nbr(s->Simplexes); } List_Delete(ListSurfaces); diff --git a/Mesh/Read_Mesh.cpp b/Mesh/Read_Mesh.cpp index 116ffcae2afcc8eddea27a62d5fc8a8d9294d56e..605b4ccf1f15edf3ca48ddfca4a5d8acef921982 100644 --- a/Mesh/Read_Mesh.cpp +++ b/Mesh/Read_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Read_Mesh.cpp,v 1.55 2003-05-12 15:44:12 geuzaine Exp $ +// $Id: Read_Mesh.cpp,v 1.56 2003-06-14 04:37:42 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -47,7 +47,7 @@ extern Context_T CTX; #define PYR2 14 #define PNT 15 -#define NB_NOD_MAX_ELM 20 +#define NB_NOD_MAX_ELM 30 int comparePhysicalGroup(const void *a, const void *b) { @@ -260,9 +260,14 @@ void Read_Mesh_MSH(Mesh * M, FILE * File_GEO) switch (Type) { case LGN1: + case LGN2: simp = Create_Simplex(vertsp[0], vertsp[1], NULL, NULL); simp->Num = Num; simp->iEnt = Elementary; + if(Type == LGN2){ + simp->VSUP = (Vertex **) Malloc(1 * sizeof(Vertex *)); + simp->VSUP[0] = vertsp[2]; + } if(!Tree_Insert(c->Simplexes, &simp)){ Msg(GERROR, "Line element %d already exists\n", simp->Num); Free_Simplex(&simp, 0); @@ -270,9 +275,16 @@ void Read_Mesh_MSH(Mesh * M, FILE * File_GEO) //NO!!! Tree_Insert(M->Simplexes, &simp) ; break; case TRI1: + case TRI2: simp = Create_Simplex(vertsp[0], vertsp[1], vertsp[2], NULL); simp->Num = Num; simp->iEnt = Elementary; + if(Type == TRI2){ + simp->VSUP = (Vertex **) Malloc(3 * sizeof(Vertex *)); + for(i = 0; i < 3; i++){ + simp->VSUP[i] = vertsp[i+3]; + } + } if(Tree_Insert(s->Simplexes, &simp) && Tree_Insert(M->Simplexes, &simp)){ M->Statistics[7]++; } @@ -282,9 +294,16 @@ void Read_Mesh_MSH(Mesh * M, FILE * File_GEO) } break; case QUA1: + case QUA2: simp = Create_Quadrangle(vertsp[0], vertsp[1], vertsp[2], vertsp[3]); simp->Num = Num; simp->iEnt = Elementary; + if(Type == QUA2){ + simp->VSUP = (Vertex **) Malloc(4 * sizeof(Vertex *)); + for(i = 0; i < 4; i++){ + simp->VSUP[i] = vertsp[i+4]; + } + } if(Tree_Insert(s->Simplexes, &simp) && Tree_Insert(M->Simplexes, &simp)){ M->Statistics[7]++; //since s->Simplexes holds quads, too :-( M->Statistics[8]++; @@ -295,9 +314,16 @@ void Read_Mesh_MSH(Mesh * M, FILE * File_GEO) } break; case TET1: + case TET2: simp = Create_Simplex(vertsp[0], vertsp[1], vertsp[2], vertsp[3]); simp->Num = Num; simp->iEnt = Elementary; + if(Type == TET2){ + simp->VSUP = (Vertex **) Malloc(6 * sizeof(Vertex *)); + for(i = 0; i < 6; i++){ + simp->VSUP[i] = vertsp[i+4]; + } + } if(Tree_Insert(v->Simplexes, &simp) && Tree_Insert(M->Simplexes, &simp)){ M->Statistics[9]++; } @@ -307,10 +333,17 @@ void Read_Mesh_MSH(Mesh * M, FILE * File_GEO) } break; case HEX1: + case HEX2: hex = Create_Hexahedron(vertsp[0], vertsp[1], vertsp[2], vertsp[3], vertsp[4], vertsp[5], vertsp[6], vertsp[7]); hex->Num = Num; hex->iEnt = Elementary; + if(Type == HEX2){ + hex->VSUP = (Vertex **) Malloc(12 * sizeof(Vertex *)); + for(i = 0; i < 12; i++){ + hex->VSUP[i] = vertsp[i+8]; + } + } if(Tree_Insert(v->Hexahedra, &hex)){ M->Statistics[10]++; } @@ -320,10 +353,17 @@ void Read_Mesh_MSH(Mesh * M, FILE * File_GEO) } break; case PRI1: + case PRI2: pri = Create_Prism(vertsp[0], vertsp[1], vertsp[2], vertsp[3], vertsp[4], vertsp[5]); pri->Num = Num; pri->iEnt = Elementary; + if(Type == PRI2){ + pri->VSUP = (Vertex **) Malloc(9 * sizeof(Vertex *)); + for(i = 0; i < 9; i++){ + pri->VSUP[i] = vertsp[i+6]; + } + } if(Tree_Insert(v->Prisms, &pri)){ M->Statistics[11]++; } @@ -333,10 +373,17 @@ void Read_Mesh_MSH(Mesh * M, FILE * File_GEO) } break; case PYR1: + case PYR2: pyr = Create_Pyramid(vertsp[0], vertsp[1], vertsp[2], vertsp[3], vertsp[4]); pyr->Num = Num; pyr->iEnt = Elementary; + if(Type == PYR2){ + pyr->VSUP = (Vertex **) Malloc(8 * sizeof(Vertex *)); + for(i = 0; i < 8; i++){ + pyr->VSUP[i] = vertsp[i+5]; + } + } if(Tree_Insert(v->Pyramids, &pyr)){ M->Statistics[12]++; } diff --git a/Mesh/SMS.cpp b/Mesh/SMS.cpp index 36ba13c8293901ba5fbe090d6d7401fb77a6f607..e5a0823825e5a56b7369c721c3f6404a04df0443 100644 --- a/Mesh/SMS.cpp +++ b/Mesh/SMS.cpp @@ -1,4 +1,4 @@ -// $Id: SMS.cpp,v 1.14 2003-03-21 00:52:41 geuzaine Exp $ +// $Id: SMS.cpp,v 1.15 2003-06-14 04:37:42 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -301,7 +301,6 @@ void Read_Mesh_SMS(Mesh * m, FILE * in) } Simplex *s = Create_Simplex(v1, v2, v3, v4); - // s->curvedBounds(Edge1,Edge2,Edge3,Edge4,Lists,m->VertexEdges); s->Num = i + 1; s->iEnt = GEntityId + 10000; Surface *surf; @@ -462,14 +461,12 @@ void Write_SMS_FILE(Mesh * m, char *filename) } } - // extern int DEGRE2; - printf("%d edges\n", Tree_Nbr(AllEdges.AllEdges)); l = Tree2List(m->Curves); for(i = 0; i < List_Nbr(l); i++) { List_Read(l, i, &c); AllEdges.AddTree(c->Simplexes, false); - // if(c->Num > 0 && c->Typ != MSH_SEGM_LINE)AllEdges.AddPoints(c,DEGRE2-1); + // if(c->Num > 0 && c->Typ != MSH_SEGM_LINE) AllEdges.AddPoints(c,DEGRE2-1); } List_Delete(l); printf("%d edges\n", Tree_Nbr(AllEdges.AllEdges)); diff --git a/Mesh/SecondOrder.cpp b/Mesh/SecondOrder.cpp index 9dd177da5e39d653bf6ef32b55970dc1ebe730cf..a52d5ba528e122688ae4dda900eeb3f8f193f01c 100644 --- a/Mesh/SecondOrder.cpp +++ b/Mesh/SecondOrder.cpp @@ -1,4 +1,4 @@ -// $Id: SecondOrder.cpp,v 1.15 2003-06-13 22:41:41 geuzaine Exp $ +// $Id: SecondOrder.cpp,v 1.16 2003-06-14 04:37:42 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -86,7 +86,7 @@ Vertex *middlecurve(Vertex * v1, Vertex * v2) return pv; } -Vertex *middleface(Vertex * v1, Vertex * v2) +Vertex *onsurface(Vertex * v1, Vertex * v2) { Vertex v, *pv; double U, V, U1, U2, V1, V2; @@ -108,9 +108,13 @@ Vertex *middleface(Vertex * v1, Vertex * v2) extern int edges_tetra[6][2]; extern int edges_quad[4][2]; -static Tree_T *THET; extern int EdgesInVolume; +// The following only works for additional nodes are associated with +// the edges of the mesh. If you need a complete second order +// representation, this is thus only valid for simplices (lines, +// triangles, tetrahedra)... + void PutMiddlePoint(void *a, void *b) { Edge *ed; @@ -127,7 +131,7 @@ void PutMiddlePoint(void *a, void *b) else if((v = middlecurve(ed->V[0], ed->V[1]))){ ; } - else if((v = middleface(ed->V[0], ed->V[1]))){ + else if((v = onsurface(ed->V[0], ed->V[1]))){ ; } else{ @@ -140,7 +144,7 @@ void PutMiddlePoint(void *a, void *b) } ed->newv = v; - Tree_Insert(THET, &v); + Tree_Insert(THEM->Vertices, &v); for(i = 0; i < List_Nbr(ed->Simplexes); i++) { List_Read(ed->Simplexes, i, &s); @@ -197,19 +201,23 @@ void Reset_Degre2(){ TreeEdges = Tree_Create(sizeof(Edge), compareedge); } -void Degre2(Tree_T * AllNodes, Tree_T * TreeNodes, Tree_T * TreeElm, - Curve * c, Surface * s) +void Degre2(Tree_T * TreeElm, Curve * c, Surface * s) { THES = s; THEC = c; - THET = TreeNodes; - if(THES || THEC){ + if(THES || THEC){ // 1D or 2D mesh EdgesInVolume = 0; } + // create middle edge vertices for lines, triangles, quadrangles and + // tetrahedra crEdges(TreeElm, TreeEdges); Tree_Action(TreeEdges, PutMiddlePoint); EdgesInVolume = 1; + + // FIXME: do the rest: middle face/volume vertices + hexahedra, + // prisms, pyramids + }