diff --git a/Geo/GFaceCompound.cpp b/Geo/GFaceCompound.cpp index 300bba8c1d82d6b41caeae8dc7ea189821db2c8f..cc843299dd2e32747e23c9882493c0f5cf524e9b 100644 --- a/Geo/GFaceCompound.cpp +++ b/Geo/GFaceCompound.cpp @@ -531,10 +531,11 @@ bool GFaceCompound::parametrize() const buildOct(); } - if (checkAspectRatio() > AR_MAX){ - Msg::Warning("Geometrical aspect ratio too high"); - exit(1); - paramOK = false; + double AR = checkAspectRatio(); + if (floor(AR) > AR_MAX){ + Msg::Warning("Geometrical aspect ratio too high %d ", AR); + //exit(1); + paramOK = true; //false; } return paramOK; @@ -1806,9 +1807,9 @@ bool GFaceCompound::checkTopology() const double H = getSizeH(); double D = H; if (_interior_loops.size() > 0) D = getSizeBB(_U0); - int AR = (int) checkAspectRatio(); - //int AR2 = (int) ceil(H/D); - //int AR = std::min(AR, AR2); + int AR1 = (int) checkAspectRatio(); + int AR2 = (int) ceil(H/D); + int AR = std::min(AR1, AR2); if (G != 0 || Nb < 1){ correctTopo = false; diff --git a/Geo/GFaceCompound.h b/Geo/GFaceCompound.h index 1314e92ca89806d659aa6545274e400b473d393d..73ce7eacf7478254908b68019bb18dd5426ce4b1 100644 --- a/Geo/GFaceCompound.h +++ b/Geo/GFaceCompound.h @@ -19,7 +19,7 @@ #include "meshGFaceOptimize.h" #include "linearSystem.h" -#define AR_MAX 5 //maximal geometrical spacte ratio +#define AR_MAX 5 //maximal geometrical aspect ratio /* A GFaceCompound is a model face that is the compound of model faces. diff --git a/Geo/discreteEdge.cpp b/Geo/discreteEdge.cpp index bda5879bec5a2acc27378acfea605c560147d248..bcba5b0c134b0c9952d2db4651778236df37b396 100644 --- a/Geo/discreteEdge.cpp +++ b/Geo/discreteEdge.cpp @@ -296,9 +296,7 @@ void discreteEdge::parametrize( std::map<GFace*, std::map<MVertex*, MVertex*, s } } - //computeNormals(); - - } +} void discreteEdge::computeNormals () const { @@ -383,6 +381,9 @@ GPoint discreteEdge::point(double par) const } else{ //curved PN triangle + + if (_normals.empty() ) computeNormals(); + const SVector3 n1 = _normals[vB]; const SVector3 n2 = _normals[vE]; diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index e15e9ba3867de80b5baad22e838bb49746ea878f..e9fd4023b81b7ebe92b37ee36d061271ee963b89 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -1487,7 +1487,7 @@ void partitionAndRemesh(GFaceCompound *gf) Msg::Info("*** Mesh of surface %d done by assembly remeshed faces", gf->tag()); Msg::Info("-----------------------------------------------------------"); - gf->coherenceNormals(); + //gf->coherenceNormals(); gf->meshStatistics.status = GFace::DONE; //CreateOutputFile("toto.msh", CTX::instance()->mesh.format); diff --git a/Mesh/multiscalePartition.cpp b/Mesh/multiscalePartition.cpp index 4767606e9e524897010cb050b3d90e550a0dd5cb..0ea08b12a286b9031bd69ce109e3fc1dd8bc3ded 100644 --- a/Mesh/multiscalePartition.cpp +++ b/Mesh/multiscalePartition.cpp @@ -212,7 +212,7 @@ static int getAspectRatio(std::vector<MElement *> &elements, } int AR2 = (int)ceil(H/D); - return std::min(AR, AR2); + return std::max(AR, AR2); } static void getGenusAndRatio(std::vector<MElement *> &elements, int & genus, int &AR, int &NB) diff --git a/Solver/multiscaleLaplace.cpp b/Solver/multiscaleLaplace.cpp index a3e871fc9a99ed173b5b3808572fe5b2994a48a4..60575ca8d5e463d7e684dcd3031fc4bd445057de 100644 --- a/Solver/multiscaleLaplace.cpp +++ b/Solver/multiscaleLaplace.cpp @@ -1076,6 +1076,9 @@ void multiscaleLaplace::cut (std::vector<MElement *> &elements) std::vector<MElement*> left,right; recur_cut_ (1.0, M_PI, 0.0, root,left,right); + if ( elements.size() != left.size()+right.size()) + Msg::Error("Cutting laplace wrong nb elements (%d) != left + right (%d)", elements.size(), left.size()+right.size()); + connected_left_right(left, right); if ( elements.size() != left.size()+right.size()) {