]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Valgrind OK! Such a nice tool :-) abn/colin_fix
authorabn <adrien.bruneton@cea.fr>
Thu, 30 Apr 2015 08:02:08 +0000 (10:02 +0200)
committerabn <adrien.bruneton@cea.fr>
Thu, 30 Apr 2015 08:02:08 +0000 (10:02 +0200)
src/MEDCoupling/MEDCouplingUMesh.cxx
src/MEDCoupling_Swig/MEDCouplingBasicsTest.py

index 9e5c5b950c3d03e69373c427908d532a2cca8c33..0c872c297a50d87dbe531e9f9be977f40f3c800c 100644 (file)
@@ -11468,10 +11468,9 @@ bool MEDCouplingUMesh::Colinearize2DCell(const double *coords, const int *connBg
         }
       // Now move forward:
       const unsigned fwdStart = (nbOfTurn == 0 ? 0 : posBaseElt);  // the first element to be inspected going forward
-      const unsigned endJ(nbs-nbOfHit);   // put in a constant because modified in the loop
-      for(unsigned j=1;j<endJ && nbOfHit<maxNbOfHit;j++)  // 2nd condition is to avoid ending with a cell wih one single edge
+      for(unsigned j=fwdStart+1;j<nbs && nbOfHit<maxNbOfHit;j++)  // 2nd condition is to avoid ending with a cell wih one single edge
         {
-          cm.fillSonCellNodalConnectivity2(fwdStart+(int)j,connBg+1,sz,tmpConn,typeOfSon); // get edge #(posBaseElt+i)'s connectivity
+          cm.fillSonCellNodalConnectivity2((int)j,connBg+1,sz,tmpConn,typeOfSon); // get edge #j's connectivity
           INTERP_KERNEL::Edge *eCand(MEDCouplingUMeshBuildQPFromEdge2(typeOfSon,tmpConn,coords,m));
           INTERP_KERNEL::EdgeIntersector *eint(INTERP_KERNEL::Edge::BuildIntersectorWith(e,eCand));
           bool isColinear(eint->areColinears());
index 889bf2c7ec4b84b44f4472e34cb3b7a8e58a8088..790aac8d61a2d3e3cebcc0896f7c67ef5602a3f0 100644 (file)
@@ -14747,7 +14747,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         m.colinearize2D(1e-12)
         m.checkCoherency2()
         self.assertEqual(refPtr,m.getCoords().getHiddenCppPointer())
-        self.assertTrue(m.getNodalConnectivity().isEqual(DataArrayInt([5,0,2,3,4])))
+        self.assertTrue(m.getNodalConnectivity().isEqual(DataArrayInt([NORM_POLYGON,0,2,3,4])))
         self.assertTrue(m.getNodalConnectivityIndex().isEqual(DataArrayInt([0,5])))
         pass