]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Extend operator __iadd__ of MEDCouplingFieldDouble
authorageay <ageay>
Tue, 9 Apr 2013 15:34:44 +0000 (15:34 +0000)
committerageay <ageay>
Tue, 9 Apr 2013 15:34:44 +0000 (15:34 +0000)
src/MEDCoupling_Swig/MEDCouplingBasicsTest.py
src/MEDCoupling_Swig/MEDCouplingCommon.i

index 085f33abb46900a68e3a3693607f783ae80e5a28..0f0f21e9bfd17c0c9c36a81b44720c2996be4348 100644 (file)
@@ -12152,6 +12152,9 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         f+=f2
         f.checkCoherency()
         self.assertTrue(f.getArray().isEqual(DataArrayDouble([(2,9),(5,14),(8,19),(11,24),(14,29)]),1e-12))
+        f+=[0.1,0.2]
+        f.checkCoherency()
+        self.assertTrue(f.getArray().isEqual(DataArrayDouble([(2.1,9.2),(5.1,14.2),(8.1,19.2),(11.1,24.2),(14.1,29.2)]),1e-12))
         pass
 
     def setUp(self):
index 03d6671a93084c802211fb5d83e5acc544ed0167..7349f9d8b35877625316a5c3a31e314ae5378982 100644 (file)
@@ -3738,9 +3738,7 @@ namespace ParaMEDMEM
               if(!self->getArray())
                 throw INTERP_KERNEL::Exception(msg2);
               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
-              MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
-              ret2->setArray(aaa);
-              *self+=*ret2;
+              self->getArray()->addEqual(aaa);
               Py_XINCREF(trueSelf);
               return trueSelf;
             }