]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
distance from point to mesh implementation
authorageay <ageay>
Thu, 31 Jan 2013 14:35:16 +0000 (14:35 +0000)
committerageay <ageay>
Thu, 31 Jan 2013 14:35:16 +0000 (14:35 +0000)
src/INTERP_KERNEL/CMakeLists.txt
src/INTERP_KERNEL/Makefile.am
src/MEDCoupling_Swig/MEDCouplingBasicsTest.py

index 02d8637bdfd75b635defc98d29520c01acb148a3..ae70ca322fe7a87f3c2b866af9eb45aec63535bc 100644 (file)
@@ -37,6 +37,7 @@ SET(interpkernel_SOURCES
   InterpKernelMeshQuality.cxx
   InterpKernelCellSimplify.cxx
   InterpKernelMatrixTools.cxx
+  VolSurfUser.cxx
   Bases/InterpKernelException.cxx
   Geometric2D/InterpKernelGeo2DAbstractEdge.cxx
   Geometric2D/InterpKernelGeo2DBounds.cxx
index 25258d67c7aa8261cfc8e5184cbc6c95de4cef82..a2132782424b1738cb8c7b80ba52c8ade9671cb1 100644 (file)
@@ -218,6 +218,7 @@ dist_libinterpkernel_la_SOURCES = \
        TranslationRotationMatrix.cxx \
        TetraAffineTransform.cxx \
        CellModel.cxx \
+       VolSurfUser.cxx \
        UnitTetraIntersectionBary.cxx \
        InterpolationOptions.cxx \
        DirectedBoundingBox.cxx \
index e72abcdf70fa597a8cc7f9195d9d0d14b9aa0391..7457b05b604d09a83b4ef74d1d8c8e51afd47af9 100644 (file)
@@ -10872,6 +10872,23 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         self.assertEqual(155.,d.accumulate(2))
         pass
 
+    def testSwigUMeshDistanceToMesh1(self):
+        m=MEDCouplingUMesh("toto",2)
+        coords=DataArrayDouble([2.3,3.4,5.6,6.5,-4.3,3.2,-9.8,7.6,-5.4],3,3)
+        m.setCoords(coords)
+        m.allocateCells(0)
+        m.insertNextCell(NORM_TRI3,[0,1,2])
+        a,b,c=m.distanceToPoint([-0.335,2.27,1.21])
+        self.assertEqual(0,b) ; self.assertEqual(0,c)
+        self.assertAlmostEqual(0.022360988100374124,a,14);
+        a,b,c=m.distanceToPoint(DataArrayDouble([-0.335,2.27,1.21],1,3))
+        self.assertEqual(0,b) ; self.assertEqual(0,c)
+        self.assertAlmostEqual(0.022360988100374124,a,14);
+        a,b=coords.distanceToTuple([-0.335,2.27,1.21])
+        self.assertAlmostEqual(5.243302871282566,a,14)
+        self.assertEqual(0,b)
+        pass
+
     def setUp(self):
         pass
     pass