From 2d80bf2625d4b6522af411eee29c4715e842822c Mon Sep 17 00:00:00 2001 From: ageay Date: Tue, 9 Apr 2013 14:47:57 +0000 Subject: [PATCH] Extend operator __pow__ of MEDCouplingFieldDouble --- src/MEDCoupling_Swig/MEDCoupling.i | 3 +++ src/MEDCoupling_Swig/MEDCouplingCommon.i | 7 +++++++ src/MEDCoupling_Swig/MEDCouplingFinalize.i | 2 ++ src/MEDCoupling_Swig/MEDCouplingRemapper.i | 3 +++ src/MEDLoader/Swig/MEDLoader.i | 3 +++ src/ParaMEDMEM_Swig/ParaMEDMEM.i | 3 +++ 6 files changed, 21 insertions(+) diff --git a/src/MEDCoupling_Swig/MEDCoupling.i b/src/MEDCoupling_Swig/MEDCoupling.i index 3c7aa96c5..9443f9b79 100644 --- a/src/MEDCoupling_Swig/MEDCoupling.i +++ b/src/MEDCoupling_Swig/MEDCoupling.i @@ -47,6 +47,9 @@ def ParaMEDMEMMEDCouplingFieldDoubleImul(self,*args): def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args): import _MEDCoupling return _MEDCoupling.MEDCouplingFieldDouble____idiv___(self, self, *args) +def ParaMEDMEMMEDCouplingFieldDoubleIpow(self,*args): + import _MEDCoupling + return _MEDCoupling.MEDCouplingFieldDouble____ipow___(self, self, *args) def ParaMEDMEMDataArrayIntIadd(self,*args): import _MEDCoupling return _MEDCoupling.DataArrayInt____iadd___(self, self, *args) diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i index f4e7f69b8..1c7efd9d4 100644 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ b/src/MEDCoupling_Swig/MEDCouplingCommon.i @@ -3701,6 +3701,13 @@ namespace ParaMEDMEM return trueSelf; } + PyObject *___ipow___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception) + { + *self^=other; + Py_XINCREF(trueSelf); + return trueSelf; + } + static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception) { std::vector tmp; diff --git a/src/MEDCoupling_Swig/MEDCouplingFinalize.i b/src/MEDCoupling_Swig/MEDCouplingFinalize.i index 4c2c9df4f..9a755af66 100644 --- a/src/MEDCoupling_Swig/MEDCouplingFinalize.i +++ b/src/MEDCoupling_Swig/MEDCouplingFinalize.i @@ -35,6 +35,7 @@ MEDCouplingFieldDouble.__iadd__=ParaMEDMEMMEDCouplingFieldDoubleIadd MEDCouplingFieldDouble.__isub__=ParaMEDMEMMEDCouplingFieldDoubleIsub MEDCouplingFieldDouble.__imul__=ParaMEDMEMMEDCouplingFieldDoubleImul MEDCouplingFieldDouble.__idiv__=ParaMEDMEMMEDCouplingFieldDoubleIdiv +MEDCouplingFieldDouble.__ipow__=ParaMEDMEMMEDCouplingFieldDoubleIpow DataArrayDoubleTuple.__iadd__=ParaMEDMEMDataArrayDoubleTupleIadd DataArrayDoubleTuple.__isub__=ParaMEDMEMDataArrayDoubleTupleIsub @@ -55,6 +56,7 @@ del ParaMEDMEMMEDCouplingFieldDoubleIadd del ParaMEDMEMMEDCouplingFieldDoubleIsub del ParaMEDMEMMEDCouplingFieldDoubleImul del ParaMEDMEMMEDCouplingFieldDoubleIdiv +del ParaMEDMEMMEDCouplingFieldDoubleIpow del ParaMEDMEMDataArrayIntIadd del ParaMEDMEMDataArrayIntIsub del ParaMEDMEMDataArrayIntImul diff --git a/src/MEDCoupling_Swig/MEDCouplingRemapper.i b/src/MEDCoupling_Swig/MEDCouplingRemapper.i index 77c762e85..cfb1129e1 100644 --- a/src/MEDCoupling_Swig/MEDCouplingRemapper.i +++ b/src/MEDCoupling_Swig/MEDCouplingRemapper.i @@ -122,6 +122,9 @@ def ParaMEDMEMMEDCouplingFieldDoubleImul(self,*args): def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args): import _MEDCouplingRemapper return _MEDCouplingRemapper.MEDCouplingFieldDouble____idiv___(self, self, *args) +def ParaMEDMEMMEDCouplingFieldDoubleIpow(self,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingFieldDouble____ipow___(self, self, *args) def ParaMEDMEMDataArrayIntIadd(self,*args): import _MEDCouplingRemapper return _MEDCouplingRemapper.DataArrayInt____iadd___(self, self, *args) diff --git a/src/MEDLoader/Swig/MEDLoader.i b/src/MEDLoader/Swig/MEDLoader.i index 47ebf737b..96e20f5aa 100644 --- a/src/MEDLoader/Swig/MEDLoader.i +++ b/src/MEDLoader/Swig/MEDLoader.i @@ -48,6 +48,9 @@ def ParaMEDMEMMEDCouplingFieldDoubleImul(self,*args): def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args): import _MEDLoader return _MEDLoader.MEDCouplingFieldDouble____idiv___(self, self, *args) +def ParaMEDMEMMEDCouplingFieldDoubleIpow(self,*args): + import _MEDLoader + return _MEDLoader.MEDCouplingFieldDouble____ipow___(self, self, *args) def ParaMEDMEMDataArrayIntIadd(self,*args): import _MEDLoader return _MEDLoader.DataArrayInt____iadd___(self, self, *args) diff --git a/src/ParaMEDMEM_Swig/ParaMEDMEM.i b/src/ParaMEDMEM_Swig/ParaMEDMEM.i index 9eadcf2cf..7eebdf86d 100644 --- a/src/ParaMEDMEM_Swig/ParaMEDMEM.i +++ b/src/ParaMEDMEM_Swig/ParaMEDMEM.i @@ -298,6 +298,9 @@ def ParaMEDMEMMEDCouplingFieldDoubleImul(self,*args): def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args): import _ParaMEDMEM return _ParaMEDMEM.MEDCouplingFieldDouble____idiv___(self, self, *args) +def ParaMEDMEMMEDCouplingFieldDoubleIpow(self,*args): + import _ParaMEDMEM + return _ParaMEDMEM.MEDCouplingFieldDouble____ipow___(self, self, *args) def ParaMEDMEMDataArrayIntIadd(self,*args): import _ParaMEDMEM return _ParaMEDMEM.DataArrayInt____iadd___(self, self, *args) -- 2.39.2