From 5d6b943ff73670fcc2032f5c409b7fe93851863c Mon Sep 17 00:00:00 2001 From: ageay Date: Tue, 7 Dec 2010 07:52:03 +0000 Subject: [PATCH] *** empty log message *** --- src/MEDCoupling/MEDCouplingCMesh.cxx | 6 ++--- src/MEDCoupling/MEDCouplingExtrudedMesh.cxx | 2 +- .../MEDCouplingFieldDiscretization.cxx | 6 ++--- src/MEDCoupling/MEDCouplingMemArray.cxx | 22 +++++-------------- src/MEDCoupling/MEDCouplingMemArray.hxx | 2 -- src/MEDCoupling/MEDCouplingUMesh.cxx | 4 ++-- .../Test/MEDCouplingBasicsTest1.cxx | 6 ++--- .../Test/MEDCouplingBasicsTest2.cxx | 2 +- src/MEDCoupling_Swig/MEDCoupling.i | 2 -- src/MEDCoupling_Swig/MEDCouplingBasicsTest.py | 8 +++---- 10 files changed, 23 insertions(+), 37 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingCMesh.cxx b/src/MEDCoupling/MEDCouplingCMesh.cxx index 7b3141077..9ec8bec95 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCMesh.cxx @@ -37,11 +37,11 @@ MEDCouplingCMesh::MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCpy): if(deepCpy) { if(other._x_array) - _x_array=_x_array->deepCopy(); + _x_array=_x_array->deepCpy(); if(other._y_array) - _y_array=_y_array->deepCopy(); + _y_array=_y_array->deepCpy(); if(other._z_array) - _z_array=_z_array->deepCopy(); + _z_array=_z_array->deepCpy(); } else { diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx index 385977e01..dc58eb215 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx @@ -104,7 +104,7 @@ MEDCouplingExtrudedMesh::MEDCouplingExtrudedMesh(const MEDCouplingExtrudedMesh& { _mesh2D=other._mesh2D->clone(true); _mesh1D=other._mesh1D->clone(true); - _mesh3D_ids=other._mesh3D_ids->deepCopy(); + _mesh3D_ids=other._mesh3D_ids->deepCpy(); } else { diff --git a/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx b/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx index e5ad06173..d5c1a1e8c 100644 --- a/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx @@ -259,7 +259,7 @@ void MEDCouplingFieldDiscretization::renumberEntitiesFromO2NArr(const int *old2N int oldNbOfElems=arr->getNumberOfTuples(); int nbOfComp=arr->getNumberOfComponents(); int newNbOfTuples=(*std::max_element(old2NewPtr,old2NewPtr+oldNbOfElems))+1; - DataArrayDouble *arrCpy=arr->deepCopy(); + DataArrayDouble *arrCpy=arr->deepCpy(); const double *ptSrc=arrCpy->getConstPointer(); arr->reAlloc(newNbOfTuples); double *ptToFill=arr->getPointer(); @@ -291,7 +291,7 @@ void MEDCouplingFieldDiscretization::renumberEntitiesFromO2NArr(const int *old2N void MEDCouplingFieldDiscretization::renumberEntitiesFromN2OArr(const int *new2OldPtr, int new2OldSz, DataArrayDouble *arr, const char *msg) { int nbOfComp=arr->getNumberOfComponents(); - DataArrayDouble *arrCpy=arr->deepCopy(); + DataArrayDouble *arrCpy=arr->deepCpy(); const double *ptSrc=arrCpy->getConstPointer(); arr->reAlloc(new2OldSz); double *ptToFill=arr->getPointer(); @@ -586,7 +586,7 @@ MEDCouplingFieldDiscretizationPerCell::MEDCouplingFieldDiscretizationPerCell(con { DataArrayInt *arr=other._discr_per_cell; if(arr) - _discr_per_cell=arr->deepCopy(); + _discr_per_cell=arr->deepCpy(); } void MEDCouplingFieldDiscretizationPerCell::updateTime() diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index 3d916ed2e..581b89863 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -131,20 +131,15 @@ void DataArrayDouble::checkAllocated() const throw(INTERP_KERNEL::Exception) throw INTERP_KERNEL::Exception("DataArrayDouble::checkAllocated : Array is defined but not allocated ! Call alloc or setValues method first !"); } -DataArrayDouble *DataArrayDouble::deepCopy() const -{ - return new DataArrayDouble(*this); -} - DataArrayDouble *DataArrayDouble::deepCpy() const { return new DataArrayDouble(*this); } -DataArrayDouble *DataArrayDouble::performCpy(bool deepCpy) const +DataArrayDouble *DataArrayDouble::performCpy(bool dCpy) const { - if(deepCpy) - return deepCopy(); + if(dCpy) + return deepCpy(); else { incrRef(); @@ -1405,20 +1400,15 @@ void DataArrayInt::checkAllocated() const throw(INTERP_KERNEL::Exception) throw INTERP_KERNEL::Exception("DataArrayInt::checkAllocated : Array is defined but not allocated ! Call alloc or setValues method first !"); } -DataArrayInt *DataArrayInt::deepCopy() const -{ - return new DataArrayInt(*this); -} - DataArrayInt *DataArrayInt::deepCpy() const { return new DataArrayInt(*this); } -DataArrayInt *DataArrayInt::performCpy(bool deepCpy) const +DataArrayInt *DataArrayInt::performCpy(bool dCpy) const { - if(deepCpy) - return deepCopy(); + if(dCpy) + return deepCpy(); else { incrRef(); diff --git a/src/MEDCoupling/MEDCouplingMemArray.hxx b/src/MEDCoupling/MEDCouplingMemArray.hxx index 75d1feef2..197b78974 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.hxx +++ b/src/MEDCoupling/MEDCouplingMemArray.hxx @@ -118,7 +118,6 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT static DataArrayDouble *New(); MEDCOUPLING_EXPORT bool isAllocated() const; MEDCOUPLING_EXPORT void checkAllocated() const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT DataArrayDouble *deepCopy() const; MEDCOUPLING_EXPORT DataArrayDouble *deepCpy() const; MEDCOUPLING_EXPORT DataArrayDouble *performCpy(bool deepCpy) const; MEDCOUPLING_EXPORT void alloc(int nbOfTuple, int nbOfCompo); @@ -216,7 +215,6 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT static DataArrayInt *New(); MEDCOUPLING_EXPORT bool isAllocated() const; MEDCOUPLING_EXPORT void checkAllocated() const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT DataArrayInt *deepCopy() const; MEDCOUPLING_EXPORT DataArrayInt *deepCpy() const; MEDCOUPLING_EXPORT DataArrayInt *performCpy(bool deepCpy) const; MEDCOUPLING_EXPORT void alloc(int nbOfTuple, int nbOfCompo); diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index b4b80c5e5..868292722 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -2172,7 +2172,7 @@ DataArrayDouble *MEDCouplingUMesh::fillExtCoordsUsingTranslAndAutoRotation2D(con double *retPtr=ret->getPointer(); retPtr=std::copy(getCoords()->getConstPointer(),getCoords()->getConstPointer()+getCoords()->getNbOfElems(),retPtr); MEDCouplingUMesh *tmp=MEDCouplingUMesh::New(); - DataArrayDouble *tmp2=getCoords()->deepCopy(); + DataArrayDouble *tmp2=getCoords()->deepCpy(); tmp->setCoords(tmp2); tmp2->decrRef(); const double *coo1D=mesh1D->getCoords()->getConstPointer(); @@ -2218,7 +2218,7 @@ DataArrayDouble *MEDCouplingUMesh::fillExtCoordsUsingTranslAndAutoRotation3D(con double *retPtr=ret->getPointer(); retPtr=std::copy(getCoords()->getConstPointer(),getCoords()->getConstPointer()+getCoords()->getNbOfElems(),retPtr); MEDCouplingUMesh *tmp=MEDCouplingUMesh::New(); - DataArrayDouble *tmp2=getCoords()->deepCopy(); + DataArrayDouble *tmp2=getCoords()->deepCpy(); tmp->setCoords(tmp2); tmp2->decrRef(); const double *coo1D=mesh1D->getCoords()->getConstPointer(); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx index ffa8b6a75..5dd1c85d7 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx @@ -325,7 +325,7 @@ void MEDCouplingBasicsTest::testDeepCopy() std::fill(array->getPointer(),array->getPointer()+5*3,7.); CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,array->getIJ(3,2),1e-14); double *tmp1=array->getPointer(); - DataArrayDouble *array2=array->deepCopy(); + DataArrayDouble *array2=array->deepCpy(); double *tmp2=array2->getPointer(); CPPUNIT_ASSERT(tmp1!=tmp2); array->decrRef(); @@ -337,7 +337,7 @@ void MEDCouplingBasicsTest::testDeepCopy() std::fill(array3->getPointer(),array3->getPointer()+5*3,17); CPPUNIT_ASSERT_EQUAL(17,array3->getIJ(3,2)); int *tmp3=array3->getPointer(); - DataArrayInt *array4=array3->deepCopy(); + DataArrayInt *array4=array3->deepCpy(); int *tmp4=array4->getPointer(); CPPUNIT_ASSERT(tmp3!=tmp4); array3->decrRef(); @@ -873,7 +873,7 @@ void MEDCouplingBasicsTest::testEqualFieldDouble() CPPUNIT_ASSERT(fieldOnCells1->isEqual(fieldOnCells2,1e-12,1e-15)); CPPUNIT_ASSERT(fieldOnCells2->isEqual(fieldOnCells1,1e-12,1e-15)); // - DataArrayDouble *arr2=arr->deepCopy(); + DataArrayDouble *arr2=arr->deepCpy(); fieldOnCells2->setArray(arr2); arr2->decrRef(); CPPUNIT_ASSERT(fieldOnCells1->isEqual(fieldOnCells2,1e-12,1e-15)); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx index 8e1e4fb01..883f79f8c 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx @@ -902,7 +902,7 @@ void MEDCouplingBasicsTest::testCopyTinyStringsFromOnFields() a1->fillWithZero(); a1->setInfoOnComponent(0,"c"); a1->setInfoOnComponent(1,"d"); - DataArrayDouble *a2=a1->deepCopy(); + DataArrayDouble *a2=a1->deepCpy(); a2->setInfoOnComponent(0,"e"); a2->setInfoOnComponent(1,"f"); f->setArray(a1); diff --git a/src/MEDCoupling_Swig/MEDCoupling.i b/src/MEDCoupling_Swig/MEDCoupling.i index 7e742e5e6..a6060fedd 100644 --- a/src/MEDCoupling_Swig/MEDCoupling.i +++ b/src/MEDCoupling_Swig/MEDCoupling.i @@ -93,7 +93,6 @@ using namespace INTERP_KERNEL; %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; @@ -113,7 +112,6 @@ using namespace INTERP_KERNEL; %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; diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py index a59297b61..a8b023fa3 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py @@ -182,13 +182,13 @@ class MEDCouplingBasicsTest(unittest.TestCase): array=DataArrayDouble.New(); array.setValues(5*3*[7.],5,3); self.assertEqual(array.getIJ(3,2),7.); - array2=array.deepCopy(); + array2=array.deepCpy(); self.assertEqual(array2.getIJ(3,2),7.) # array3=DataArrayInt.New(); array3.setValues(5*3*[17],5,3); self.assertEqual(array3.getIJ(3,2),17); - array4=array3.deepCopy(); + array4=array3.deepCpy(); self.assertEqual(array4.getIJ(3,2),17); pass def testRevNodal(self): @@ -594,7 +594,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): self.assertTrue(fieldOnCells1.isEqual(fieldOnCells2,1e-12,1e-15)); self.assertTrue(fieldOnCells2.isEqual(fieldOnCells1,1e-12,1e-15)); # - arr2=arr.deepCopy(); + arr2=arr.deepCpy(); fieldOnCells2.setArray(arr2); self.assertTrue(fieldOnCells1.isEqual(fieldOnCells2,1e-12,1e-15)); self.assertTrue(fieldOnCells2.isEqual(fieldOnCells1,1e-12,1e-15)); @@ -2485,7 +2485,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): a1.fillWithZero(); a1.setInfoOnComponent(0,"c"); a1.setInfoOnComponent(1,"d"); - a2=a1.deepCopy(); + a2=a1.deepCpy(); a2.setInfoOnComponent(0,"e"); a2.setInfoOnComponent(1,"f"); f.setArray(a1); -- 2.39.2