diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp index 086054a42c0402c2ef0ecf64a0dc44a4161526b1..97645751eaa5c594a8772b6874fb59fafc66dee7 100644 --- a/Geo/GFace.cpp +++ b/Geo/GFace.cpp @@ -623,6 +623,7 @@ void GFace::getMeanPlaneData(double plan[3][3]) const double GFace::curvatureDiv(const SPoint2 ¶m) const { + if (geomType() == Plane) return 0; // X=X(u,v) Y=Y(u,v) Z=Z(u,v) @@ -687,7 +688,6 @@ double GFace::curvatureMax(const SPoint2 ¶m) const double GFace::curvatures(const SPoint2 ¶m, SVector3 *dirMax, SVector3 *dirMin, double *curvMax, double *curvMin) const { - printf("in curv face \n"); Pair<SVector3, SVector3> D1 = firstDer(param); if(geomType() == Plane){ @@ -729,6 +729,7 @@ double GFace::getMetricEigenvalue(const SPoint2 &) void GFace::getMetricEigenVectors(const SPoint2 ¶m, double eigVal[2], double eigVec[4]) const { + // first derivatives Pair<SVector3,SVector3> D1 = firstDer(param); SVector3 du = D1.first(); diff --git a/Geo/GFaceCompound.cpp b/Geo/GFaceCompound.cpp index f5c0b72b1439371c619632155e552406e1b53dd1..dcfef1ad2213a9050bbe9570763b8df3d162df5e 100644 --- a/Geo/GFaceCompound.cpp +++ b/Geo/GFaceCompound.cpp @@ -452,9 +452,10 @@ bool GFaceCompound::trivial() const { if(_compound.size() == 1 && (*(_compound.begin()))->getNativeType() == GEntity::OpenCascadeModel && - (*(_compound.begin()))->geomType() != GEntity::DiscreteSurface){ + (*(_compound.begin()))->geomType() != GEntity::DiscreteSurface && + _mapping != CONFORMAL){ if ((*(_compound.begin()))->periodic(0) || - (*(_compound.begin()))->periodic(1) )return false; + (*(_compound.begin()))->periodic(1) ) return false; return true; } return false; @@ -1605,9 +1606,9 @@ Pair<SVector3,SVector3> GFaceCompound::firstDer(const SPoint2 ¶m) const void GFaceCompound::secondDer(const SPoint2 ¶m, SVector3 *dudu, SVector3 *dvdv, SVector3 *dudv) const { - if(!oct) parametrize(); - Msg::Fatal("Computation of the second derivatives is not implemented for compound faces"); + //leave debug here (since outputScalarField calls curvatureDiv) + Msg::Debug("Computation of the second derivatives is not implemented for compound faces"); } diff --git a/Geo/discreteFace.cpp b/Geo/discreteFace.cpp index 49701ef0a7b58707a8dc1b098260cd1e19b77a9a..ef5f80f3888b923fecf62234e7b793efb237b753 100644 --- a/Geo/discreteFace.cpp +++ b/Geo/discreteFace.cpp @@ -128,6 +128,7 @@ Pair<SVector3, SVector3> discreteFace::firstDer(const SPoint2 ¶m) const void discreteFace::secondDer(const SPoint2 ¶m, SVector3 *dudu, SVector3 *dvdv, SVector3 *dudv) const { + if (getCompound()){ return getCompound()->secondDer(param, dudu, dvdv, dudv); } diff --git a/Mesh/BDS.cpp b/Mesh/BDS.cpp index 11cf3c3718b19bc431f22bbbef2c579660a7e6dd..19fc0c1c0b09656457e222073119db577397dd79 100644 --- a/Mesh/BDS.cpp +++ b/Mesh/BDS.cpp @@ -15,7 +15,7 @@ void outputScalarField(std::list<BDS_Face*> t, const char *iii, int param, GFace *gf) { - FILE *f = fopen(iii, "w"); + FILE *f = fopen(iii, "w"); if(!f) return; fprintf(f, "View \"scalar\" {\n"); std::list<BDS_Face*>::iterator tit = t.begin(); diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index f747fe2ee10f502a3b1377f4a41ec10782eb60de..76a6c52ca7ea74ccc3aef47ba91c7d166b6cddba 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -888,8 +888,9 @@ static bool meshGenerator(GFace *gf, int RECUR_ITER, if(algoDelaunay2D(gf) && !onlyInitialMesh){ if(CTX::instance()->mesh.algo2d == ALGO_2D_FRONTAL) bowyerWatsonFrontal(gf); - else if(CTX::instance()->mesh.algo2d == ALGO_2D_FRONTAL_QUAD) + else if(CTX::instance()->mesh.algo2d == ALGO_2D_FRONTAL_QUAD){ bowyerWatsonFrontalLayers(gf,true); + } else if(CTX::instance()->mesh.algo2d == ALGO_2D_DELAUNAY || CTX::instance()->mesh.algo2d == ALGO_2D_AUTO) bowyerWatson(gf); @@ -1412,7 +1413,7 @@ static bool meshGeneratorPeriodic(GFace *gf, bool debug = true) outputScalarField(m->triangles, name, 1); } - // start mesh generation + // start mesh generation for periodic face if(!algoDelaunay2D(gf)){ refineMeshBDS(gf, *m, CTX::instance()->mesh.refineSteps, true); optimizeMeshBDS(gf, *m, 2); @@ -1513,7 +1514,7 @@ void deMeshGFace::operator() (GFace *gf) } // for debugging, change value from -1 to -100; -int debugSurface = -1; +int debugSurface = -100 ; //-1; void meshGFace::operator() (GFace *gf) { @@ -1582,7 +1583,7 @@ void meshGFace::operator() (GFace *gf) else { if(!meshGeneratorPeriodic (gf, debugSurface >= 0 || debugSurface == -100)) - Msg::Error("Impossible to mesh face %d", gf->tag()); + Msg::Error("Impossible to mesh periodic face %d", gf->tag()); } Msg::Debug("Type %d %d triangles generated, %d internal vertices", diff --git a/benchmarks/testsuite/cone.geo b/benchmarks/testsuite/cone.geo new file mode 100644 index 0000000000000000000000000000000000000000..3fd47a5befa612320a8d3737d27e00e9a8848a7d --- /dev/null +++ b/benchmarks/testsuite/cone.geo @@ -0,0 +1,14 @@ + +//BLOSSOM_QUAD +Mesh.Algorithm = 8; //delquad +Mesh.RecombinationAlgorithm=1;//blossom + +//REPARAM +//Mesh.RemeshParametrization=1; //(0) harmonic (1) conformal +//Mesh.RemeshAlgorithm=0; //(0) nosplit (1) automatic (2) split metis + +Mesh.CharacteristicLengthFactor=0.08; + +Merge "Cone_1.brep"; + +Recombine Surface{1}; \ No newline at end of file