diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index de77aba0836759dd602788cb3dff973b27a59451..95da1e3e5145956fe58fd3d87ef69c9ac7513e42 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.353 2005-04-28 14:53:12 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.354 2005-06-08 19:12:04 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -695,7 +695,7 @@ void file_save_as_cb(CALLBACK_ARGS) {"Gmsh options (*.opt)", _save_options}, {"Gmsh unrolled geometry (*.geo)", _save_geo}, {"Gmsh mesh (*.msh)", _save_msh}, - {"Gmsh characteristic length field (*.pos)", _save_lc}, + {"Gmsh mesh statistics (*.pos)", _save_lc}, {"GREF mesh (*.gref)", _save_gref}, {"I-DEAS universal mesh (*.unv)", _save_unv}, {"PLOT3D formatted ASCII mgrid (*.p3d)", _save_p3d}, diff --git a/Graphics/CreateFile.cpp b/Graphics/CreateFile.cpp index 1ff6c80c899915491a41bbbc33eb86739f9b5946..e40b49c45a49cf228be75a8e4054c6f08f708d81 100644 --- a/Graphics/CreateFile.cpp +++ b/Graphics/CreateFile.cpp @@ -1,4 +1,4 @@ -// $Id: CreateFile.cpp,v 1.68 2005-03-09 02:18:40 geuzaine Exp $ +// $Id: CreateFile.cpp,v 1.69 2005-06-08 19:12:04 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -121,7 +121,7 @@ void CreateOutputFile(char *name, int format) break; case FORMAT_LC: - ExportLcField(&M, name); + ExportMeshStatistics(&M, name); Msg(STATUS2N, "Wrote '%s'", name); break; diff --git a/Mesh/3D_BGMesh.cpp b/Mesh/3D_BGMesh.cpp index 4d1c342adba32d3dc043377048201bf8f2cf351e..6e6d8fb435e9c371c64a403ef93e0dbfa2d48509 100644 --- a/Mesh/3D_BGMesh.cpp +++ b/Mesh/3D_BGMesh.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_BGMesh.cpp,v 1.36 2005-01-01 19:35:30 geuzaine Exp $ +// $Id: 3D_BGMesh.cpp,v 1.37 2005-06-08 19:12:05 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -30,15 +30,15 @@ extern Mesh *THEM; extern Context_T CTX; -static FILE *lcfile = NULL; +static FILE *statfile = NULL; -void ExportLc(void *a, void *b) +void ExportStatistics(void *a, void *b) { Element *ele = *(Element**)a; - if(lcfile) ele->ExportLcField(lcfile); + if(statfile) ele->ExportStatistics(statfile); } -void ExportLcField(Mesh * M, char *filename, int volume, int surface) +void ExportMeshStatistics(Mesh * M, char *filename, int volume, int surface) { if(!Tree_Nbr(M->Volumes) && !Tree_Nbr(M->Surfaces)){ Msg(GERROR, "No volumes or surfaces to save"); @@ -53,45 +53,49 @@ void ExportLcField(Mesh * M, char *filename, int volume, int surface) return; } - lcfile = fopen(filename, "w"); + statfile = fopen(filename, "w"); - if(!lcfile) { + if(!statfile) { Msg(GERROR, "Unable to open file '%s'", filename); return; } if(volume && Tree_Nbr(M->Volumes)){ List_T *l = Tree2List(M->Volumes); - fprintf(lcfile, "View \"Volume LC Field\" {\n"); + fprintf(statfile, "View \"Volume Statistics\" {\n"); + fprintf(statfile, "T2(1.e5,30,%d){\"Characteristic Length\", \"Gamma\", \"Eta\", " + "\"Rho\", \"Element Number\"};\n", (1<<16)|(4<<8)); for(int i = 0; i < List_Nbr(l); i++) { Volume *vol; List_Read(l, i, &vol); - Tree_Action(vol->Simplexes, ExportLc); - Tree_Action(vol->SimplexesBase, ExportLc); - Tree_Action(vol->Hexahedra, ExportLc); - Tree_Action(vol->Prisms, ExportLc); - Tree_Action(vol->Pyramids, ExportLc); + Tree_Action(vol->Simplexes, ExportStatistics); + Tree_Action(vol->SimplexesBase, ExportStatistics); + Tree_Action(vol->Hexahedra, ExportStatistics); + Tree_Action(vol->Prisms, ExportStatistics); + Tree_Action(vol->Pyramids, ExportStatistics); } List_Delete(l); - fprintf(lcfile, "};\n"); + fprintf(statfile, "};\n"); } if(surface && Tree_Nbr(M->Surfaces)){ List_T *l = Tree2List(M->Surfaces); - fprintf(lcfile, "View \"Surface LC Field\" {\n"); + fprintf(statfile, "View \"Surface Statistics\" {\n"); + fprintf(statfile, "T2(1.e5,30,%d){\"Characteristic Length\", \"Gamma\", \"Eta\", " + "\"Rho\", \"Element Number\"};\n", (1<<16)|(4<<8)); for(int i = 0; i < List_Nbr(l); i++) { Surface *surf; List_Read(l, i, &surf); - Tree_Action(surf->Simplexes, ExportLc); - Tree_Action(surf->SimplexesBase, ExportLc); - Tree_Action(surf->Quadrangles, ExportLc); + Tree_Action(surf->Simplexes, ExportStatistics); + Tree_Action(surf->SimplexesBase, ExportStatistics); + Tree_Action(surf->Quadrangles, ExportStatistics); } List_Delete(l); - fprintf(lcfile, "};\n"); + fprintf(statfile, "};\n"); } - fclose(lcfile); - lcfile = NULL; + fclose(statfile); + statfile = NULL; } static Mesh *TMPM = NULL; diff --git a/Mesh/Element.cpp b/Mesh/Element.cpp index 82d381136411d14bf89e450abaf6b84158fb99c2..64a0cd3355e30b2ea7048ef4d3d2eddaad487020 100644 --- a/Mesh/Element.cpp +++ b/Mesh/Element.cpp @@ -1,4 +1,4 @@ -// $Id: Element.cpp,v 1.7 2005-03-30 19:17:07 geuzaine Exp $ +// $Id: Element.cpp,v 1.8 2005-06-08 19:12:05 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -49,6 +49,16 @@ double Element::lij(Vertex *Vi, Vertex *Vj) DSQR(Vi->Pos.Z - Vj->Pos.Z)); } +double Element::RhoShapeMeasure() +{ + double min = minEdge(); + double max = maxEdge(); + if(max) + return min/max; + else + return 0.; +} + // Quads Quadrangle::Quadrangle() @@ -71,21 +81,34 @@ double Quadrangle::maxEdge() return maxlij; } +double Quadrangle::minEdge() +{ + double minlij = 1.e25; + for(int i = 0; i < 4; i++) + minlij = DMIN(minlij, lij(V[edges_quad[i][0]], V[edges_quad[i][1]])); + return minlij; +} + Quadrangle *Create_Quadrangle(Vertex *v1, Vertex *v2, Vertex *v3, Vertex *v4) { return new Quadrangle(v1, v2, v3, v4); } -void Quadrangle::ExportLcField(FILE * f) +void Quadrangle::ExportStatistics(FILE * f) { - if(!VSUP) - fprintf(f, "SQ(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g,%g};\n", + int N; + + if(!VSUP){ + N = 4; + fprintf(f, "SQ(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g,%g", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y, V[1]->Pos.Z, V[2]->Pos.X, V[2]->Pos.Y, V[2]->Pos.Z, V[3]->Pos.X, V[3]->Pos.Y, V[3]->Pos.Z, V[0]->lc, V[1]->lc, V[2]->lc, V[3]->lc); - else + } + else{ + N = 9; fprintf(f, "SQ2(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g," - "%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g,%g,%g,%g,%g,%g,%g};\n", + "%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g,%g,%g,%g,%g,%g,%g", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y, V[1]->Pos.Z, V[2]->Pos.X, V[2]->Pos.Y, V[2]->Pos.Z, V[3]->Pos.X, V[3]->Pos.Y, V[3]->Pos.Z, @@ -94,6 +117,18 @@ void Quadrangle::ExportLcField(FILE * f) VSUP[3]->Pos.Y, VSUP[3]->Pos.Z, VSUP[4]->Pos.X, VSUP[4]->Pos.Y, VSUP[4]->Pos.Z, V[0]->lc, V[1]->lc, V[2]->lc, V[3]->lc, VSUP[0]->lc, VSUP[1]->lc, VSUP[2]->lc, VSUP[3]->lc, VSUP[4]->lc); + } + + double g = 0.; + double e = 0.; + double r = RhoShapeMeasure(); + double n = Num; + for(int i = 0; i < N; i++) fprintf(f, ",%g", g); + for(int i = 0; i < N; i++) fprintf(f, ",%g", e); + for(int i = 0; i < N; i++) fprintf(f, ",%g", r); + for(int i = 0; i < N; i++) fprintf(f, ",%g", n); + + fprintf(f, "};\n"); } void Free_Quadrangle(void *a, void *b) @@ -151,6 +186,14 @@ double Hexahedron::maxEdge() return maxlij; } +double Hexahedron::minEdge() +{ + double minlij = 1.e25; + for(int i = 0; i < 12; i++) + minlij = DMIN(minlij, lij(V[edges_hexa[i][0]], V[edges_hexa[i][1]])); + return minlij; +} + Hexahedron *Create_Hexahedron(Vertex * v1, Vertex * v2, Vertex * v3, Vertex * v4, Vertex * v5, Vertex * v6, Vertex * v7, Vertex * v8) @@ -158,18 +201,23 @@ Hexahedron *Create_Hexahedron(Vertex * v1, Vertex * v2, Vertex * v3, return new Hexahedron(v1, v2, v3, v4, v5, v6, v7, v8); } -void Hexahedron::ExportLcField(FILE * f) +void Hexahedron::ExportStatistics(FILE * f) { - if(!VSUP) + int N; + + if(!VSUP){ + N = 8; fprintf(f,"SH(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g," - "%g,%g,%g,%g,%g,%g){%g,%g,%g,%g,%g,%g,%g,%g};\n", + "%g,%g,%g,%g,%g,%g){%g,%g,%g,%g,%g,%g,%g,%g\n", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y, V[1]->Pos.Z, V[2]->Pos.X, V[2]->Pos.Y, V[2]->Pos.Z, V[3]->Pos.X, V[3]->Pos.Y, V[3]->Pos.Z, V[4]->Pos.X, V[4]->Pos.Y, V[4]->Pos.Z, V[5]->Pos.X, V[5]->Pos.Y, V[5]->Pos.Z, V[6]->Pos.X, V[6]->Pos.Y, V[6]->Pos.Z, V[7]->Pos.X, V[7]->Pos.Y, V[7]->Pos.Z, V[0]->lc, V[1]->lc, V[2]->lc, V[3]->lc, V[4]->lc, V[5]->lc, V[6]->lc, V[7]->lc); + } else{ + N = 27; fprintf(f,"SH2(%g,%g,%g", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z); for(int i = 1; i < 8; i++) fprintf(f,",%g,%g,%g", V[i]->Pos.X, V[i]->Pos.Y, V[i]->Pos.Z); @@ -180,8 +228,18 @@ void Hexahedron::ExportLcField(FILE * f) fprintf(f,",%g", V[i]->lc); for(int i = 0; i < 19; i++) fprintf(f,",%g", VSUP[i]->lc); - fprintf(f,"};\n"); } + + double g = 0.; + double e = 0.; + double r = RhoShapeMeasure(); + double n = Num; + for(int i = 0; i < N; i++) fprintf(f, ",%g", g); + for(int i = 0; i < N; i++) fprintf(f, ",%g", e); + for(int i = 0; i < N; i++) fprintf(f, ",%g", r); + for(int i = 0; i < N; i++) fprintf(f, ",%g", n); + + fprintf(f, "};\n"); } void Free_Hexahedron(void *a, void *b) @@ -239,23 +297,36 @@ double Prism::maxEdge() return maxlij; } +double Prism::minEdge() +{ + double minlij = 1.e25; + for(int i = 0; i < 9; i++) + minlij = DMIN(minlij, lij(V[edges_prism[i][0]], V[edges_prism[i][1]])); + return minlij; +} + Prism *Create_Prism(Vertex * v1, Vertex * v2, Vertex * v3, Vertex * v4, Vertex * v5, Vertex * v6) { return new Prism(v1, v2, v3, v4, v5, v6); } -void Prism::ExportLcField(FILE * f) +void Prism::ExportStatistics(FILE * f) { - if(!VSUP) + int N; + + if(!VSUP){ + N = 6; fprintf(f,"SI(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)" - "{%g,%g,%g,%g,%g,%g};\n", + "{%g,%g,%g,%g,%g,%g", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y, V[1]->Pos.Z, V[2]->Pos.X, V[2]->Pos.Y, V[2]->Pos.Z, V[3]->Pos.X, V[3]->Pos.Y, V[3]->Pos.Z, V[4]->Pos.X, V[4]->Pos.Y, V[4]->Pos.Z, V[5]->Pos.X, V[5]->Pos.Y, V[5]->Pos.Z, V[0]->lc, V[1]->lc, V[2]->lc, V[3]->lc, V[4]->lc, V[5]->lc); + } else{ + N = 18; fprintf(f,"SI2(%g,%g,%g", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z); for(int i = 1; i < 6; i++) fprintf(f,",%g,%g,%g", V[i]->Pos.X, V[i]->Pos.Y, V[i]->Pos.Z); @@ -266,8 +337,18 @@ void Prism::ExportLcField(FILE * f) fprintf(f,",%g", V[i]->lc); for(int i = 0; i < 12; i++) fprintf(f,",%g", VSUP[i]->lc); - fprintf(f,"};\n"); } + + double g = 0.; + double e = 0.; + double r = RhoShapeMeasure(); + double n = Num; + for(int i = 0; i < N; i++) fprintf(f, ",%g", g); + for(int i = 0; i < N; i++) fprintf(f, ",%g", e); + for(int i = 0; i < N; i++) fprintf(f, ",%g", r); + for(int i = 0; i < N; i++) fprintf(f, ",%g", n); + + fprintf(f, "};\n"); } void Free_Prism(void *a, void *b) @@ -323,21 +404,34 @@ double Pyramid::maxEdge() return maxlij; } +double Pyramid::minEdge() +{ + double minlij = 1.e25; + for(int i = 0; i < 8; i++) + minlij = DMIN(minlij, lij(V[edges_pyramid[i][0]], V[edges_pyramid[i][1]])); + return minlij; +} + Pyramid *Create_Pyramid(Vertex * v1, Vertex * v2, Vertex * v3, Vertex * v4, Vertex * v5) { return new Pyramid(v1, v2, v3, v4, v5); } -void Pyramid::ExportLcField(FILE * f) +void Pyramid::ExportStatistics(FILE * f) { - if(!VSUP) + int N; + + if(!VSUP){ + N = 5; fprintf(f,"SY(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g,%g,%g};\n", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y, V[1]->Pos.Z, V[2]->Pos.X, V[2]->Pos.Y, V[2]->Pos.Z, V[3]->Pos.X, V[3]->Pos.Y, V[3]->Pos.Z, V[4]->Pos.X, V[4]->Pos.Y, V[4]->Pos.Z, V[0]->lc, V[1]->lc, V[2]->lc, V[3]->lc, V[4]->lc); + } else{ + N = 14; fprintf(f,"SY2(%g,%g,%g", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z); for(int i = 1; i < 5; i++) fprintf(f,",%g,%g,%g", V[i]->Pos.X, V[i]->Pos.Y, V[i]->Pos.Z); @@ -348,8 +442,18 @@ void Pyramid::ExportLcField(FILE * f) fprintf(f,",%g", V[i]->lc); for(int i = 0; i < 9; i++) fprintf(f,",%g", VSUP[i]->lc); - fprintf(f,"};\n"); } + + double g = 0.; + double e = 0.; + double r = RhoShapeMeasure(); + double n = Num; + for(int i = 0; i < N; i++) fprintf(f, ",%g", g); + for(int i = 0; i < N; i++) fprintf(f, ",%g", e); + for(int i = 0; i < N; i++) fprintf(f, ",%g", r); + for(int i = 0; i < N; i++) fprintf(f, ",%g", n); + + fprintf(f, "};\n"); } void Free_Pyramid(void *a, void *b) diff --git a/Mesh/Element.h b/Mesh/Element.h index 076b288d7da5750c958914af30ec5a3f6752ade2..387da33950b9b3062fc6ffd8dae004017e61f080 100644 --- a/Mesh/Element.h +++ b/Mesh/Element.h @@ -34,7 +34,9 @@ class Element { virtual ~Element(); double lij(Vertex *Vi, Vertex *Vj); virtual double maxEdge() = 0; - virtual void ExportLcField(FILE *f) = 0; + virtual double minEdge() = 0; + double RhoShapeMeasure(); + virtual void ExportStatistics(FILE *f) = 0; }; class Quadrangle : public Element{ @@ -44,7 +46,8 @@ class Quadrangle : public Element{ Quadrangle(Vertex *v1, Vertex *v2, Vertex *v3, Vertex *v4); ~Quadrangle() {} double maxEdge(); - void ExportLcField(FILE *f); + double minEdge(); + void ExportStatistics(FILE *f); }; class Hexahedron : public Element{ @@ -56,7 +59,8 @@ class Hexahedron : public Element{ ~Hexahedron() {} double Orientation(); double maxEdge(); - void ExportLcField(FILE *f); + double minEdge(); + void ExportStatistics(FILE *f); }; class Prism : public Element{ @@ -68,7 +72,8 @@ class Prism : public Element{ ~Prism() {} double Orientation(); double maxEdge(); - void ExportLcField(FILE *f); + double minEdge(); + void ExportStatistics(FILE *f); }; class Pyramid : public Element{ @@ -79,7 +84,8 @@ class Pyramid : public Element{ ~Pyramid() {} double Orientation(); double maxEdge(); - void ExportLcField(FILE *f); + double minEdge(); + void ExportStatistics(FILE *f); }; // C interface diff --git a/Mesh/Mesh.h b/Mesh/Mesh.h index b5f19768bba964445e5f771286e19a32e959d3ad..7b76dd8041a3739e865d4624678997a8b745ee5b 100644 --- a/Mesh/Mesh.h +++ b/Mesh/Mesh.h @@ -494,7 +494,7 @@ int Recombine(Tree_T *TreeAllVert, Tree_T *TreeAllSimp, Tree_T *TreeAllQuad, double a); int Recombine_All(Mesh *M); void ApplyLcFactor(Mesh *M); -void ExportLcField(Mesh *M, char *filename, int volume=1, int surface=1); +void ExportMeshStatistics(Mesh *M, char *filename, int volume=1, int surface=1); void Degre1(); void Degre2(int dim); diff --git a/Mesh/Simplex.cpp b/Mesh/Simplex.cpp index 295569a1660cce28e25b278e8fd55531369d82dc..88cd8222f8fdc2669401f13bda71a0ef1ddff286 100644 --- a/Mesh/Simplex.cpp +++ b/Mesh/Simplex.cpp @@ -1,4 +1,4 @@ -// $Id: Simplex.cpp,v 1.41 2005-05-16 00:50:10 geuzaine Exp $ +// $Id: Simplex.cpp,v 1.42 2005-06-08 19:12:05 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -172,45 +172,40 @@ double SimplexBase::maxEdge() return maxlij; } +double SimplexBase::minEdge() +{ + double minlij = 1.e25; + int N = V[3] ? 6 : 3; + + if(V[3] || V[2]) + for(int i = 0; i < N; i++) + minlij = DMIN(minlij, lij(V[edges_tetra[i][0]], V[edges_tetra[i][1]])); + else if(V[1]) + minlij = lij(V[0], V[1]); + + return minlij; +} + double SimplexBase::EtaShapeMeasure() { - int i, j; + if(!V[3]) return 0.; + double lij2 = 0.0; - for(i = 0; i <= 3; i++) { - for(j = i + 1; j <= 3; j++) { + for(int i = 0; i <= 3; i++) { + for(int j = i + 1; j <= 3; j++) { lij2 += DSQR(lij(V[i], V[j])); } } return 12. * pow(9. / 10. * DSQR(fabs(Volume_Simplexe())), 1./3.) / (lij2); } -double SimplexBase::RhoShapeMeasure() -{ - int i, j; - double minlij = 1.e25, maxlij = 0.0; - for(i = 0; i <= 3; i++) { - for(j = i + 1; j <= 3; j++) { - if(i != j) { - minlij = DMIN(minlij, fabs(lij(V[i], V[j]))); - maxlij = DMAX(maxlij, fabs(lij(V[i], V[j]))); - } - } - } - return minlij / maxlij; -} - double SimplexBase::GammaShapeMeasure() { - int i, j, N; - double maxlij = 0.0; + if(!V[3]) return 0.; - if(V[3]) - N = 4; - else - N = 3; - - for(i = 0; i <= N - 1; i++) { - for(j = i + 1; j <= N - 1; j++) { + double maxlij = 0.0; + for(int i = 0; i <= 3; i++) { + for(int j = i + 1; j <= 3; j++) { if(i != j) maxlij = DMAX(maxlij, lij(V[i], V[j])); } @@ -218,43 +213,56 @@ double SimplexBase::GammaShapeMeasure() return 12. * rhoin() / (sqrt(6.) * maxlij); } -void SimplexBase::ExportLcField(FILE * f) +void SimplexBase::ExportStatistics(FILE * f) { + int N; + if(!V[2]){ - if(!VSUP) - fprintf(f, "SL(%g,%g,%g,%g,%g,%g){%g,%g};\n", + if(!VSUP){ + N = 2; + fprintf(f, "SL(%g,%g,%g,%g,%g,%g){%g,%g", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y, V[1]->Pos.Z, V[0]->lc, V[1]->lc); - else - fprintf(f, "SL2(%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g};\n", + } + else{ + N = 3; + fprintf(f, "SL2(%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y, V[1]->Pos.Z, VSUP[0]->Pos.X, VSUP[0]->Pos.Y, VSUP[0]->Pos.Z, V[0]->lc, V[1]->lc, VSUP[0]->lc); + } } else if(!V[3]){ - if(!VSUP) - fprintf(f, "ST(%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g};\n", + if(!VSUP){ + N = 3; + fprintf(f, "ST(%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y, V[1]->Pos.Z, V[2]->Pos.X, V[2]->Pos.Y, V[2]->Pos.Z, V[0]->lc, V[1]->lc, V[2]->lc); - else + } + else{ + N = 6; fprintf(f, "ST2(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)" - "{%g,%g,%g,%g,%g,%g};\n", + "{%g,%g,%g,%g,%g,%g", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y, V[1]->Pos.Z, V[2]->Pos.X, V[2]->Pos.Y, V[2]->Pos.Z, VSUP[0]->Pos.X, VSUP[0]->Pos.Y, VSUP[0]->Pos.Z, VSUP[1]->Pos.X, VSUP[1]->Pos.Y, VSUP[1]->Pos.Z, VSUP[2]->Pos.X, VSUP[2]->Pos.Y, VSUP[2]->Pos.Z, V[0]->lc, V[1]->lc, V[2]->lc, VSUP[0]->lc, VSUP[1]->lc, VSUP[2]->lc); + } } else{ - if(!VSUP) - fprintf(f, "SS(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g,%g};\n", + if(!VSUP){ + N = 4; + fprintf(f, "SS(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g,%g", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y, V[1]->Pos.Z, V[2]->Pos.X, V[2]->Pos.Y, V[2]->Pos.Z, V[3]->Pos.X, V[3]->Pos.Y, V[3]->Pos.Z, V[0]->lc, V[1]->lc, V[2]->lc, V[3]->lc); - else + } + else{ + N = 10; fprintf(f, "SS2(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g," - "%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g,%g,%g,%g,%g,%g,%g,%g};\n", + "%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g,%g,%g,%g,%g,%g,%g,%g", V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y, V[1]->Pos.Z, V[2]->Pos.X, V[2]->Pos.Y, V[2]->Pos.Z, V[3]->Pos.X, V[3]->Pos.Y, V[3]->Pos.Z, VSUP[0]->Pos.X, VSUP[0]->Pos.Y, VSUP[0]->Pos.Z, @@ -264,7 +272,19 @@ void SimplexBase::ExportLcField(FILE * f) VSUP[5]->Pos.X, VSUP[5]->Pos.Y, VSUP[5]->Pos.Z, V[0]->lc, V[1]->lc, V[2]->lc, V[3]->lc, VSUP[0]->lc, VSUP[1]->lc, VSUP[2]->lc, VSUP[3]->lc, VSUP[4]->lc, VSUP[5]->lc); + } } + + double g = GammaShapeMeasure(); + double e = EtaShapeMeasure(); + double r = RhoShapeMeasure(); + double n = Num; + for(int i = 0; i < N; i++) fprintf(f, ",%g", g); + for(int i = 0; i < N; i++) fprintf(f, ",%g", e); + for(int i = 0; i < N; i++) fprintf(f, ",%g", r); + for(int i = 0; i < N; i++) fprintf(f, ",%g", n); + + fprintf(f, "};\n"); } SimplexBase *Create_SimplexBase(Vertex * v1, Vertex * v2, Vertex * v3, Vertex * v4) diff --git a/Mesh/Simplex.h b/Mesh/Simplex.h index bbf3cb537c20b32dadb3057a60da106210a1c8e1..c6db93b2ff134803af6daff05d97a62e6ecef74d 100644 --- a/Mesh/Simplex.h +++ b/Mesh/Simplex.h @@ -38,11 +38,11 @@ class SimplexBase : public Element { double AireFace(Vertex *V[3]); double surfsimpl(); double GammaShapeMeasure(); - double RhoShapeMeasure(); double EtaShapeMeasure(); double rhoin(); double maxEdge(); - void ExportLcField(FILE *f); + double minEdge(); + void ExportStatistics(FILE *f); }; SimplexBase *Create_SimplexBase(Vertex *v1, Vertex *v2, Vertex *v3, Vertex *v4); diff --git a/doc/FAQ b/doc/FAQ index bf5589d977ab7a0b44644e22493508ce4872e546..9c6dfa80afc01f22c02213683e720ec4c999c0e1 100644 --- a/doc/FAQ +++ b/doc/FAQ @@ -1,4 +1,4 @@ -$Id: FAQ,v 1.62 2005-06-04 03:28:31 geuzaine Exp $ +$Id: FAQ,v 1.63 2005-06-08 19:12:05 geuzaine Exp $ This is the Gmsh FAQ @@ -289,10 +289,11 @@ Tools->Statistics? They measure the quality of the tetrahedra in a mesh: rho ~ min_edge_length / max_edge_length -eta ~ volume^(2/3) / sum_edge_length2 +eta ~ volume^(2/3) / sum_edge_length^2 gamma ~ volume / sum_face_area / max_edge_length -For the exact definitions, look at Mesh/Simplex.cpp. +For the exact definitions, look at Mesh/Element.cpp and +Mesh/Simplex.cpp. ******************************************************************** diff --git a/doc/VERSIONS b/doc/VERSIONS index 23ced5c4535bc8250e6c46c830995acc1ca5dfce..88da8e8fd5e5710079b5c31a8626437461702ec0 100644 --- a/doc/VERSIONS +++ b/doc/VERSIONS @@ -1,4 +1,4 @@ -$Id: VERSIONS,v 1.331 2005-06-06 23:16:07 geuzaine Exp $ +$Id: VERSIONS,v 1.332 2005-06-08 19:12:05 geuzaine Exp $ New since 1.60: added support for second order (curved) elements in post-processor; new version (1.4) of post-processing file formats; new @@ -10,7 +10,7 @@ loading and drawing of line meshes and 2D iso views; optimize handling of meshes with large number of physical entities; Removed Discrete Line and Discrete Surface commands: the same functionnality can now be obtained by simply loading meshes in the usual formats; fixed coloring -by mesh partition; +by mesh partition; new "mesh statistics" export format; New in 1.60: added support for discrete curves; new Window menu on Mac OS X; generalized all octree-based plugins (CutGrid, StreamLines,