From 3020c55e063a95340a5449d874ab6520ded89eb9 Mon Sep 17 00:00:00 2001 From: ageay Date: Thu, 31 Jan 2013 14:35:16 +0000 Subject: [PATCH] distance from point to mesh implementation --- src/INTERP_KERNEL/CMakeLists.txt | 1 + src/INTERP_KERNEL/Makefile.am | 1 + src/MEDCoupling_Swig/MEDCouplingBasicsTest.py | 17 +++++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/src/INTERP_KERNEL/CMakeLists.txt b/src/INTERP_KERNEL/CMakeLists.txt index 02d8637bd..ae70ca322 100644 --- a/src/INTERP_KERNEL/CMakeLists.txt +++ b/src/INTERP_KERNEL/CMakeLists.txt @@ -37,6 +37,7 @@ SET(interpkernel_SOURCES InterpKernelMeshQuality.cxx InterpKernelCellSimplify.cxx InterpKernelMatrixTools.cxx + VolSurfUser.cxx Bases/InterpKernelException.cxx Geometric2D/InterpKernelGeo2DAbstractEdge.cxx Geometric2D/InterpKernelGeo2DBounds.cxx diff --git a/src/INTERP_KERNEL/Makefile.am b/src/INTERP_KERNEL/Makefile.am index 25258d67c..a21327824 100644 --- a/src/INTERP_KERNEL/Makefile.am +++ b/src/INTERP_KERNEL/Makefile.am @@ -218,6 +218,7 @@ dist_libinterpkernel_la_SOURCES = \ TranslationRotationMatrix.cxx \ TetraAffineTransform.cxx \ CellModel.cxx \ + VolSurfUser.cxx \ UnitTetraIntersectionBary.cxx \ InterpolationOptions.cxx \ DirectedBoundingBox.cxx \ diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py index e72abcdf7..7457b05b6 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py @@ -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 -- 2.39.2