From 1fec38ff7622e14012df346c1f825a47bb427e4d Mon Sep 17 00:00:00 2001 From: Anthony GEAY Date: Wed, 23 Sep 2020 21:49:29 +0200 Subject: [PATCH] WIP --- src/MEDCoupling/MEDCouplingFieldInt32.cxx | 6 +- src/MEDCoupling/MEDCouplingFieldInt32.hxx | 2 +- .../MEDCouplingTimeDiscretization.cxx | 87 ++++++++++++++++--- .../MEDCouplingTimeDiscretization.hxx | 20 ++--- src/MEDCoupling_Swig/MEDCouplingCommon.i | 87 +++++++++++-------- src/MEDCoupling_Swig/MEDCouplingFinalize.i | 6 +- src/MEDCoupling_Swig/MEDCouplingTypemaps.i | 11 +-- 7 files changed, 148 insertions(+), 71 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingFieldInt32.cxx b/src/MEDCoupling/MEDCouplingFieldInt32.cxx index 919faae67..06f72baa8 100644 --- a/src/MEDCoupling/MEDCouplingFieldInt32.cxx +++ b/src/MEDCoupling/MEDCouplingFieldInt32.cxx @@ -39,7 +39,7 @@ MEDCouplingFieldInt32 *MEDCouplingFieldInt32::New(const MEDCouplingFieldTemplate return new MEDCouplingFieldInt32(ft,td); } -MEDCouplingFieldInt32::MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td):MEDCouplingFieldT(type,MEDCouplingTimeDiscretizationInt::New(td)) +MEDCouplingFieldInt32::MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td):MEDCouplingFieldT(type,MEDCouplingTimeDiscretizationInt32::New(td)) { } @@ -47,14 +47,14 @@ MEDCouplingFieldInt32::MEDCouplingFieldInt32(const MEDCouplingFieldInt32& other, { } -MEDCouplingFieldInt32::MEDCouplingFieldInt32(NatureOfField n, MEDCouplingTimeDiscretizationInt *td, MEDCouplingFieldDiscretization *type):MEDCouplingFieldT(type,n,td) +MEDCouplingFieldInt32::MEDCouplingFieldInt32(NatureOfField n, MEDCouplingTimeDiscretizationInt32 *td, MEDCouplingFieldDiscretization *type):MEDCouplingFieldT(type,n,td) { } /*! * ** WARINING : This method do not deeply copy neither mesh nor spatial discretization. Only a shallow copy (reference) is done for mesh and spatial discretization ! ** */ -MEDCouplingFieldInt32::MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td):MEDCouplingFieldT(ft,MEDCouplingTimeDiscretizationInt::New(td),false) +MEDCouplingFieldInt32::MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td):MEDCouplingFieldT(ft,MEDCouplingTimeDiscretizationInt32::New(td),false) { } diff --git a/src/MEDCoupling/MEDCouplingFieldInt32.hxx b/src/MEDCoupling/MEDCouplingFieldInt32.hxx index 658546059..5244bcdc6 100644 --- a/src/MEDCoupling/MEDCouplingFieldInt32.hxx +++ b/src/MEDCoupling/MEDCouplingFieldInt32.hxx @@ -43,7 +43,7 @@ namespace MEDCoupling protected: MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td); MEDCouplingFieldInt32(const MEDCouplingFieldInt32& other, bool deepCopy); - MEDCouplingFieldInt32(NatureOfField n, MEDCouplingTimeDiscretizationInt *td, MEDCouplingFieldDiscretization *type); + MEDCouplingFieldInt32(NatureOfField n, MEDCouplingTimeDiscretizationInt32 *td, MEDCouplingFieldDiscretization *type); MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td); ~MEDCouplingFieldInt32() { } }; diff --git a/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx b/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx index 6d19818f2..873193aba 100644 --- a/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx +++ b/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx @@ -694,27 +694,27 @@ void MEDCouplingTimeKeeper::checkTimePresence(double time, double eps) const //////////////////////// -MEDCouplingTimeDiscretizationInt::MEDCouplingTimeDiscretizationInt(const MEDCouplingTimeDiscretizationInt& other, bool deepCopy):MEDCouplingTimeDiscretizationSimple(other,deepCopy) +MEDCouplingTimeDiscretizationInt32::MEDCouplingTimeDiscretizationInt32(const MEDCouplingTimeDiscretizationInt32& other, bool deepCopy):MEDCouplingTimeDiscretizationSimple(other,deepCopy) { } -MEDCouplingTimeDiscretizationInt *MEDCouplingTimeDiscretizationInt::performCopyOrIncrRef(bool deepCopy) const +MEDCouplingTimeDiscretizationInt32 *MEDCouplingTimeDiscretizationInt32::performCopyOrIncrRef(bool deepCopy) const { - return new MEDCouplingTimeDiscretizationInt(*this,deepCopy); + return new MEDCouplingTimeDiscretizationInt32(*this,deepCopy); } -MEDCouplingTimeDiscretizationInt *MEDCouplingTimeDiscretizationInt::New(TypeOfTimeDiscretization type) +MEDCouplingTimeDiscretizationInt32 *MEDCouplingTimeDiscretizationInt32::New(TypeOfTimeDiscretization type) { switch(type) { - case MEDCouplingTimeDiscretizationInt::DISCRETIZATION: - return new MEDCouplingTimeDiscretizationInt; + case MEDCouplingTimeDiscretizationInt32::DISCRETIZATION: + return new MEDCouplingTimeDiscretizationInt32; default: throw INTERP_KERNEL::Exception("Time discretization not implemented yet for integers !"); } } -bool MEDCouplingTimeDiscretizationInt::isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate *other, int prec, std::string& reason) const +bool MEDCouplingTimeDiscretizationInt32::isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate *other, Int32 prec, std::string& reason) const { if(prec!=0) throw INTERP_KERNEL::Exception("isEqualIfNotWhy : only precision equal to 0 supported for int !"); @@ -723,10 +723,10 @@ bool MEDCouplingTimeDiscretizationInt::isEqualIfNotWhy(const MEDCouplingTimeDisc reason="Time discretization is NULL."; return false; } - const MEDCouplingTimeDiscretizationInt *otherC(dynamic_cast(other)); + const MEDCouplingTimeDiscretizationInt32 *otherC(dynamic_cast(other)); if(!otherC) - throw INTERP_KERNEL::Exception("isEqualIfNotWhy : other is not a MEDCouplingTimeDiscretizationInt !"); - if(!MEDCouplingTimeDiscretizationTemplate::areStrictlyCompatible(other,reason)) + throw INTERP_KERNEL::Exception("isEqualIfNotWhy : other is not a MEDCouplingTimeDiscretizationInt32 !"); + if(!MEDCouplingTimeDiscretizationTemplate::areStrictlyCompatible(other,reason)) return false; if(!_tk.isEqualIfNotWhy(otherC->_tk,_time_tolerance,reason)) return false; @@ -735,11 +735,72 @@ bool MEDCouplingTimeDiscretizationInt::isEqualIfNotWhy(const MEDCouplingTimeDisc return _array->isEqualIfNotWhy(*other->getArray(),reason); } -bool MEDCouplingTimeDiscretizationInt::isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate *other, int prec) const +bool MEDCouplingTimeDiscretizationInt32::isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate *other, Int32 prec) const { if(prec!=0) - throw INTERP_KERNEL::Exception("MEDCouplingTimeDiscretizationInt::isEqualWithoutConsideringStr : only precision 0 is supported !"); - const MEDCouplingTimeDiscretizationInt *otherC(dynamic_cast(other)); + throw INTERP_KERNEL::Exception("MEDCouplingTimeDiscretizationInt32::isEqualWithoutConsideringStr : only precision 0 is supported !"); + const MEDCouplingTimeDiscretizationInt32 *otherC(dynamic_cast(other)); + if(!otherC) + throw INTERP_KERNEL::Exception("isEqualWithoutConsideringStr : other is not a MEDCouplingTimeDiscretizationInt !"); + std::string tmp; + if(!areStrictlyCompatible(other,tmp)) + return false; + std::string reason; + if(!_tk.isEqualIfNotWhy(otherC->_tk,_time_tolerance,reason)) + return false; + if(_array==other->getArray()) + return true; + return _array->isEqualWithoutConsideringStr(*(other->getArray())); +} + +//////////////////////// + +MEDCouplingTimeDiscretizationInt64::MEDCouplingTimeDiscretizationInt64(const MEDCouplingTimeDiscretizationInt64& other, bool deepCopy):MEDCouplingTimeDiscretizationSimple(other,deepCopy) +{ +} + +MEDCouplingTimeDiscretizationInt64 *MEDCouplingTimeDiscretizationInt64::performCopyOrIncrRef(bool deepCopy) const +{ + return new MEDCouplingTimeDiscretizationInt64(*this,deepCopy); +} + +MEDCouplingTimeDiscretizationInt64 *MEDCouplingTimeDiscretizationInt64::New(TypeOfTimeDiscretization type) +{ + switch(type) + { + case MEDCouplingTimeDiscretizationInt64::DISCRETIZATION: + return new MEDCouplingTimeDiscretizationInt64; + default: + throw INTERP_KERNEL::Exception("Time discretization not implemented yet for integers !"); + } +} + +bool MEDCouplingTimeDiscretizationInt64::isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate *other, Int64 prec, std::string& reason) const +{ + if(prec!=0) + throw INTERP_KERNEL::Exception("isEqualIfNotWhy : only precision equal to 0 supported for int !"); + if(!other) + { + reason="Time discretization is NULL."; + return false; + } + const MEDCouplingTimeDiscretizationInt64 *otherC(dynamic_cast(other)); + if(!otherC) + throw INTERP_KERNEL::Exception("isEqualIfNotWhy : other is not a MEDCouplingTimeDiscretizationInt64 !"); + if(!MEDCouplingTimeDiscretizationTemplate::areStrictlyCompatible(other,reason)) + return false; + if(!_tk.isEqualIfNotWhy(otherC->_tk,_time_tolerance,reason)) + return false; + if(_array==other->getArray()) + return true; + return _array->isEqualIfNotWhy(*other->getArray(),reason); +} + +bool MEDCouplingTimeDiscretizationInt64::isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate *other, Int64 prec) const +{ + if(prec!=0) + throw INTERP_KERNEL::Exception("MEDCouplingTimeDiscretizationInt64::isEqualWithoutConsideringStr : only precision 0 is supported !"); + const MEDCouplingTimeDiscretizationInt64 *otherC(dynamic_cast(other)); if(!otherC) throw INTERP_KERNEL::Exception("isEqualWithoutConsideringStr : other is not a MEDCouplingTimeDiscretizationInt !"); std::string tmp; diff --git a/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx b/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx index 809155a55..480ac7d78 100644 --- a/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx +++ b/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx @@ -238,16 +238,16 @@ namespace MEDCoupling static const TypeOfTimeDiscretization DISCRETIZATION=ONE_TIME; }; - class MEDCouplingTimeDiscretizationInt : public MEDCouplingTimeDiscretizationSimple + class MEDCouplingTimeDiscretizationInt32 : public MEDCouplingTimeDiscretizationSimple { public: - MEDCouplingTimeDiscretizationInt() { } - std::string getClassName() const override { return std::string("MEDCouplingTimeDiscretizationInt"); } - MEDCouplingTimeDiscretizationInt(const MEDCouplingTimeDiscretizationInt& other, bool deepCopy); - static MEDCouplingTimeDiscretizationInt *New(TypeOfTimeDiscretization type); - MEDCouplingTimeDiscretizationInt *performCopyOrIncrRef(bool deepCopy) const; - bool isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate *other, int prec, std::string& reason) const; - bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate *other, int prec) const; + MEDCouplingTimeDiscretizationInt32() { } + std::string getClassName() const override { return std::string("MEDCouplingTimeDiscretizationInt32"); } + MEDCouplingTimeDiscretizationInt32(const MEDCouplingTimeDiscretizationInt32& other, bool deepCopy); + static MEDCouplingTimeDiscretizationInt32 *New(TypeOfTimeDiscretization type); + MEDCouplingTimeDiscretizationInt32 *performCopyOrIncrRef(bool deepCopy) const; + bool isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate *other, Int32 prec, std::string& reason) const; + bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate *other, Int32 prec) const; }; class MEDCouplingTimeDiscretizationInt64 : public MEDCouplingTimeDiscretizationSimple @@ -258,8 +258,8 @@ namespace MEDCoupling MEDCouplingTimeDiscretizationInt64(const MEDCouplingTimeDiscretizationInt64& other, bool deepCopy); static MEDCouplingTimeDiscretizationInt64 *New(TypeOfTimeDiscretization type); MEDCouplingTimeDiscretizationInt64 *performCopyOrIncrRef(bool deepCopy) const; - bool isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate *other, int prec, std::string& reason) const; - bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate *other, int prec) const; + bool isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate *other, Int64 prec, std::string& reason) const override; + bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate *other, Int64 prec) const override; }; class MEDCouplingTimeDiscretizationFloat : public MEDCouplingTimeDiscretizationSimple diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i index 38f2d0f3c..f671fa41b 100644 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ b/src/MEDCoupling_Swig/MEDCouplingCommon.i @@ -37,7 +37,8 @@ #include "MEDCoupling1GTUMesh.hxx" #include "MEDCouplingField.hxx" #include "MEDCouplingFieldDouble.hxx" -#include "MEDCouplingFieldInt.hxx" +#include "MEDCouplingFieldInt32.hxx" +#include "MEDCouplingFieldInt64.hxx" #include "MEDCouplingFieldFloat.hxx" #include "MEDCouplingFieldTemplate.hxx" #include "MEDCouplingGaussLocalization.hxx" @@ -270,15 +271,24 @@ typedef long int mcIdType; %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization; %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti; %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl; -%newobject MEDCoupling::MEDCouplingFieldInt::New; -%newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField; -%newobject MEDCoupling::MEDCouplingFieldInt::getArray; -%newobject MEDCoupling::MEDCouplingFieldInt::deepCopy; -%newobject MEDCoupling::MEDCouplingFieldInt::clone; -%newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh; -%newobject MEDCoupling::MEDCouplingFieldInt::buildSubPart; -%newobject MEDCoupling::MEDCouplingFieldInt::buildSubPartRange; -%newobject MEDCoupling::MEDCouplingFieldInt::__getitem__; +%newobject MEDCoupling::MEDCouplingFieldInt32::New; +%newobject MEDCoupling::MEDCouplingFieldInt32::convertToDblField; +%newobject MEDCoupling::MEDCouplingFieldInt32::getArray; +%newobject MEDCoupling::MEDCouplingFieldInt32::deepCopy; +%newobject MEDCoupling::MEDCouplingFieldInt32::clone; +%newobject MEDCoupling::MEDCouplingFieldInt32::cloneWithMesh; +%newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPart; +%newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPartRange; +%newobject MEDCoupling::MEDCouplingFieldInt32::__getitem__; +%newobject MEDCoupling::MEDCouplingFieldInt64::New; +%newobject MEDCoupling::MEDCouplingFieldInt64::convertToDblField; +%newobject MEDCoupling::MEDCouplingFieldInt64::getArray; +%newobject MEDCoupling::MEDCouplingFieldInt64::deepCopy; +%newobject MEDCoupling::MEDCouplingFieldInt64::clone; +%newobject MEDCoupling::MEDCouplingFieldInt64::cloneWithMesh; +%newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPart; +%newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPartRange; +%newobject MEDCoupling::MEDCouplingFieldInt64::__getitem__; %newobject MEDCoupling::MEDCouplingFieldFloat::New; %newobject MEDCoupling::MEDCouplingFieldFloat::convertToDblField; %newobject MEDCoupling::MEDCouplingFieldFloat::getArray; @@ -489,7 +499,8 @@ typedef long int mcIdType; %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();" %feature("unref") MEDCouplingFieldDouble "$this->decrRef();" %feature("unref") MEDCouplingFieldFloat "$this->decrRef();" -%feature("unref") MEDCouplingFieldInt "$this->decrRef();" +%feature("unref") MEDCouplingFieldInt32 "$this->decrRef();" +%feature("unref") MEDCouplingFieldInt64 "$this->decrRef();" %feature("unref") MEDCouplingMultiFields "$this->decrRef();" %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();" %feature("unref") MEDCouplingMultiFields "$this->decrRef();" @@ -3885,7 +3896,8 @@ namespace MEDCoupling public: static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f); static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f); - static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f); + static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt32& f); + static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt64& f); static MEDCouplingFieldTemplate *New(TypeOfField type); std::string simpleRepr() const; std::string advancedRepr() const; @@ -3903,7 +3915,12 @@ namespace MEDCoupling return MEDCouplingFieldTemplate::New(f); } - MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) + MEDCouplingFieldTemplate(const MEDCouplingFieldInt32& f) + { + return MEDCouplingFieldTemplate::New(f); + } + + MEDCouplingFieldTemplate(const MEDCouplingFieldInt64& f) { return MEDCouplingFieldTemplate::New(f); } @@ -3953,7 +3970,7 @@ namespace MEDCoupling %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT; %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT; - class MEDCouplingFieldInt; + class MEDCouplingFieldInt32; class MEDCouplingFieldFloat; class MEDCouplingFieldDouble : public MEDCouplingFieldT @@ -3971,7 +3988,7 @@ namespace MEDCoupling std::string simpleRepr() const; std::string advancedRepr() const; std::string writeVTK(const std::string& fileName, bool isBinary=true) const; - MEDCouplingFieldInt *convertToIntField() const; + MEDCouplingFieldInt32 *convertToIntField() const; MEDCouplingFieldFloat *convertToFloatField() const; MEDCouplingFieldDouble *clone(bool recDeepCpy) const; MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const; @@ -5165,34 +5182,34 @@ namespace MEDCoupling } }; - class MEDCouplingFieldInt : public MEDCouplingFieldT + class MEDCouplingFieldInt32 : public MEDCouplingFieldT { public: - static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME); - static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME); - bool isEqual(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const; - bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const; + static MEDCouplingFieldInt32 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME); + static MEDCouplingFieldInt32 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME); + bool isEqual(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const; + bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const; void setTimeUnit(const std::string& unit); std::string getTimeUnit() const; void setTime(double val, int iteration, int order); void setArray(DataArrayInt32 *array); - MEDCouplingFieldInt *deepCopy() const; - MEDCouplingFieldInt *clone(bool recDeepCpy) const; - MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const; + MEDCouplingFieldInt32 *deepCopy() const; + MEDCouplingFieldInt32 *clone(bool recDeepCpy) const; + MEDCouplingFieldInt32 *cloneWithMesh(bool recDeepCpy) const; MEDCouplingFieldDouble *convertToDblField() const; - MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const; + MEDCouplingFieldInt32 *buildSubPartRange(int begin, int end, int step) const; %extend { - MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME) + MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME) { - return MEDCouplingFieldInt::New(type,td); + return MEDCouplingFieldInt32::New(type,td); } - MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME) + MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME) { - return MEDCouplingFieldInt::New(ft,td); + return MEDCouplingFieldInt32::New(ft,td); } - PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const + PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const { std::string ret1; bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1); @@ -5216,12 +5233,12 @@ namespace MEDCoupling return oss.str(); } - MEDCouplingFieldInt *buildSubPart(PyObject *li) const + MEDCouplingFieldInt32 *buildSubPart(PyObject *li) const { return fieldT_buildSubPart(self,li); } - MEDCouplingFieldInt *__getitem__(PyObject *li) const + MEDCouplingFieldInt32 *__getitem__(PyObject *li) const { return fieldT__getitem__(self,li); } @@ -5247,7 +5264,7 @@ namespace MEDCoupling PyObject *getTinySerializationInformation() const { - return field_getTinySerializationInformation(self); + return field_getTinySerializationInformation(self); } PyObject *serialize() const @@ -5257,7 +5274,7 @@ namespace MEDCoupling PyObject *__getstate__() const { - return field__getstate__(self,MEDCoupling_MEDCouplingFieldInt_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt_serialize); + return field__getstate__(self,MEDCoupling_MEDCouplingFieldInt32_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt32_serialize); } void __setstate__(PyObject *inp) @@ -5984,10 +6001,10 @@ def MEDCouplingFieldDoubleReduce(self): self.checkConsistencyLight() d=(self.getTypeOfField(),self.getTimeDiscretization()) return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),)) -def MEDCouplingFieldIntReduce(self): +def MEDCouplingFieldInt32Reduce(self): self.checkConsistencyLight() d=(self.getTypeOfField(),self.getTimeDiscretization()) - return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt,(d,(self.__getstate__()),)) + return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt32,(d,(self.__getstate__()),)) def MEDCouplingFieldFloatReduce(self): self.checkConsistencyLight() d=(self.getTypeOfField(),self.getTimeDiscretization()) diff --git a/src/MEDCoupling_Swig/MEDCouplingFinalize.i b/src/MEDCoupling_Swig/MEDCouplingFinalize.i index 7ab5de4e7..b0ea9a4a0 100644 --- a/src/MEDCoupling_Swig/MEDCouplingFinalize.i +++ b/src/MEDCoupling_Swig/MEDCouplingFinalize.i @@ -86,7 +86,8 @@ MEDCouplingFieldDouble.__ifloordiv__=MEDCouplingFieldDoubleIdiv MEDCouplingFieldTemplate.__reduce__=MEDCouplingFieldTemplateReduce -MEDCouplingFieldInt.__reduce__=MEDCouplingFieldIntReduce +MEDCouplingFieldInt32.__reduce__=MEDCouplingFieldInt32Reduce +MEDCouplingFieldInt64.__reduce__=MEDCouplingFieldInt64Reduce MEDCouplingFieldFloat.__reduce__=MEDCouplingFieldFloatReduce @@ -185,7 +186,8 @@ del MEDCouplingFieldDoubleIpow del MEDCouplingFieldDoubleIsub del MEDCouplingFieldDoubleReduce del MEDCouplingFieldFloatReduce -del MEDCouplingFieldIntReduce +del MEDCouplingFieldInt32Reduce +del MEDCouplingFieldInt64Reduce del MEDCouplingFieldTemplateReduce del MEDCouplingIMeshReduce del MEDCouplingMappedExtrudedMeshReduce diff --git a/src/MEDCoupling_Swig/MEDCouplingTypemaps.i b/src/MEDCoupling_Swig/MEDCouplingTypemaps.i index 2b49912aa..c2f2f2f40 100644 --- a/src/MEDCoupling_Swig/MEDCouplingTypemaps.i +++ b/src/MEDCoupling_Swig/MEDCouplingTypemaps.i @@ -16,10 +16,9 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// Author : Anthony Geay (CEA/DEN) +// Author : Anthony Geay (EDF R&D) -#ifndef __MEDCOUPLINGTYPEMAPS_I__ -#define __MEDCOUPLINGTYPEMAPS_I__ +#pragma once #include "MEDCouplingDataArrayTypemaps.i" #include "MEDCouplingUMesh.hxx" @@ -135,8 +134,8 @@ static PyObject *convertField(MEDCoupling::MEDCouplingField *f, int owner) } if(dynamic_cast(f)) ret=SWIG_NewPointerObj(reinterpret_cast(f),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,owner); - if(dynamic_cast(f)) - ret=SWIG_NewPointerObj(reinterpret_cast(f),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldInt,owner); + if(dynamic_cast(f)) + ret=SWIG_NewPointerObj(reinterpret_cast(f),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldInt32,owner); if(dynamic_cast(f)) ret=SWIG_NewPointerObj(reinterpret_cast(f),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldFloat,owner); if(!ret) @@ -767,5 +766,3 @@ PyObject *Mesh_getCellsContainingPointsLike(PyObject *p, double eps, const MEDCo PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits::TI, SWIG_POINTER_OWN | 0 )); return ret; } - -#endif -- 2.39.2