]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Addition of time inside MEDCouplingMesh class.
authorageay <ageay>
Tue, 15 Feb 2011 16:11:06 +0000 (16:11 +0000)
committerageay <ageay>
Tue, 15 Feb 2011 16:11:06 +0000 (16:11 +0000)
14 files changed:
src/MEDCoupling/MEDCouplingCMesh.cxx
src/MEDCoupling/MEDCouplingCMesh.hxx
src/MEDCoupling/MEDCouplingExtrudedMesh.cxx
src/MEDCoupling/MEDCouplingExtrudedMesh.hxx
src/MEDCoupling/MEDCouplingMesh.cxx
src/MEDCoupling/MEDCouplingMesh.hxx
src/MEDCoupling/MEDCouplingPointSet.cxx
src/MEDCoupling/MEDCouplingPointSet.hxx
src/MEDCoupling/MEDCouplingUMesh.cxx
src/MEDCoupling/MEDCouplingUMesh.hxx
src/MEDCoupling/MEDCouplingUMeshDesc.cxx
src/MEDCoupling/MEDCouplingUMeshDesc.hxx
src/MEDCoupling_Swig/MEDCoupling.i
src/ParaMEDMEM/ElementLocator.cxx

index b792233f5f48d60c24ae45155ce449a3a9fab59a..07e8e3768fce3f8a480558a4b1d9b912835fd5cb 100644 (file)
@@ -766,12 +766,16 @@ void MEDCouplingCMesh::fill3DUnstructuredMesh(MEDCouplingUMesh *m) const
   connI->decrRef();
 }
 
-void MEDCouplingCMesh::getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const
+void MEDCouplingCMesh::getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const
 {
+  int it,order;
+  double time=getTime(it,order);
   tinyInfo.clear();
+  tinyInfoD.clear();
   littleStrings.clear();
   littleStrings.push_back(getName());
   littleStrings.push_back(getDescription());
+  littleStrings.push_back(getTimeUnit());
   const DataArrayDouble *thisArr[3]={_x_array,_y_array,_z_array};
   for(int i=0;i<3;i++)
     {
@@ -785,6 +789,9 @@ void MEDCouplingCMesh::getTinySerializationInformation(std::vector<int>& tinyInf
       tinyInfo.push_back(val);
       littleStrings.push_back(st);
     }
+  tinyInfo.push_back(it);
+  tinyInfo.push_back(order);
+  tinyInfoD.push_back(time);
 }
 
 void MEDCouplingCMesh::resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const
@@ -816,11 +823,12 @@ void MEDCouplingCMesh::serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const
       a2Ptr=std::copy(thisArr[i]->getConstPointer(),thisArr[i]->getConstPointer()+thisArr[i]->getNumberOfTuples(),a2Ptr);
 }
 
-void MEDCouplingCMesh::unserialization(const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
+void MEDCouplingCMesh::unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
                                        const std::vector<std::string>& littleStrings)
 {
   setName(littleStrings[0].c_str());
   setDescription(littleStrings[1].c_str());
+  setTimeUnit(littleStrings[2].c_str());
   DataArrayDouble **thisArr[3]={&_x_array,&_y_array,&_z_array};
   const double *data=a2->getConstPointer();
   for(int i=0;i<3;i++)
@@ -829,10 +837,11 @@ void MEDCouplingCMesh::unserialization(const std::vector<int>& tinyInfo, const D
         {
           (*(thisArr[i]))=DataArrayDouble::New();
           (*(thisArr[i]))->alloc(tinyInfo[i],1);
-          (*(thisArr[i]))->setInfoOnComponent(0,littleStrings[i+2].c_str());
+          (*(thisArr[i]))->setInfoOnComponent(0,littleStrings[i+3].c_str());
           std::copy(data,data+tinyInfo[i],(*(thisArr[i]))->getPointer());
           data+=tinyInfo[i];
         }
     }
+  setTime(tinyInfoD[0],tinyInfo[3],tinyInfo[4]);
 }
 
index 3b3e50aa70ea2691bf02bbd3ac4084e3eb969666..45b4254ffeef4e2c4c01d2267e98c42595a951e1 100644 (file)
@@ -86,10 +86,10 @@ namespace ParaMEDMEM
     void getSplitCellValues(int *res) const;
     void getSplitNodeValues(int *res) const;
     //serialisation-unserialization
-    void getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
+    void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
     void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const;
     void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
-    void unserialization(const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
+    void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
                          const std::vector<std::string>& littleStrings);
   private:
     MEDCouplingCMesh();
index 6391ada0278985bbcf491d3fac0ad83def7a37fa..b212ebbb21a0a879315accec7e67824aec748d64 100644 (file)
@@ -687,14 +687,16 @@ void MEDCouplingExtrudedMesh::computeExtrusionAlg(const MEDCouplingUMesh *mesh3D
   revDescIndx->decrRef();
 }
 
-void MEDCouplingExtrudedMesh::getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const
+void MEDCouplingExtrudedMesh::getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const
 {
   std::vector<int> tinyInfo1;
   std::vector<std::string> ls1;
-  _mesh2D->getTinySerializationInformation(tinyInfo1,ls1);
+  std::vector<double> ls3;
+  _mesh2D->getTinySerializationInformation(ls3,tinyInfo1,ls1);
   std::vector<int> tinyInfo2;
   std::vector<std::string> ls2;
-  _mesh1D->getTinySerializationInformation(tinyInfo2,ls2);
+  std::vector<double> ls4;
+  _mesh1D->getTinySerializationInformation(ls4,tinyInfo2,ls2);
   tinyInfo.clear(); littleStrings.clear();
   tinyInfo.insert(tinyInfo.end(),tinyInfo1.begin(),tinyInfo1.end());
   littleStrings.insert(littleStrings.end(),ls1.begin(),ls1.end());
@@ -754,7 +756,7 @@ void MEDCouplingExtrudedMesh::serialize(DataArrayInt *&a1, DataArrayDouble *&a2)
   a2_2->decrRef();
 }
 
-void MEDCouplingExtrudedMesh::unserialization(const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings)
+void MEDCouplingExtrudedMesh::unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings)
 {
   setName(littleStrings[littleStrings.size()-2].c_str());
   setDescription(littleStrings.back().c_str());
@@ -775,7 +777,8 @@ void MEDCouplingExtrudedMesh::unserialization(const std::vector<int>& tinyInfo,
   a2Ptr+=a2tmp->getNbOfElems();
   a1Ptr+=a1tmp->getNbOfElems();
   ls2.insert(ls2.end(),littleStrings.begin(),littleStrings.begin()+ls1.size());
-  _mesh2D->unserialization(ti1,a1tmp,a2tmp,ls2);
+  std::vector<double> d1(1);
+  _mesh2D->unserialization(d1,ti1,a1tmp,a2tmp,ls2);
   a1tmp->decrRef(); a2tmp->decrRef();
   //
   ls2.clear();
@@ -786,7 +789,7 @@ void MEDCouplingExtrudedMesh::unserialization(const std::vector<int>& tinyInfo,
   std::copy(a2Ptr,a2Ptr+a2tmp->getNbOfElems(),a2tmp->getPointer());
   std::copy(a1Ptr,a1Ptr+a1tmp->getNbOfElems(),a1tmp->getPointer());
   a1Ptr+=a1tmp->getNbOfElems();
-  _mesh1D->unserialization(ti2,a1tmp,a2tmp,ls2);
+  _mesh1D->unserialization(d1,ti2,a1tmp,a2tmp,ls2);
   a1tmp->decrRef(); a2tmp->decrRef();
   //
   _mesh3D_ids=DataArrayInt::New();
index 7d87aabf28232a9591a8864230bda1523a7b6beb..be0937cb14078fb867f8e1146a4f1ae855dc40ba 100644 (file)
@@ -84,10 +84,10 @@ namespace ParaMEDMEM
     DataArrayDouble *getCoordinatesAndOwner() const;
     DataArrayDouble *getBarycenterAndOwner() const;
     //Serialization unserialisation
-    void getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
+    void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
     void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const;
     void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
-    void unserialization(const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
+    void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
                          const std::vector<std::string>& littleStrings);
   private:
     MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
index 4cd5dde75f18537dee4021ae8b94a07a95f862a2..49208b0fbe0d91665a8fd6c1de4d08858249b887 100644 (file)
 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
 
 #include <set>
+#include <cmath>
 #include <sstream>
 #include <iterator>
 
 using namespace ParaMEDMEM;
 
+MEDCouplingMesh::MEDCouplingMesh():_time(0.),_iteration(-1),_order(-1)
+{
+}
+
+MEDCouplingMesh::MEDCouplingMesh(const MEDCouplingMesh& other):_name(other._name),_description(other._description),
+                                                               _time(other._time),_iteration(other._iteration),
+                                                               _order(other._order),_time_unit(other._time_unit)
+{
+}
+
 /*!
  * This method is only for ParaMEDMEM in ParaFIELD constructor.
  */
@@ -39,7 +50,8 @@ bool MEDCouplingMesh::isStructured() const
 
 bool MEDCouplingMesh::isEqual(const MEDCouplingMesh *other, double prec) const
 {
-  return _name==other->_name && _description==other->_description;
+  return _name==other->_name && _description==other->_description && _iteration==other->_iteration
+    && _order==other->_order && _time_unit==other->_time_unit && fabs(_time-other->_time)<1e-12;
 }
 
 /*!
@@ -184,6 +196,7 @@ void MEDCouplingMesh::copyTinyStringsFrom(const MEDCouplingMesh *other) throw(IN
 {
   _name=other->_name;
   _description=other->_description;
+  _time_unit=other->_time_unit;
 }
 
 /*!
index 8c883beb1db50f158b13add2a86f756f62404c3d..ac0bc49abb13429df7208600e2a767afb6d59da4 100644 (file)
@@ -50,6 +50,10 @@ namespace ParaMEDMEM
     const char *getName() const { return _name.c_str(); }
     void setDescription(const char *descr) { _description=descr; }
     const char *getDescription() const { return _description.c_str(); }
+    double getTime(int& iteration, int& order) const { iteration=_iteration; order=_order; return _time; }
+    void setTime(double val, int iteration, int order) { _time=val; _iteration=iteration; _order=order; }
+    void setTimeUnit(const char *unit) { _time_unit=unit; }
+    const char *getTimeUnit() const { return _time_unit.c_str(); }
     virtual MEDCouplingMesh *deepCpy() const = 0;
     virtual MEDCouplingMeshType getType() const = 0;
     bool isStructured() const;
@@ -99,18 +103,22 @@ namespace ParaMEDMEM
     virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const;
     static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2);
     //serialisation-unserialization
-    virtual void getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const = 0;
+    virtual void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const = 0;
     virtual void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const = 0;
     virtual void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const = 0;
-    virtual void unserialization(const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
+    virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
                                  const std::vector<std::string>& littleStrings) = 0;
   protected:
-    MEDCouplingMesh() { }
-    MEDCouplingMesh(const MEDCouplingMesh& other):_name(other._name),_description(other._description) { }
+    MEDCouplingMesh();
+    MEDCouplingMesh(const MEDCouplingMesh& other);
     virtual ~MEDCouplingMesh() { }
   private:
     std::string _name;
     std::string _description;
+    double _time;
+    int _iteration;
+    int _order;
+    std::string _time_unit;
   };
 }
 
index 329377252449634d8e2e87b3541301f4f0578acb..816023a9bc0458c627bba1b9266ddd4eb00fb95a 100644 (file)
@@ -597,31 +597,41 @@ MEDCouplingPointSet *MEDCouplingPointSet::BuildInstanceFromMeshType(MEDCouplingM
 /*!
  * First step of serialization process. Used by ParaMEDMEM and MEDCouplingCorba to transfert data between process.
  */
-void MEDCouplingPointSet::getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const
+void MEDCouplingPointSet::getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const
 {
+  int it,order;
+  double time=getTime(it,order);
   if(_coords)
     {
       int spaceDim=getSpaceDimension();
-      littleStrings.resize(spaceDim+3);
+      littleStrings.resize(spaceDim+4);
       littleStrings[0]=getName();
       littleStrings[1]=getDescription();
       littleStrings[2]=_coords->getName();
+      littleStrings[3]=getTimeUnit();
       for(int i=0;i<spaceDim;i++)
-        littleStrings[i+3]=getCoords()->getInfoOnComponent(i);
+        littleStrings[i+4]=getCoords()->getInfoOnComponent(i);
       tinyInfo.clear();
       tinyInfo.push_back(getType());
       tinyInfo.push_back(spaceDim);
       tinyInfo.push_back(getNumberOfNodes());
+      tinyInfo.push_back(it);
+      tinyInfo.push_back(order);
+      tinyInfoD.push_back(time);
     }
   else
     {
-      littleStrings.resize(2);
+      littleStrings.resize(3);
       littleStrings[0]=getName();
       littleStrings[1]=getDescription();
+      littleStrings[2]=getTimeUnit();
       tinyInfo.clear();
       tinyInfo.push_back(getType());
       tinyInfo.push_back(-1);
       tinyInfo.push_back(-1);
+      tinyInfo.push_back(it);
+      tinyInfo.push_back(order);
+      tinyInfoD.push_back(time);
     }
 }
 
@@ -648,11 +658,11 @@ void MEDCouplingPointSet::resizeForUnserialization(const std::vector<int>& tinyI
   if(tinyInfo[2]>=0 && tinyInfo[1]>=1)
     {
       a2->alloc(tinyInfo[2],tinyInfo[1]);
-      littleStrings.resize(tinyInfo[1]+3);
+      littleStrings.resize(tinyInfo[1]+4);
     }
   else
     {
-      littleStrings.resize(2);
+      littleStrings.resize(3);
     }
 }
 
@@ -660,7 +670,7 @@ void MEDCouplingPointSet::resizeForUnserialization(const std::vector<int>& tinyI
  * Second and final unserialization process.
  * @param tinyInfo must be equal to the result given by getTinySerializationInformation method.
  */
-void MEDCouplingPointSet::unserialization(const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings)
+void MEDCouplingPointSet::unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings)
 {
   if(tinyInfo[2]>=0 && tinyInfo[1]>=1)
     {
@@ -668,13 +678,17 @@ void MEDCouplingPointSet::unserialization(const std::vector<int>& tinyInfo, cons
       setName(littleStrings[0].c_str());
       setDescription(littleStrings[1].c_str());
       a2->setName(littleStrings[2].c_str());
+      setTimeUnit(littleStrings[3].c_str());
       for(int i=0;i<tinyInfo[1];i++)
-        getCoords()->setInfoOnComponent(i,littleStrings[i+3].c_str());
+        getCoords()->setInfoOnComponent(i,littleStrings[i+4].c_str());
+      setTime(tinyInfoD[0],tinyInfo[3],tinyInfo[4]);
     }
   else
     {
       setName(littleStrings[0].c_str());
       setDescription(littleStrings[1].c_str());
+      setTimeUnit(littleStrings[2].c_str());
+      setTime(tinyInfoD[0],tinyInfo[3],tinyInfo[4]);
     }
 }
 
index 2a3cc85279a43470692e9f2f68cfc521c1419e33..f18a77b0fa55212def47b89c40a1ed855cef50a1 100644 (file)
@@ -87,10 +87,10 @@ namespace ParaMEDMEM
     virtual void renumberNodes2(const int *newNodeNumbers, int newNbOfNodes);
     virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const = 0;
     //! size of returned tinyInfo must be always the same.
-    void getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
+    void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
     void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const;
     void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
-    void unserialization(const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
+    void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
                          const std::vector<std::string>& littleStrings);
     virtual void getCellsInBoundingBox(const double *bbox, double eps, std::vector<int>& elems) = 0;
     virtual void getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector<int>& elems) = 0;
index 4872671268b30ec15205d673e4514e11707b4d8c..8f3ad75e8be423f5bbe4737cfc0009f1d9255a92 100644 (file)
@@ -1663,9 +1663,9 @@ int MEDCouplingUMesh::getMeshLength() const
 /*!
  * First step of serialization process. Used by ParaMEDMEM and MEDCouplingCorba to transfert data between process.
  */
-void MEDCouplingUMesh::getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const
+void MEDCouplingUMesh::getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const
 {
-  MEDCouplingPointSet::getTinySerializationInformation(tinyInfo,littleStrings);
+  MEDCouplingPointSet::getTinySerializationInformation(tinyInfoD,tinyInfo,littleStrings);
   tinyInfo.push_back(getMeshDimension());
   tinyInfo.push_back(getNumberOfCells());
   if(_nodal_connec)
@@ -1679,7 +1679,7 @@ void MEDCouplingUMesh::getTinySerializationInformation(std::vector<int>& tinyInf
  */
 bool MEDCouplingUMesh::isEmptyMesh(const std::vector<int>& tinyInfo) const
 {
-  return tinyInfo[4]<=0;
+  return tinyInfo[6]<=0;
 }
 
 /*!
@@ -1690,7 +1690,7 @@ void MEDCouplingUMesh::resizeForUnserialization(const std::vector<int>& tinyInfo
 {
   MEDCouplingPointSet::resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
   if(tinyInfo[5]!=-1)
-    a1->alloc(tinyInfo[5]+tinyInfo[4]+1,1);
+    a1->alloc(tinyInfo[7]+tinyInfo[6]+1,1);
 }
 
 /*!
@@ -1717,20 +1717,20 @@ void MEDCouplingUMesh::serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const
  * Second and final unserialization process.
  * @param tinyInfo must be equal to the result given by getTinySerializationInformation method.
  */
-void MEDCouplingUMesh::unserialization(const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings)
+void MEDCouplingUMesh::unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings)
 {
-  MEDCouplingPointSet::unserialization(tinyInfo,a1,a2,littleStrings);
-  setMeshDimension(tinyInfo[3]);
-  if(tinyInfo[5]!=-1)
+  MEDCouplingPointSet::unserialization(tinyInfoD,tinyInfo,a1,a2,littleStrings);
+  setMeshDimension(tinyInfo[5]);
+  if(tinyInfo[7]!=-1)
     {
       // Connectivity
       const int *recvBuffer=a1->getConstPointer();
       DataArrayInt* myConnecIndex=DataArrayInt::New();
-      myConnecIndex->alloc(tinyInfo[4]+1,1);
-      std::copy(recvBuffer,recvBuffer+tinyInfo[4]+1,myConnecIndex->getPointer());
+      myConnecIndex->alloc(tinyInfo[6]+1,1);
+      std::copy(recvBuffer,recvBuffer+tinyInfo[6]+1,myConnecIndex->getPointer());
       DataArrayInt* myConnec=DataArrayInt::New();
-      myConnec->alloc(tinyInfo[5],1);
-      std::copy(recvBuffer+tinyInfo[4]+1,recvBuffer+tinyInfo[4]+1+tinyInfo[5],myConnec->getPointer());
+      myConnec->alloc(tinyInfo[7],1);
+      std::copy(recvBuffer+tinyInfo[6]+1,recvBuffer+tinyInfo[6]+1+tinyInfo[7],myConnec->getPointer());
       setConnectivity(myConnec, myConnecIndex) ;
       myConnec->decrRef();
       myConnecIndex->decrRef();
index c820f6899e209f3514bbc915e734adb04cde1e31..9e4597d4c5523e02db5b0644ebc1ea52664c977e 100644 (file)
@@ -68,11 +68,11 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT int getMeshLength() const;
     MEDCOUPLING_EXPORT void computeTypes();
     //! size of returned tinyInfo must be always the same.
-    MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
+    MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
     MEDCOUPLING_EXPORT bool isEmptyMesh(const std::vector<int>& tinyInfo) const;
     MEDCOUPLING_EXPORT void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const;
     MEDCOUPLING_EXPORT void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
-    MEDCOUPLING_EXPORT void unserialization(const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
+    MEDCOUPLING_EXPORT void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
     //tools
     MEDCOUPLING_EXPORT bool areCellsEqual(int cell1, int cell2, int compType) const;
     MEDCOUPLING_EXPORT bool areCellsEqual0(int cell1, int cell2) const;
index 562dcdf52d7f7b5c6ab13f238776b3d6fb35ca57..f09efe65889913513d8f22abb30876df5dbc35a9 100644 (file)
@@ -174,9 +174,9 @@ void MEDCouplingUMeshDesc::setConnectivity(DataArrayInt *descConn, DataArrayInt
   computeTypes();
 }
 
-void MEDCouplingUMeshDesc::getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const
+void MEDCouplingUMeshDesc::getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const
 {
-  MEDCouplingPointSet::getTinySerializationInformation(tinyInfo,littleStrings);
+  MEDCouplingPointSet::getTinySerializationInformation(tinyInfoD,tinyInfo,littleStrings);
   tinyInfo.push_back(getMeshDimension());
   tinyInfo.push_back(getNumberOfNodes());
   tinyInfo.push_back(getNumberOfCells());
@@ -214,10 +214,10 @@ void MEDCouplingUMeshDesc::serialize(DataArrayInt *&a1, DataArrayDouble *&a2) co
   std::copy(faceConnIndex,faceConnIndex+getNumberOfFaces()+1,ptA1);
 }
 
-void MEDCouplingUMeshDesc::unserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings)
+void MEDCouplingUMeshDesc::unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings)
 {
   std::vector<int> tinyInfoTmp(tinyInfo.begin()+1,tinyInfo.end());
-  MEDCouplingPointSet::unserialization(tinyInfoTmp,a1,a2,littleStrings);
+  MEDCouplingPointSet::unserialization(tinyInfoD,tinyInfoTmp,a1,a2,littleStrings);
   //
   const int *recvBuffer=a1->getConstPointer();
   DataArrayInt *descConn=DataArrayInt::New();
index 0c063e44962d3f0d8ec5055e67b9878d6b7f0859..c83a1ec71b1472af730ab56f709ab5553d156bf7 100644 (file)
@@ -54,11 +54,11 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return UNSTRUCTURED_DESC; }
     MEDCOUPLING_EXPORT void setConnectivity(DataArrayInt *descConn, DataArrayInt *descConnIndex, DataArrayInt *nodalFaceConn, DataArrayInt *nodalFaceConnIndx);
     //tools to overload
-    MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
+    MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
     MEDCOUPLING_EXPORT bool isEmptyMesh(const std::vector<int>& tinyInfo) const;
     MEDCOUPLING_EXPORT void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings);
     MEDCOUPLING_EXPORT void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
-    MEDCOUPLING_EXPORT void unserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
+    MEDCOUPLING_EXPORT void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
     MEDCOUPLING_EXPORT void getCellsInBoundingBox(const double *bbox, double eps, std::vector<int>& elems);
     MEDCOUPLING_EXPORT void getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps, std::vector<int>& elems);
     MEDCOUPLING_EXPORT DataArrayInt *mergeNodes(double precision, bool& areNodesMerged, int& newNbOfNodes);
index b1a69f29cbf1f2e0c7433c83519a67256f522c88..2b4d8e46fa3eafaaae108e709aceedf22a4b8dcb 100644 (file)
@@ -283,6 +283,9 @@ namespace ParaMEDMEM
     const char *getName() const;
     void setDescription(const char *descr);
     const char *getDescription() const;
+    void setTime(double val, int iteration, int order);
+    void setTimeUnit(const char *unit);
+    const char *getTimeUnit() const;
     virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception) = 0;
     bool isStructured() const throw(INTERP_KERNEL::Exception);
     virtual MEDCouplingMesh *deepCpy() const = 0;
@@ -317,6 +320,17 @@ namespace ParaMEDMEM
            return self->simpleRepr();
          }
 
+         PyObject *getTime() throw(INTERP_KERNEL::Exception)
+         {
+           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;
+         }
+
          int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
          {
            int sz;
@@ -490,10 +504,10 @@ namespace ParaMEDMEM
       virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception) = 0;
       virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception) = 0;
       //! size of returned tinyInfo must be always the same.
-      void getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
+      void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
       void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
       void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const throw(INTERP_KERNEL::Exception);
-      void unserialization(const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
+      void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
                            const std::vector<std::string>& littleStrings) throw(INTERP_KERNEL::Exception);
       virtual void getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector<int>& elems) throw(INTERP_KERNEL::Exception) = 0;
       virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception) = 0;
index 45e5457e358ebc90a0a0c31d9d220ceac2f0af8d..ad0ecbfcbdd6a57eaa1650f1b20e1b13c9fe6a1a 100644 (file)
@@ -231,11 +231,12 @@ namespace ParaMEDMEM
   
     // First stage : exchanging sizes
     // ------------------------------
+    vector<double> tinyInfoLocalD,tinyInfoDistantD(1);//not used for the moment
     vector<int> tinyInfoLocal,tinyInfoDistant;
     vector<string> tinyInfoLocalS;
     //Getting tiny info of local mesh to allow the distant proc to initialize and allocate
     //the transmitted mesh.
-    local_mesh->getTinySerializationInformation(tinyInfoLocal,tinyInfoLocalS);
+    local_mesh->getTinySerializationInformation(tinyInfoLocalD,tinyInfoLocal,tinyInfoLocalS);
     tinyInfoLocal.push_back(distant_ids_send->getNumberOfTuples());
     tinyInfoDistant.resize(tinyInfoLocal.size());
     std::fill(tinyInfoDistant.begin(),tinyInfoDistant.end(),0);
@@ -302,7 +303,7 @@ namespace ParaMEDMEM
     //
     distant_mesh=distant_mesh_tmp;
     //finish unserialization
-    distant_mesh->unserialization(tinyInfoDistant,v1Distant,v2Distant,unusedTinyDistantSts);
+    distant_mesh->unserialization(tinyInfoDistantD,tinyInfoDistant,v1Distant,v2Distant,unusedTinyDistantSts);
     //
     distant_ids_recv=new int[tinyInfoDistant.back()];
     comm_interface.sendRecv((void *)distant_ids_send->getConstPointer(),tinyInfoLocal.back(), MPI_INT,