diff --git a/Fltk/highOrderToolsWindow.cpp b/Fltk/highOrderToolsWindow.cpp index 3a49732803aad884f28c39bc403b5d193151a044..d64c66379b212df43d57302e21c3f0716f8b1982 100644 --- a/Fltk/highOrderToolsWindow.cpp +++ b/Fltk/highOrderToolsWindow.cpp @@ -197,6 +197,7 @@ static void highordertools_runopti_cb(Fl_Widget *w, void *data) FastCurvingParameters p; p.onlyVisible = onlyVisible; p.dim = dim; + p.curveOuterBL = FastCurvingParameters::OUTER_CURVE; HighOrderMeshFastCurving(GModel::current(), p); break; } diff --git a/Mesh/HighOrder.cpp b/Mesh/HighOrder.cpp index cb15a76c294211487bc32c8680f6e8fa89a21422..3b33fb66c647dae084b3a8e038967d8e057720e6 100644 --- a/Mesh/HighOrder.cpp +++ b/Mesh/HighOrder.cpp @@ -1661,7 +1661,7 @@ void SetOrderN(GModel *m, int order, bool linear, bool incomplete, bool onlyVisi // Determine mesh dimension and curve BL elements FastCurvingParameters p; p.dim = 0; - // p.curveOuterBL = true; + p.curveOuterBL = FastCurvingParameters::OUTER_CURVE; // p.optimizeGeometry = true; for (GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it) if ((*it)->getNumMeshElements() > 0) { p.dim = 3; break; } diff --git a/contrib/HighOrderMeshOptimizer/OptHomFastCurving.cpp b/contrib/HighOrderMeshOptimizer/OptHomFastCurving.cpp index 1845e3e3ee7bd80eb57f235e990dcddbc4260e64..62336f7c023f4785fe265d3c6ae43b04a7a0d99c 100644 --- a/contrib/HighOrderMeshOptimizer/OptHomFastCurving.cpp +++ b/contrib/HighOrderMeshOptimizer/OptHomFastCurving.cpp @@ -944,15 +944,17 @@ void curveColumn(const FastCurvingParameters &p, GEntity *geomEnt, // Create meta-element MetaEl metaElt(metaElType, order, baseVert, topPrimVert); - // If allowed, curve top face of meta-element while avoiding breaking the element above - if (p.curveOuterBL) { + // If required, curve top face of meta-element + if (p.curveOuterBL != FastCurvingParameters::OUTER_NOCURVE) { MElement* &lastElt = blob.back(); double minJacDet, maxJacDet; double deformMin = 0., qualDeformMin = 1.; double deformMax = 1.; double qualDeformMax = curveAndMeasureAboveEl(metaElt, lastElt, aboveElt, deformMax); - if (qualDeformMax < MINQUAL) { // Max deformation makes element above invalid + // Bisection on displacement to avoid breaking the element above if required + if ((p.curveOuterBL == FastCurvingParameters::OUTER_CURVECONSERVATIVE) && + (qualDeformMax < MINQUAL)) { // Max deformation makes element above invalid for (int iter = 0; iter < MAXITER; iter++) { // Bisection to find max. deformation that makes element above valid const double deformMid = 0.5 * (deformMin + deformMax); const double qualDeformMid = curveAndMeasureAboveEl(metaElt, lastElt, diff --git a/contrib/HighOrderMeshOptimizer/OptHomFastCurving.h b/contrib/HighOrderMeshOptimizer/OptHomFastCurving.h index 7b5bdd140456619e74e266fb6939cb5fb1125e87..b709bc08b663805334b5022c630d767da5589996 100644 --- a/contrib/HighOrderMeshOptimizer/OptHomFastCurving.h +++ b/contrib/HighOrderMeshOptimizer/OptHomFastCurving.h @@ -33,10 +33,11 @@ class GModel; struct FastCurvingParameters { + enum OUTERBLCURVE { OUTER_NOCURVE, OUTER_CURVE, OUTER_CURVECONSERVATIVE }; int dim ; // Spatial dimension of the mesh to curve bool onlyVisible ; // Apply curving to visible entities ONLY? bool optimizeGeometry; // Optimize boundary edges/faces to fit geometry? - bool curveOuterBL; // Curve also the outer surface of the boundary layer? + OUTERBLCURVE curveOuterBL; // Curve also the outer surface of the boundary layer? int maxNumLayers; // Maximum number of layers of elements to curve in BL double maxRho; // Maximum ratio min/max edge/face size for elements to curve in BL double maxAngle; // Maximum angle between layers of elements to curve in BL @@ -44,7 +45,7 @@ struct FastCurvingParameters { FastCurvingParameters () : dim(3), onlyVisible(true), optimizeGeometry(false), - curveOuterBL(false), maxNumLayers(100), maxRho(0.5), + curveOuterBL(OUTER_NOCURVE), maxNumLayers(100), maxRho(0.5), maxAngle(3.1415927*10./180.), maxAngleInner(3.1415927*30./180.) { }