From 06677754b49fc24f2cbcbdab485af57f14b8dd72 Mon Sep 17 00:00:00 2001 From: abn Date: Wed, 24 Oct 2018 17:58:37 +0200 Subject: [PATCH] Bug fix : Edge::sortIdAbs() was merging points too agressively. --- .../Geometric2D/InterpKernelGeo2DEdge.cxx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx index 37dd4f892..98abd9aea 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx @@ -928,11 +928,6 @@ bool Edge::isEqual(const Edge& other) const return _start->isEqual(*other._start) && _end->isEqual(*other._end); } -inline bool eqpair(const std::pair& p1, const std::pair& p2) -{ - return fabs(p1.first-p2.first)& subNodes) void Edge::sortIdsAbs(const std::vector& addNodes, const std::map& mapp1, const std::map& mapp2, std::vector& edgesThis) { + int startId=(*mapp1.find(_start)).second; + int endId=(*mapp1.find(_end)).second; + if (! addNodes.size()) // quick way out, no new node to add. + { + edgesThis.push_back(startId); + edgesThis.push_back(endId); + return; + } + Bounds b; b.prepareForAggregation(); b.aggregate(getBounds()); @@ -998,11 +1002,8 @@ void Edge::sortIdsAbs(const std::vector& addNodes, const for(std::size_t i=0;i(getCharactValueBtw0And1(*addNodes[i]),addNodes[i]); std::sort(an2.begin(),an2.end()); - int startId=(*mapp1.find(_start)).second; - int endId=(*mapp1.find(_end)).second; std::vector tmpp; - std::vector< std::pair >::const_iterator itend=std::unique(an2.begin(),an2.end(),eqpair); - for(std::vector< std::pair >::const_iterator it=an2.begin();it!=itend;it++) + for(std::vector< std::pair >::const_iterator it=an2.begin();it!=an2.end();it++) { int idd=(*mapp2.find((*it).second)).second; if((*it).first