]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Fix problem for not locatable points in the context of NodeFE spatial discr
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 24 Aug 2022 13:37:09 +0000 (15:37 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 24 Aug 2022 13:37:09 +0000 (15:37 +0200)
src/INTERP_KERNEL/InterpKernelRootsMultiDim.hxx
src/MEDCoupling_Swig/MEDCouplingRemapperTest.py

index 68eb57acbd1478095d103399a6eed0251cd2cff3..5d2faaba9de8fc2a36b9167327a4315f38c1c87e 100644 (file)
@@ -206,7 +206,10 @@ namespace INTERP_KERNEL
             if (temp > test) test=temp;
         }
         check=(test < TOLMIN);
-        return;
+        if( check )
+          return;
+        else
+          continue;
       }
       test=0.0;
       for (i=0;i<n;i++)
index ef5df95cde24d20af97e9ae4100b50485221343a..71cde7dde26eb7bbdc532d7fff817b899621358d 100644 (file)
@@ -1642,6 +1642,17 @@ class MEDCouplingBasicsTest(unittest.TestCase):
             ftest.setGaussLocalizationOnType(gt,sum([list(elt) for elt in MEDCouplingGaussLocalization.GetDefaultReferenceCoordinatesOf(gt).getValuesAsTuple()],[]),list(cooInRefElemFoundByNewton),[1])
             self.assertTrue ( float( (ftest.getLocalizationOfDiscr()-zePt).magnitude() ) < 1e-4 )
 
+        # testing with outside point
+        for zePt in outPts:
+            #safer than
+            #self.assertRaises(InterpKernelException,sd.getCooInRefElement,srcField.getMesh(),zePt.buildDADouble())
+            try:
+                sd.getCooInRefElement(srcField.getMesh(),zePt.buildDADouble())
+            except InterpKernelException as e:
+                self.assertTrue("fail to locate point" in e.what())
+            else:
+                self.assertTrue(false,"")    
+
     def checkMatrix(self,mat1,mat2,nbCols,eps):
         self.assertEqual(len(mat1),len(mat2))
         for i in range(len(mat1)):