From e3cbf7693391e60ee387bc1fd91d59f97eff4f51 Mon Sep 17 00:00:00 2001 From: Thomas Toulorge <thomas.toulorge@mines-paristech.fr> Date: Tue, 20 Jun 2017 15:37:58 +0200 Subject: [PATCH] Add options in high-order BL fast curving Add different possibilities for curving of outer BL faces. Set default to non-conservative outer BL curving. --- Fltk/highOrderToolsWindow.cpp | 1 + Mesh/HighOrder.cpp | 2 +- contrib/HighOrderMeshOptimizer/OptHomFastCurving.cpp | 8 +++++--- contrib/HighOrderMeshOptimizer/OptHomFastCurving.h | 5 +++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Fltk/highOrderToolsWindow.cpp b/Fltk/highOrderToolsWindow.cpp index 3a49732803..d64c66379b 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 cb15a76c29..3b33fb66c6 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 1845e3e3ee..62336f7c02 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 7b5bdd1404..b709bc08b6 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.) { } -- GitLab