diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp index 441725dc4eaf3647e23135a842b487621829045e..a696b8cfd0ed739f100e273ef34fc365387d0228 100644 --- a/Common/OpenFile.cpp +++ b/Common/OpenFile.cpp @@ -348,7 +348,9 @@ int MergeFile(std::string fileName, bool warnIfMissing) if(status > 1) status = PView::readMSH(fileName); #endif if(CTX::instance()->mesh.order > 1) - SetOrderN(GModel::current(), CTX::instance()->mesh.order, false, false); + SetOrderN(GModel::current(), CTX::instance()->mesh.order, + CTX::instance()->mesh.secondOrderLinear, + CTX::instance()->mesh.secondOrderIncomplete); } #if !defined(HAVE_NO_POST) else if(!strncmp(header, "$PostFormat", 11) || diff --git a/Geo/GEdge.cpp b/Geo/GEdge.cpp index 0f96fc49a05f1733654120753fc4aee5bbb75038..dcec6e589753471193e77bf86adf4361684a3137 100644 --- a/Geo/GEdge.cpp +++ b/Geo/GEdge.cpp @@ -5,7 +5,6 @@ #include <sstream> #include <algorithm> -#include <limits> #include "GmshConfig.h" #include "GmshDefines.h" @@ -199,22 +198,19 @@ GPoint GEdge::closestPoint(const SPoint3 & q,double& t) const Range<double> interval = parBounds(0); - double tMin = std::min(interval.high(),interval.low()); - double tMax = std::max(interval.high(),interval.low()); + double tMin = std::min(interval.high(), interval.low()); + double tMax = std::max(interval.high(), interval.low()); double relax = 1.; - double dt,dt0,t0; + double dt, dt0, t0; int nb = 10; t = (tMin + tMax) * 0.5; while (relax > 0.1) { - int i = 0; - - t = 0.5 * (tMin + tMax); - dt0 = tMax - tMin; - dt = dt0; - + t = 0.5 * (tMin + tMax); + dt0 = tMax - tMin; + dt = dt0; while (dt > tolerance * dt0 && i++ < nb) { t0 = t; dt0 = dt; diff --git a/Geo/GEdge.h b/Geo/GEdge.h index 444847c557e343ff4b9dcb01e58e042ebaaf0674..3dbbefb2b5662697cd8439eeadca69f28cfd65a8 100644 --- a/Geo/GEdge.h +++ b/Geo/GEdge.h @@ -67,9 +67,10 @@ class GEdge : public GEntity { virtual bool containsParam(double pt) const; // get the position for the given parameter location - virtual SVector3 position(double p) const { + virtual SVector3 position(double p) const + { GPoint gp = point(p); - return SVector3(gp.x(),gp.y(),gp.z()); + return SVector3(gp.x(), gp.y(), gp.z()); } // get first derivative of edge at the given parameter @@ -130,7 +131,8 @@ class GEdge : public GEntity { virtual bool periodic(int dim) const { return v0 == v1; } // true if edge is used in hyperbolic layer on face gf - virtual bool inHyperbolicLayer(GFace* gf) { + virtual bool inHyperbolicLayer(GFace* gf) + { return bl_faces.find(gf) != bl_faces.end(); }