From d4c68c17b01ae87e359b75a44964ec5fe9ab44cd Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sun, 3 Dec 2006 00:04:31 +0000 Subject: [PATCH] - revert convergence check on xyz error in xyz2uv: just issue a warning - remove computation of mean plane during meshing: it's not used anymore (we only use the mean plane for plane Gmsh surfacesm and it is already computed correctly in the gmshFace constructor) --- Geo/GFace.cpp | 18 ++++++++++-------- Geo/gmshFace.cpp | 4 +--- Mesh/meshGFace.cpp | 14 +++----------- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp index f1b6f650c7..7c1d108e5a 100644 --- a/Geo/GFace.cpp +++ b/Geo/GFace.cpp @@ -1,4 +1,4 @@ -// $Id: GFace.cpp,v 1.23 2006-11-27 22:22:13 geuzaine Exp $ +// $Id: GFace.cpp,v 1.24 2006-12-03 00:04:31 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -24,6 +24,7 @@ #include "GEdge.h" #include "Message.h" #include "Numeric.h" +#include "Context.h" #if defined(HAVE_GSL) #include <gsl/gsl_vector.h> @@ -34,6 +35,8 @@ void dsvdcmp(double **a, int m, int n, double w[], double **v); #endif +extern Context_T CTX; + GFace::GFace(GModel *model, int tag) : GEntity(model, tag), r1(0), r2(0) { meshAttributes.recombine = 0; @@ -403,7 +406,7 @@ void GFace::XYZtoUV(const double X, const double Y, const double Z, const int MaxIter = 25; const int NumInitGuess = 11; - double Unew = 0., Vnew = 0., err,err2; + double Unew = 0., Vnew = 0., err, err_xyz; int iter; double mat[3][3], jac[3][3]; double umin, umax, vmin, vmax; @@ -446,19 +449,18 @@ void GFace::XYZtoUV(const double X, const double Y, const double Z, jac[2][1] * (Z - P.z())); err = DSQR(Unew - U) + DSQR(Vnew - V); - // A BETTER TEST !! (JFR/AUG 2006) - err2 = DSQR(X - P.x()) + DSQR(Y - P.y()) + DSQR(Z - P.z()); + err_xyz = DSQR(X - P.x()) + DSQR(Y - P.y()) + DSQR(Z - P.z()); iter++; U = Unew; V = Vnew; } - - if(iter < MaxIter && err <= Precision && err2 <= 1.e-5 && + if(iter < MaxIter && err <= Precision && Unew <= umax && Vnew <= vmax && Unew >= umin && Vnew >= vmin){ - if (err2 > Precision) - Msg(WARNING,"converged for i=%d j=%d (err=%g iter=%d) BUT err2 = %g", i, j, err, iter,err2); + if(err_xyz > 1.e-5) + Msg(WARNING,"converged for i=%d j=%d (err=%g iter=%d), but err_xyz = %g", + i, j, err, iter, err_xyz); return; } } diff --git a/Geo/gmshFace.cpp b/Geo/gmshFace.cpp index be1d978562..868519bea2 100644 --- a/Geo/gmshFace.cpp +++ b/Geo/gmshFace.cpp @@ -1,4 +1,4 @@ -// $Id: gmshFace.cpp,v 1.26 2006-11-29 16:57:01 remacle Exp $ +// $Id: gmshFace.cpp,v 1.27 2006-12-03 00:04:31 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -161,7 +161,6 @@ GPoint gmshFace::point(double par1, double par2) const if(s->Typ == MSH_SURF_PLAN){ double x, y, z, VX[3], VY[3]; getMeanPlaneData(VX, VY, x, y, z); - return GPoint(x + VX[0] * par1 + VY[0] * par2, y + VX[1] * par1 + VY[1] * par2, z + VX[2] * par1 + VY[2] * par2, this, pp); @@ -207,7 +206,6 @@ SPoint2 gmshFace::parFromPoint(const SPoint3 &qp) const return SPoint2(u, v); } else{ - // XYZtoUV(s, qp.x(), qp.y(), qp.z(), &u, &v, 1.0); return GFace::parFromPoint(qp); } } diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index e051dabc77..bde0721acb 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -1,4 +1,4 @@ -// $Id: meshGFace.cpp,v 1.36 2006-11-30 13:55:20 geuzaine Exp $ +// $Id: meshGFace.cpp,v 1.37 2006-12-03 00:04:31 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -1337,20 +1337,12 @@ void meshGFace :: operator() (GFace *gf) std::vector<MVertex*> points; std::vector<int> indices; - // compute loops on the fly -// indices indicate start and end points of a loop - // loops are not yet oriented + // compute loops on the fly (indices indicate start and end points + // of a loop; loops are not yet oriented) Msg(DEBUG1, "Computing edge loops"); computeEdgeLoops(gf, points, indices); - Msg(DEBUG1, "Computing mean plane"); - - - - // compute the mean plane, this is sometimes useful - gf->computeMeanPlane(points); Msg(DEBUG1, "Generating the mesh"); - // temp fix until we create MEdgeLoops in gmshFace: if(gf->getNativeType() == GEntity::GmshModel || gf->edgeLoops.empty()) gmsh2DMeshGenerator ( gf ) ; -- GitLab