m->decrRef();
m2->decrRef();
}
+
+void MEDCouplingBasicsTest4::testChangeUnderlyingMeshWithCMesh1()
+{
+ MEDCouplingCMesh* mesh=MEDCouplingCMesh::New();
+ DataArrayDouble* coordsX=DataArrayDouble::New();
+ double arrX[4] = { -1., 1., 2., 4. };
+ coordsX->useArray(arrX,false, CPP_DEALLOC,4,1);
+ DataArrayDouble* coordsY=DataArrayDouble::New();
+ double arrY[4] = { -2., 2., 4., 8. };
+ coordsY->useArray(arrY,false, CPP_DEALLOC,4,1);
+ DataArrayDouble* coordsZ=DataArrayDouble::New();
+ double arrZ[4] = { -3., 3., 6., 12. };
+ coordsZ->useArray(arrZ,false, CPP_DEALLOC,4,1);
+ mesh->setCoords(coordsX,coordsY,coordsZ);
+ coordsX->decrRef();
+ coordsY->decrRef();
+ coordsZ->decrRef();
+ MEDCouplingMesh *mesh2=mesh->deepCpy();
+ //
+ static const int ids1[9]={0,1,2,10,11,12,20,21,22};
+ for(const int *myId=ids1;myId!=ids1+9;myId++)
+ {
+ MEDCouplingFieldDouble *f=mesh->getMeasureField(true);
+ f->changeUnderlyingMesh(mesh2,*myId,1e-12);
+ f->decrRef();
+ }
+ mesh2->setName("uuuu");
+ for(const int *myId=ids1+1;myId!=ids1+9;myId++)
+ {
+ MEDCouplingFieldDouble *f=mesh->getMeasureField(true);
+ f->changeUnderlyingMesh(mesh2,*myId,1e-12);
+ f->decrRef();
+ }
+ //
+ mesh2->decrRef();
+ mesh->decrRef();
+}
self.assertTrue(m.isEqual(m3,1e-12));
pass
+ def testChangeUnderlyingMeshWithCMesh1(self):
+ mesh=MEDCouplingCMesh.New();
+ coordsX=DataArrayDouble.New();
+ arrX=[ -1., 1., 2., 4. ]
+ coordsX.setValues(arrX,4,1);
+ coordsY=DataArrayDouble.New();
+ arrY=[ -2., 2., 4., 8. ]
+ coordsY.setValues(arrY,4,1);
+ coordsZ=DataArrayDouble.New();
+ arrZ=[ -3., 3., 6., 12. ]
+ coordsZ.setValues(arrZ,4,1);
+ mesh.setCoords(coordsX,coordsY,coordsZ);
+ f=mesh.getMeasureField(True)
+ mesh2=mesh.deepCpy()
+ for myId in [0,1,2,10,11,12,20,21,22]:
+ f=mesh.getMeasureField(True)
+ f.changeUnderlyingMesh(mesh2,myId,1e-12);
+ pass
+ mesh2.setName("uuuu")
+ for myId in [1,2,10,11,12,20,21,22]:
+ f=mesh.getMeasureField(True)
+ f.changeUnderlyingMesh(mesh2,myId,1e-12);
+ pass
+ pass
+
def setUp(self):
pass
pass