]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
WIP
authorAnthony GEAY <anthony.geay@edf.fr>
Wed, 23 Sep 2020 20:23:59 +0000 (22:23 +0200)
committerAnthony GEAY <anthony.geay@edf.fr>
Wed, 23 Sep 2020 20:23:59 +0000 (22:23 +0200)
src/MEDCoupling_Swig/MEDCouplingCommon.i
src/MEDCoupling_Swig/MEDCouplingTypemaps.i
src/MEDLoader/MEDFileField1TS.cxx
src/MEDLoader/MEDFileField1TS.hxx

index f671fa41bf7fe3b6ca1fe7273f7555265470e588..b7b634fdba316d511c7cf12e049c961ab01289e4 100644 (file)
@@ -3971,6 +3971,7 @@ namespace MEDCoupling
   %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
   
   class MEDCouplingFieldInt32;
+  class MEDCouplingFieldInt64;
   class MEDCouplingFieldFloat;
   
   class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
@@ -5284,6 +5285,108 @@ namespace MEDCoupling
     }
   };
 
+  class MEDCouplingFieldInt64 : public MEDCouplingFieldT<int>
+  {
+  public:
+    static MEDCouplingFieldInt64 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
+    static MEDCouplingFieldInt64 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
+    bool isEqual(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
+    bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt64 *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(DataArrayInt64 *array);
+    MEDCouplingFieldInt64 *deepCopy() const;
+    MEDCouplingFieldInt64 *clone(bool recDeepCpy) const;
+    MEDCouplingFieldInt64 *cloneWithMesh(bool recDeepCpy) const;
+    MEDCouplingFieldDouble *convertToDblField() const;
+    MEDCouplingFieldInt64 *buildSubPartRange(int begin, int end, int step) const;
+    %extend {
+      MEDCouplingFieldInt64(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
+      {
+        return MEDCouplingFieldInt64::New(type,td);
+      }
+
+      MEDCouplingFieldInt64(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
+      {
+        return MEDCouplingFieldInt64::New(ft,td);
+      }
+
+      PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const
+      {
+        std::string ret1;
+        bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
+        PyObject *ret=PyTuple_New(2);
+        PyObject *ret0Py=ret0?Py_True:Py_False;
+        Py_XINCREF(ret0Py);
+        PyTuple_SetItem(ret,0,ret0Py);
+        PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
+        return ret;
+      }
+      
+      std::string __str__() const
+      {
+        return self->simpleRepr();
+      }
+
+      std::string __repr__() const
+      {
+        std::ostringstream oss;
+        self->reprQuickOverview(oss);
+        return oss.str();
+      }
+
+      MEDCouplingFieldInt64 *buildSubPart(PyObject *li) const
+      {
+        return fieldT_buildSubPart(self,li);
+      }
+
+      MEDCouplingFieldInt64 *__getitem__(PyObject *li) const
+      {
+        return fieldT__getitem__(self,li);
+      }
+
+      DataArrayInt64 *getArray()
+      {
+        DataArrayInt64 *ret=self->getArray();
+        if(ret)
+          ret->incrRef();
+        return ret;
+      }
+      
+      PyObject *getTime()
+        {
+        int tmp1,tmp2;
+        double tmp0=self->getTime(tmp1,tmp2);
+        PyObject *res = PyList_New(3);
+        PyList_SetItem(res,0,SWIG_From_double(tmp0));
+        PyList_SetItem(res,1,SWIG_From_int(tmp1));
+        PyList_SetItem(res,2,SWIG_From_int(tmp2));
+        return res;
+        }
+
+      PyObject *getTinySerializationInformation() const
+      {
+        return field_getTinySerializationInformation<MEDCouplingFieldInt64>(self);
+      }
+      
+      PyObject *serialize() const
+      {
+        return field_serialize<Int64>(self);
+      }
+
+      PyObject *__getstate__() const
+      {
+        return field__getstate__<MEDCouplingFieldInt64>(self,MEDCoupling_MEDCouplingFieldInt64_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt64_serialize);
+      }
+      
+      void __setstate__(PyObject *inp)
+      {
+        field__setstate__<Int64>(self,inp);
+      }
+    }
+  };
+
   class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
   {
   public:
@@ -6005,6 +6108,10 @@ def MEDCouplingFieldInt32Reduce(self):
     self.checkConsistencyLight()
     d=(self.getTypeOfField(),self.getTimeDiscretization())
     return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt32,(d,(self.__getstate__()),))
+def MEDCouplingFieldInt64Reduce(self):
+    self.checkConsistencyLight()
+    d=(self.getTypeOfField(),self.getTimeDiscretization())
+    return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt64,(d,(self.__getstate__()),))
 def MEDCouplingFieldFloatReduce(self):
     self.checkConsistencyLight()
     d=(self.getTypeOfField(),self.getTimeDiscretization())
@@ -6027,10 +6134,9 @@ def MEDCouplingFieldTemplateReduce(self):
 MEDCouplingUMesh.ExtractFromIndexedArrays           = DataArrayInt.ExtractFromIndexedArrays
 MEDCouplingUMesh.ExtractFromIndexedArraysSlice      = DataArrayInt.ExtractFromIndexedArraysSlice
 MEDCouplingUMesh.SetPartOfIndexedArrays             = DataArrayInt.SetPartOfIndexedArrays
-##MEDCouplingUMesh.SetPartOfIndexedArraysSlice        = DataArrayInt.SetPartOfIndexedArraysSlice
 MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx      = DataArrayInt.SetPartOfIndexedArraysSameIdx
 MEDCouplingUMesh.RemoveIdsFromIndexedArrays         = DataArrayInt.RemoveIdsFromIndexedArrays
-##MEDCouplingUMesh.SetPartOfIndexedArraysSameIdxSlice = DataArrayInt.SetPartOfIndexedArraysSameIdxSlice
+MEDCouplingFieldInt = MEDCouplingFieldInt32
 
 %}
 
index c2f2f2f400daba9a0a0f06868e0875849d6f825f..94c0ad0f86d7ceb953b06913cdfa369e70633f5c 100644 (file)
@@ -136,6 +136,8 @@ static PyObject *convertField(MEDCoupling::MEDCouplingField *f, int owner)
     ret=SWIG_NewPointerObj(reinterpret_cast<void*>(f),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,owner);
   if(dynamic_cast<MEDCoupling::MEDCouplingFieldInt32 *>(f))
     ret=SWIG_NewPointerObj(reinterpret_cast<void*>(f),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldInt32,owner);
+  if(dynamic_cast<MEDCoupling::MEDCouplingFieldInt64 *>(f))
+    ret=SWIG_NewPointerObj(reinterpret_cast<void*>(f),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldInt64,owner);
   if(dynamic_cast<MEDCoupling::MEDCouplingFieldFloat *>(f))
     ret=SWIG_NewPointerObj(reinterpret_cast<void*>(f),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldFloat,owner);
   if(!ret)
index 085a6d6a84c917c30d5dd403c921e7ca6834e0d3..6d723d61439dd9d1fb17fd6479248441c42847f3 100644 (file)
@@ -2612,7 +2612,7 @@ std::vector< std::vector<DataArrayDouble *> > MEDFileField1TS::getFieldSplitedBy
 
 //= MEDFileIntField1TS
 
-MCAuto<MEDCouplingFieldDouble> MEDFileIntField1TS::ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt *f)
+MCAuto<MEDCouplingFieldDouble> MEDFileIntField1TS::ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt32 *f)
 {
   if(!f)
     throw INTERP_KERNEL::Exception("MEDFileIntField1TS::ConvertFieldIntToFieldDouble : null input field !");
index 5784c02aad43191e64648e4d3dfc78abe5c8c932..7f931f14b8a28e5d9031648925ef27f40f22433d 100644 (file)
@@ -431,7 +431,7 @@ namespace MEDCoupling
     MEDLOADER_EXPORT MEDFileIntField1TS *shallowCpy() const { return new MEDFileIntField1TS(*this); }
     MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileIntField1TS"); }
   public:
-    MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldDouble> ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt *f);
+    MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldDouble> ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt32 *f);
   private:
     med_field_type getMEDFileFieldType() const { return MED_INT32; }
   private: