]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
add test for Nan - computeTriangleHeight
authorNATHALIE GORE <ng13417n@dsp1077169.postes.calibre.edf.fr>
Mon, 18 Dec 2023 08:47:54 +0000 (09:47 +0100)
committerNATHALIE GORE <ng13417n@dsp1077169.postes.calibre.edf.fr>
Mon, 18 Dec 2023 08:47:54 +0000 (09:47 +0100)
src/MEDCoupling_Swig/MEDCouplingBasicsTest7.py

index c45f74141b3e8a558b556b8bfa4ea15a985a826d..2041b0b34a5bbafb5fc593d9d21d7480966a628a 100644 (file)
@@ -1209,6 +1209,16 @@ class MEDCouplingBasicsTest7(unittest.TestCase):
         expected2 = DataArrayDouble([sqrt(2)/2.0, sqrt(2)/2.0])
         self.assertTrue( res2.minPerTuple().isEqual(expected2,1e-12) )
 
+    def testComputeTriangleHeight1(self):
+        m = MEDCouplingUMesh("mesh",2)
+        m.setCoords(DataArrayDouble([(0,0,0),(0,0,0),(10,0,0)]))
+        m.allocateCells()
+        m.insertNextCell(NORM_TRI3, [0,1,2])
+        m = MEDCoupling1SGTUMesh(m)
+        res = m.computeTriangleHeight()
+        expected = DataArrayDouble([(10,0,0)])
+        self.assertTrue( res.isEqual(expected,1e-12) )
+    
     def testDAILocateComponentId0(self):
         arr = DataArrayInt( [(0, 1, 2), (3, 4, 5), (6, 2, 3), (7, 8, 9), (9, 0, 10), (11, 12, 13), (14, 5, 11), (15, 16, 17)] )
         valToSearchIntoTuples = DataArrayInt( [1, 4, 6, 8, 10, 12, 14, 16, 17] )