From a94d55e3a0340f69e1ea560e70b697c1a7426525 Mon Sep 17 00:00:00 2001 From: Emilie Marchandise <emilie.marchandise@uclouvain.be> Date: Thu, 6 Oct 2011 14:34:56 +0000 Subject: [PATCH] --- Geo/GFace.cpp | 3 ++- Geo/GFaceCompound.cpp | 9 +++++---- Geo/discreteFace.cpp | 1 + Mesh/BDS.cpp | 2 +- Mesh/meshGFace.cpp | 9 +++++---- benchmarks/testsuite/cone.geo | 14 ++++++++++++++ 6 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 benchmarks/testsuite/cone.geo diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp index 086054a42c..97645751ea 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 f5c0b72b14..dcfef1ad22 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 49701ef0a7..ef5f80f388 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 11cf3c3718..19fc0c1c0b 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 f747fe2ee1..76a6c52ca7 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 0000000000..3fd47a5bef --- /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 -- GitLab