Salome HOME
Copyright update 2022
[tools/medcoupling.git] / src / ParaMEDMEM_Swig / ParaMEDMEMCommon.i
index b1fcf01033fa7e298dc9d8a650d67a838a5c86ca..290da2a8a008e39bbe4787b4bec22efad6ced024 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include "InterpKernelDEC.hxx"
 #include "NonCoincidentDEC.hxx"
 #include "StructuredCoincidentDEC.hxx"
+#include "OverlapDEC.hxx"
 #include "ParaMESH.hxx"
 #include "ParaFIELD.hxx"
-#include "ICoCoMEDField.hxx"
+#include "ICoCoMEDDoubleField.hxx"
+#include "ICoCoMEDIntField.hxx"
 #include "ComponentTopology.hxx"
 #include "ParaUMesh.hxx"
 #include "ParaSkyLineArray.hxx"
+#include "ParaDataArray.hxx"
 
 using namespace INTERP_KERNEL;
 using namespace MEDCoupling;
@@ -53,10 +56,7 @@ using namespace ICoCo;
 %include "DisjointDEC.hxx"
 %include "InterpKernelDEC.hxx"
 %include "StructuredCoincidentDEC.hxx"
-
-%include "ICoCoField.hxx"
-%rename(ICoCoMEDField) ICoCo::MEDField;
-%include "ICoCoMEDField.hxx"
+%include "OverlapDEC.hxx"
 
 %newobject MEDCoupling::ParaUMesh::New;
 %newobject MEDCoupling::ParaUMesh::getMesh;
@@ -64,6 +64,12 @@ using namespace ICoCo;
 %newobject MEDCoupling::ParaUMesh::getGlobalNodeIds;
 %newobject MEDCoupling::ParaUMesh::getCellIdsLyingOnNodes;
 %newobject MEDCoupling::ParaUMesh::redistributeCells;
+%newobject MEDCoupling::ParaUMesh::redistributeCellField;
+%newobject MEDCoupling::ParaUMesh::redistributeNodeField;
+%newobject MEDCoupling::ParaDataArrayInt32::New;
+%newobject MEDCoupling::ParaDataArrayInt32::buildComplement;
+%newobject MEDCoupling::ParaDataArrayInt64::New;
+%newobject MEDCoupling::ParaDataArrayInt64::buildComplement;
 %newobject MEDCoupling::ParaSkyLineArray::New;
 %newobject MEDCoupling::ParaSkyLineArray::equiRedistribute;
 %newobject MEDCoupling::ParaSkyLineArray::getSkyLineArray;
@@ -71,6 +77,8 @@ using namespace ICoCo;
 
 %feature("unref") ParaSkyLineArray "$this->decrRef();"
 %feature("unref") ParaUMesh "$this->decrRef();"
+%feature("unref") ParaDataArrayInt32 "$this->decrRef();"
+%feature("unref") ParaDataArrayInt64 "$this->decrRef();"
 
 %nodefaultctor;
 
@@ -160,6 +168,10 @@ namespace MEDCoupling
   public:
     static ParaUMesh *New(MEDCouplingUMesh *mesh, DataArrayIdType *globalCellIds, DataArrayIdType *globalNodeIds);
     ParaUMesh *redistributeCells(const DataArrayIdType *globalCellIds) const;
+    DataArrayIdType *redistributeCellField(const DataArrayIdType *globalCellIds, const DataArrayIdType *fieldValueToRed) const;
+    DataArrayDouble *redistributeCellField(const DataArrayIdType *globalCellIds, const DataArrayDouble *fieldValueToRed) const;
+    DataArrayIdType *redistributeNodeField(const DataArrayIdType *globalCellIds, const DataArrayIdType *fieldValueToRed) const;
+    DataArrayDouble *redistributeNodeField(const DataArrayIdType *globalCellIds, const DataArrayDouble *fieldValueToRed) const;
     %extend
     {
       ParaUMesh(MEDCouplingUMesh *mesh, DataArrayIdType *globalCellIds, DataArrayIdType *globalNodeIds)
@@ -196,6 +208,38 @@ namespace MEDCoupling
     }
   };
 
+  class ParaDataArray : public RefCountObject
+  {
+  };
+
+  class ParaDataArrayInt32 : public ParaDataArray
+  {
+  public:
+    static ParaDataArrayInt32 *New(DataArrayInt32 *seqDa);
+    DataArrayIdType *buildComplement(int nbOfElems) const;
+    %extend
+    {
+      ParaDataArrayInt32(DataArrayInt32 *seqDa)
+      {
+        return ParaDataArrayInt32::New(seqDa);
+      }
+    }
+  };
+
+  class ParaDataArrayInt64 : public ParaDataArray
+  {
+  public:
+    static ParaDataArrayInt64 *New(DataArrayInt64 *seqDa);
+    DataArrayIdType *buildComplement(long nbOfElems) const;
+    %extend
+    {
+      ParaDataArrayInt64(DataArrayInt64 *seqDa)
+      {
+        return ParaDataArrayInt64::New(seqDa);
+      }
+    }
+  };
+
   class ParaSkyLineArray : public RefCountObject
   {
   public:
@@ -273,3 +317,10 @@ public:
     return ret;
   }
 }
+
+%pythoncode %{
+if MEDCouplingUse64BitIDs():
+  ParaDataArrayInt = ParaDataArrayInt64
+else:
+  ParaDataArrayInt = ParaDataArrayInt32
+%}