]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
bug MEDCouplingFieldDouble::applyFunc(nbOfComp,value)
authorageay <ageay>
Fri, 12 Apr 2013 08:14:45 +0000 (08:14 +0000)
committerageay <ageay>
Fri, 12 Apr 2013 08:14:45 +0000 (08:14 +0000)
src/MEDCoupling_Swig/MEDCouplingBasicsTest.py

index c758d43ba8e3d406b3faa0e1abfdf8a255a4f02e..bc1b857add8e6a2c73f24ef75da22dd570cb3e8f 100644 (file)
@@ -12516,6 +12516,25 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         self.assertTrue(f[-2:0:-1,0].getArray().isEqual(arr[[11,12,13,6,7,8,9,10,2,3,4,5],0],1e-12))
         pass
 
+    def testSwig2FieldDoubleApplyFuncBug1(self):
+        f=MEDCouplingFieldDouble(ON_CELLS)
+        f.setMesh(MEDCouplingDataForTest.build2DTargetMesh_1())
+        f.applyFunc(3,700.)
+        f.checkCoherency()
+        self.assertEqual(3,f.getArray().getNumberOfComponents())
+        f.getArray().rearrange(1)
+        self.assertTrue(f.getArray().isUniform(700.,1e-10))
+        f.getArray().rearrange(3)
+        f.checkCoherency()
+        f.applyFunc(4,800.)
+        f.checkCoherency()
+        self.assertEqual(4,f.getArray().getNumberOfComponents())
+        f.getArray().rearrange(1)
+        self.assertTrue(f.getArray().isUniform(800.,1e-10))
+        f.getArray().rearrange(4)
+        f.checkCoherency()
+        pass
+
     def setUp(self):
         pass
     pass