From fdaaf1a87ce8cd18e7a49dffd09270b130844de5 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 14 Jul 2004 22:53:50 +0000 Subject: [PATCH] add an area constraint on the elements in the initial mesh to make the refinement nicer --- Mesh/2D_Mesh_Triangle.cpp | 18 +++++++++--------- benchmarks/misc/bgmesh/proj.geo | 4 +--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Mesh/2D_Mesh_Triangle.cpp b/Mesh/2D_Mesh_Triangle.cpp index 408cdbeb1d..0c0ba1795e 100644 --- a/Mesh/2D_Mesh_Triangle.cpp +++ b/Mesh/2D_Mesh_Triangle.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Mesh_Triangle.cpp,v 1.10 2004-07-14 22:42:26 geuzaine Exp $ +// $Id: 2D_Mesh_Triangle.cpp,v 1.11 2004-07-14 22:53:50 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -182,16 +182,16 @@ int Mesh_Triangle(Surface * s) mid.edgemarkerlist = NULL; // triangulate the points with minimum angle > 20 deg, with no - // boundary breaking, - - // TODO: - // and with an area constraint related to the + // boundary breaking, and with an area constraint related to the // maximum char. length allowed (this last constraint is to avoid an // extremely coarse initial grid, on which the interpolation of the // final char. lengths would be awful). - //sprintf(opts, "pqzYa%e", lc_max*lc_max/2.); - strcpy(opts, "pqzY"); + double a = lc_max*lc_max / 1.2; // FIXME: bof + if(a > 1.e-6) + sprintf(opts, "pqzYa%f", a); + else + strcpy(opts, "pqzY"); if(CTX.verbosity < 4) strcat(opts, "Q"); triangulate(opts, &in, &mid, NULL); @@ -226,7 +226,7 @@ int Mesh_Triangle(Surface * s) Calcule_Z_Plan(&v, &dum); Projette_Inverse(&v, &dum); val = Lc_XYZ(v->Pos.X, v->Pos.Y, v->Pos.Z, THEM); - val = val * val / 1.2; + val = val * val / 1.2; // FIXME: bof Free_Vertex(&v, 0); } else { @@ -236,7 +236,7 @@ int Mesh_Triangle(Surface * s) val += mid.pointattributelist[k]; } val /= mid.numberofcorners; - val = val * val / 1.5; + val = val * val / 1.5; // FIXME: bof } mid.trianglearealist[i] = val; } diff --git a/benchmarks/misc/bgmesh/proj.geo b/benchmarks/misc/bgmesh/proj.geo index 31caeecb4e..a73b221626 100644 --- a/benchmarks/misc/bgmesh/proj.geo +++ b/benchmarks/misc/bgmesh/proj.geo @@ -9,6 +9,4 @@ Line(4) = {1,4}; Line Loop(5) = {2,3,4,1}; Plane Surface(6) = {5}; Extrude Surface { 6, {0,0.0,1} }; -Surface Loop(29) = {23,6,15,19,28,27}; -Volume(30) = {29}; -Physical Volume(1) = {30}; +Physical Volume(1) = {1}; -- GitLab