From 66423193c07c9c8f10816594d23edd7271c7a2a1 Mon Sep 17 00:00:00 2001 From: abn Date: Wed, 9 Jan 2019 14:48:50 +0100 Subject: [PATCH] Bug fix in compute residual: the stop condition is really on pol1Zip only. We might end up with remaining boundary edges from pol2 (and that's OK) --- .../InterpKernelGeo2DQuadraticPolygon.cxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx index 74ffdc372..26c7a7223 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx @@ -1193,6 +1193,15 @@ std::list::iterator QuadraticPolygon::CheckInList(Node *n, s return iEnd; } +/*! +* Compute the remaining parts of the intersection of mesh1 by mesh2. +* The general algorithm is to : +* - either return full cells from pol1 that were simply not touched by mesh2 +* - or to: +* - concatenate pieces from pol1 into consecutive pieces (a bit like zipConsecutiveSegments()) +* - complete those pieces by edges found in edgesInPol2OnBoundary, which are edges from pol2 located on the boundary of the previously built +* intersecting cells +*/ void QuadraticPolygon::ComputeResidual(const QuadraticPolygon& pol1, const std::set& notUsedInPol1, const std::set& edgesInPol2OnBoundary, const std::map& mapp, int offset, int idThis, std::vector& addCoordsQuadratic, std::vector& conn, @@ -1218,7 +1227,7 @@ void QuadraticPolygon::ComputeResidual(const QuadraticPolygon& pol1, const std:: // Zip consecutive edges found in notUsedInPol1L and which are not overlapping with boundary edge from edgesInPol2OnBoundary: while(!notUsedInPol1L.empty()) { - // If all nodes are IN or ON (why ON?) then error + // If all nodes are IN or edge is ON (i.e. as initialised at the begining of the method) then error for(int i=0;igetStartNode()->getLoc()!=IN_1 || itPol1.current()->getLoc()!=FULL_ON_1);i++) itPol1.nextLoop(); if(itPol1.current()->getStartNode()->getLoc()!=IN_1 || itPol1.current()->getLoc()!=FULL_ON_1) @@ -1249,7 +1258,7 @@ void QuadraticPolygon::ComputeResidual(const QuadraticPolygon& pol1, const std:: // [ABN] at least 3 turns for very small cases (typically one (quad) edge against one (quad or lin) edge forming a new cell)! maxNbOfTurn = maxNbOfTurn<3 ? 3 : maxNbOfTurn; nbOfTurn=0; - while(nbOfTurn see if(!pol1Zip.empty()) below ... for(std::list::iterator itConstr=retPolsUnderContruction.begin();itConstr!=retPolsUnderContruction.end();) @@ -1313,6 +1322,8 @@ void QuadraticPolygon::ComputeResidual(const QuadraticPolygon& pol1, const std:: retPolsUnderContruction.push_back(tmp); pol1Zip.erase(pol1Zip.begin()); } + else + break; nbOfTurn++; } if(nbOfTurn==maxNbOfTurn) -- 2.39.2