]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
*** empty log message ***
authorageay <ageay>
Mon, 6 Dec 2010 16:55:47 +0000 (16:55 +0000)
committerageay <ageay>
Mon, 6 Dec 2010 16:55:47 +0000 (16:55 +0000)
src/INTERP_KERNEL/Bases/InterpKernelAutoPtr.hxx [new file with mode: 0644]
src/INTERP_KERNEL/Bases/Makefile.am
src/MEDCoupling/Test/MEDCouplingBasicsTest.hxx
src/MEDCoupling_Swig/MEDCouplingBasicsTest.py
src/MEDCoupling_Swig/MEDCouplingTypemaps.i
src/MEDCoupling_Swig/libMEDCoupling_Swig.i

diff --git a/src/INTERP_KERNEL/Bases/InterpKernelAutoPtr.hxx b/src/INTERP_KERNEL/Bases/InterpKernelAutoPtr.hxx
new file mode 100644 (file)
index 0000000..5851a24
--- /dev/null
@@ -0,0 +1,45 @@
+//  Copyright (C) 2007-2010  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
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef __INTERPKERNELAUTOPTR_HXX__
+#define __INTERPKERNELAUTOPTR_HXX__
+
+namespace INTERP_KERNEL
+{
+  template<class T>
+  class AutoPtr
+  {
+  public:
+    AutoPtr(T *ptr=0):_ptr(ptr) {  }
+    ~AutoPtr() { destroyPtr(); }
+    AutoPtr &operator=(T *ptr) { destroyPtr(); _ptr=ptr; return *this; }
+    T *operator->() { return _ptr ; }
+    const T *operator->() const { return _ptr; }
+    T& operator*() { return *_ptr; }
+    const T& operator*() const { return *_ptr; }
+    operator T *() { return _ptr; }
+    operator const T *() const { return _ptr; }
+  private:
+    void destroyPtr() { delete [] _ptr; }
+  private:
+    T *_ptr;
+  };
+}
+
+#endif
index fc89569bc3422e42cad1f617e3f62cc04899da6b..4b74948f3ff45bef548b68f6f049d30a39fc4e30 100755 (executable)
@@ -32,7 +32,8 @@ NormalizedUnstructuredMesh.hxx  \
 InterpKernelStlExt.hxx          \
 InterpKernelHashMap.hxx         \
 InterpKernelHashTable.hxx       \
-InterpKernelHashFun.hxx
+InterpKernelHashFun.hxx         \
+InterpKernelAutoPtr.hxx
 
 # Libraries targets
 
index 4982c2e7af424926314f211ef81a4e3326c20835..e522b1462668204245822f9f1bfcd664e10a1e16 100644 (file)
@@ -160,6 +160,10 @@ namespace ParaMEDMEM
     CPPUNIT_TEST( testExtrudedMesh7 );
     CPPUNIT_TEST( testSimplexize1 );
     CPPUNIT_TEST( testSimplexize2 );
+    CPPUNIT_TEST( testDAMeld1 );
+    CPPUNIT_TEST( testFieldMeld1 );
+    CPPUNIT_TEST( testMergeNodes2 );
+    CPPUNIT_TEST( testMergeField2 );
     //MEDCouplingBasicsTestInterp.cxx
     CPPUNIT_TEST( test2DInterpP0P0_1 );
     CPPUNIT_TEST( test2DInterpP0P0PL_1 );
@@ -348,6 +352,10 @@ namespace ParaMEDMEM
     void testExtrudedMesh7();
     void testSimplexize1();
     void testSimplexize2();
+    void testDAMeld1();
+    void testFieldMeld1();
+    void testMergeNodes2();
+    void testMergeField2();
     //MEDCouplingBasicsTestInterp.cxx
     void test2DInterpP0P0_1();
     void test2DInterpP0P0PL_1();
index 25119adda93dba35f79ba1bf140f52e5d99c08f2..fff780c0c3cece733f5b7f91d5ea92618dc7ed7c 100644 (file)
@@ -5165,6 +5165,179 @@ class MEDCouplingBasicsTest(unittest.TestCase):
             pass
         #
         pass
+
+    def testDAMeld1(self):
+        da1=DataArrayDouble.New();
+        da1.alloc(7,2);
+        da2=DataArrayDouble.New();
+        da2.alloc(7,1);
+        #
+        da1.fillWithValue(7.);
+        da2.iota(0.);
+        da3=da2.applyFunc(3,"10*x*IVec+100*x*JVec+1000*x*KVec");
+        #
+        da1.setInfoOnComponent(0,"c0da1");
+        da1.setInfoOnComponent(1,"c1da1");
+        da3.setInfoOnComponent(0,"c0da3");
+        da3.setInfoOnComponent(1,"c1da3");
+        da3.setInfoOnComponent(2,"c2da3");
+        #
+        da1C=da1.deepCpy();
+        da1.meldWith(da3);
+        self.assertEqual(5,da1.getNumberOfComponents());
+        self.assertEqual(7,da1.getNumberOfTuples());
+        self.assertTrue(da1.getInfoOnComponent(0)=="c0da1");
+        self.assertTrue(da1.getInfoOnComponent(1)=="c1da1");
+        self.assertTrue(da1.getInfoOnComponent(2)=="c0da3");
+        self.assertTrue(da1.getInfoOnComponent(3)=="c1da3");
+        self.assertTrue(da1.getInfoOnComponent(4)=="c2da3");
+        #
+        expected1=[7.,7.,0.,0.,0., 7.,7.,10.,100.,1000., 7.,7.,20.,200.,2000., 7.,7.,30.,300.,3000., 7.,7.,40.,400.,4000.,7.,7.,50.,500.,5000.,7.,7.,60.,600.,6000.]
+        for i in xrange(35):
+            self.assertAlmostEqual(expected1[i],da1.getIJ(0,i),10);
+            pass
+        #
+        dai1=da1C.convertToIntArr();
+        dai3=da3.convertToIntArr();
+        dai1.meldWith(dai3);
+        self.assertEqual(5,dai1.getNumberOfComponents());
+        self.assertEqual(7,dai1.getNumberOfTuples());
+        self.assertTrue(dai1.getInfoOnComponent(0)=="c0da1");
+        self.assertTrue(dai1.getInfoOnComponent(1)=="c1da1");
+        self.assertTrue(dai1.getInfoOnComponent(2)=="c0da3");
+        self.assertTrue(dai1.getInfoOnComponent(3)=="c1da3");
+        self.assertTrue(dai1.getInfoOnComponent(4)=="c2da3");
+        for i in xrange(35):
+            self.assertEqual(int(expected1[i]),dai1.getIJ(0,i));
+            pass
+        # test of static method DataArrayDouble::meld
+        da4=DataArrayDouble.meld(da1C,da3);
+        tmp=DataArrayDouble.meld([da1C,da3]);
+        self.assertTrue(da4.isEqual(tmp,1e-10))
+        self.assertEqual(5,da4.getNumberOfComponents());
+        self.assertEqual(7,da4.getNumberOfTuples());
+        self.assertTrue(da4.getInfoOnComponent(0)=="c0da1");
+        self.assertTrue(da4.getInfoOnComponent(1)=="c1da1");
+        self.assertTrue(da4.getInfoOnComponent(2)=="c0da3");
+        self.assertTrue(da4.getInfoOnComponent(3)=="c1da3");
+        self.assertTrue(da4.getInfoOnComponent(4)=="c2da3");
+        for i in xrange(35):
+            self.assertAlmostEqual(expected1[i],da4.getIJ(0,i),10);
+            pass
+        # test of static method DataArrayInt::meld
+        dai1=da1C.convertToIntArr();
+        dai4=DataArrayInt.meld(dai1,dai3);
+        tmp=DataArrayInt.meld([dai1,dai3]);
+        self.assertTrue(dai4.isEqual(tmp))
+        self.assertEqual(5,dai4.getNumberOfComponents());
+        self.assertEqual(7,dai4.getNumberOfTuples());
+        self.assertTrue(dai4.getInfoOnComponent(0)=="c0da1");
+        self.assertTrue(dai4.getInfoOnComponent(1)=="c1da1");
+        self.assertTrue(dai4.getInfoOnComponent(2)=="c0da3");
+        self.assertTrue(dai4.getInfoOnComponent(3)=="c1da3");
+        self.assertTrue(dai4.getInfoOnComponent(4)=="c2da3");
+        for i in xrange(35):
+            self.assertEqual(int(expected1[i]),dai4.getIJ(0,i));
+            pass
+        pass
+
+    def testFieldMeld1(self):
+        m=MEDCouplingDataForTest.build3DSurfTargetMesh_1();
+        f1=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME);
+        f1.setMesh(m);
+        da1=DataArrayDouble.New();
+        arr1=[12.,23.,34.,45.,56.]
+        da1.setValues(arr1,5,1);
+        da1.setInfoOnComponent(0,"aaa");
+        f1.setArray(da1);
+        f1.setTime(3.4,2,1);
+        f1.checkCoherency();
+        #
+        f2=f1.deepCpy();
+        f2.setMesh(f1.getMesh());
+        f2.checkCoherency();
+        f2.changeNbOfComponents(2,5.);
+        f2.assign(5.);
+        f2.getArray().setInfoOnComponent(0,"bbb");
+        f2.getArray().setInfoOnComponent(1,"ccc");
+        f2.checkCoherency();
+        #
+        f3=MEDCouplingFieldDouble.meldFields(f2,f1);
+        f3.checkCoherency();
+        self.assertEqual(5,f3.getNumberOfTuples());
+        self.assertEqual(3,f3.getNumberOfComponents());
+        self.assertTrue(f3.getArray().getInfoOnComponent(0)=="bbb");
+        self.assertTrue(f3.getArray().getInfoOnComponent(1)=="ccc");
+        self.assertTrue(f3.getArray().getInfoOnComponent(2)=="aaa");
+        expected1=[5.,5.,12.,5.,5.,23.,5.,5.,34.,5.,5.,45.,5.,5.,56.]
+        for i in xrange(15):
+            self.assertAlmostEqual(expected1[i],f3.getIJ(0,i),12);
+            pass
+        time,dt,it=f3.getTime();
+        self.assertAlmostEqual(3.4,time,14);
+        self.assertEqual(2,dt);
+        self.assertEqual(1,it);
+        #
+        f4=f2.buildNewTimeReprFromThis(NO_TIME,False);
+        f5=f1.buildNewTimeReprFromThis(NO_TIME,False);
+        f6=MEDCouplingFieldDouble.meldFields(f4,f5);
+        f6.checkCoherency();
+        self.assertEqual(5,f6.getNumberOfTuples());
+        self.assertEqual(3,f6.getNumberOfComponents());
+        self.assertTrue(f6.getArray().getInfoOnComponent(0)=="bbb");
+        self.assertTrue(f6.getArray().getInfoOnComponent(1)=="ccc");
+        self.assertTrue(f6.getArray().getInfoOnComponent(2)=="aaa");
+        for i in xrange(15):
+            self.assertAlmostEqual(expected1[i],f6.getIJ(0,i),12);
+            pass
+        #
+        pass
+
+    def testMergeNodes2(self):
+        m1=MEDCouplingDataForTest.build2DTargetMesh_1();
+        m2=MEDCouplingDataForTest.build2DTargetMesh_1();
+        vec=[0.002,0.]
+        m2.translate(vec);
+        #
+        m3=MEDCouplingUMesh.mergeUMeshes([m1,m2]);
+        da,b,newNbOfNodes=m3.mergeNodes2(0.01);
+        self.assertEqual(9,m3.getNumberOfNodes());
+        expected1=[-0.299,-0.3, 0.201,-0.3, 0.701,-0.3, -0.299,0.2, 0.201,0.2, 0.701,0.2, -0.299,0.7, 0.201,0.7, 0.701,0.7]
+        for i in xrange(18):
+            self.assertAlmostEqual(expected1[i],m3.getCoords().getIJ(0,i),13);
+            pass
+        #
+        pass
+
+    def testMergeField2(self):
+        m=MEDCouplingDataForTest.build2DTargetMesh_1();
+        f1=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME);
+        f1.setMesh(m);
+        arr=DataArrayDouble.New();
+        arr.alloc(5,2);
+        arr.fillWithValue(2.);
+        f1.setArray(arr);
+        f2=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME);
+        f2.setMesh(m);
+        arr=DataArrayDouble.New();
+        arr.alloc(5,2);
+        arr.fillWithValue(5.);
+        f2.setArray(arr);
+        f3=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME);
+        f3.setMesh(m);
+        arr=DataArrayDouble.New();
+        arr.alloc(5,2);
+        arr.fillWithValue(7.);
+        f3.setArray(arr);
+        #
+        f4=MEDCouplingFieldDouble.mergeFields([f1,f2,f3]);
+        self.assertEqual(15,f4.getMesh().getNumberOfCells());
+        expected1=[2.,2.,2.,2.,2.,2.,2.,2.,2.,2., 5.,5.,5.,5.,5.,5.,5.,5.,5.,5., 7.,7.,7.,7.,7.,7.,7.,7.,7.,7.]
+        for i in xrange(30):
+            self.assertAlmostEqual(expected1[i],f4.getIJ(0,i),13);
+            pass
+        #
+        pass
     
     def setUp(self):
         pass
index d1af65ba8c5de44a72e184d3b96bf33215cc5320..3236a3d15cf5f9cc6251ccaa258f7562aafdb237 100644 (file)
@@ -250,7 +250,7 @@ void convertPyObjToVecUMeshes(PyObject *ms, std::vector<ParaMEDMEM::MEDCouplingU
           int status=SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,0|0);
           if(!SWIG_IsOK(status))
             {
-              PyErr_SetString(PyExc_TypeError,"list must contain only DataArrayInt");
+              PyErr_SetString(PyExc_TypeError,"list must contain only MEDCouplingUMesh");
               PyErr_Print();
               return;
             }
@@ -265,6 +265,90 @@ void convertPyObjToVecUMeshes(PyObject *ms, std::vector<ParaMEDMEM::MEDCouplingU
     }
 }
 
+void convertPyObjToVecUMeshesCst(PyObject *ms, std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& v)
+{
+  if(PyList_Check(ms))
+    {
+      int size=PyList_Size(ms);
+      v.resize(size);
+      for(int i=0;i<size;i++)
+        {
+          PyObject *obj=PyList_GetItem(ms,i);
+          void *argp;
+          int status=SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,0|0);
+          if(!SWIG_IsOK(status))
+            {
+              PyErr_SetString(PyExc_TypeError,"list must contain only MEDCouplingUMesh");
+              PyErr_Print();
+              return;
+            }
+          const ParaMEDMEM::MEDCouplingUMesh *arg=reinterpret_cast< const ParaMEDMEM::MEDCouplingUMesh * >(argp);
+          v[i]=arg;
+        }
+    }
+  else
+    {
+      PyErr_SetString(PyExc_TypeError,"convertPyObjToVecUMeshesCst : not a list");
+      PyErr_Print();
+    }
+}
+
+void convertPyObjToVecDataArrayDblCst(PyObject *ms, std::vector<const ParaMEDMEM::DataArrayDouble *>& v)
+{
+  if(PyList_Check(ms))
+    {
+      int size=PyList_Size(ms);
+      v.resize(size);
+      for(int i=0;i<size;i++)
+        {
+          PyObject *obj=PyList_GetItem(ms,i);
+          void *argp;
+          int status=SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
+          if(!SWIG_IsOK(status))
+            {
+              PyErr_SetString(PyExc_TypeError,"list must contain only DataArrayDouble");
+              PyErr_Print();
+              return;
+            }
+          const ParaMEDMEM::DataArrayDouble *arg=reinterpret_cast< const ParaMEDMEM::DataArrayDouble * >(argp);
+          v[i]=arg;
+        }
+    }
+  else
+    {
+      PyErr_SetString(PyExc_TypeError,"convertPyObjToVecDataArrayDblCst : not a list");
+      PyErr_Print();
+    }
+}
+
+void convertPyObjToVecFieldDblCst(PyObject *ms, std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *>& v)
+{
+  if(PyList_Check(ms))
+    {
+      int size=PyList_Size(ms);
+      v.resize(size);
+      for(int i=0;i<size;i++)
+        {
+          PyObject *obj=PyList_GetItem(ms,i);
+          void *argp;
+          int status=SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0);
+          if(!SWIG_IsOK(status))
+            {
+              PyErr_SetString(PyExc_TypeError,"list must contain only MEDCouplingFieldDouble");
+              PyErr_Print();
+              return;
+            }
+          const ParaMEDMEM::MEDCouplingFieldDouble *arg=reinterpret_cast< const ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+          v[i]=arg;
+        }
+    }
+  else
+    {
+      PyErr_SetString(PyExc_TypeError,"convertPyObjToVecFieldDblCst : not a list");
+      PyErr_Print();
+    }
+}
+
 void convertPyObjToVecDataArrayInt(PyObject *ms, std::vector<ParaMEDMEM::DataArrayInt *>& v)
 {
   if(PyList_Check(ms))
@@ -292,3 +376,31 @@ void convertPyObjToVecDataArrayInt(PyObject *ms, std::vector<ParaMEDMEM::DataArr
       PyErr_Print();
     }
 }
+
+void convertPyObjToVecDataArrayIntCst(PyObject *ms, std::vector<const ParaMEDMEM::DataArrayInt *>& v)
+{
+  if(PyList_Check(ms))
+    {
+      int size=PyList_Size(ms);
+      v.resize(size);
+      for(int i=0;i<size;i++)
+        {
+          PyObject *obj=PyList_GetItem(ms,i);
+          void *argp;
+          int status=SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
+          if(!SWIG_IsOK(status))
+            {
+              PyErr_SetString(PyExc_TypeError,"list must contain only DataArrayInt");
+              PyErr_Print();
+              return;
+            }
+          ParaMEDMEM::DataArrayInt *arg=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
+          v[i]=arg;
+        }
+    }
+  else
+    {
+      PyErr_SetString(PyExc_TypeError,"convertPyObjToVecDataArrayInt : not a list");
+      PyErr_Print();
+    }
+}
index 65112f642431c9d2006bc86956ca8043f9047775..dc31f1d851549e0e8cb542bc4dfbe8d89abf3a3b 100644 (file)
@@ -62,6 +62,7 @@ using namespace INTERP_KERNEL;
 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
 %newobject ParaMEDMEM::MEDCouplingFieldDouble::mergeFields;
+%newobject ParaMEDMEM::MEDCouplingFieldDouble::meldFields;
 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
@@ -88,10 +89,12 @@ using namespace INTERP_KERNEL;
 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator/;
 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
+%newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
 %newobject ParaMEDMEM::DataArrayInt::New;
 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
 %newobject ParaMEDMEM::DataArrayInt::deepCopy;
+%newobject ParaMEDMEM::DataArrayInt::deepCpy;
 %newobject ParaMEDMEM::DataArrayInt::performCpy;
 %newobject ParaMEDMEM::DataArrayInt::substr;
 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
@@ -105,13 +108,16 @@ using namespace INTERP_KERNEL;
 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
 %newobject ParaMEDMEM::DataArrayInt::aggregate;
+%newobject ParaMEDMEM::DataArrayInt::meld;
 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
 %newobject ParaMEDMEM::DataArrayDouble::New;
 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
 %newobject ParaMEDMEM::DataArrayDouble::deepCopy;
+%newobject ParaMEDMEM::DataArrayDouble::deepCpy;
 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
 %newobject ParaMEDMEM::DataArrayDouble::aggregate;
+%newobject ParaMEDMEM::DataArrayDouble::meld;
 %newobject ParaMEDMEM::DataArrayDouble::dot;
 %newobject ParaMEDMEM::DataArrayDouble::crossProduct;
 %newobject ParaMEDMEM::DataArrayDouble::add;
@@ -149,8 +155,11 @@ using namespace INTERP_KERNEL;
 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
+%newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
+%newobject ParaMEDMEM::MEDCouplingPointSet::mergeNodesArray;
+%newobject ParaMEDMEM::MEDCouplingPointSet::buildInstanceFromMeshType;
 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
 %newobject ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer;
@@ -169,7 +178,6 @@ using namespace INTERP_KERNEL;
 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
-%newobject ParaMEDMEM::MEDCouplingCMesh::buildUnstructured;
 %feature("unref") DataArrayDouble "$this->decrRef();"
 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
 %feature("unref") MEDCouplingMesh "$this->decrRef();"
@@ -218,6 +226,7 @@ namespace ParaMEDMEM
 
   class DataArrayInt;
   class DataArrayDouble;
+  class MEDCouplingUMesh;
   class MEDCouplingFieldDouble;
 
   class MEDCouplingMesh : public RefCountObject, public TimeLabel
@@ -246,6 +255,7 @@ namespace ParaMEDMEM
     virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const = 0;
     virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
     virtual MEDCouplingFieldDouble *buildOrthogonalField() const = 0;
+    virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
     virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception) = 0;
     virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const;
     virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
@@ -391,7 +401,7 @@ namespace ParaMEDMEM
       void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
       void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
       virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception) = 0;
-      static DataArrayDouble *mergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2);
+      static DataArrayDouble *mergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
       static MEDCouplingPointSet *buildInstanceFromMeshType(MEDCouplingMeshType type);
       virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const = 0;
       virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const = 0;
@@ -473,6 +483,13 @@ namespace ParaMEDMEM
              self->renumberNodes(tmp,newNbOfNodes);
              delete [] tmp;
            }
+           void renumberNodes2(PyObject *li, int newNbOfNodes)
+           {
+             int size;
+             int *tmp=convertPyToNewIntArr2(li,&size);
+             self->renumberNodes2(tmp,newNbOfNodes);
+             delete [] tmp;
+           }
            PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
              {
                std::vector<int> nodes;
@@ -606,6 +623,7 @@ namespace ParaMEDMEM
     MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
     MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
     MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
+    static MEDCouplingUMesh *mergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
     %extend {
       std::string __str__() const
       {
@@ -638,6 +656,17 @@ namespace ParaMEDMEM
         PyList_SetItem(res,2,SWIG_From_int(ret2));
         return res;
       }
+      PyObject *mergeNodes2(double precision)
+      {
+        bool ret1;
+        int ret2;
+        DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
+        PyObject *res = PyList_New(3);
+        PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+        PyList_SetItem(res,1,SWIG_From_bool(ret1));
+        PyList_SetItem(res,2,SWIG_From_int(ret2));
+        return res;
+      }
       PyObject *checkButterflyCells()
       {
         std::vector<int> cells;
@@ -797,11 +826,17 @@ namespace ParaMEDMEM
         std::copy(pos,pos+3,vals+3);
         return convertDblArrToPyListOfTuple(vals,3,2);
       }
+      
+      static MEDCouplingUMesh *mergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
+      {
+        std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
+        convertPyObjToVecUMeshesCst(li,tmp);
+        return MEDCouplingUMesh::mergeUMeshes(tmp);
+      }
     }
     void convertToPolyTypes(const std::vector<int>& cellIdsToConvert);
     void unPolyze();
     MEDCouplingUMesh *buildExtrudedMeshFromThis(const MEDCouplingUMesh *mesh1D, int policy);
-    static MEDCouplingUMesh *mergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
   };
 
   class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
@@ -843,7 +878,6 @@ namespace ParaMEDMEM
                    DataArrayDouble *coordsY=0,
                    DataArrayDouble *coordsZ=0);
     void setCoordsAt(int i, DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
-    MEDCouplingUMesh *buildUnstructured() const;
     %extend {
       std::string __str__() const
       {
@@ -1046,6 +1080,20 @@ namespace ParaMEDMEM
      convertPyToNewIntArr3(li,tmp);
      self->setSelectedComponents(a,tmp);
    }
+
+   static DataArrayDouble *aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
+   {
+     std::vector<const DataArrayDouble *> tmp;
+     convertPyObjToVecDataArrayDblCst(li,tmp);
+     return DataArrayDouble::aggregate(tmp);
+   }
+
+   static DataArrayDouble *meld(PyObject *li) throw(INTERP_KERNEL::Exception)
+   {
+     std::vector<const DataArrayDouble *> tmp;
+     convertPyObjToVecDataArrayDblCst(li,tmp);
+     return DataArrayDouble::meld(tmp);
+   }
  };
 
 %extend ParaMEDMEM::DataArrayInt
@@ -1182,6 +1230,13 @@ namespace ParaMEDMEM
      convertPyToNewIntArr3(li,tmp);
      self->setSelectedComponents(a,tmp);
    }
+
+   static DataArrayInt *meld(PyObject *li) throw(INTERP_KERNEL::Exception)
+   {
+     std::vector<const DataArrayInt *> tmp;
+     convertPyObjToVecDataArrayIntCst(li,tmp);
+     return DataArrayInt::meld(tmp);
+   }
  };
 
 namespace ParaMEDMEM
@@ -1263,6 +1318,7 @@ namespace ParaMEDMEM
     std::string advancedRepr() const;
     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
+    MEDCouplingFieldDouble *deepCpy() const;
     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const;
     TypeOfTimeDiscretization getTimeDiscretization() const;
     void checkCoherency() const throw(INTERP_KERNEL::Exception);
@@ -1287,6 +1343,7 @@ namespace ParaMEDMEM
     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
     bool mergeNodes(double eps) throw(INTERP_KERNEL::Exception);
+    bool mergeNodes2(double eps) throw(INTERP_KERNEL::Exception);
     bool zipCoords() throw(INTERP_KERNEL::Exception);
     bool zipConnectivity(int compType) throw(INTERP_KERNEL::Exception);
     bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
@@ -1319,14 +1376,15 @@ namespace ParaMEDMEM
     DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
     MEDCouplingFieldDouble *buildSubPart(const DataArrayInt *part) const throw(INTERP_KERNEL::Exception);
     static MEDCouplingFieldDouble *mergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
-    static MEDCouplingFieldDouble *dotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
-    MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const;
-    static MEDCouplingFieldDouble *crossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
-    MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const;
-    static MEDCouplingFieldDouble *maxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
-    MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const;
-    static MEDCouplingFieldDouble *minFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
-    MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const;
+    static MEDCouplingFieldDouble *meldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
+    static MEDCouplingFieldDouble *dotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
+    MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
+    static MEDCouplingFieldDouble *crossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
+    MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
+    static MEDCouplingFieldDouble *maxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
+    MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
+    static MEDCouplingFieldDouble *minFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
+    MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
     MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
     const MEDCouplingFieldDouble &operator+=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception);
     MEDCouplingFieldDouble *operator-(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
@@ -1546,6 +1604,13 @@ namespace ParaMEDMEM
         convertPyToNewIntArr3(li,tmp);
         self->setSelectedComponents(f,tmp);
       }
+
+      static MEDCouplingFieldDouble *mergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
+      {
+        std::vector<const MEDCouplingFieldDouble *> tmp;
+        convertPyObjToVecFieldDblCst(li,tmp);
+        return MEDCouplingFieldDouble::mergeFields(tmp);
+      }
     }
   };
 }