]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
agy : before big one
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 29 Aug 2018 06:45:13 +0000 (08:45 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 29 Aug 2018 06:45:13 +0000 (08:45 +0200)
src/INTERP_KERNEL/PointLocatorAlgos.txx
src/MEDCoupling_Swig/MEDCouplingBasicsTest3.py

index 2c19ff49df7334a7d65c18ff2b070a85fb7cd4d3..07abf8a6b0620c2e01fc7c85b24e43c3c6e6573b 100644 (file)
@@ -170,12 +170,11 @@ namespace INTERP_KERNEL
       const NumberingPolicy numPol=MyMeshType::My_numPol;
 
       const CellModel& cmType=CellModel::GetCellModel(type);
-      if (cmType.isQuadratic())
-        throw INTERP_KERNEL::Exception("PointLocatorAlgos.txx::isElementContainsPoint(): Invalid cell type detected! Quadratic types not supported!");
-
       //
       if (SPACEDIM==2)
         {
+          if (cmType.isQuadratic())
+            throw INTERP_KERNEL::Exception("PointLocatorAlgos.txx::isElementContainsPoint(): Invalid cell type detected! Quadratic types not supported!");
           int nbEdges=cmType.getNumberOfSons();
           double *pts = new double[nbEdges*SPACEDIM];
           for (int iedge=0; iedge<nbEdges; iedge++)
index 37862dcf088b5ea86c3475224896e89080eb4d3b..a5d5e16fc0ff0ae7e91bca580822fcdbd0da3a48 100644 (file)
@@ -1247,30 +1247,26 @@ class MEDCouplingBasicsTest3(unittest.TestCase):
         coords=[0.33312787792955395, -0.35155740179580952, -0.03567564825034563, 1.307146326477638, -0.57234557776250305, -0.08608044208272235, 0.5551834466499993, 0.62324964668794192, -0.014638951108536295, 0.37761817224442129, -0.38324019806913578, 0.96283164472856886, 0.79494856035658679, -0.40628057809270046, 0.0021004190225864614, 1.023740446371799, 0.07665912970471335, -0.072889657161871096, 0.54564584619517376, 0.11132872093429744, 0.039647326652013051, 0.27164784387819052, -0.42018012100866675, 0.46563376500745146, 0.89501965094896418, -0.56148455362735061, 0.43337469695473035, 0.49118025152924394, 0.093884938060727313, 0.47216346905220891]
         conn=[0,1,2,3,4,5,6,7,8,9]
         coo=DataArrayDouble.New();
-        coo.setValues(coords,10,3);       
+        coo.setValues(coords,10,3);
         m.setCoords(coo);
         m.allocateCells(1);
         m.insertNextCell(NORM_TETRA10,10,conn[0:10])
         m.finishInsertingCells();
         #
-        f=MEDCouplingFieldDouble(ON_NODES,ONE_TIME);
+        f=MEDCouplingFieldDouble.New(ON_NODES,ONE_TIME);
         f.setMesh(m);
-        da=DataArrayDouble([1.1,2.1,3.1,4.1,   0,0,0,0,0]);
+        da=DataArrayDouble.New();
+        vals1=[1.1,2.1,3.1,4.1,5.2,6.2,7.2,8.2,9.2,10.2]
+        da.setValues(vals1,10,1);
         f.setArray(da);
+        f.checkConsistencyLight()
         #
         loc=[0.64637931739890486, -0.16185896817550552, 0.22678966365273748]
-        # Localisation on quadratic cells not supported:
-        self.assertRaises(InterpKernelException, f.getValueOnMulti,loc);
-        
-        # Localisation on linear 3D cell:
-        m.setConnectivity(DataArrayInt([NORM_TETRA4, 0,1,2,3]), DataArrayInt([0,5]))
-        f2=MEDCouplingFieldDouble(ON_NODES,ONE_TIME);
-        f2.setMesh(m);
-        da=DataArrayDouble([1.1,2.1,3.1,4.1])
-        f2.setArray(da);
-        locs2 = f2.getValueOnMulti(loc)
-        
-        self.assertAlmostEqual(2.68,locs2.getIJ(0,0),12);
+        locs=f.getValueOnMulti(loc);
+        expected1=[10.0844021968047]
+        for i in range(1):
+            self.assertAlmostEqual(expected1[i],locs.getIJ(0,i),12);
+            pass
         pass
 
     def testGetValueOn2(self):