]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
Ready to integrate management of fields on AMR mesh.
authorgeay <anthony.geay@cea.fr>
Wed, 28 May 2014 08:21:22 +0000 (10:21 +0200)
committergeay <anthony.geay@cea.fr>
Wed, 28 May 2014 08:21:22 +0000 (10:21 +0200)
src/MEDCoupling/MEDCouplingCartesianAMRMesh.cxx
src/MEDCoupling/MEDCouplingCartesianAMRMesh.hxx
src/MEDCoupling_Swig/MEDCouplingBasicsTest.py
src/MEDCoupling_Swig/MEDCouplingCommon.i
src/MEDCoupling_Swig/MEDCouplingTypemaps.i

index 0960420631fe4c55ff51c3b0db6aa5c6b4496911..8aa50804e9a7682d86e44dc346085a5495a9c89d 100644 (file)
@@ -53,6 +53,22 @@ MEDCouplingCartesianAMRPatchGen::MEDCouplingCartesianAMRPatchGen(MEDCouplingCart
   _mesh=mesh; _mesh->incrRef();
 }
 
+const MEDCouplingCartesianAMRMeshGen *MEDCouplingCartesianAMRPatchGen::getMeshSafe() const
+{
+  const MEDCouplingCartesianAMRMeshGen *mesh(_mesh);
+  if(!mesh)
+    throw INTERP_KERNEL::Exception("MEDCouplingCartesianAMRPatchGen::getMeshSafe const : the mesh is NULL !");
+  return mesh;
+}
+
+MEDCouplingCartesianAMRMeshGen *MEDCouplingCartesianAMRPatchGen::getMeshSafe()
+{
+  MEDCouplingCartesianAMRMeshGen *mesh(_mesh);
+    if(!mesh)
+      throw INTERP_KERNEL::Exception("MEDCouplingCartesianAMRPatchGen::getMeshSafe : the mesh is NULL !");
+    return mesh;
+}
+
 std::vector<const BigMemoryObject *> MEDCouplingCartesianAMRPatchGen::getDirectChildren() const
 {
   std::vector<const BigMemoryObject *> ret;
@@ -73,6 +89,11 @@ MEDCouplingCartesianAMRPatch::MEDCouplingCartesianAMRPatch(MEDCouplingCartesianA
     throw INTERP_KERNEL::Exception("MEDCouplingCartesianAMRPatch constructor : space dimension of father and input bottomLeft/topRight size mismatches !");
 }
 
+void MEDCouplingCartesianAMRPatch::addPatch(const std::vector< std::pair<int,int> >& bottomLeftTopRight, const std::vector<int>& factors)
+{
+  return getMeshSafe()->addPatch(bottomLeftTopRight,factors);
+}
+
 int MEDCouplingCartesianAMRPatch::getNumberOfOverlapedCellsForFather() const
 {
   return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(_bl_tr);
@@ -1039,7 +1060,21 @@ MEDCouplingCartesianAMRMesh *MEDCouplingCartesianAMRMesh::New(const std::string&
   return new MEDCouplingCartesianAMRMesh(meshName,spaceDim,nodeStrctStart,nodeStrctStop,originStart,originStop,dxyzStart,dxyzStop);
 }
 
+void MEDCouplingCartesianAMRMesh::setData(MEDCouplingDataForGodFather *data)
+{
+  _data=data;
+}
+
 MEDCouplingCartesianAMRMesh::MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, const int *nodeStrctStart, const int *nodeStrctStop,
                                                          const double *originStart, const double *originStop, const double *dxyzStart, const double *dxyzStop):MEDCouplingCartesianAMRMeshGen(meshName,spaceDim,nodeStrctStart,nodeStrctStop,originStart,originStop,dxyzStart,dxyzStop)
 {
 }
+
+std::vector<const BigMemoryObject *> MEDCouplingCartesianAMRMesh::getDirectChildren() const
+{
+  std::vector<const BigMemoryObject *> ret(MEDCouplingCartesianAMRMeshGen::getDirectChildren());
+  const MEDCouplingDataForGodFather *pt(_data);
+  if(pt)
+    ret.push_back(pt);
+  return ret;
+}
index cf467e235d31fc141d848e3e14b92e05e000bea2..bd38f61d28539b3f05230a7ec92546d341fd4b6c 100644 (file)
@@ -51,6 +51,8 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT const MEDCouplingCartesianAMRMeshGen *getMesh() const { return _mesh; }
   protected:
     MEDCouplingCartesianAMRPatchGen(MEDCouplingCartesianAMRMeshGen *mesh);
+    const MEDCouplingCartesianAMRMeshGen *getMeshSafe() const;
+    MEDCouplingCartesianAMRMeshGen *getMeshSafe();
   private:
     std::vector<const BigMemoryObject *> getDirectChildren() const;
   protected:
@@ -83,7 +85,7 @@ namespace ParaMEDMEM
     std::size_t getHeapMemorySizeWithoutChildren() const;
   };
 
-  class MEDCouplingGodFatherData : public RefCountObject
+  class MEDCouplingDataForGodFather : public RefCountObject
   {
   };
   /// @endcond
@@ -161,9 +163,15 @@ namespace ParaMEDMEM
   public:
     MEDCOUPLING_EXPORT static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, const int *nodeStrctStart, const int *nodeStrctStop,
                                                                const double *originStart, const double *originStop, const double *dxyzStart, const double *dxyzStop);
+    MEDCOUPLING_EXPORT const MEDCouplingDataForGodFather *getDataConst() const { return _data; }
+    MEDCOUPLING_EXPORT MEDCouplingDataForGodFather *getData() { return _data; }
+    MEDCOUPLING_EXPORT void setData(MEDCouplingDataForGodFather *data);
   private:
     MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, const int *nodeStrctStart, const int *nodeStrctStop,
                                 const double *originStart, const double *originStop, const double *dxyzStart, const double *dxyzStop);
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+  private:
+    MEDCouplingAutoRefCountObjectPtr<MEDCouplingDataForGodFather> _data;
   };
 }
 
index 3fa6114d6cbac121a44dd22096dde27c05e889be..f36dd9f429ae4cd7a806a9ca57d1e262c2234b09 100644 (file)
@@ -15189,6 +15189,15 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         f4=MEDCouplingFieldDouble(ON_CELLS) ; f4.setMesh(amr[4].getMesh().getImageMesh().buildWithGhost(1)) ; f4.setArray(da4) ; f4.setName("p4") ; f4.checkCoherency()
         #
         self.assertTrue(da0.isEqual(DataArrayDouble([28.8,16.9,16.9,16.9,16.9,17.9,17.9,17.9,17.9,18.9,18.9,18.9,18.9,25.7,34.8,23.9,23.9,23.9,23.9,24.9,24.9,24.9,24.9,25.9,25.9,25.9,25.9,31.7,40.8,23.9,23.9,23.9,23.9,24.9,24.9,24.9,24.9,25.9,25.9,25.9,25.9,37.7,46.8,23.9,23.9,23.9,23.9,24.9,24.9,24.9,24.9,25.9,25.9,25.9,25.9,43.7,52.8,23.9,23.9,23.9,23.9,24.9,24.9,24.9,24.9,25.9,25.9,25.9,25.9,49.7,58.8,30.9,30.9,30.9,30.9,31.9,31.9,31.9,31.9,32.9,32.9,32.9,32.9,7.6,64.8,30.9,30.9,30.9,30.9,31.9,31.9,31.9,31.9,32.9,32.9,32.9,32.9,13.6,70.8,30.9,30.9,30.9,30.9,31.9,31.9,31.9,31.9,32.9,32.9,32.9,32.9,19.6,76.8,30.9,30.9,30.9,30.9,31.9,31.9,31.9,31.9,32.9,32.9,32.9,32.9,25.6,36.9,37.9,37.9,37.9,37.9,38.9,38.9,38.9,38.9,39.9,39.9,39.9,39.9,40.9]),1e-12))
+        #
+        g0=amr.retrieveGridsAt(0)
+        self.assertEqual(1,len(g0))
+        self.assertTrue(isinstance(g0[0],MEDCouplingCartesianAMRPatchGF))
+        g1=amr.retrieveGridsAt(1)
+        self.assertEqual(5,len(g1))
+        for i in xrange(5):
+            self.assertTrue(isinstance(g1[i],MEDCouplingCartesianAMRPatch))
+            pass
         pass
 
     def setUp(self):
index b3eae00602ca7248d8d4825263aa4d8acd097521..24a60c9c4d9e82fe60e34dd5175919a624fd8fc1 100644 (file)
@@ -80,6 +80,19 @@ using namespace INTERP_KERNEL;
 }
 //$$$$$$$$$$$$$$$$$$
 
+////////////////////
+%typemap(out) MEDCouplingCartesianAMRPatchGen*
+{
+  $result=convertCartesianAMRPatch($1,$owner);
+}
+//$$$$$$$$$$$$$$$$$$
+
+////////////////////
+%typemap(out) MEDCouplingCartesianAMRMeshGen*
+{
+  $result=convertCartesianAMRMesh($1,$owner);
+}
+//$$$$$$$$$$$$$$$$$$
 
 ////////////////////
 %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
@@ -316,19 +329,21 @@ using namespace INTERP_KERNEL;
 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRPatch::getMesh;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRPatch::__getitem__;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::getMesh;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::__getitem__;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getImageMesh;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getGodFather;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getFather;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getPatch;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::__getitem__;
 %newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::New;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::buildUnstructured;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::buildMeshFromPatchEnvelop;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::buildMeshOfDirectChildrenOnly;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getImageMesh;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getGodFather;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getFather;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getPatch;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::createCellFieldOnPatch;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::findPatchesInTheNeighborhoodOf;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::__getitem__;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getDataConst;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getData;
 %newobject ParaMEDMEM::DenseMatrix::New;
 %newobject ParaMEDMEM::DenseMatrix::deepCpy;
 %newobject ParaMEDMEM::DenseMatrix::shallowCpy;
@@ -359,8 +374,13 @@ using namespace INTERP_KERNEL;
 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
+%feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
+%feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
+%feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
+%feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
+%feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
 %feature("unref") DenseMatrix "$this->decrRef();"
 
 %rename(assign) *::operator=;
@@ -4736,16 +4756,30 @@ namespace ParaMEDMEM
   };
 
   class MEDCouplingCartesianAMRMesh;
-
-  class MEDCouplingCartesianAMRPatch : public RefCountObject
+  
+  class MEDCouplingCartesianAMRPatchGen : public RefCountObject
   {
   public:
     int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
     int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
     int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
+    %extend
+    {
+      MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
+      {
+        MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
+        if(ret)
+          ret->incrRef();
+        return ret;
+      }
+    }
+  };
+
+  class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
+  {
+  public:
     int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
     bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
-    bool isGodFatherPatch() const throw(INTERP_KERNEL::Exception);
     %extend
     {
       PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
@@ -4754,14 +4788,6 @@ namespace ParaMEDMEM
         return convertFromVectorPairInt(ret);
       }
 
-      MEDCouplingCartesianAMRMesh *getMesh() const throw(INTERP_KERNEL::Exception)
-      {
-        MEDCouplingCartesianAMRMesh *ret(const_cast<MEDCouplingCartesianAMRMesh *>(self->getMesh()));
-        if(ret)
-          ret->incrRef();
-        return ret;
-      }
-
       void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
       {
         std::vector< std::pair<int,int> > inp;
@@ -4771,9 +4797,9 @@ namespace ParaMEDMEM
 
       MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
       {
-        const MEDCouplingCartesianAMRMesh *mesh(self->getMesh());
+        const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
         if(!mesh)
-          throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__getitem__ : no underlying mesh !");
+          throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
         if(patchId==mesh->getNumberOfPatches())
           {
             std::ostringstream oss;
@@ -4789,7 +4815,7 @@ namespace ParaMEDMEM
 
       void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
       {
-        MEDCouplingCartesianAMRMesh *mesh(const_cast<MEDCouplingCartesianAMRMesh *>(self->getMesh()));
+        MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
         if(!mesh)
           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
         mesh->removePatch(patchId);
@@ -4797,15 +4823,23 @@ namespace ParaMEDMEM
 
       int __len__() const throw(INTERP_KERNEL::Exception)
       {
-        const MEDCouplingCartesianAMRMesh *mesh(self->getMesh());
+        const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
         if(!mesh)
           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
         return mesh->getNumberOfPatches();
       }
     }
   };
+
+  class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
+  {
+  };
+
+  class MEDCouplingDataForGodFather : public RefCountObject
+  {
+  };
   
-  class MEDCouplingCartesianAMRMesh : public RefCountObject, public TimeLabel
+  class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
   {
   public:
     int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
@@ -4834,30 +4868,6 @@ namespace ParaMEDMEM
     DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
     %extend
     {
-      static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
-      {
-        static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
-        static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
-        const int *nodeStrctPtr(0);
-        const double *originPtr(0),*dxyzPtr(0);
-        int sw,sz,val0;
-        std::vector<int> bb0;
-        nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
-        //
-        double val,val2;
-        std::vector<double> bb,bb2;
-        int sz1,sz2;
-        originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
-        dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
-        //
-        return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
-      }
-
-      MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
-      {
-        return ParaMEDMEM_MEDCouplingCartesianAMRMesh_New(meshName,spaceDim,nodeStrct,origin,dxyz);
-      }
-
       void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
       {
         std::vector< std::pair<int,int> > inp;
@@ -4865,17 +4875,27 @@ namespace ParaMEDMEM
         self->addPatch(inp,factors);
       }
 
-      MEDCouplingCartesianAMRMesh *getFather() const throw(INTERP_KERNEL::Exception)
+      PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
+      {
+        std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
+        int sz(ps.size());
+        PyObject *ret = PyList_New(sz);
+        for(int i=0;i<sz;i++)
+          PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
+        return ret;
+      }
+
+      MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
       {
-        MEDCouplingCartesianAMRMesh *ret(const_cast<MEDCouplingCartesianAMRMesh *>(self->getFather()));
+        MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
         if(ret)
           ret->incrRef();
         return ret;
       }
       
-      MEDCouplingCartesianAMRMesh *getGodFather() const throw(INTERP_KERNEL::Exception)
+      MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
       {
-        MEDCouplingCartesianAMRMesh *ret(const_cast<MEDCouplingCartesianAMRMesh *>(self->getGodFather()));
+        MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
         if(ret)
           ret->incrRef();
         return ret;
@@ -4931,6 +4951,58 @@ namespace ParaMEDMEM
     }
   };
 
+  class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
+  {
+  };
+
+  class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
+  {
+  public:
+    void setData(MEDCouplingDataForGodFather *data) throw(INTERP_KERNEL::Exception);
+    %extend
+    {
+      static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
+      {
+        static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
+        static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
+        const int *nodeStrctPtr(0);
+        const double *originPtr(0),*dxyzPtr(0);
+        int sw,sz,val0;
+        std::vector<int> bb0;
+        nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
+        //
+        double val,val2;
+        std::vector<double> bb,bb2;
+        int sz1,sz2;
+        originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
+        dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
+        //
+        return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
+      }
+
+      MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
+      {
+        return ParaMEDMEM_MEDCouplingCartesianAMRMesh_New(meshName,spaceDim,nodeStrct,origin,dxyz);
+      }
+
+      MEDCouplingDataForGodFather *getDataConst() const throw(INTERP_KERNEL::Exception)
+      {
+        const MEDCouplingDataForGodFather *ret(self->getDataConst());
+        if(ret)
+          ret->incrRef();
+        return const_cast<MEDCouplingDataForGodFather *>(ret);
+      }
+
+      MEDCouplingDataForGodFather *getData() throw(INTERP_KERNEL::Exception)
+      {
+        MEDCouplingDataForGodFather *ret(self->getData());
+        if(ret)
+          ret->incrRef();
+        return ret;
+      }
+    }
+  };
+
   class DenseMatrix : public RefCountObject, public TimeLabel
   {
   public:
index f0382c2cda99b332ce87ee14b0a34554a92da26d..0a50f88f8b69bb9fb4a9eb80db49cb071b13b468 100644 (file)
@@ -85,6 +85,42 @@ static PyObject* convertMultiFields(ParaMEDMEM::MEDCouplingMultiFields *mfs, int
   return ret;
 }
 
+static PyObject *convertCartesianAMRMesh(ParaMEDMEM::MEDCouplingCartesianAMRMeshGen *mesh, int owner) throw(INTERP_KERNEL::Exception)
+{
+  if(!mesh)
+    {
+      Py_XINCREF(Py_None);
+      return Py_None;
+    }
+  if(dynamic_cast<ParaMEDMEM::MEDCouplingCartesianAMRMeshSub *>(mesh))
+    {
+      return SWIG_NewPointerObj(reinterpret_cast<void*>(mesh),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRMeshSub,owner);
+    }
+  if(dynamic_cast<ParaMEDMEM::MEDCouplingCartesianAMRMesh *>(mesh))
+    {
+      return SWIG_NewPointerObj(reinterpret_cast<void*>(mesh),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRMesh,owner);
+    }
+  throw INTERP_KERNEL::Exception("convertCartesianAMRMesh wrap : unrecognized type of cartesian AMR mesh !");
+}
+
+static PyObject *convertCartesianAMRPatch(ParaMEDMEM::MEDCouplingCartesianAMRPatchGen *patch, int owner) throw(INTERP_KERNEL::Exception)
+{
+  if(!patch)
+    {
+      Py_XINCREF(Py_None);
+      return Py_None;
+    }
+  if(dynamic_cast<ParaMEDMEM::MEDCouplingCartesianAMRPatchGF *>(patch))
+    {
+      return SWIG_NewPointerObj(reinterpret_cast<void*>(patch),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRPatchGF,owner);
+    }
+  if(dynamic_cast<ParaMEDMEM::MEDCouplingCartesianAMRPatch *>(patch))
+    {
+      return SWIG_NewPointerObj(reinterpret_cast<void*>(patch),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRPatch,owner);
+    }
+  throw INTERP_KERNEL::Exception("convertCartesianAMRPatch wrap : unrecognized type of cartesian AMR patch !");
+}
+
 static ParaMEDMEM::MEDCouplingFieldDouble *ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(ParaMEDMEM::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
 {
   const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__add__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";