--- /dev/null
+// 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
InterpKernelStlExt.hxx \
InterpKernelHashMap.hxx \
InterpKernelHashTable.hxx \
-InterpKernelHashFun.hxx
+InterpKernelHashFun.hxx \
+InterpKernelAutoPtr.hxx
# Libraries targets
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 );
void testExtrudedMesh7();
void testSimplexize1();
void testSimplexize2();
+ void testDAMeld1();
+ void testFieldMeld1();
+ void testMergeNodes2();
+ void testMergeField2();
//MEDCouplingBasicsTestInterp.cxx
void test2DInterpP0P0_1();
void test2DInterpP0P0PL_1();
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
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;
}
}
}
+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))
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();
+ }
+}
%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;
%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;
%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;
%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;
%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();"
class DataArrayInt;
class DataArrayDouble;
+ class MEDCouplingUMesh;
class MEDCouplingFieldDouble;
class MEDCouplingMesh : public RefCountObject, public TimeLabel
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);
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;
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;
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
{
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;
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
DataArrayDouble *coordsY=0,
DataArrayDouble *coordsZ=0);
void setCoordsAt(int i, DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *buildUnstructured() const;
%extend {
std::string __str__() const
{
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
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
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);
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);
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);
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);
+ }
}
};
}