From: eap Date: Fri, 29 Nov 2019 17:39:48 +0000 (+0300) Subject: LOT4: update MEDCoupling/Test X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ea95c073647198bb77dc145fba39ba217f4268d9;p=tools%2Fmedcoupling.git LOT4: update MEDCoupling/Test --- diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest.hxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest.hxx index 6023488ed..ab111273d 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest.hxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest.hxx @@ -22,6 +22,7 @@ #define __MEDCOUPLINGBASICSTEST_HXX__ #include +#include "MCType.hxx" #include #include @@ -93,9 +94,9 @@ namespace MEDCoupling static DataArrayDouble *buildCoordsForMultiTypes_1(); static MEDCouplingMultiFields *buildMultiFields_1(); static std::vector buildMultiFields_2(); - static double sumAll(const std::vector< std::map >& matrix); + static double sumAll(const std::vector< std::map >& matrix); protected: - static int countNonZero(const std::vector< std::map >& matrix); + static int countNonZero(const std::vector< std::map >& matrix); static void test2D1DMeshesIntersection(MEDCouplingUMesh *sourceMesh, MEDCouplingUMesh *targetMesh, diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest0.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest0.cxx index 91184f47a..f057a7215 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest0.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest0.cxx @@ -35,7 +35,7 @@ using namespace MEDCoupling; -typedef std::vector > IntersectionMatrix; +typedef std::vector > IntersectionMatrix; MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSourceMesh_2() { @@ -46,7 +46,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSourceMesh_2() 0.0, 200.0, 200.0, 200.0, 0.0, 200.0, 200.0, 100.0, 200.0, 200.0, 200.0, 149.999999970343, 149.9999999874621, 49.999999881628682}; - int sourceConn[212]={25, 27, 13, 19, 18, 3, 20, 21, 5, 10, 17, 1, 1, 3, 0, 7, 18, 1, 0, 27, 12, 27, 13, 24, 25, 19, 16, 26, 1, 2, 6, 8, 15, 13, + mcIdType sourceConn[212]={25, 27, 13, 19, 18, 3, 20, 21, 5, 10, 17, 1, 1, 3, 0, 7, 18, 1, 0, 27, 12, 27, 13, 24, 25, 19, 16, 26, 1, 2, 6, 8, 15, 13, 12, 5, 24, 13, 25, 27, 10, 11, 9, 6, 19, 8, 23, 1, 22, 8, 23, 19, 16, 13, 17, 1, 6, 9, 10, 8, 13, 17, 5, 15, 5, 4, 1, 12, 18, 0, 24, 27, 19, 20, 18, 1, 7, 6, 5, 1, 4, 12, 15, 14, 25, 27, 19, 18, 1, 19, 16, 13, 20, 19, 23, 1, 27, 12, 1, 0, 6, 5, 1, 10, 4, 5, 1, 7, 12, 27, 1, 13, 5, 15, 4, 12, 19, 16, 26, 22, 13, 5, 17, 1, 1, 3, 7, 2, 13, 5, 1, 12, 18, 1, 3, 0, 8, 23, 2, 9, 3, @@ -70,7 +70,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSourceMesh_2() MEDCouplingUMesh *MEDCouplingBasicsTest::build3DTargetMesh_2() { double targetCoords[24]={200.0, 200.0, 0.0, 200.0, 200.0, 200.0, 200.0, 0.0, 0.0, 200.0, 0.0, 200.0, 0.0, 200.0, 0.0, 0.0, 200.0, 200.0, 0.0, 0.0, 0.0, 0.0, 0.0, 200.0}; - int targetConn[20]={5, 6, 3, 0, 1, 3, 0, 5, 3, 6, 5, 7, 6, 4, 0, 5, 6, 3, 0, 2}; + mcIdType targetConn[20]={5, 6, 3, 0, 1, 3, 0, 5, 3, 6, 5, 7, 6, 4, 0, 5, 6, 3, 0, 2}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(3); targetMesh->allocateCells(5); @@ -91,7 +91,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build1DTargetMesh_1() 25.,25.,0., 25.,25.,50., 25.,25.,200., 75.,25.,0., 75.,25.,50., 75.,25.,200., 25.,125.,0., 25.,125.,50., 25.,125.,200., 125.,125.,0., 125.,125.,50., 125.,125.,200. }; - int targetConn[16]={0,1, 1,2, 3,4, 4,5, 6,7, 7,8, 9,10, 10,11}; + mcIdType targetConn[16]={0,1, 1,2, 3,4, 4,5, 6,7, 7,8, 9,10, 10,11}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New("my name of mesh 1D",1); targetMesh->allocateCells(8); @@ -109,7 +109,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build1DTargetMesh_1() MEDCouplingUMesh *MEDCouplingBasicsTest::build2DSourceMesh_1() { double sourceCoords[8]={-0.3,-0.3, 0.7,-0.3, -0.3,0.7, 0.7,0.7}; - int sourceConn[6]={0,3,1,0,2,3}; + mcIdType sourceConn[6]={0,3,1,0,2,3}; MEDCouplingUMesh *sourceMesh=MEDCouplingUMesh::New("my name of mesh 2D",2); sourceMesh->allocateCells(2); sourceMesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,sourceConn); @@ -126,7 +126,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2DSourceMesh_1() MEDCouplingUMesh *MEDCouplingBasicsTest::build2DTargetMesh_1() { double targetCoords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 }; - int targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + mcIdType targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(2); targetMesh->allocateCells(5); @@ -147,7 +147,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2DTargetMesh_1() MEDCouplingUMesh *MEDCouplingBasicsTest::build2DTargetMeshPerm_1() { double targetCoords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 }; - int targetConn[18]={0,3,4,1, 1,2,4, 4,5,2, 6,7,4,3, 7,8,5,4}; + mcIdType targetConn[18]={0,3,4,1, 1,2,4, 4,5,2, 6,7,4,3, 7,8,5,4}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(2); targetMesh->allocateCells(5); @@ -168,7 +168,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2DTargetMeshPerm_1() MEDCouplingUMesh *MEDCouplingBasicsTest::build2DTargetMesh_2() { double targetCoords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 }; - int targetConn[24]={0,3,4, 0,4,1, 1,4,2, 4,5,2, 3,6,4, 6,7,4, 4,7,5, 7,8,5 }; + mcIdType targetConn[24]={0,3,4, 0,4,1, 1,4,2, 4,5,2, 3,6,4, 6,7,4, 4,7,5, 7,8,5 }; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(2); targetMesh->allocateCells(8); @@ -192,7 +192,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2DTargetMesh_2() MEDCouplingUMesh *MEDCouplingBasicsTest::buildCU1DMesh_U() { double coords[4]={ 0.0, 0.3, 0.75, 1.0 }; - int conn[2*3]={ 0,1, 1,2, 2,3 }; + mcIdType conn[2*3]={ 0,1, 1,2, 2,3 }; MEDCouplingUMesh *mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(1); mesh->allocateCells(3); @@ -210,7 +210,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::buildCU1DMesh_U() MEDCouplingUMesh *MEDCouplingBasicsTest::buildCU2DMesh_U() { double coords[18]={0.0,0.0, 0.5,0.0, 1.0,0.0, 0.0,0.5, 0.5,0.5, 1.0,0.5, 0.0,1.0, 0.5,1.0, 1.0,1.0 }; - int conn[18]={0,1,4,3, 3,4,7,6, 4,5,8,7, 1,5,4, 1,2,5 }; + mcIdType conn[18]={0,1,4,3, 3,4,7,6, 4,5,8,7, 1,5,4, 1,2,5 }; MEDCouplingUMesh *mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); @@ -234,7 +234,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::buildCU3DMesh_U() // 0.0,1.0,0.0 ,0.0,0.3,0.0 ,0.0,0.3,0.3 ,0.3,0.0,0.0 ,0.3,0.3,1.0 ,1.0,0.0,1.0 ,1.0,0.0,0.3 ,0.3,0.0,0.3 ,0.3,1.0,0.3 ,0.0,0.3,1.0 ,0.3,0.0,1.0 ,0.3,0.3,0.3 ,1.0,0.3,1.0 ,1.0,0.0,0.0 ,0.0,0.0,0.0 ,1.0,0.3,0.3 ,0.3,1.0,0.0 ,1.0,1.0,0.3 ,1.0,1.0,1.0 ,0.0,1.0,1.0 ,0.3,0.3,0.0 ,0.0,1.0,0.3 ,0.0,0.0,1.0 ,0.3,1.0,1.0 ,1.0,0.3,0.0 ,0.0,0.0,0.3 ,1.0,1.0,0.0 0.0,0.0,0.0, 0.3,0.0,0.0, 1.0,0.0,0.0, 0.0,0.3,0.0, 0.3,0.3,0.0, 1.0,0.3,0.0, 0.0,1.0,0.0, 0.3,1.0,0.0, 1.0,1.0,0.0, 0.0,0.0,0.3, 0.3,0.0,0.3, 1.0,0.0,0.3, 0.0,0.3,0.3, 0.3,0.3,0.3, 1.0,0.3,0.3, 0.0,1.0,0.3, 0.3,1.0,0.3, 1.0,1.0,0.3, 0.0,0.0,1.0, 0.3,0.0,1.0, 1.0,0.0,1.0, 0.0,0.3,1.0, 0.3,0.3,1.0, 1.0,0.3,1.0, 0.0,1.0,1.0, 0.3,1.0,1.0, 1.0,1.0,1.0, }; - int conn[8*8]= + mcIdType conn[8*8]= { // 11,15,12,4,8,17,18,23,3,13,6,7,20,24,15,11,14,3,7,25,1,20,11,2,1,20,11,2,0,16,8,21,20,24,15,11,16,26,17,8,25,7,10,22,2,11,4,9,2,11,4,9,21,8,23,19,7,6,5,10,11,15,12,4 0,3,4,1,9,12,13,10, 1,4,5,2,10,13,14,11, 3,6,7,4,12,15,16,13, 4,7,8,5,13,16,17,14, 9,12,13,10,18,21,22,19, 10,13,14,11,19,22,23,20, 12,15,16,13,21,24,25,22, 13,16,17,14,22,25,26,23 @@ -256,7 +256,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::buildCU3DMesh_U() MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSurfSourceMesh_1() { double sourceCoords[12]={-0.3,-0.3,0.5, 0.7,-0.3,1.5, -0.3,0.7,0.5, 0.7,0.7,1.5}; - int sourceConn[6]={0,3,1,0,2,3}; + mcIdType sourceConn[6]={0,3,1,0,2,3}; MEDCouplingUMesh *sourceMesh=MEDCouplingUMesh::New(); sourceMesh->setMeshDimension(2); sourceMesh->allocateCells(2); @@ -274,7 +274,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSurfSourceMesh_1() MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSurfSourceMesh_2() { double sourceCoords[12]={-0.3,-0.3,0., 0.7,-0.3,0., -0.3,0.7,0., 0.7,0.7,0.}; - int sourceConn[6]={0,3,1,0,2,3}; + mcIdType sourceConn[6]={0,3,1,0,2,3}; MEDCouplingUMesh *sourceMesh=MEDCouplingUMesh::New(); sourceMesh->setMeshDimension(2); sourceMesh->allocateCells(2); @@ -292,7 +292,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSurfSourceMesh_2() MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSurfTargetMesh_1() { double targetCoords[27]={-0.3,-0.3,0.5, 0.2,-0.3,1., 0.7,-0.3,1.5, -0.3,0.2,0.5, 0.2,0.2,1., 0.7,0.2,1.5, -0.3,0.7,0.5, 0.2,0.7,1., 0.7,0.7,1.5}; - int targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + mcIdType targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(2); targetMesh->allocateCells(5); @@ -316,7 +316,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSurfTargetMesh_1() MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSurfTargetMeshPerm_1() { double targetCoords[27]={-0.3,-0.3,0.5, 0.2,-0.3,1., 0.7,-0.3,1.5, -0.3,0.2,0.5, 0.2,0.2,1., 0.7,0.2,1.5, -0.3,0.7,0.5, 0.2,0.7,1., 0.7,0.7,1.5}; - int targetConn[18]={0,3,4,1, 1,4,2, 4,2,5, 6,7,4,3, 7,8,5,4}; + mcIdType targetConn[18]={0,3,4,1, 1,4,2, 4,2,5, 6,7,4,3, 7,8,5,4}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(2); targetMesh->allocateCells(5); @@ -337,7 +337,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSurfTargetMeshPerm_1() MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSurfTargetMesh_2() { double targetCoords[27]={-0.3,-0.3,0.5, 0.2,-0.3,1., 0.7,-0.3,1.5, -0.3,0.2,0.5, 0.2,0.2,1., 0.7,0.2,1.5, -0.3,0.7,0.5, 0.2,0.7,1., 0.7,0.7,1.5}; - int targetConn[24]={0,3,4, 0,4,1, 1,4,2, 4,5,2, 3,6,4, 6,7,4, 4,7,5, 7,8,5 }; + mcIdType targetConn[24]={0,3,4, 0,4,1, 1,4,2, 4,5,2, 3,6,4, 6,7,4, 4,7,5, 7,8,5 }; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(2); targetMesh->allocateCells(8); @@ -362,7 +362,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSourceMesh_1() { double sourceCoords[27]={ 0.0, 0.0, 200.0, 0.0, 0.0, 0.0, 0.0, 200.0, 200.0, 0.0, 200.0, 0.0, 200.0, 0.0, 200.0, 200.0, 0.0, 0.0, 200.0, 200.0, 200.0, 200.0, 200.0, 0.0, 100.0, 100.0, 100.0 }; - int sourceConn[48]={8,1,7,3, 6,0,8,2, 7,4,5,8, 6,8,4,7, 6,8,0,4, 6,8,7,3, 8,1,3,0, 4,1,5,8, 1,7,5,8, 0,3,8,2, 8,1,0,4, 3,6,8,2}; + mcIdType sourceConn[48]={8,1,7,3, 6,0,8,2, 7,4,5,8, 6,8,4,7, 6,8,0,4, 6,8,7,3, 8,1,3,0, 4,1,5,8, 1,7,5,8, 0,3,8,2, 8,1,0,4, 3,6,8,2}; MEDCouplingUMesh *sourceMesh=MEDCouplingUMesh::New(); sourceMesh->setMeshDimension(3); sourceMesh->allocateCells(12); @@ -392,7 +392,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3DTargetMesh_1() double targetCoords[81]={ 0., 0., 0., 50., 0., 0. , 200., 0., 0. , 0., 50., 0., 50., 50., 0. , 200., 50., 0., 0., 200., 0., 50., 200., 0. , 200., 200., 0. , 0., 0., 50., 50., 0., 50. , 200., 0., 50. , 0., 50., 50., 50., 50., 50. , 200., 50., 50., 0., 200., 50., 50., 200., 50. , 200., 200., 50. , 0., 0., 200., 50., 0., 200. , 200., 0., 200. , 0., 50., 200., 50., 50., 200. , 200., 50., 200., 0., 200., 200., 50., 200., 200. , 200., 200., 200. }; - int targetConn[64]={0,1,4,3,9,10,13,12, 1,2,5,4,10,11,14,13, 3,4,7,6,12,13,16,15, 4,5,8,7,13,14,17,16, + mcIdType targetConn[64]={0,1,4,3,9,10,13,12, 1,2,5,4,10,11,14,13, 3,4,7,6,12,13,16,15, 4,5,8,7,13,14,17,16, 9,10,13,12,18,19,22,21, 10,11,14,13,19,20,23,22, 12,13,16,15,21,22,25,24, 13,14,17,16,22,23,26,25}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(3); @@ -411,7 +411,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3DTargetMesh_1() MEDCouplingUMesh *MEDCouplingBasicsTest::build2DTargetMeshMergeNode_1() { double targetCoords[36]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,-0.3, 0.2,-0.3, 0.2,-0.3, 0.2,0.2, 0.2,0.2, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7, 0.2,0.7 }; - int targetConn[18]={0,9,7,5, 4,6,2, 10,11,8, 9,14,15,7, 17,16,13,6}; + mcIdType targetConn[18]={0,9,7,5, 4,6,2, 10,11,8, 9,14,15,7, 17,16,13,6}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(2); targetMesh->allocateCells(5); @@ -434,7 +434,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3DTargetMeshMergeNode_1() double targetCoords[93]={ 0., 0., 0., 50., 0., 0. , 200., 0., 0. , 0., 50., 0., 50., 50., 0. , 200., 50., 0., 0., 200., 0., 50., 200., 0. , 200., 200., 0. , 0., 0., 50., 50., 0., 50. , 200., 0., 50. , 0., 50., 50., 50., 50., 50. , 200., 50., 50., 0., 200., 50., 50., 200., 50. , 200., 200., 50. , 0., 0., 200., 50., 0., 200. , 200., 0., 200. , 0., 50., 200., 50., 50., 200. , 200., 50., 200., 0., 200., 200., 50., 200., 200. , 200., 200., 200., 50.,0.,0., 50.,0.,0., 50.,0.,0., 200., 50., 200.}; - int targetConn[64]={0,29,4,3,9,10,13,12, 28,2,5,4,10,11,14,13, 3,4,7,6,12,13,16,15, 4,5,8,7,13,14,17,16, + mcIdType targetConn[64]={0,29,4,3,9,10,13,12, 28,2,5,4,10,11,14,13, 3,4,7,6,12,13,16,15, 4,5,8,7,13,14,17,16, 9,10,13,12,18,19,22,21, 10,11,14,13,19,20,23,22, 12,13,16,15,21,22,25,24, 13,14,17,16,22,30,26,25}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(3); @@ -462,7 +462,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3DExtrudedUMesh_1(MEDCouplingUMesh 0.,0.,3., 1.,1.,3., 1.,1.25,3., 1.,0.,3., 1.,1.5,3., 2.,0.,3., 2.,1.,3., 1.,2.,3., 0.,2.,3., 3.,1.,3., 3.,2.,3., 0.,1.,3., 1.,3.,3., 2.,2.,3., 2.,3.,3.}; - int conn[354]={ + mcIdType conn[354]={ // 0 0,11,1,3,15,26,16,18, 1,2,4,7,13,6,-1,1,16,21,6,-1,6,21,28,13,-1,13,7,22,28,-1,7,4,19,22,-1,4,2,17,19,-1,2,1,16,17,-1,16,21,28,22,19,17, 1,6,5,3,16,21,20,18, 13,10,9,6,28,25,24,21, @@ -479,7 +479,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3DExtrudedUMesh_1(MEDCouplingUMesh 41,38,37,34,32,31,-1,41,56,46,31,-1,31,46,47,32,-1,32,47,49,34,-1,34,49,52,37,-1,37,38,53,52,-1,38,41,56,53,-1,56,46,47,49,52,53, 37,42,44,43,52,57,59,58 }; - int conn2[28]={7,12,14,13, 11,8,7,4,2,1, 13,10,9,6, 1,6,5,3, 1,2,4,7,13,6, 0,11,1,3}; + mcIdType conn2[28]={7,12,14,13, 11,8,7,4,2,1, 13,10,9,6, 1,6,5,3, 1,2,4,7,13,6, 0,11,1,3}; // MEDCouplingUMesh *ret=MEDCouplingUMesh::New(); ret->setMeshDimension(3); @@ -559,7 +559,7 @@ void MEDCouplingBasicsTest::build3DExtrudedUMesh_2(MEDCouplingUMesh *&meshN, MED 4.2729998779296876, 0.43212001800537109, 0.14404000282287599, 4.2729998779296876, 0, 0.21606000900268554, 4.2729998779296876, 0.10803000450134277, 0.21606000900268554, 4.2729998779296876, 0.21606000900268554, 0.21606000900268554, 4.2729998779296876, 0.28808000564575198, 0.21606000900268554, 4.2729998779296876, 0.36010002136230468, 0.21606000900268554, 4.2729998779296876, 0.43212001800537109, 0.21606000900268554, 4.2729998779296876}; - const int connN[320]={ + const mcIdType connN[320]={ 0, 1, 7, 6, 30, 31, 37, 36, 1, 2, 8, 7, 31, 32, 38, 37, 2, 3, 9, 8, 32, 33, 39, 38, 3, 4, 10, 9, 33, 34, 40, 39, 4, 5, 11, 10, 34, 35, 41, 40, 6, 7, 13, 12, 36, 37, 43, 42, 7, 8, 14, 13, 37, 38, 44, 43, 8, 9, 15, 14, 38, 39, 45, 44, 9, 10, 16, 15, 39, 40, 46, 45, 10, 11, 17, 16, 40, 41, 47, 46, 12, 13, 19, 18, 42, 43, 49, 48, 13, 14, 20, 19, 43, 44, 50, 49, 14, 15, 21, 20, 44, 45, 51, 50, 15, 16, 22, 21, 45, 46, 52, 51, 16, 17, 23, @@ -617,7 +617,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2DTargetMeshMerged_1() -0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7, 0.7,-0.3, 1.7,-0.3, 0.7,0.7, 1.7,0.7 }; - int targetConn[24]={ + mcIdType targetConn[24]={ 0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4, 9,12,10,9,11,12 }; @@ -652,7 +652,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2DCurveMesh(double dx, double dy) { 0.+dx,0.+dy, 1.+dx,0.+dy, 2.+dx,1.+dy }; - int targetConn[2*2]={1,2, 0,1}; + mcIdType targetConn[2*2]={1,2, 0,1}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New("2Dcurve 1D mesh",1); targetMesh->allocateCells(2); @@ -673,7 +673,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build1DMesh(double dx) { 0.+dx, 1.+dx, 3.+dx, 4.+dx }; - int targetConn[2*3]={1,2, 0,1, 2,3}; + mcIdType targetConn[2*3]={1,2, 0,1, 2,3}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New("1D mesh",1); targetMesh->allocateCells(3); @@ -692,7 +692,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build1DSourceMesh_2() { MEDCouplingUMesh *ret=MEDCouplingUMesh::New("1DSourceMesh",1); ret->allocateCells(4); - int conn[8]={0,1,2,3,1,2,3,4}; + mcIdType conn[8]={0,1,2,3,1,2,3,4}; for(int i=0;i<4;i++) ret->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,conn+2*i); ret->finishInsertingCells(); @@ -709,7 +709,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build1DTargetMesh_2() { MEDCouplingUMesh *ret=MEDCouplingUMesh::New("1DTargetMesh",1); ret->allocateCells(2); - int conn[4]={1,2,0,1}; + mcIdType conn[4]={1,2,0,1}; for(int i=0;i<2;i++) ret->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,conn+2*i); ret->finishInsertingCells(); @@ -726,7 +726,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2DCurveSourceMesh_2() { MEDCouplingUMesh *ret=MEDCouplingUMesh::New("1DSourceMesh",1); ret->allocateCells(4); - int conn[8]={0,1,2,3,1,2,3,4}; + mcIdType conn[8]={0,1,2,3,1,2,3,4}; for(int i=0;i<4;i++) ret->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,conn+2*i); ret->finishInsertingCells(); @@ -743,7 +743,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2DCurveTargetMesh_2() { MEDCouplingUMesh *ret=MEDCouplingUMesh::New("1DTargetMesh",1); ret->allocateCells(2); - int conn[4]={1,2,0,1}; + mcIdType conn[4]={1,2,0,1}; for(int i=0;i<2;i++) ret->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,conn+2*i); ret->finishInsertingCells(); @@ -760,7 +760,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build1DTargetMesh_3() { MEDCouplingUMesh *ret=MEDCouplingUMesh::New("1DMesh_3",1); ret->allocateCells(4); - int conn[10]={0,1,2, 3,4, 6,5,7 ,9,8}; + mcIdType conn[10]={0,1,2, 3,4, 6,5,7 ,9,8}; ret->insertNextCell(INTERP_KERNEL::NORM_SEG3,3,conn); ret->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,conn+3); ret->insertNextCell(INTERP_KERNEL::NORM_SEG3,3,conn+5); @@ -779,7 +779,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2DCurveTargetMesh_3() { MEDCouplingUMesh *ret=MEDCouplingUMesh::New("2DCurveMesh_3",1); ret->allocateCells(4); - int conn[10]={0,1,2, 3,4, 6,5,7 ,9,8}; + mcIdType conn[10]={0,1,2, 3,4, 6,5,7 ,9,8}; ret->insertNextCell(INTERP_KERNEL::NORM_SEG3,3,conn); ret->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,conn+3); ret->insertNextCell(INTERP_KERNEL::NORM_SEG3,3,conn+5); @@ -798,7 +798,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2DTargetMesh_3() { MEDCouplingUMesh *ret=MEDCouplingUMesh::New("2DMesh_3",2); ret->allocateCells(10); - int conn[52]={ + mcIdType conn[52]={ 0,1,2, 0,1,3,4, 0,1,3,5,4, 0,1,2,6,7,8, 0,1,3,4,6,9,2,10, 0,2,1, 0,4,3,1, 0,4,5,3,1, 0,2,1,8,7,6, 0,4,3,1,10,2,9,6 }; @@ -829,7 +829,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2DTargetMesh_3() MEDCouplingUMesh *MEDCouplingBasicsTest::build2DTargetMesh_4() { double targetCoords[20]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 }; - int targetConn[18]={0,4,5,1, 1,5,3, 5,6,2, 7,8,5,4, 8,9,6,5}; + mcIdType targetConn[18]={0,4,5,1, 1,5,3, 5,6,2, 7,8,5,4, 8,9,6,5}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(2); targetMesh->allocateCells(5); @@ -995,7 +995,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build1DMultiTypes_1() { MEDCouplingUMesh *mesh=MEDCouplingUMesh::New("Multi1DMesh",1); DataArrayDouble *coo=buildCoordsForMultiTypes_1(); - const int conn[5]={0,2, 0,2,1}; + const mcIdType conn[5]={0,2, 0,2,1}; mesh->allocateCells(2); mesh->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,conn); mesh->insertNextCell(INTERP_KERNEL::NORM_SEG3,3,conn+2); @@ -1009,7 +1009,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2DMultiTypes_1() { MEDCouplingUMesh *mesh=MEDCouplingUMesh::New("Multi2DMesh",2); DataArrayDouble *coo=buildCoordsForMultiTypes_1(); - const int conn[21]={3,4,5, 3,4,5,6,7,8, 0,9,10,11, 0,9,10,11,12,13,14,15}; + const mcIdType conn[21]={3,4,5, 3,4,5,6,7,8, 0,9,10,11, 0,9,10,11,12,13,14,15}; mesh->allocateCells(4); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,conn); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI6,6,conn+3); @@ -1025,7 +1025,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3DMultiTypes_1() { MEDCouplingUMesh *mesh=MEDCouplingUMesh::New("Multi3DMesh",3); DataArrayDouble *coo=buildCoordsForMultiTypes_1(); - const int conn[81]={0,16,17,18, + const mcIdType conn[81]={0,16,17,18, 0,16,17,18,19,20,21,22,23,24, 0,11,10,9,25, 0,11,10,9,25,15,14,13,12,26,27,28,29, @@ -1124,7 +1124,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::buildHexa8Mesh_1() const double coords[81]={0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.0, 1.0, 0.5, 0.0, 0.0, 1.0, 0.0, 0.5, 1.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.5, 1.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.0, 1.0, 0.5, 0.5, 1.0, 0.5, 1.0, 1.0, 0.5, 0.0, 0.0, 1.0, 0.5, 0.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.5, 1.0, 0.5, 0.5, 1.0, 1.0, 0.5, 1.0, 0.0, 1.0, 1.0, 0.5, 1.0, 1.0, 1.0, 1.0, 1.0}; coo->alloc(27,3); std::copy(coords,coords+81,coo->getPointer()); - const int conn[64]={3,12,13,4,0,9,10,1, + const mcIdType conn[64]={3,12,13,4,0,9,10,1, 4,13,14,5,1,10,11,2, 6,15,16,7,3,12,13,4, 7,16,17,8,4,13,14,5, @@ -1146,7 +1146,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::buildPointe_1(MEDCouplingUMesh *& m1) MEDCouplingUMesh *mesh=MEDCouplingUMesh::New("Pointe.med",3); MEDCouplingUMesh *mesh2=MEDCouplingUMesh::New("Pointe.med",2); const double coords[57]={0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 0.0, 1.0, 0.0, 2.0, 1.0, -2.0, 0.0, 1.0, 0.0, -2.0, 1.0, 1.0, 1.0, 2.0, -1.0, 1.0, 2.0, -1.0, -1.0, 2.0, 1.0, -1.0, 2.0, 1.0, 1.0, 3.0, -1.0, 1.0, 3.0, -1.0, -1.0, 3.0, 1.0, -1.0, 3.0, 1.0, 1.0, 4.0, -1.0, 1.0, 4.0, -1.0, -1.0, 4.0, 1.0, -1.0, 4.0, 0.0, 0.0, 5.0}; - const int conn[74]={0,1,2,5,0,1,3,2,0,1,4,3,0,1,5,4,1,6,3,2,1,7,4,3,1,8,5,4,1,9,2,5,1,6,2,9,1,7,3,6,1,8,4,7,1,9,5,8, 6,7,8,9,1,14,17,16,15,18, 10,11,12,13,6,7,8,9,14,15,16,17,10,11,12,13}; + const mcIdType conn[74]={0,1,2,5,0,1,3,2,0,1,4,3,0,1,5,4,1,6,3,2,1,7,4,3,1,8,5,4,1,9,2,5,1,6,2,9,1,7,3,6,1,8,4,7,1,9,5,8, 6,7,8,9,1,14,17,16,15,18, 10,11,12,13,6,7,8,9,14,15,16,17,10,11,12,13}; DataArrayDouble *coo=DataArrayDouble::New(); coo->alloc(19,3); std::copy(coords,coords+57,coo->getPointer()); @@ -1162,7 +1162,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::buildPointe_1(MEDCouplingUMesh *& m1) mesh->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+66); mesh->finishInsertingCells(); //[1,34,29,23,41,32] - const int conn2[20]={0,5,1,14,18,17,8,7,4,9,5,2, 12,8,9,13,6,7,8,9}; + const mcIdType conn2[20]={0,5,1,14,18,17,8,7,4,9,5,2, 12,8,9,13,6,7,8,9}; mesh2->allocateCells(6); for(int i=0;i<4;i++) mesh2->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,conn2+3*i); @@ -1174,11 +1174,11 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::buildPointe_1(MEDCouplingUMesh *& m1) return mesh; } -double MEDCouplingBasicsTest::sumAll(const std::vector< std::map >& matrix) +double MEDCouplingBasicsTest::sumAll(const std::vector< std::map >& matrix) { double ret=0.; - for(std::vector< std::map >::const_iterator iter=matrix.begin();iter!=matrix.end();iter++) - for(std::map::const_iterator iter2=(*iter).begin();iter2!=(*iter).end();iter2++) + for(std::vector< std::map >::const_iterator iter=matrix.begin();iter!=matrix.end();iter++) + for(std::map::const_iterator iter2=(*iter).begin();iter2!=(*iter).end();iter2++) ret+=(*iter2).second; return ret; } @@ -1189,7 +1189,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2D1DSourceMesh() -5., 3., -9., 0., -13., 3., -9., 8., -7., 0., -7., 8. }; - int sourceConn[16]={0,1, 1,2, 2,3, 3,0, 3,4, 4,5, 4,6, 7,8}; + mcIdType sourceConn[16]={0,1, 1,2, 2,3, 3,0, 3,4, 4,5, 4,6, 7,8}; MEDCouplingUMesh *sourceMesh=MEDCouplingUMesh::New(); sourceMesh->setMeshDimension(1); sourceMesh->allocateCells(8); @@ -1213,7 +1213,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build2D1DSourceMesh() MEDCouplingUMesh *MEDCouplingBasicsTest::build2D1DTargetMesh() { double targetCoords[10]={-17., 0., -17.,6., -9.,6., -9.,0., -5., 3.}; - int targetConn[7]={0,1,2,3, 2,3,4}; + mcIdType targetConn[7]={0,1,2,3, 2,3,4}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(2); targetMesh->allocateCells(2); @@ -1238,7 +1238,7 @@ MEDCouplingUMesh* MEDCouplingBasicsTest::build2D1DSegSourceMesh(const double shi const int nbYP1 = nbY + 1; sourceMesh->allocateCells(nbY); - int sourceConn[2]; + mcIdType sourceConn[2]; for (int iY = 0; iY < nbY; ++iY) { sourceConn[0] = iY ; @@ -1273,7 +1273,7 @@ MEDCouplingUMesh* MEDCouplingBasicsTest::build2D1DQuadTargetMesh(const double in const int nbYP1 = nbY + 1; targetMesh->allocateCells(nbX * nbY); - int targetConn[4]; + mcIdType targetConn[4]; for (int iX = 0; iX < nbX; ++iX) { for (int iY = 0; iY < nbY; ++iY) @@ -1316,7 +1316,7 @@ MEDCouplingUMesh* MEDCouplingBasicsTest::build2D1DTriTargetMesh(const double inc const int nbYP1 = nbY + 1; targetMesh->allocateCells(nbX * nbY * 2); - int targetConn[3]; + mcIdType targetConn[3]; for (int iX = 0; iX < nbX; ++iX) { for (int iY = 0; iY < nbY; ++iY) @@ -1360,7 +1360,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3D2DSourceMesh() -20., 0., 16., -18., 0., 16., -20., 2.5, 16., -25., 0., -5., 5., 0., -5., 5., 0. , 25., -25.,0.,25. }; - int sourceConn[25]={0,1,2, 3,4,5,6, 7,8,9, 10,11,12,13, 14,15,16, 3,4,8,7, 17,18,19,20}; + mcIdType sourceConn[25]={0,1,2, 3,4,5,6, 7,8,9, 10,11,12,13, 14,15,16, 3,4,8,7, 17,18,19,20}; MEDCouplingUMesh *sourceMesh=MEDCouplingUMesh::New(); sourceMesh->setMeshDimension(2); sourceMesh->allocateCells(7); @@ -1388,7 +1388,7 @@ MEDCouplingUMesh *MEDCouplingBasicsTest::build3D2DTargetMesh() -20.,-5.,10., -20.,-5.,-4., -12.,-5.,-4., -12.,-5.,10., -20., 0.,-4., -12., 0.,-4. }; - int targetConn[20]={4,5,7,8, 0,3,2,1,4,7,6,5, 4,13,14,7,9,10,11,12}; + mcIdType targetConn[20]={4,5,7,8, 0,3,2,1,4,7,6,5, 4,13,14,7,9,10,11,12}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(3); targetMesh->allocateCells(3); @@ -1416,7 +1416,7 @@ MEDCouplingUMesh* MEDCouplingBasicsTest::build3D2DQuadSourceMesh(const double sh const int nbZP1 = nbZ + 1; sourceMesh->allocateCells(nbY * nbZ); - int sourceConn[4]; + mcIdType sourceConn[4]; for (int iY = 0; iY < nbY; ++iY) { for (int iZ = 0; iZ < nbZ; ++iZ) @@ -1462,7 +1462,7 @@ MEDCouplingUMesh* MEDCouplingBasicsTest::build3D2DTriSourceMesh(const double shi const int nbZP1 = nbZ + 1; sourceMesh->allocateCells(nbY * nbZ * 2); - int sourceConn[3]; + mcIdType sourceConn[3]; for (int iY = 0; iY < nbY; ++iY) { for (int iZ = 0; iZ < nbZ; ++iZ) @@ -1512,7 +1512,7 @@ MEDCouplingUMesh* MEDCouplingBasicsTest::build3D2DHexaTargetMesh(const double in const int nbZP1 = nbZ + 1; targetMesh->allocateCells(nbX * nbY * nbZ); - int targetConn[8]; + mcIdType targetConn[8]; for (int iX = 0; iX < nbX; ++iX) { for (int iY = 0; iY < nbY; ++iY) @@ -1568,7 +1568,7 @@ MEDCouplingUMesh* MEDCouplingBasicsTest::build3D2DTetraTargetMesh(const double i const int nbZP1 = nbZ + 1; targetMesh->allocateCells(nbX * nbY * nbZ * 5); - int targetConn[4]; + mcIdType targetConn[4]; for (int iX = 0; iX < nbX; ++iX) { for (int iY = 0; iY < nbY; ++iY) @@ -1627,11 +1627,11 @@ MEDCouplingUMesh* MEDCouplingBasicsTest::build3D2DTetraTargetMesh(const double i return targetMesh; } -int MEDCouplingBasicsTest::countNonZero(const std::vector< std::map >& matrix) +int MEDCouplingBasicsTest::countNonZero(const std::vector< std::map >& matrix) { int ret=0; - for(std::vector< std::map >::const_iterator iter=matrix.begin();iter!=matrix.end();iter++) - for(std::map::const_iterator iter2=(*iter).begin();iter2!=(*iter).end();iter2++) + for(std::vector< std::map >::const_iterator iter=matrix.begin();iter!=matrix.end();iter++) + for(std::map::const_iterator iter2=(*iter).begin();iter2!=(*iter).end();iter2++) if (!INTERP_KERNEL::epsilonEqual((*iter2).second, 0.)) ret +=1; return ret; } diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx index bcaf814dc..2473089de 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx @@ -23,6 +23,7 @@ #include "MEDCouplingCMesh.hxx" #include "MEDCouplingMappedExtrudedMesh.hxx" #include "MEDCouplingFieldDouble.hxx" +#include "MEDCouplingMemArray.txx" #include #include #include @@ -71,7 +72,7 @@ void MEDCouplingBasicsTest1::testArray2() arr->setInfoOnComponent(1,"hhhh"); arr->setInfoOnComponent(2,"jj"); arr->setInfoOnComponent(3,"kkkkkk"); - MCAuto arr2(arr->convertToIntArr()); + MCAuto arr2(arr->convertToIntArr()); MCAuto arr3(arr2->convertToDblArr()); CPPUNIT_ASSERT(arr->isEqual(*arr3,1e-14)); arr->decrRef(); @@ -122,8 +123,8 @@ void MEDCouplingBasicsTest1::testArray3() void MEDCouplingBasicsTest1::testMesh() { - const int nbOfCells=6; - const int nbOfNodes=12; + const mcIdType nbOfCells=6; + const mcIdType nbOfNodes=12; double coords[3*nbOfNodes]={ 0.024155, 0.04183768725682622, -0.305, 0.04831000000000001, -1.015761910347357e-17, -0.305, 0.09662000000000001, -1.832979297858306e-18, @@ -132,10 +133,10 @@ void MEDCouplingBasicsTest1::testMesh() 0.09662000000000001, -1.832979297858306e-18, -0.2863, 0.120775, 0.04183768725682623, -0.2863, 0.09662000000000001, 0.08367537451365245, -0.2863, 0.04831000000000001, 0.08367537451365246, -0.2863, }; - int tab4[4*nbOfCells]={ + mcIdType tab4[4*nbOfCells]={ 1, 2, 8, 7, 2, 3, 9, 8, 3, 4, 10, 9, 4, 5, 11, 10, 5, 0, 6, 11, 0, 1, 7, 6, }; - CPPUNIT_ASSERT_EQUAL(MEDCouplingMesh::GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NORM_TRI3),3); + CPPUNIT_ASSERT_EQUAL(MEDCouplingMesh::GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NORM_TRI3),ToIdType(3)); CPPUNIT_ASSERT(MEDCouplingMesh::IsStaticGeometricType(INTERP_KERNEL::NORM_TRI3)); CPPUNIT_ASSERT(MEDCouplingMesh::IsLinearGeometricType(INTERP_KERNEL::NORM_TRI3)); CPPUNIT_ASSERT_EQUAL(MEDCouplingMesh::GetDimensionOfGeometricType(INTERP_KERNEL::NORM_TRI3),2); @@ -145,7 +146,7 @@ void MEDCouplingBasicsTest1::testMesh() CPPUNIT_ASSERT(MEDCouplingMesh::IsLinearGeometricType(INTERP_KERNEL::NORM_POLYGON)); CPPUNIT_ASSERT_EQUAL(MEDCouplingMesh::GetDimensionOfGeometricType(INTERP_KERNEL::NORM_POLYGON),2); CPPUNIT_ASSERT_EQUAL(std::string(MEDCouplingMesh::GetReprOfGeometricType(INTERP_KERNEL::NORM_POLYGON)),std::string("NORM_POLYGON")); - CPPUNIT_ASSERT_EQUAL(MEDCouplingMesh::GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NORM_TRI6),6); + CPPUNIT_ASSERT_EQUAL(MEDCouplingMesh::GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NORM_TRI6),ToIdType(6)); CPPUNIT_ASSERT(MEDCouplingMesh::IsStaticGeometricType(INTERP_KERNEL::NORM_TRI6)); CPPUNIT_ASSERT(!MEDCouplingMesh::IsLinearGeometricType(INTERP_KERNEL::NORM_TRI6)); CPPUNIT_ASSERT_EQUAL(MEDCouplingMesh::GetDimensionOfGeometricType(INTERP_KERNEL::NORM_TRI6),2); @@ -153,19 +154,19 @@ void MEDCouplingBasicsTest1::testMesh() MEDCouplingUMesh *mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(8); - const int *curConn=tab4; - for(int i=0;iinsertNextCell(INTERP_KERNEL::NORM_QUAD4,4,curConn); mesh->finishInsertingCells(); - CPPUNIT_ASSERT_EQUAL((std::size_t)30,mesh->getNodalConnectivity()->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)mesh->getNumberOfCells()); + CPPUNIT_ASSERT_EQUAL(ToIdType(30),mesh->getNodalConnectivity()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh->getNumberOfCells()); //test 0 - no copy no ownership DataArrayDouble *myCoords=DataArrayDouble::New(); myCoords->useArray(coords,false,DeallocType::CPP_DEALLOC,nbOfNodes,3); mesh->setCoords(myCoords); mesh->setCoords(myCoords); myCoords->decrRef(); - CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)mesh->getNumberOfCells()); + CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh->getNumberOfCells()); mesh->checkConsistencyLight(); //test 1 - no copy ownership C++ myCoords=DataArrayDouble::New(); @@ -174,7 +175,7 @@ void MEDCouplingBasicsTest1::testMesh() myCoords->useArray(tmp,true,DeallocType::CPP_DEALLOC,nbOfNodes,3); mesh->setCoords(myCoords); myCoords->decrRef(); - CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)mesh->getNumberOfCells()); + CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh->getNumberOfCells()); mesh->checkConsistencyLight(); //test 2 - no copy ownership C myCoords=DataArrayDouble::New(); @@ -204,31 +205,31 @@ void MEDCouplingBasicsTest1::testMesh() MEDCouplingUMesh *mesh2=mesh->clone(false); CPPUNIT_ASSERT(mesh2!=mesh); mesh2->checkConsistencyLight(); - CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)mesh2->getNumberOfCells()); + CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh2->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(nbOfNodes,mesh2->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(3,mesh2->getSpaceDimension()); CPPUNIT_ASSERT(mesh!=mesh2); CPPUNIT_ASSERT(mesh->getCoords()==mesh2->getCoords()); CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.2863,mesh2->getCoords()->getIJ(11,2),1e-14); CPPUNIT_ASSERT(mesh->getNodalConnectivity()==mesh2->getNodalConnectivity()); - CPPUNIT_ASSERT_EQUAL(3,mesh2->getNodalConnectivity()->getIJ(7,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),mesh2->getNodalConnectivity()->getIJ(7,0)); CPPUNIT_ASSERT(mesh->getNodalConnectivityIndex()==mesh2->getNodalConnectivityIndex()); - CPPUNIT_ASSERT_EQUAL(15,mesh2->getNodalConnectivityIndex()->getIJ(3,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(15),mesh2->getNodalConnectivityIndex()->getIJ(3,0)); mesh2->decrRef(); // test clone not recursively MEDCouplingUMesh *mesh3=mesh->clone(true); CPPUNIT_ASSERT(mesh3!=mesh); mesh3->checkConsistencyLight(); - CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)mesh3->getNumberOfCells()); + CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh3->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(nbOfNodes,mesh3->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(3,mesh3->getSpaceDimension()); CPPUNIT_ASSERT(mesh!=mesh3); CPPUNIT_ASSERT(mesh->getCoords()!=mesh3->getCoords()); CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.2863,mesh3->getCoords()->getIJ(11,2),1e-14); CPPUNIT_ASSERT(mesh->getNodalConnectivity()!=mesh3->getNodalConnectivity()); - CPPUNIT_ASSERT_EQUAL(3,mesh3->getNodalConnectivity()->getIJ(7,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),mesh3->getNodalConnectivity()->getIJ(7,0)); CPPUNIT_ASSERT(mesh->getNodalConnectivityIndex()!=mesh3->getNodalConnectivityIndex()); - CPPUNIT_ASSERT_EQUAL(15,mesh3->getNodalConnectivityIndex()->getIJ(3,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(15),mesh3->getNodalConnectivityIndex()->getIJ(3,0)); mesh3->decrRef(); //test 4 - Field on cells MEDCouplingFieldDouble *fieldOnCells=MEDCouplingFieldDouble::New(ON_CELLS); @@ -246,7 +247,7 @@ void MEDCouplingBasicsTest1::testMesh() MEDCouplingFieldDouble *fieldOnCells2=fieldOnCells->clone(false); CPPUNIT_ASSERT(fieldOnCells2!=fieldOnCells); fieldOnCells2->checkConsistencyLight(); - CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)fieldOnCells2->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(nbOfCells,fieldOnCells2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(9,(int)fieldOnCells2->getNumberOfComponents()); CPPUNIT_ASSERT(fieldOnCells2->getArray()==fieldOnCells->getArray()); CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,fieldOnCells2->getArray()->getIJ(3,7),1e-14); @@ -255,7 +256,7 @@ void MEDCouplingBasicsTest1::testMesh() MEDCouplingFieldDouble *fieldOnCells3=fieldOnCells->clone(true); CPPUNIT_ASSERT(fieldOnCells3!=fieldOnCells); fieldOnCells3->checkConsistencyLight(); - CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)fieldOnCells3->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(nbOfCells,fieldOnCells3->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(9,(int)fieldOnCells3->getNumberOfComponents()); CPPUNIT_ASSERT(fieldOnCells3->getArray()!=fieldOnCells->getArray()); CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,fieldOnCells3->getArray()->getIJ(3,7),1e-14); @@ -271,7 +272,7 @@ void MEDCouplingBasicsTest1::testMesh() void MEDCouplingBasicsTest1::testMeshPointsCloud() { double targetCoords[27]={-0.3,-0.3,0.5, 0.2,-0.3,1., 0.7,-0.3,1.5, -0.3,0.2,0.5, 0.2,0.2,1., 0.7,0.2,1.5, -0.3,0.7,0.5, 0.2,0.7,1., 0.7,0.7,1.5}; - const int targetConn[]={0,1,2,3,4,5,7,6}; + const mcIdType targetConn[]={0,1,2,3,4,5,7,6}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(0); targetMesh->allocateCells(8); @@ -294,7 +295,7 @@ void MEDCouplingBasicsTest1::testMeshPointsCloud() targetMesh->checkConsistencyLight(); CPPUNIT_ASSERT_EQUAL(3,targetMesh->getSpaceDimension()); CPPUNIT_ASSERT_EQUAL(8,(int)targetMesh->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(9,targetMesh->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(ToIdType(9),targetMesh->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(0,targetMesh->getMeshDimension()); // targetMesh->decrRef(); @@ -362,14 +363,14 @@ void MEDCouplingBasicsTest1::testDeepCopy() void MEDCouplingBasicsTest1::testRevNodal() { MEDCouplingUMesh *mesh=build2DTargetMesh_1(); - DataArrayInt *revNodal=DataArrayInt::New(); - DataArrayInt *revNodalIndx=DataArrayInt::New(); + DataArrayIdType *revNodal=DataArrayIdType::New(); + DataArrayIdType *revNodalIndx=DataArrayIdType::New(); // mesh->getReverseNodalConnectivity(revNodal,revNodalIndx); - const int revNodalExpected[18]={0,0,1,1,2,0,3,0,1,2,3,4,2,4,3,3,4,4}; - const int revNodalIndexExpected[10]={0,1,3,5,7,12,14,15,17,18}; - CPPUNIT_ASSERT_EQUAL((std::size_t)18,revNodal->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)10,revNodalIndx->getNbOfElems()); + const mcIdType revNodalExpected[18]={0,0,1,1,2,0,3,0,1,2,3,4,2,4,3,3,4,4}; + const mcIdType revNodalIndexExpected[10]={0,1,3,5,7,12,14,15,17,18}; + CPPUNIT_ASSERT_EQUAL(ToIdType(18),revNodal->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(10),revNodalIndx->getNbOfElems()); CPPUNIT_ASSERT(std::equal(revNodalExpected,revNodalExpected+18,revNodal->getPointer())); CPPUNIT_ASSERT(std::equal(revNodalIndexExpected,revNodalIndexExpected+10,revNodalIndx->getPointer())); // @@ -383,14 +384,14 @@ void MEDCouplingBasicsTest1::testConvertToPolyTypes() ////// 2D MEDCouplingUMesh *mesh=build2DTargetMesh_1(); // - const int elts[2]={1,3}; - std::vector eltsV(elts,elts+2); + const mcIdType elts[2]={1,3}; + std::vector eltsV(elts,elts+2); mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size()); mesh->checkConsistencyLight(); CPPUNIT_ASSERT_EQUAL(5,(int)mesh->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(23,(int)mesh->getNodalConnectivity()->getNumberOfTuples()); - const int *pt=mesh->getNodalConnectivity()->getConstPointer(); - const int expected1[23]={4, 0, 3, 4, 1, 5, 1, 4, 2, 3, 4, 5, 2, 5, 6, 7, 4, 3, 4, 7, 8, 5, 4}; + const mcIdType *pt=mesh->getNodalConnectivity()->getConstPointer(); + const mcIdType expected1[23]={4, 0, 3, 4, 1, 5, 1, 4, 2, 3, 4, 5, 2, 5, 6, 7, 4, 3, 4, 7, 8, 5, 4}; CPPUNIT_ASSERT(std::equal(expected1,expected1+23,pt)); // mesh->decrRef(); @@ -411,32 +412,32 @@ void MEDCouplingBasicsTest1::testConvertToPolyTypes() void MEDCouplingBasicsTest1::testDescConn2D() { MEDCouplingUMesh *mesh=build2DTargetMesh_1(); - DataArrayInt *desc=DataArrayInt::New(); - DataArrayInt *descIndx=DataArrayInt::New(); - DataArrayInt *revDesc=DataArrayInt::New(); - DataArrayInt *revDescIndx=DataArrayInt::New(); + DataArrayIdType *desc=DataArrayIdType::New(); + DataArrayIdType *descIndx=DataArrayIdType::New(); + DataArrayIdType *revDesc=DataArrayIdType::New(); + DataArrayIdType *revDescIndx=DataArrayIdType::New(); // MEDCouplingUMesh *mesh2=mesh->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx); mesh2->checkConsistencyLight(); CPPUNIT_ASSERT_EQUAL(1,mesh2->getMeshDimension()); CPPUNIT_ASSERT_EQUAL(13,(int)mesh2->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL((std::size_t)14,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(14,(int)revDescIndx->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)6,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(6,(int)descIndx->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)18,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)desc->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)18,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)revDesc->getNumberOfTuples()); - const int expected1[18]={0,1,2,3, 2,4,5, 6,7,4, 8,9,1,10, 11,12,6,9}; + CPPUNIT_ASSERT_EQUAL(ToIdType(14),revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(14,(int)revDescIndx->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(6),descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(6,(int)descIndx->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(18),desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)desc->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(18),revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)revDesc->getNumberOfTuples()); + const mcIdType expected1[18]={0,1,2,3, 2,4,5, 6,7,4, 8,9,1,10, 11,12,6,9}; CPPUNIT_ASSERT(std::equal(expected1,expected1+18,desc->getConstPointer())); - const int expected2[6]={0,4,7,10,14,18}; + const mcIdType expected2[6]={0,4,7,10,14,18}; CPPUNIT_ASSERT(std::equal(expected2,expected2+6,descIndx->getConstPointer())); - const int expected3[14]={0,1,3,5,6,8,9,11,12,13,15,16,17,18}; + const mcIdType expected3[14]={0,1,3,5,6,8,9,11,12,13,15,16,17,18}; CPPUNIT_ASSERT(std::equal(expected3,expected3+14,revDescIndx->getConstPointer())); - const int expected4[18]={0, 0,3, 0,1, 0, 1,2, 1, 2,4, 2, 3, 3,4, 3, 4, 4}; + const mcIdType expected4[18]={0, 0,3, 0,1, 0, 1,2, 1, 2,4, 2, 3, 3,4, 3, 4, 4}; CPPUNIT_ASSERT(std::equal(expected4,expected4+18,revDesc->getConstPointer())); - DataArrayInt *conn=mesh2->getNodalConnectivity(); - DataArrayInt *connIndex=mesh2->getNodalConnectivityIndex(); - const int expected5[14]={0,3,6,9,12,15,18,21,24,27,30,33,36,39}; + DataArrayIdType *conn=mesh2->getNodalConnectivity(); + DataArrayIdType *connIndex=mesh2->getNodalConnectivityIndex(); + const mcIdType expected5[14]={0,3,6,9,12,15,18,21,24,27,30,33,36,39}; CPPUNIT_ASSERT(std::equal(expected5,expected5+14,connIndex->getConstPointer())); - const int expected6[39]={1, 0, 3, 1, 3, 4, 1, 4, 1, 1, 1, 0, 1, 4, 2, 1, 2, 1, 1, 4, 5, 1, 5, 2, 1, 6, 7, 1, 7, 4, 1, 3, 6, 1, 7, 8, 1, 8, 5}; + const mcIdType expected6[39]={1, 0, 3, 1, 3, 4, 1, 4, 1, 1, 1, 0, 1, 4, 2, 1, 2, 1, 1, 4, 5, 1, 5, 2, 1, 6, 7, 1, 7, 4, 1, 3, 6, 1, 7, 8, 1, 8, 5}; CPPUNIT_ASSERT(std::equal(expected6,expected6+39,conn->getConstPointer())); // desc->decrRef(); @@ -445,24 +446,24 @@ void MEDCouplingBasicsTest1::testDescConn2D() revDescIndx->decrRef(); mesh2->decrRef(); // - const int elts[2]={1,3}; - std::vector eltsV(elts,elts+2); + const mcIdType elts[2]={1,3}; + std::vector eltsV(elts,elts+2); mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size()); mesh->checkConsistencyLight(); // - desc=DataArrayInt::New(); - descIndx=DataArrayInt::New(); - revDesc=DataArrayInt::New(); - revDescIndx=DataArrayInt::New(); + desc=DataArrayIdType::New(); + descIndx=DataArrayIdType::New(); + revDesc=DataArrayIdType::New(); + revDescIndx=DataArrayIdType::New(); // mesh2=mesh->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx); mesh2->checkConsistencyLight(); CPPUNIT_ASSERT_EQUAL(1,mesh2->getMeshDimension()); CPPUNIT_ASSERT_EQUAL(13,(int)mesh2->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL((std::size_t)14,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(14,(int)revDescIndx->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)6,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(6,(int)descIndx->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)18,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)desc->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)18,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)revDesc->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(14),revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(14,(int)revDescIndx->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(6),descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(6,(int)descIndx->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(18),desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)desc->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(18),revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)revDesc->getNumberOfTuples()); CPPUNIT_ASSERT(std::equal(expected1,expected1+18,desc->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected2,expected2+6,descIndx->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected3,expected3+14,revDescIndx->getConstPointer())); @@ -483,29 +484,29 @@ void MEDCouplingBasicsTest1::testDescConn2D() void MEDCouplingBasicsTest1::testDescConn3D() { MEDCouplingUMesh *mesh=build3DTargetMesh_1(); - DataArrayInt *desc=DataArrayInt::New(); - DataArrayInt *descIndx=DataArrayInt::New(); - DataArrayInt *revDesc=DataArrayInt::New(); - DataArrayInt *revDescIndx=DataArrayInt::New(); + DataArrayIdType *desc=DataArrayIdType::New(); + DataArrayIdType *descIndx=DataArrayIdType::New(); + DataArrayIdType *revDesc=DataArrayIdType::New(); + DataArrayIdType *revDescIndx=DataArrayIdType::New(); // MEDCouplingUMesh *mesh2=mesh->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx); mesh2->checkConsistencyLight(); CPPUNIT_ASSERT_EQUAL(2,mesh2->getMeshDimension()); CPPUNIT_ASSERT_EQUAL(36,(int)mesh2->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL((std::size_t)37,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(37,(int)revDescIndx->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)9,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(9,(int)descIndx->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)48,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)desc->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)48,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)revDesc->getNumberOfTuples()); - const int expected1[9]={0, 6, 12, 18, 24, 30, 36, 42, 48}; - const int expected2[48]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 11, 12, 4, 13, 14, 15, 16, 17, 10, 18, 19, 13, 1, 20, 21, 22, 23, 24, 7, 25, 26, 27, 28, 22, 12, 29, 23, 30, 31, 32, 17, 33, 28, 34, 35, 30}; - const int expected3[37]={0, 1, 3, 4, 6, 8, 9, 10, 12, 13, 14, 16, 17, 19, 21, 22, 23, 24, 26, 27, 28, 29, 30, 32, 34, 35, 36, 37, 38, 40, 41, 43, 44, 45, 46, 47, 48}; - const int expected4[48]={0, 0, 4, 0, 0, 1, 0, 2, 0, 1, 1, 5, 1, 1, 1, 3, 2, 2, 6, 2, 3, 2, 2, 3, 3, 7, 3, 3, 4, 4, 4, 5, 4, 6, 4, 5, 5, 5, 5, 7, 6, 6, 7, 6, 6, 7, 7, 7}; - const int expected5[37]={0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180}; - const int expected6[180]={4, 0, 1, 4, 3, 4, 9, 12, 13, 10, 4, 0, 9, 10, 1, 4, 1, 10, 13, 4, 4, 4, 13, 12, 3, 4, 3, 12, 9, 0, 4, 1, 2, 5, 4, 4, 10, 13, 14, 11, 4, 1, 10, 11, 2, 4, 2, 11, 14, + CPPUNIT_ASSERT_EQUAL(ToIdType(37),revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(37,(int)revDescIndx->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(9),descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(9,(int)descIndx->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(48),desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)desc->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(48),revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)revDesc->getNumberOfTuples()); + const mcIdType expected1[9]={0, 6, 12, 18, 24, 30, 36, 42, 48}; + const mcIdType expected2[48]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 11, 12, 4, 13, 14, 15, 16, 17, 10, 18, 19, 13, 1, 20, 21, 22, 23, 24, 7, 25, 26, 27, 28, 22, 12, 29, 23, 30, 31, 32, 17, 33, 28, 34, 35, 30}; + const mcIdType expected3[37]={0, 1, 3, 4, 6, 8, 9, 10, 12, 13, 14, 16, 17, 19, 21, 22, 23, 24, 26, 27, 28, 29, 30, 32, 34, 35, 36, 37, 38, 40, 41, 43, 44, 45, 46, 47, 48}; + const mcIdType expected4[48]={0, 0, 4, 0, 0, 1, 0, 2, 0, 1, 1, 5, 1, 1, 1, 3, 2, 2, 6, 2, 3, 2, 2, 3, 3, 7, 3, 3, 4, 4, 4, 5, 4, 6, 4, 5, 5, 5, 5, 7, 6, 6, 7, 6, 6, 7, 7, 7}; + const mcIdType expected5[37]={0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180}; + const mcIdType expected6[180]={4, 0, 1, 4, 3, 4, 9, 12, 13, 10, 4, 0, 9, 10, 1, 4, 1, 10, 13, 4, 4, 4, 13, 12, 3, 4, 3, 12, 9, 0, 4, 1, 2, 5, 4, 4, 10, 13, 14, 11, 4, 1, 10, 11, 2, 4, 2, 11, 14, 5, 4, 5, 14, 13, 4, 4, 3, 4, 7, 6, 4, 12, 15, 16, 13, 4, 4, 13, 16, 7, 4, 7, 16, 15, 6, 4, 6, 15, 12, 3, 4, 4, 5, 8, 7, 4, 13, 16, 17, 14, 4, 5, 14, 17, 8, 4, 8, 17, 16, 7, 4, 18, 21, 22, 19, 4, 9, 18, 19, 10, 4, 10, 19, 22, 13, 4, 13, 22, 21, 12, 4, 12, 21, 18, 9, 4, 19, 22, 23, 20, 4, 10, 19, 20, 11, 4, 11, 20, 23, 14, 4, 14, 23, 22, 13, 4, 21, 24, 25, 22, 4, 13, 22, 25, 16, 4, 16, 25, 24, 15, 4, 15, 24, 21, 12, 4, 22, 25, 26, 23, 4, 14, 23, 26, 17, 4, 17, 26, 25, 16}; - const int expected7[180]={4, 0, 1, 4, 3, 4, 9, 12, 13, 10, 4, 0, 9, 10, 1, 4, 1, 10, 13, 4, 4, 4, 13, 12, 3, 4, 3, 12, 9, 0, 5, 1, 2, 5, 4, 5, 10, 13, 14, 11, 5, 1, 10, 11, 2, 5, 2, 11, 14, + const mcIdType expected7[180]={4, 0, 1, 4, 3, 4, 9, 12, 13, 10, 4, 0, 9, 10, 1, 4, 1, 10, 13, 4, 4, 4, 13, 12, 3, 4, 3, 12, 9, 0, 5, 1, 2, 5, 4, 5, 10, 13, 14, 11, 5, 1, 10, 11, 2, 5, 2, 11, 14, 5, 5, 5, 14, 13, 4, 4, 3, 4, 7, 6, 4, 12, 15, 16, 13, 4, 4, 13, 16, 7, 4, 7, 16, 15, 6, 4, 6, 15, 12, 3, 5, 4, 5, 8, 7, 5, 13, 16, 17, 14, 5, 5, 14, 17, 8, 5, 8, 17, 16, 7, 4, 18, 21, 22, 19, 4, 9, 18, 19, 10, 4, 10, 19, 22, 13, 4, 13, 22, 21, 12, 4, 12, 21, 18, 9, 4, 19, 22, 23, 20, 4, 10, 19, 20, 11, 4, 11, 20, 23, 14, 4, 14, 23, 22, 13, 4, 21, 24, 25, 22, 4, 13, 22, 25, 16, 4, 16, 25, 24, 15, 4, 15, 24, 21, 12, 4, 22, 25, 26, 23, 4, 14, 23, 26, 17, 4, 17, 26, 25, 16}; @@ -523,22 +524,22 @@ void MEDCouplingBasicsTest1::testDescConn3D() revDescIndx->decrRef(); mesh2->decrRef(); // - const int elts[2]={1,3}; - std::vector eltsV(elts,elts+2); + const mcIdType elts[2]={1,3}; + std::vector eltsV(elts,elts+2); mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size()); mesh->checkConsistencyLight(); - desc=DataArrayInt::New(); - descIndx=DataArrayInt::New(); - revDesc=DataArrayInt::New(); - revDescIndx=DataArrayInt::New(); + desc=DataArrayIdType::New(); + descIndx=DataArrayIdType::New(); + revDesc=DataArrayIdType::New(); + revDescIndx=DataArrayIdType::New(); mesh2=mesh->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx); mesh2->checkConsistencyLight(); CPPUNIT_ASSERT_EQUAL(2,mesh2->getMeshDimension()); CPPUNIT_ASSERT_EQUAL(36,(int)mesh2->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL((std::size_t)37,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(37,(int)revDescIndx->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)9,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(9,(int)descIndx->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)48,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)desc->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)48,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)revDesc->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(37),revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(37,(int)revDescIndx->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(9),descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(9,(int)descIndx->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(48),desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)desc->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(48),revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)revDesc->getNumberOfTuples()); CPPUNIT_ASSERT(std::equal(expected1,expected1+9,descIndx->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected2,expected2+48,desc->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected3,expected3+37,revDescIndx->getConstPointer())); @@ -557,10 +558,10 @@ void MEDCouplingBasicsTest1::testDescConn3D() void MEDCouplingBasicsTest1::testFindBoundaryNodes() { MEDCouplingUMesh *mesh=build3DTargetMesh_1(); - DataArrayInt *boundaryNodes=mesh->findBoundaryNodes(); + DataArrayIdType *boundaryNodes=mesh->findBoundaryNodes(); CPPUNIT_ASSERT_EQUAL(26,(int)boundaryNodes->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)boundaryNodes->getNumberOfComponents()); - const int expected1[26]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26}; + const mcIdType expected1[26]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26}; CPPUNIT_ASSERT(std::equal(expected1,expected1+26,boundaryNodes->begin())); boundaryNodes->decrRef(); mesh->decrRef(); @@ -571,7 +572,7 @@ void MEDCouplingBasicsTest1::testBoundaryMesh() MEDCouplingUMesh *mesh=build3DTargetMesh_1(); MEDCouplingPointSet *mesh2=mesh->buildBoundaryMesh(false); CPPUNIT_ASSERT_EQUAL(24,(int)mesh2->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(26,mesh2->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(26,(int)mesh2->getNumberOfNodes()); mesh2->decrRef(); mesh->decrRef(); } @@ -580,8 +581,8 @@ void MEDCouplingBasicsTest1::testBuildPartOfMySelf() { MEDCouplingUMesh *mesh=build2DTargetMesh_1(); mesh->setName("Toto"); - const int tab1[2]={0,4}; - const int tab2[3]={0,2,3}; + const mcIdType tab1[2]={0,4}; + const mcIdType tab2[3]={0,2,3}; // MEDCouplingPointSet *subMeshSimple=mesh->buildPartOfMySelf(tab1,tab1+2,true); MEDCouplingUMesh *subMesh=dynamic_cast(subMeshSimple); @@ -595,10 +596,10 @@ void MEDCouplingBasicsTest1::testBuildPartOfMySelf() CPPUNIT_ASSERT(name=="Toto"); CPPUNIT_ASSERT(mesh->getCoords()==subMesh->getCoords()); CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getNumberOfCells()); - const int subConn[10]={4,0,3,4,1,4,7,8,5,4}; - const int subConnIndex[3]={0,5,10}; - CPPUNIT_ASSERT_EQUAL((std::size_t)10,subMesh->getNodalConnectivity()->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)3,subMesh->getNodalConnectivityIndex()->getNbOfElems()); + const mcIdType subConn[10]={4,0,3,4,1,4,7,8,5,4}; + const mcIdType subConnIndex[3]={0,5,10}; + CPPUNIT_ASSERT_EQUAL(ToIdType(10),subMesh->getNodalConnectivity()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),subMesh->getNodalConnectivityIndex()->getNbOfElems()); CPPUNIT_ASSERT(std::equal(subConn,subConn+10,subMesh->getNodalConnectivity()->getPointer())); CPPUNIT_ASSERT(std::equal(subConnIndex,subConnIndex+3,subMesh->getNodalConnectivityIndex()->getPointer())); subMesh->decrRef(); @@ -613,13 +614,13 @@ void MEDCouplingBasicsTest1::testBuildPartOfMySelf() CPPUNIT_ASSERT(name=="Toto"); CPPUNIT_ASSERT(mesh->getCoords()==subMesh->getCoords()); CPPUNIT_ASSERT_EQUAL(3,(int)subMesh->getNumberOfCells()); - const int subConn2[14]={4,0,3,4,1,3,4,5,2,4,6,7,4,3}; - const int subConnIndex2[4]={0,5,9,14}; - CPPUNIT_ASSERT_EQUAL((std::size_t)14,subMesh->getNodalConnectivity()->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)4,subMesh->getNodalConnectivityIndex()->getNbOfElems()); + const mcIdType subConn2[14]={4,0,3,4,1,3,4,5,2,4,6,7,4,3}; + const mcIdType subConnIndex2[4]={0,5,9,14}; + CPPUNIT_ASSERT_EQUAL(ToIdType(14),subMesh->getNodalConnectivity()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(4),subMesh->getNodalConnectivityIndex()->getNbOfElems()); CPPUNIT_ASSERT(std::equal(subConn2,subConn2+14,subMesh->getNodalConnectivity()->getPointer())); CPPUNIT_ASSERT(std::equal(subConnIndex2,subConnIndex2+4,subMesh->getNodalConnectivityIndex()->getPointer())); - const int tab3[3]={0,1,2}; + const mcIdType tab3[3]={0,1,2}; MEDCouplingPointSet *subMeshSimple2=subMeshSimple->buildPartOfMySelf(tab3,tab3+3,true); subMesh->decrRef(); name=subMeshSimple2->getName(); @@ -632,17 +633,17 @@ void MEDCouplingBasicsTest1::testBuildPartOfMySelf() void MEDCouplingBasicsTest1::testBuildPartOfMySelfNode() { MEDCouplingUMesh *mesh=build2DTargetMesh_1(); - const int tab1[4]={5,7,8,4}; + const mcIdType tab1[4]={5,7,8,4}; MEDCouplingPointSet *subMeshSimple=mesh->buildPartOfMySelfNode(tab1,tab1+4,true); MEDCouplingUMesh *subMesh=dynamic_cast(subMeshSimple); CPPUNIT_ASSERT(subMesh); CPPUNIT_ASSERT_EQUAL(1,(int)subMesh->getAllGeoTypes().size()); CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllGeoTypes().begin()); CPPUNIT_ASSERT_EQUAL(1,(int)subMesh->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL((std::size_t)5,subMesh->getNodalConnectivity()->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)2,subMesh->getNodalConnectivityIndex()->getNbOfElems()); - const int subConn[5]={4,7,8,5,4}; - const int subConnIndex[3]={0,5}; + CPPUNIT_ASSERT_EQUAL(ToIdType(5),subMesh->getNodalConnectivity()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(2),subMesh->getNodalConnectivityIndex()->getNbOfElems()); + const mcIdType subConn[5]={4,7,8,5,4}; + const mcIdType subConnIndex[3]={0,5}; CPPUNIT_ASSERT(std::equal(subConn,subConn+5,subMesh->getNodalConnectivity()->getPointer())); CPPUNIT_ASSERT(std::equal(subConnIndex,subConnIndex+2,subMesh->getNodalConnectivityIndex()->getPointer())); CPPUNIT_ASSERT(subMesh->getCoords()==mesh->getCoords()); @@ -655,16 +656,16 @@ void MEDCouplingBasicsTest1::testBuildPartOfMySelfNode() CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*subMesh->getAllGeoTypes().begin()); CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++subMesh->getAllGeoTypes().begin())); CPPUNIT_ASSERT_EQUAL(3,(int)subMesh->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL((std::size_t)14,subMesh->getNodalConnectivity()->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)4,subMesh->getNodalConnectivityIndex()->getNbOfElems()); - const int subConn2[14]={3,4,5,2,4,6,7,4,3,4,7,8,5,4}; - const int subConnIndex2[4]={0,4,9,14}; + CPPUNIT_ASSERT_EQUAL(ToIdType(14),subMesh->getNodalConnectivity()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(4),subMesh->getNodalConnectivityIndex()->getNbOfElems()); + const mcIdType subConn2[14]={3,4,5,2,4,6,7,4,3,4,7,8,5,4}; + const mcIdType subConnIndex2[4]={0,4,9,14}; CPPUNIT_ASSERT(std::equal(subConn2,subConn2+14,subMesh->getNodalConnectivity()->getPointer())); CPPUNIT_ASSERT(std::equal(subConnIndex2,subConnIndex2+4,subMesh->getNodalConnectivityIndex()->getPointer())); CPPUNIT_ASSERT(subMesh->getCoords()==mesh->getCoords()); subMeshSimple->decrRef(); //testing the case where length of tab2 is greater than max number of node per cell. - const int tab2[7]={0,3,2,1,4,5,6}; + const mcIdType tab2[7]={0,3,2,1,4,5,6}; subMeshSimple=mesh->buildPartOfMySelfNode(tab2,tab2+7,true); subMesh=dynamic_cast(subMeshSimple); CPPUNIT_ASSERT(subMesh); @@ -682,10 +683,10 @@ void MEDCouplingBasicsTest1::testZipCoords() MEDCouplingUMesh *mesh=build2DTargetMesh_1(); CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllGeoTypes().size()); CPPUNIT_ASSERT_EQUAL(2,mesh->getSpaceDimension()); - CPPUNIT_ASSERT_EQUAL(9,mesh->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(9,(int)mesh->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(5,(int)mesh->getNumberOfCells()); - std::vector oldConn(mesh->getNodalConnectivity()->getNbOfElems()); - std::vector oldConnIndex(mesh->getNumberOfCells()+1); + std::vector oldConn(mesh->getNodalConnectivity()->getNbOfElems()); + std::vector oldConnIndex(mesh->getNumberOfCells()+1); std::copy(mesh->getNodalConnectivity()->getPointer(),mesh->getNodalConnectivity()->getPointer()+oldConn.size(),oldConn.begin()); std::copy(mesh->getNodalConnectivityIndex()->getPointer(),mesh->getNodalConnectivityIndex()->getPointer()+mesh->getNumberOfCells()+1,oldConnIndex.begin()); DataArrayDouble *oldCoords=mesh->getCoords(); @@ -693,7 +694,7 @@ void MEDCouplingBasicsTest1::testZipCoords() mesh->zipCoords(); CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllGeoTypes().size()); CPPUNIT_ASSERT_EQUAL(2,mesh->getSpaceDimension()); - CPPUNIT_ASSERT_EQUAL(9,mesh->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(9,(int)mesh->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(5,(int)mesh->getNumberOfCells()); CPPUNIT_ASSERT(mesh->getCoords()!=oldCoords); CPPUNIT_ASSERT(std::equal(mesh->getCoords()->getPointer(),mesh->getCoords()->getPointer()+2*9,oldCoords->getPointer())); @@ -701,21 +702,21 @@ void MEDCouplingBasicsTest1::testZipCoords() CPPUNIT_ASSERT(std::equal(oldConnIndex.begin(),oldConnIndex.end(),mesh->getNodalConnectivityIndex()->getPointer())); oldCoords->decrRef(); // - const int tab1[2]={0,4}; + const mcIdType tab1[2]={0,4}; MEDCouplingPointSet *subMeshPtSet=mesh->buildPartOfMySelf(tab1,tab1+2,true); MEDCouplingUMesh *subMesh=dynamic_cast(subMeshPtSet); CPPUNIT_ASSERT(subMesh); - DataArrayInt *traducer=subMesh->zipCoordsTraducer(); - const int expectedTraducer[9]={0,1,-1,2,3,4,-1,5,6}; + DataArrayIdType *traducer=subMesh->zipCoordsTraducer(); + const mcIdType expectedTraducer[9]={0,1,-1,2,3,4,-1,5,6}; CPPUNIT_ASSERT(std::equal(expectedTraducer,expectedTraducer+9,traducer->getPointer())); traducer->decrRef(); CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllGeoTypes().begin()); CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getNumberOfCells()); - const int subConn[10]={4,0,2,3,1,4,5,6,4,3}; - const int subConnIndex[3]={0,5,10}; - CPPUNIT_ASSERT_EQUAL(7,subMesh->getNumberOfNodes()); - CPPUNIT_ASSERT_EQUAL((std::size_t)10,subMesh->getNodalConnectivity()->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)3,subMesh->getNodalConnectivityIndex()->getNbOfElems()); + const mcIdType subConn[10]={4,0,2,3,1,4,5,6,4,3}; + const mcIdType subConnIndex[3]={0,5,10}; + CPPUNIT_ASSERT_EQUAL(7,(int)subMesh->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(ToIdType(10),subMesh->getNodalConnectivity()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),subMesh->getNodalConnectivityIndex()->getNbOfElems()); CPPUNIT_ASSERT(std::equal(subConn,subConn+10,subMesh->getNodalConnectivity()->getPointer())); CPPUNIT_ASSERT(std::equal(subConnIndex,subConnIndex+3,subMesh->getNodalConnectivityIndex()->getPointer())); subMesh->decrRef(); @@ -725,9 +726,9 @@ void MEDCouplingBasicsTest1::testZipCoords() CPPUNIT_ASSERT(subMesh); CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllGeoTypes().begin()); CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(7,subMesh->getNumberOfNodes()); - CPPUNIT_ASSERT_EQUAL((std::size_t)10,subMesh->getNodalConnectivity()->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)3,subMesh->getNodalConnectivityIndex()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(7,(int)subMesh->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(ToIdType(10),subMesh->getNodalConnectivity()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),subMesh->getNodalConnectivityIndex()->getNbOfElems()); CPPUNIT_ASSERT(std::equal(subConn,subConn+10,subMesh->getNodalConnectivity()->getPointer())); CPPUNIT_ASSERT(std::equal(subConnIndex,subConnIndex+3,subMesh->getNodalConnectivityIndex()->getPointer())); subMesh->decrRef(); @@ -739,7 +740,7 @@ void MEDCouplingBasicsTest1::testZipConnectivity() { MEDCouplingUMesh *m1=build2DTargetMesh_1(); MEDCouplingUMesh *m2=build2DTargetMesh_1(); - int cells1[3]={2,3,4}; + mcIdType cells1[3]={2,3,4}; MEDCouplingPointSet *m3_1=m2->buildPartOfMySelf(cells1,cells1+3,true); MEDCouplingUMesh *m3=dynamic_cast(m3_1); CPPUNIT_ASSERT(m3); @@ -753,15 +754,15 @@ void MEDCouplingBasicsTest1::testZipConnectivity() m5->decrRef(); // bool areNodesMerged; - int newNbOfNodes; + mcIdType newNbOfNodes; CPPUNIT_ASSERT_EQUAL(10,(int)m6->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(22,m6->getNumberOfNodes()); - DataArrayInt *arr=m6->mergeNodes(1e-13,areNodesMerged,newNbOfNodes); + CPPUNIT_ASSERT_EQUAL(22,(int)m6->getNumberOfNodes()); + DataArrayIdType *arr=m6->mergeNodes(1e-13,areNodesMerged,newNbOfNodes); arr->decrRef(); CPPUNIT_ASSERT(areNodesMerged); CPPUNIT_ASSERT_EQUAL(10,(int)m6->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(9,m6->getNumberOfNodes()); - CPPUNIT_ASSERT_EQUAL(9,newNbOfNodes); + CPPUNIT_ASSERT_EQUAL(9,(int)m6->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(9,(int)newNbOfNodes); // arr=m6->zipConnectivityTraducer(0); CPPUNIT_ASSERT_EQUAL(7,(int)m6->getNumberOfCells()); @@ -794,7 +795,7 @@ void MEDCouplingBasicsTest1::testEqualMesh() CPPUNIT_ASSERT(mesh1->isEqual(mesh2,1e-12)); CPPUNIT_ASSERT(mesh2->isEqual(mesh1,1e-12)); // - int *pt2=mesh1->getNodalConnectivity()->getPointer(); + mcIdType *pt2=mesh1->getNodalConnectivity()->getPointer(); pt2[5]++; CPPUNIT_ASSERT(!mesh1->isEqual(mesh2,1e-12)); CPPUNIT_ASSERT(!mesh2->isEqual(mesh1,1e-12)); @@ -941,14 +942,14 @@ void MEDCouplingBasicsTest1::testBuildSubMeshData() //check buildSubMesh on field on cells MEDCouplingFieldDouble *fieldCells=MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME); fieldCells->setMesh(targetMesh); - const int elts[3]={1,2,4}; - DataArrayInt *di; + const mcIdType elts[3]={1,2,4}; + DataArrayIdType *di; MEDCouplingMesh *ret1=fieldCells->buildSubMeshData(elts,elts+3,di); CPPUNIT_ASSERT_EQUAL(3,(int)ret1->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(9,ret1->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(9,(int)ret1->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(3,(int)di->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)di->getNumberOfComponents()); - const int *toCheck=di->getConstPointer(); + const mcIdType *toCheck=di->getConstPointer(); CPPUNIT_ASSERT(std::equal(elts,elts+3,toCheck)); MEDCouplingUMesh *ret1DC=dynamic_cast(ret1); CPPUNIT_ASSERT(ret1DC); @@ -962,11 +963,11 @@ void MEDCouplingBasicsTest1::testBuildSubMeshData() MEDCouplingUMesh *ret2DC=dynamic_cast(ret2); CPPUNIT_ASSERT(ret2DC); CPPUNIT_ASSERT_EQUAL(3,(int)ret2->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(6,ret2->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(6,(int)ret2->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(6,(int)di->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)di->getNumberOfComponents()); toCheck=di->getConstPointer(); - const int expected[6]={1,2,4,5,7,8}; + const mcIdType expected[6]={1,2,4,5,7,8}; CPPUNIT_ASSERT(std::equal(expected,expected+6,toCheck)); ret2->decrRef(); di->decrRef(); @@ -980,24 +981,24 @@ void MEDCouplingBasicsTest1::testExtrudedMesh1() MEDCouplingUMesh *mesh3D=build3DExtrudedUMesh_1(mesh2D); MEDCouplingMappedExtrudedMesh *ext=MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,1); CPPUNIT_ASSERT_EQUAL(18,(int)ext->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(60,ext->getNumberOfNodes()); - DataArrayInt *ids3D=ext->getMesh3DIds(); - const int ids3DExpected[18]={5,4,3,2,1,0, 11,10,9,8,7,6, 17,16,15,14,13,12}; + CPPUNIT_ASSERT_EQUAL(60,(int)ext->getNumberOfNodes()); + DataArrayIdType *ids3D=ext->getMesh3DIds(); + const mcIdType ids3DExpected[18]={5,4,3,2,1,0, 11,10,9,8,7,6, 17,16,15,14,13,12}; CPPUNIT_ASSERT_EQUAL(18,(int)ids3D->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)ids3D->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(ids3DExpected,ids3DExpected+18,ids3D->getConstPointer())); MEDCouplingUMesh *mesh1D=ext->getMesh1D(); - CPPUNIT_ASSERT_EQUAL(4,mesh1D->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(4,(int)mesh1D->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(3,(int)mesh1D->getNumberOfCells()); const double mesh1DExpected[12]={0.66666666666666663, 1.4583333333333333, 0, 0.66666666666666663, 1.4583333333333333, 1, 0.66666666666666663, 1.4583333333333333, 2, 0.66666666666666663, 1.4583333333333333, 3}; DataArrayDouble *mesh1DCoords=mesh1D->getCoords(); CPPUNIT_ASSERT_EQUAL(4,(int)mesh1DCoords->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(3,(int)mesh1DCoords->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(mesh1DExpected,mesh1DExpected+12,mesh1DCoords->getConstPointer())); - DataArrayInt *conn1D=mesh1D->getNodalConnectivity(); + DataArrayIdType *conn1D=mesh1D->getNodalConnectivity(); CPPUNIT_ASSERT_EQUAL(9,(int)conn1D->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)conn1D->getNumberOfComponents()); - const int conn1DExpected[9]={1,0,1,1,1,2,1,2,3}; + const mcIdType conn1DExpected[9]={1,0,1,1,1,2,1,2,3}; CPPUNIT_ASSERT(std::equal(conn1DExpected,conn1DExpected+9,conn1D->getConstPointer())); ext->decrRef(); mesh3D->decrRef(); @@ -1010,11 +1011,11 @@ void MEDCouplingBasicsTest1::testExtrudedMesh2() build3DExtrudedUMesh_2(mN,mTT,mTF); // bool b=false; - int newNbOfNodes; - DataArrayInt *da=mTT->mergeNodes(1e-12,b,newNbOfNodes); + mcIdType newNbOfNodes; + DataArrayIdType *da=mTT->mergeNodes(1e-12,b,newNbOfNodes); CPPUNIT_ASSERT(b); da->decrRef(); - std::vector n; + std::vector n; double pt[3]={300.,300.,0.}; double v[3]={0.,0.,2.}; mTT->findNodesOnPlane(pt,v,1e-12,n); @@ -1081,12 +1082,12 @@ void MEDCouplingBasicsTest1::testExtrudedMesh3() CPPUNIT_ASSERT_EQUAL(15,(int)m4->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(5,(int)m4->getMesh2D()->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(3,(int)m4->getMesh1D()->getNumberOfCells()); - const int *m3DIds=m4->getMesh3DIds()->getConstPointer(); - for(int i=0;i<15;i++) + const mcIdType *m3DIds=m4->getMesh3DIds()->getConstPointer(); + for(mcIdType i=0;i<15;i++) CPPUNIT_ASSERT_EQUAL(i,m3DIds[i]); m4->decrRef(); //some random in cells to check that extrusion alg find it correctly - const int expected1[15]={1,3,2,0,6,5,7,10,11,8,12,9,14,13,4}; + const mcIdType expected1[15]={1,3,2,0,6,5,7,10,11,8,12,9,14,13,4}; m3->renumberCells(expected1,false); m4=MEDCouplingMappedExtrudedMesh::New(m3,m1,0); CPPUNIT_ASSERT_EQUAL(15,(int)m4->getNumberOfCells()); @@ -1098,7 +1099,7 @@ void MEDCouplingBasicsTest1::testExtrudedMesh3() m4->decrRef(); m3->decrRef(); //play with polygons and polyedrons - std::vector cells(2); cells[0]=2; cells[1]=3; + std::vector cells(2); cells[0]=2; cells[1]=3; m1->convertToPolyTypes(&cells[0],&cells[0]+cells.size()); m3=m1->buildExtrudedMesh(m2,0); CPPUNIT_ASSERT_EQUAL((int)INTERP_KERNEL::NORM_HEXA8,(int)m3->getTypeOfCell(0)); @@ -1128,7 +1129,7 @@ void MEDCouplingBasicsTest1::testExtrudedMesh3() void MEDCouplingBasicsTest1::testExtrudedMesh4() { MEDCouplingUMesh *m1=build2DTargetMesh_1(); - std::vector cells(2); cells[0]=2; cells[1]=4; + std::vector cells(2); cells[0]=2; cells[1]=4; m1->convertToPolyTypes(&cells[0],&cells[0]+cells.size()); m1->changeSpaceDimension(3); MEDCouplingUMesh *m2=buildCU1DMesh_U(); @@ -1138,8 +1139,8 @@ void MEDCouplingBasicsTest1::testExtrudedMesh4() m2->rotate(center,vector,-M_PI/2.); m1->zipCoords(); MEDCouplingUMesh *m3=m1->buildExtrudedMesh(m2,0); - const int expected1[15]= {1,3,2,0,6,5,7,10,11,8,12,9,14,13,4}; - const int rexpected1[15]={3, 0, 2, 1, 14, 5, 4, 6, 9, 11, 7, 8, 10, 13, 12}; + const mcIdType expected1[15]= {1,3,2,0,6,5,7,10,11,8,12,9,14,13,4}; + const mcIdType rexpected1[15]={3, 0, 2, 1, 14, 5, 4, 6, 9, 11, 7, 8, 10, 13, 12}; m3->renumberCells(expected1,false); MEDCouplingMappedExtrudedMesh *m4=MEDCouplingMappedExtrudedMesh::New(m3,m1,0); CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,m4->getTypeOfCell(0)); @@ -1174,16 +1175,16 @@ void MEDCouplingBasicsTest1::testExtrudedMesh4() void MEDCouplingBasicsTest1::testFindCommonNodes() { - DataArrayInt *comm,*commI; + DataArrayIdType *comm,*commI; MEDCouplingUMesh *targetMesh=build3DTargetMesh_1(); targetMesh->findCommonNodes(1e-10,-1,comm,commI); CPPUNIT_ASSERT_EQUAL(1,(int)commI->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(0,(int)comm->getNumberOfTuples()); - int newNbOfNodes; - DataArrayInt *o2n=targetMesh->buildNewNumberingFromCommonNodesFormat(comm,commI,newNbOfNodes); - CPPUNIT_ASSERT_EQUAL(27,newNbOfNodes); + mcIdType newNbOfNodes; + DataArrayIdType *o2n=targetMesh->buildNewNumberingFromCommonNodesFormat(comm,commI,newNbOfNodes); + CPPUNIT_ASSERT_EQUAL(27,(int)newNbOfNodes); CPPUNIT_ASSERT_EQUAL(27,(int)o2n->getNumberOfTuples()); - const int o2nExp1[27]= + const mcIdType o2nExp1[27]= { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20, 21,22,23,24,25,26 @@ -1195,18 +1196,18 @@ void MEDCouplingBasicsTest1::testFindCommonNodes() targetMesh->decrRef(); // targetMesh=build3DTargetMeshMergeNode_1(); - CPPUNIT_ASSERT_EQUAL(31,targetMesh->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(31,(int)targetMesh->getNumberOfNodes()); targetMesh->findCommonNodes(1e-10,-1,comm,commI); CPPUNIT_ASSERT_EQUAL(3,(int)commI->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(6,(int)comm->getNumberOfTuples()); - const int commExpected[6]={1,27,28,29,23,30}; - const int commIExpected[3]={0,4,6}; + const mcIdType commExpected[6]={1,27,28,29,23,30}; + const mcIdType commIExpected[3]={0,4,6}; CPPUNIT_ASSERT(std::equal(commExpected,commExpected+6,comm->getConstPointer())); CPPUNIT_ASSERT(std::equal(commIExpected,commIExpected+3,commI->getConstPointer())); o2n=targetMesh->buildNewNumberingFromCommonNodesFormat(comm,commI,newNbOfNodes); CPPUNIT_ASSERT_EQUAL(31,(int)o2n->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(27,newNbOfNodes); - const int o2nExp2[31]= + CPPUNIT_ASSERT_EQUAL(27,(int)newNbOfNodes); + const mcIdType o2nExp2[31]= { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20, 21,22,23,24,25,26,1,1,1,23 @@ -1233,7 +1234,7 @@ void MEDCouplingBasicsTest1::testFindCommonNodes() targetMesh->updateTime(); CPPUNIT_ASSERT(time!=targetMesh->getTimeOfThis()); CPPUNIT_ASSERT(areNodesMerged); - int connExp[72]={18,0,1,4,3,9,10,13,12, 18,1,2,5,4,10,11,14,13, 18,3,4,7,6,12,13,16,15, + mcIdType connExp[72]={18,0,1,4,3,9,10,13,12, 18,1,2,5,4,10,11,14,13, 18,3,4,7,6,12,13,16,15, 18,4,5,8,7,13,14,17,16, 18,9,10,13,12,18,19,22,21, 18,10,11,14,13,19,20,23,22, 18,12,13,16,15,21,22,25,24, 18,13,14,17,16,22,23,26,25}; @@ -1252,13 +1253,13 @@ void MEDCouplingBasicsTest1::testFindCommonNodes() o2n->decrRef(); //2D targetMesh=build2DTargetMeshMergeNode_1(); - CPPUNIT_ASSERT_EQUAL(18,targetMesh->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(18,(int)targetMesh->getNumberOfNodes()); time=targetMesh->getTimeOfThis(); o2n=targetMesh->mergeNodes(1e-10,areNodesMerged,newNbOfNodes); CPPUNIT_ASSERT(time!=targetMesh->getTimeOfThis()); CPPUNIT_ASSERT(areNodesMerged); - CPPUNIT_ASSERT_EQUAL(9,targetMesh->getNumberOfNodes()); - int connExp2[23]={4,0,4,3,1, 3,1,3,2, 3,3,5,2, 4,4,6,7,3, 4,7,8,5,3}; + CPPUNIT_ASSERT_EQUAL(9,(int)targetMesh->getNumberOfNodes()); + mcIdType connExp2[23]={4,0,4,3,1, 3,1,3,2, 3,3,5,2, 4,4,6,7,3, 4,7,8,5,3}; CPPUNIT_ASSERT_EQUAL(23,(int)targetMesh->getNodalConnectivity()->getNumberOfTuples()); CPPUNIT_ASSERT(std::equal(connExp2,connExp2+23,targetMesh->getNodalConnectivity()->getConstPointer())); double coordsExp2[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, 0.2,0.2, -0.3,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7}; @@ -1270,15 +1271,15 @@ void MEDCouplingBasicsTest1::testFindCommonNodes() void MEDCouplingBasicsTest1::testCheckButterflyCells() { - std::vector cells; + std::vector cells; MEDCouplingUMesh *sourceMesh=build2DTargetMesh_1(); sourceMesh->checkButterflyCells(cells); CPPUNIT_ASSERT(cells.empty()); - int *pt=sourceMesh->getNodalConnectivity()->getPointer(); + mcIdType *pt=sourceMesh->getNodalConnectivity()->getPointer(); std::swap(pt[15],pt[16]); sourceMesh->checkButterflyCells(cells); CPPUNIT_ASSERT_EQUAL(1,(int)cells.size()); - CPPUNIT_ASSERT_EQUAL(3,cells[0]); + CPPUNIT_ASSERT_EQUAL(3,(int)cells[0]); cells.clear(); std::swap(pt[15],pt[16]); sourceMesh->checkButterflyCells(cells); @@ -1292,7 +1293,7 @@ void MEDCouplingBasicsTest1::testCheckButterflyCells() std::swap(pt[15],pt[16]); sourceMesh->checkButterflyCells(cells); CPPUNIT_ASSERT_EQUAL(1,(int)cells.size()); - CPPUNIT_ASSERT_EQUAL(3,cells[0]); + CPPUNIT_ASSERT_EQUAL(3,(int)cells[0]); cells.clear(); std::swap(pt[15],pt[16]); sourceMesh->checkButterflyCells(cells); @@ -1314,10 +1315,10 @@ void MEDCouplingBasicsTest1::testMergeMesh1() CPPUNIT_ASSERT(m3->isEqual(m4,1.e-12)); m4->decrRef(); bool isMerged; - int newNbOfNodes; - DataArrayInt *da=m3C->mergeNodes(1.e-12,isMerged,newNbOfNodes); - CPPUNIT_ASSERT_EQUAL(11,m3C->getNumberOfNodes()); - CPPUNIT_ASSERT_EQUAL(11,newNbOfNodes); + mcIdType newNbOfNodes; + DataArrayIdType *da=m3C->mergeNodes(1.e-12,isMerged,newNbOfNodes); + CPPUNIT_ASSERT_EQUAL(11,(int)m3C->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(11,(int)newNbOfNodes); CPPUNIT_ASSERT(isMerged); da->decrRef(); m3->decrRef(); @@ -1329,7 +1330,7 @@ void MEDCouplingBasicsTest1::testMergeMeshOnSameCoords1() { MEDCouplingUMesh *m1=build2DTargetMesh_1(); MEDCouplingUMesh *m2=build2DTargetMesh_1(); - std::vector cells(5); + std::vector cells(5); for(int i=0;i<5;i++) cells[i]=i; m2->convertToPolyTypes(&cells[0],&cells[0]+cells.size()); @@ -1342,15 +1343,15 @@ void MEDCouplingBasicsTest1::testMergeMeshOnSameCoords1() m4->checkConsistencyLight(); CPPUNIT_ASSERT(m4->getCoords()==m1->getCoords()); CPPUNIT_ASSERT_EQUAL(15,(int)m4->getNumberOfCells()); - const int cells1[5]={0,1,2,3,4}; + const mcIdType cells1[5]={0,1,2,3,4}; MEDCouplingPointSet *m1_1=m4->buildPartOfMySelf(cells1,cells1+5,true); m1_1->setName(m1->getName().c_str()); CPPUNIT_ASSERT(m1->isEqual(m1_1,1e-12)); - const int cells2[5]={5,6,7,8,9}; + const mcIdType cells2[5]={5,6,7,8,9}; MEDCouplingPointSet *m2_1=m4->buildPartOfMySelf(cells2,cells2+5,true); m2_1->setName(m2->getName().c_str()); CPPUNIT_ASSERT(m2->isEqual(m2_1,1e-12)); - const int cells3[5]={10,11,12,13,14}; + const mcIdType cells3[5]={10,11,12,13,14}; MEDCouplingPointSet *m3_1=m4->buildPartOfMySelf(cells3,cells3+5,true); m3_1->setName(m3->getName().c_str()); CPPUNIT_ASSERT(m3->isEqual(m3_1,1e-12)); @@ -1953,19 +1954,19 @@ void MEDCouplingBasicsTest1::testCheckConsecutiveCellTypes() CPPUNIT_ASSERT(!targetMesh->checkConsecutiveCellTypes()); CPPUNIT_ASSERT(!targetMesh->checkConsecutiveCellTypesAndOrder(order1,order1+2)); CPPUNIT_ASSERT(!targetMesh->checkConsecutiveCellTypesAndOrder(order2,order2+2)); - DataArrayInt *da=targetMesh->getRenumArrForConsecutiveCellTypesSpec(order1,order1+2); + DataArrayIdType *da=targetMesh->getRenumArrForConsecutiveCellTypesSpec(order1,order1+2); CPPUNIT_ASSERT_EQUAL(5,(int)da->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da->getNumberOfComponents()); - const int expected1[5]={2,0,1,3,4}; + const mcIdType expected1[5]={2,0,1,3,4}; CPPUNIT_ASSERT(std::equal(expected1,expected1+5,da->getConstPointer())); da->decrRef(); da=targetMesh->getRenumArrForConsecutiveCellTypesSpec(order2,order2+2); CPPUNIT_ASSERT_EQUAL(5,(int)da->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da->getNumberOfComponents()); - const int expected2[5]={0,3,4,1,2}; + const mcIdType expected2[5]={0,3,4,1,2}; CPPUNIT_ASSERT(std::equal(expected2,expected2+5,da->getConstPointer())); da->decrRef(); - const int renumber1[5]={4,0,1,2,3}; + const mcIdType renumber1[5]={4,0,1,2,3}; targetMesh->renumberCells(renumber1,false); CPPUNIT_ASSERT(targetMesh->checkConsecutiveCellTypes()); CPPUNIT_ASSERT(targetMesh->checkConsecutiveCellTypesAndOrder(order1,order1+2)); @@ -1978,15 +1979,15 @@ void MEDCouplingBasicsTest1::testRearrange2ConsecutiveCellTypes() { MEDCouplingUMesh *m1_1=build2DSourceMesh_1(); MEDCouplingUMesh *m2_1=build2DTargetMesh_1(); - DataArrayInt *arr1=m1_1->rearrange2ConsecutiveCellTypes(); + DataArrayIdType *arr1=m1_1->rearrange2ConsecutiveCellTypes(); MEDCouplingUMesh *m1_2=build2DSourceMesh_1(); CPPUNIT_ASSERT(m1_2->isEqual(m1_1,1e-12)); - const int expected1[2]={0,1}; + const mcIdType expected1[2]={0,1}; CPPUNIT_ASSERT_EQUAL(2,(int)arr1->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)arr1->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(expected1,expected1+2,arr1->getConstPointer())); arr1->decrRef(); - const int expected2[5]={0,3,4,1,2}; + const mcIdType expected2[5]={0,3,4,1,2}; arr1=m2_1->rearrange2ConsecutiveCellTypes(); CPPUNIT_ASSERT_EQUAL(5,(int)arr1->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)arr1->getNumberOfComponents()); @@ -2024,55 +2025,55 @@ void MEDCouplingBasicsTest1::testFuseUMeshesOnSameCoords() { std::vector meshes; MEDCouplingUMesh *m2=build2DTargetMesh_1(); - int cells1[3]={2,3,4}; + mcIdType cells1[3]={2,3,4}; MEDCouplingPointSet *m3_1=m2->buildPartOfMySelf(cells1,cells1+3,true); MEDCouplingUMesh *m3=dynamic_cast(m3_1); CPPUNIT_ASSERT(m3); meshes.push_back(m3); - int cells2[3]={1,2,4}; + mcIdType cells2[3]={1,2,4}; MEDCouplingPointSet *m4_1=m2->buildPartOfMySelf(cells2,cells2+3,true); MEDCouplingUMesh *m4=dynamic_cast(m4_1); CPPUNIT_ASSERT(m4); meshes.push_back(m4); - int cells3[2]={1,2}; + mcIdType cells3[2]={1,2}; MEDCouplingPointSet *m5_1=m2->buildPartOfMySelf(cells3,cells3+2,true); MEDCouplingUMesh *m5=dynamic_cast(m5_1); CPPUNIT_ASSERT(m5); meshes.push_back(m5); m2->decrRef(); // - std::vector corr; + std::vector corr; MEDCouplingUMesh *m7=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,0,corr); CPPUNIT_ASSERT_EQUAL(4,(int)m7->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(3,(int)corr.size()); - const int expectedVals1[3]={3,3,2}; - const int expectedVals2[3][3]={{0,1,2},{3,0,2},{3,0,111111}}; + const mcIdType expectedVals1[3]={3,3,2}; + const mcIdType expectedVals2[3][3]={{0,1,2},{3,0,2},{3,0,111111}}; for(int i=0;i<3;i++) { - DataArrayInt *arr=corr[i]; + DataArrayIdType *arr=corr[i]; CPPUNIT_ASSERT_EQUAL(1,(int)arr->getNumberOfComponents()); - int nbOfVals=expectedVals1[i]; - CPPUNIT_ASSERT_EQUAL(nbOfVals,(int)arr->getNumberOfTuples()); - const int *vals=arr->getConstPointer(); - for(int j=0;jgetNumberOfTuples()); + const mcIdType *vals=arr->getConstPointer(); + for(mcIdType j=0;j > fidsOfGroups; - std::vector corr2(corr.begin(),corr.end()); - DataArrayInt *arr2=DataArrayInt::MakePartition(corr2,m7->getNumberOfCells(),fidsOfGroups); - const int fidExp[4]={5,1,3,4}; - const int fidsGrp[3][3]={{1,3,5},{3,4,5},{4,5,23344}}; + std::vector< std::vector > fidsOfGroups; + std::vector corr2(corr.begin(),corr.end()); + DataArrayIdType *arr2=DataArrayIdType::MakePartition(corr2,m7->getNumberOfCells(),fidsOfGroups); + const mcIdType fidExp[4]={5,1,3,4}; + const mcIdType fidsGrp[3][3]={{1,3,5},{3,4,5},{4,5,23344}}; CPPUNIT_ASSERT_EQUAL(3,(int)fidsOfGroups.size()); CPPUNIT_ASSERT_EQUAL(1,(int)arr2->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(4,(int)arr2->getNumberOfTuples()); CPPUNIT_ASSERT(std::equal(fidExp,fidExp+4,arr2->getConstPointer())); for(int i=0;i<3;i++) { - int nbOfVals=expectedVals1[i]; - CPPUNIT_ASSERT_EQUAL(nbOfVals,(int)fidsOfGroups[i].size()); + mcIdType nbOfVals=expectedVals1[i]; + CPPUNIT_ASSERT_EQUAL(nbOfVals,ToIdType(fidsOfGroups[i].size())); CPPUNIT_ASSERT(std::equal(fidsOfGroups[i].begin(),fidsOfGroups[i].end(),fidsGrp[i])); } - for(std::vector::iterator iter=corr.begin();iter!=corr.end();iter++) + for(std::vector::iterator iter=corr.begin();iter!=corr.end();iter++) (*iter)->decrRef(); arr2->decrRef(); m7->decrRef(); @@ -2087,21 +2088,21 @@ void MEDCouplingBasicsTest1::testFuseUMeshesOnSameCoords2() MEDCouplingUMesh *m2; MEDCouplingUMesh *m1=build3DExtrudedUMesh_1(m2); m2->decrRef(); - const int part1[5]={2,3,6,4,10}; + const mcIdType part1[5]={2,3,6,4,10}; MEDCouplingUMesh *m3=(MEDCouplingUMesh *)m1->buildPartOfMySelf(part1,part1+5,true); - const int part2[4]={5,6,4,7}; + const mcIdType part2[4]={5,6,4,7}; MEDCouplingUMesh *m4=(MEDCouplingUMesh *)m1->buildPartOfMySelf(part2,part2+4,true); std::vector meshes; meshes.push_back(m1); meshes.push_back(m3); meshes.push_back(m3); meshes.push_back(m4); - std::vector corr; + std::vector corr; MEDCouplingUMesh *m5=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,0,corr); CPPUNIT_ASSERT_EQUAL(18,(int)m5->getNumberOfCells()); - std::vector::iterator it=corr.begin(); - const int exp1[4]={18,5,5,4}; - const int exp2[4][18]={ + std::vector::iterator it=corr.begin(); + const mcIdType exp1[4]={18,5,5,4}; + const mcIdType exp2[4][18]={ {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17}, {2,3,6,4,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, {2,3,6,4,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, @@ -2110,7 +2111,7 @@ void MEDCouplingBasicsTest1::testFuseUMeshesOnSameCoords2() int i=0; for(;it!=corr.end();it++,i++) { - int sz=(*it)->getNumberOfTuples(); + mcIdType sz=(*it)->getNumberOfTuples(); CPPUNIT_ASSERT_EQUAL(exp1[i],sz); CPPUNIT_ASSERT(std::equal(exp2[i],exp2[i]+sz,(*it)->getConstPointer())); } @@ -2136,7 +2137,7 @@ void MEDCouplingBasicsTest1::testBuildOrthogonalField() targetMesh->decrRef(); // testing double targetCoords[12]={0.,0.,0.,0.5,0.,0.5,1.,0.,1.,0.,1.,0.}; - int targetConn[4]={0,1,2,3}; + mcIdType targetConn[4]={0,1,2,3}; targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(2); targetMesh->allocateCells(1); @@ -2162,13 +2163,13 @@ void MEDCouplingBasicsTest1::testGetCellsContainingPoint() { MEDCouplingUMesh *targetMesh=build2DTargetMesh_1(); double pos[12]={0.,0.,0.4,0.4,0.,0.4,0.1,0.1,0.25,0.,0.65,0.}; - MCAuto t1,t2; + MCAuto t1,t2; //2D basic targetMesh->getCellsContainingPoints(pos,6,1e-12,t1,t2); CPPUNIT_ASSERT_EQUAL(6,(int)t1->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(7,(int)t2->getNbOfElems()); - const int expectedValues1[6]={0,4,3,0,1,2}; - const int expectedValues2[7]={0,1,2,3,4,5,6}; + const mcIdType expectedValues1[6]={0,4,3,0,1,2}; + const mcIdType expectedValues2[7]={0,1,2,3,4,5,6}; CPPUNIT_ASSERT(std::equal(t1->begin(),t1->end(),expectedValues1)); CPPUNIT_ASSERT(std::equal(t2->begin(),t2->end(),expectedValues2)); //2D with no help of bounding box. @@ -2182,50 +2183,50 @@ void MEDCouplingBasicsTest1::testGetCellsContainingPoint() CPPUNIT_ASSERT(std::equal(t2->begin(),t2->end(),expectedValues2)); //2D outside const double pos1bis[2]={-0.3303300858899107,-0.11819805153394641}; - CPPUNIT_ASSERT_EQUAL(-1,targetMesh->getCellContainingPoint(pos1bis,1e-12)); + CPPUNIT_ASSERT_EQUAL(ToIdType(-1),targetMesh->getCellContainingPoint(pos1bis,1e-12)); targetMesh->decrRef(); //test limits 2D targetMesh=build2DTargetMesh_1(); const double pos2[2]={0.2,-0.05}; - std::vector t11; + std::vector t11; t11.clear(); targetMesh->getCellsContainingPoint(pos2,1e-12,t11); CPPUNIT_ASSERT_EQUAL(2,(int)t11.size()); - const int expectedValues3[2]={0,1}; + const mcIdType expectedValues3[2]={0,1}; CPPUNIT_ASSERT(std::equal(t11.begin(),t11.end(),expectedValues3)); const double pos3[2]={0.2,0.2}; t11.clear(); targetMesh->getCellsContainingPoint(pos3,1e-12,t11); CPPUNIT_ASSERT_EQUAL(5,(int)t11.size()); - const int expectedValues4[5]={0,1,2,3,4}; + const mcIdType expectedValues4[5]={0,1,2,3,4}; CPPUNIT_ASSERT(std::equal(t11.begin(),t11.end(),expectedValues4)); - CPPUNIT_ASSERT_EQUAL(0,targetMesh->getCellContainingPoint(pos3,1e-12)); + CPPUNIT_ASSERT_EQUAL(ToIdType(0),targetMesh->getCellContainingPoint(pos3,1e-12)); targetMesh->decrRef(); //3D targetMesh=build3DTargetMesh_1(); const double pos4[3]={25.,25.,25.}; - CPPUNIT_ASSERT_EQUAL(0,targetMesh->getCellContainingPoint(pos4,1e-12)); + CPPUNIT_ASSERT_EQUAL(ToIdType(0),targetMesh->getCellContainingPoint(pos4,1e-12)); const double pos5[3]={50.,50.,50.}; t11.clear(); targetMesh->getCellsContainingPoint(pos5,1e-12,t11); CPPUNIT_ASSERT_EQUAL(8,(int)t11.size()); - const int expectedValues5[8]={0,1,2,3,4,5,6,7}; + const mcIdType expectedValues5[8]={0,1,2,3,4,5,6,7}; CPPUNIT_ASSERT(std::equal(t11.begin(),t11.end(),expectedValues5)); const double pos6[3]={0., 50., 0.}; t11.clear(); targetMesh->getCellsContainingPoint(pos6,1e-12,t11); CPPUNIT_ASSERT_EQUAL(2,(int)t11.size()); - const int expectedValues6[2]={0,2}; + const mcIdType expectedValues6[2]={0,2}; CPPUNIT_ASSERT(std::equal(t11.begin(),t11.end(),expectedValues6)); //3D outside const double pos7[3]={-1.0,-1.0,0.}; - CPPUNIT_ASSERT_EQUAL(-1,targetMesh->getCellContainingPoint(pos7,1e-12)); + CPPUNIT_ASSERT_EQUAL(ToIdType(-1),targetMesh->getCellContainingPoint(pos7,1e-12)); //3D outside 2 const double center2[3]={0.,0.,0.}; const double vec2[3]={0.,-1.,0.}; targetMesh->rotate(center2,vec2,0.78539816339744830962); const double pos8[3]={-25,25.,12.}; - CPPUNIT_ASSERT_EQUAL(-1,targetMesh->getCellContainingPoint(pos8,1e-12)); + CPPUNIT_ASSERT_EQUAL(ToIdType(-1),targetMesh->getCellContainingPoint(pos8,1e-12)); // targetMesh->decrRef(); } @@ -2255,7 +2256,7 @@ void MEDCouplingBasicsTest1::testGetValueOn1() // targetMesh=build2DSourceMesh_1(); MEDCouplingFieldDouble *fieldOnNodes=MEDCouplingFieldDouble::New(ON_NODES); - int nbOfNodes=targetMesh->getNumberOfNodes(); + mcIdType nbOfNodes=targetMesh->getNumberOfNodes(); fieldOnNodes->setMesh(targetMesh); array=DataArrayDouble::New(); array->alloc(nbOfNodes,2); @@ -2454,38 +2455,38 @@ void MEDCouplingBasicsTest1::testCMesh2() coordsZ1->useArray(arrZ1,false, DeallocType::CPP_DEALLOC,4,1); mesh1->setCoords(coordsX1,coordsY1,coordsZ1); - std::vector dis=mesh1->getDistributionOfTypes(); + std::vector dis=mesh1->getDistributionOfTypes(); CPPUNIT_ASSERT_EQUAL(3,(int) dis.size()); - CPPUNIT_ASSERT_EQUAL((int) INTERP_KERNEL::NORM_HEXA8,dis[0]); - CPPUNIT_ASSERT_EQUAL(27,dis[1]); - CPPUNIT_ASSERT_EQUAL(-1,dis[2]); + CPPUNIT_ASSERT_EQUAL(ToIdType(INTERP_KERNEL::NORM_HEXA8),dis[0]); + CPPUNIT_ASSERT_EQUAL(ToIdType(27),dis[1]); + CPPUNIT_ASSERT_EQUAL(ToIdType(-1),dis[2]); - std::vector idsPerType; + std::vector idsPerType; CPPUNIT_ASSERT(!(mesh1->checkTypeConsistencyAndContig(dis, idsPerType))); - dis[0]=(int) INTERP_KERNEL::NORM_QUAD4; + dis[0]=(mcIdType) INTERP_KERNEL::NORM_QUAD4; CPPUNIT_ASSERT_THROW(mesh1->checkTypeConsistencyAndContig(dis, idsPerType),INTERP_KERNEL::Exception); - dis[0]=(int) INTERP_KERNEL::NORM_HEXA8; + dis[0]=(mcIdType) INTERP_KERNEL::NORM_HEXA8; dis[2]=0; - DataArrayInt *ids=DataArrayInt::New(); + DataArrayIdType *ids=DataArrayIdType::New(); ids->alloc(10,1); ids->fillWithValue(23); idsPerType.push_back(ids); - DataArrayInt* check=mesh1->checkTypeConsistencyAndContig(dis, idsPerType); + DataArrayIdType* check=mesh1->checkTypeConsistencyAndContig(dis, idsPerType); CPPUNIT_ASSERT(check); CPPUNIT_ASSERT(check->isEqual(*ids)); - std::vector code; - std::vector idsInPflPerType; - std::vector pfls; + std::vector code; + std::vector idsInPflPerType; + std::vector pfls; mesh1->splitProfilePerType(ids,code,idsInPflPerType,pfls); CPPUNIT_ASSERT_EQUAL(3,(int)code.size()); - CPPUNIT_ASSERT_EQUAL((int) INTERP_KERNEL::NORM_HEXA8,code[0]); - CPPUNIT_ASSERT_EQUAL(10,code[1]); - CPPUNIT_ASSERT_EQUAL(0,code[2]); + CPPUNIT_ASSERT_EQUAL(ToIdType(INTERP_KERNEL::NORM_HEXA8),code[0]); + CPPUNIT_ASSERT_EQUAL(ToIdType(10),code[1]); + CPPUNIT_ASSERT_EQUAL(ToIdType(0),code[2]); CPPUNIT_ASSERT_EQUAL(1,(int)idsInPflPerType.size()); CPPUNIT_ASSERT_EQUAL(1,(int)pfls.size()); - DataArrayInt *exp=DataArrayInt::New(); exp->alloc(10,1); exp->iota(0); + DataArrayIdType *exp=DataArrayIdType::New(); exp->alloc(10,1); exp->iota(0); CPPUNIT_ASSERT(idsInPflPerType[0]->isEqual(*exp)); exp->decrRef(); CPPUNIT_ASSERT(pfls[0]->isEqual(*ids)); @@ -2494,29 +2495,29 @@ void MEDCouplingBasicsTest1::testCMesh2() ids->decrRef(); check->decrRef(); - int cells1[4]={0,1,25,26}; + mcIdType cells1[4]={0,1,25,26}; MEDCouplingUMesh *partMesh1= dynamic_cast(mesh1->buildPart(cells1,cells1+4)); CPPUNIT_ASSERT(partMesh1); CPPUNIT_ASSERT_EQUAL(4,(int)partMesh1->getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8)); - CPPUNIT_ASSERT_EQUAL(64,mesh1->getNumberOfNodes()); - CPPUNIT_ASSERT_EQUAL(64,partMesh1->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(64,(int)mesh1->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(64,(int)partMesh1->getNumberOfNodes()); - int cells2[2]={25,26}; - DataArrayInt* arr1; + mcIdType cells2[2]={25,26}; + DataArrayIdType* arr1; MEDCouplingCMesh *partMesh2= dynamic_cast(mesh1->buildPartAndReduceNodes(cells2,cells2+2,arr1)); CPPUNIT_ASSERT(partMesh2); CPPUNIT_ASSERT_EQUAL(2,(int)partMesh2->getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8)); - CPPUNIT_ASSERT_EQUAL(12,partMesh2->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(12,(int)partMesh2->getNumberOfNodes()); - int cells3[2]={2,3}; - DataArrayInt* arr2; + mcIdType cells3[2]={2,3}; + DataArrayIdType* arr2; MEDCouplingUMesh *partMesh3= dynamic_cast(partMesh1->buildPartAndReduceNodes(cells3,cells3+2,arr2)); CPPUNIT_ASSERT(partMesh3); CPPUNIT_ASSERT_EQUAL(2,(int)partMesh3->getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8)); - CPPUNIT_ASSERT_EQUAL(12,partMesh3->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(12,(int)partMesh3->getNumberOfNodes()); CPPUNIT_ASSERT_THROW(mesh1->simplexize(0),INTERP_KERNEL::Exception); CPPUNIT_ASSERT_THROW(mesh1->getMeasureFieldOnNode(true),INTERP_KERNEL::Exception); @@ -2538,7 +2539,7 @@ void MEDCouplingBasicsTest1::testCMesh2() MEDCouplingFieldDouble *f1=mesh2d->buildOrthogonalField(); std::vector tinyInfoD; - std::vector tinyInfo; + std::vector tinyInfo; std::vector littleStrings; mesh2d->getTinySerializationInformation(tinyInfoD, tinyInfo, littleStrings); CPPUNIT_ASSERT_EQUAL(5,(int)tinyInfo.size()); @@ -2548,7 +2549,7 @@ void MEDCouplingBasicsTest1::testCMesh2() CPPUNIT_ASSERT_EQUAL(-1,(int)tinyInfo[3]); //it CPPUNIT_ASSERT_EQUAL(-1,(int)tinyInfo[4]); //order CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,tinyInfoD[0],1e-14); //time - DataArrayInt* d1=DataArrayInt::New(); + DataArrayIdType* d1=DataArrayIdType::New(); DataArrayDouble* d2=DataArrayDouble::New(); mesh2d->resizeForUnserialization(tinyInfo, d1, d2, littleStrings); CPPUNIT_ASSERT_EQUAL(0,(int)d1->getNumberOfTuples()); @@ -2620,17 +2621,17 @@ void MEDCouplingBasicsTest1::testTryToShareSameCoords() void MEDCouplingBasicsTest1::testFindNodeOnPlane() { MEDCouplingUMesh *mesh=build3DTargetMesh_1(); - std::vector n; + std::vector n; double pt[3]={300.,300.,0.}; double v[3]={0.,0.,2.}; mesh->findNodesOnPlane(pt,v,1e-12,n); CPPUNIT_ASSERT_EQUAL(9,(int)n.size()); MEDCouplingUMesh *m3dSurf=(MEDCouplingUMesh *)mesh->buildFacePartOfMySelfNode(&n[0],&n[0]+n.size(),true); MEDCouplingMappedExtrudedMesh *me=MEDCouplingMappedExtrudedMesh::New(mesh,m3dSurf,0); - const DataArrayInt *da=me->getMesh3DIds(); + const DataArrayIdType *da=me->getMesh3DIds(); CPPUNIT_ASSERT_EQUAL(8,(int)me->getNumberOfCells()); - const int expected[8]={0,1,2,3,4,5,6,7}; - const int *val=da->getConstPointer(); + const mcIdType expected[8]={0,1,2,3,4,5,6,7}; + const mcIdType *val=da->getConstPointer(); for(int i=0;i<8;i++) CPPUNIT_ASSERT_EQUAL(expected[i],val[i]); me->decrRef(); @@ -2643,7 +2644,7 @@ void MEDCouplingBasicsTest1::testRenumberCells() MEDCouplingUMesh *m=build3DSurfTargetMesh_1(); MEDCouplingUMesh *m2=build3DSurfTargetMesh_1(); CPPUNIT_ASSERT(m->isEqual(m2,0)); - const int arr[5]={12,3,25,2,26}; + const mcIdType arr[5]={12,3,25,2,26}; m->renumberCells(arr,true); CPPUNIT_ASSERT(!m->isEqual(m2,0)); CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,m->getTypeOfCell(0)); @@ -2651,7 +2652,7 @@ void MEDCouplingBasicsTest1::testRenumberCells() CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,m->getTypeOfCell(2)); CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,m->getTypeOfCell(3)); CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,m->getTypeOfCell(4)); - const int arr2[5]={5,-1,-5,4,8}; + const mcIdType arr2[5]={5,-1,-5,4,8}; m->renumberCells(arr2,true); CPPUNIT_ASSERT(m->isEqual(m2,0)); m->decrRef(); @@ -2683,8 +2684,8 @@ void MEDCouplingBasicsTest1::testSetConnectivity() { MEDCouplingUMesh *m1 = build1DTargetMesh_1(); - DataArrayInt * conn = DataArrayInt::New(); - DataArrayInt * connI = DataArrayInt::New(); + DataArrayIdType * conn = DataArrayIdType::New(); + DataArrayIdType * connI = DataArrayIdType::New(); m1->setConnectivity(conn, connI, true); // was SEG-Faulting with empty arrays conn->decrRef(); connI->decrRef(); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx index ea9e88da3..d68ab59fb 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx @@ -51,17 +51,17 @@ void MEDCouplingBasicsTest2::testGaussPointField1() MEDCouplingFieldDouble *f=MEDCouplingFieldDouble::New(ON_GAUSS_PT,NO_TIME); CPPUNIT_ASSERT_THROW(f->getNumberOfTuples(), INTERP_KERNEL::Exception); // Sanity check! f->setMesh(m); - CPPUNIT_ASSERT_EQUAL(5,f->getNumberOfMeshPlacesExpected()); - CPPUNIT_ASSERT_EQUAL(0,f->getNbOfGaussLocalization()); + CPPUNIT_ASSERT_EQUAL(ToIdType(5),f->getNumberOfMeshPlacesExpected()); + CPPUNIT_ASSERT_EQUAL(ToIdType(0),f->getNbOfGaussLocalization()); f->setGaussLocalizationOnType(INTERP_KERNEL::NORM_TRI3,_refCoo1,_gsCoo1,_wg1); f->setGaussLocalizationOnType(INTERP_KERNEL::NORM_TRI3,_refCoo1,_gsCoo1,_wg1); // not a bug only to check that it works well CPPUNIT_ASSERT_THROW(f->setGaussLocalizationOnType(INTERP_KERNEL::NORM_QUAD4,_refCoo1,_gsCoo1,_wg1),INTERP_KERNEL::Exception); - CPPUNIT_ASSERT_EQUAL(1,f->getNbOfGaussLocalization()); + CPPUNIT_ASSERT_EQUAL(ToIdType(1),f->getNbOfGaussLocalization()); const double refCoo2[8]={ 0.,0., 1.,0., 1.,1., 0.,1. }; std::vector _refCoo2(refCoo2,refCoo2+8); _gsCoo1.resize(4); _wg1.resize(2); f->setGaussLocalizationOnType(INTERP_KERNEL::NORM_QUAD4,_refCoo2,_gsCoo1,_wg1); - CPPUNIT_ASSERT_EQUAL(2,f->getNbOfGaussLocalization()); + CPPUNIT_ASSERT_EQUAL(ToIdType(2),f->getNbOfGaussLocalization()); DataArrayDouble *array=DataArrayDouble::New(); array->alloc(18,2); double *ptr=array->getPointer(); @@ -75,30 +75,30 @@ void MEDCouplingBasicsTest2::testGaussPointField1() CPPUNIT_ASSERT_DOUBLES_EQUAL(16.,f->getIJK(1,5,1),1e-14); // f->clearGaussLocalizations(); - CPPUNIT_ASSERT_EQUAL(0,f->getNbOfGaussLocalization()); + CPPUNIT_ASSERT_EQUAL(ToIdType(0),f->getNbOfGaussLocalization()); CPPUNIT_ASSERT_THROW(f->checkConsistencyLight(),INTERP_KERNEL::Exception); - int ids1[4]={0,1,3,4}; + mcIdType ids1[4]={0,1,3,4}; CPPUNIT_ASSERT_THROW(f->setGaussLocalizationOnCells(ids1,ids1+4,_refCoo2,_gsCoo1,_wg1),INTERP_KERNEL::Exception); - CPPUNIT_ASSERT_EQUAL(0,f->getNbOfGaussLocalization()); - int ids2[2]={0,4}; + CPPUNIT_ASSERT_EQUAL(ToIdType(0),f->getNbOfGaussLocalization()); + mcIdType ids2[2]={0,4}; f->setGaussLocalizationOnCells(ids2,ids2+2,_refCoo2,_gsCoo1,_wg1); - CPPUNIT_ASSERT_EQUAL(1,f->getNbOfGaussLocalization()); - CPPUNIT_ASSERT_EQUAL(0,f->getGaussLocalizationIdOfOneCell(0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(1),f->getNbOfGaussLocalization()); + CPPUNIT_ASSERT_EQUAL(ToIdType(0),f->getGaussLocalizationIdOfOneCell(0)); CPPUNIT_ASSERT_THROW(f->getGaussLocalizationIdOfOneCell(1),INTERP_KERNEL::Exception); - int ids3[2]={1,2}; + mcIdType ids3[2]={1,2}; f->setGaussLocalizationOnCells(ids3,ids3+2,_refCoo1,_gsCoo1,_wg1); - CPPUNIT_ASSERT_EQUAL(2,f->getNbOfGaussLocalization()); - CPPUNIT_ASSERT_EQUAL(0,f->getGaussLocalizationIdOfOneCell(0)); - CPPUNIT_ASSERT_EQUAL(1,f->getGaussLocalizationIdOfOneCell(1)); - CPPUNIT_ASSERT_EQUAL(1,f->getGaussLocalizationIdOfOneCell(2)); + CPPUNIT_ASSERT_EQUAL(ToIdType(2),f->getNbOfGaussLocalization()); + CPPUNIT_ASSERT_EQUAL(ToIdType(0),f->getGaussLocalizationIdOfOneCell(0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(1),f->getGaussLocalizationIdOfOneCell(1)); + CPPUNIT_ASSERT_EQUAL(ToIdType(1),f->getGaussLocalizationIdOfOneCell(2)); CPPUNIT_ASSERT_THROW(f->checkConsistencyLight(),INTERP_KERNEL::Exception);//<- cell 3 has no localization - int ids4[1]={3}; + mcIdType ids4[1]={3}; std::vector _gsCoo2(_gsCoo1); std::vector _wg2(_wg1); _gsCoo2[0]=0.8888777776666; _wg2[0]=0.1234567892377; f->setGaussLocalizationOnCells(ids4,ids4+1,_refCoo2,_gsCoo2,_wg2); - CPPUNIT_ASSERT_EQUAL(3,f->getNbOfGaussLocalization()); - std::vector tmpIds; + CPPUNIT_ASSERT_EQUAL(ToIdType(3),f->getNbOfGaussLocalization()); + std::vector tmpIds; f->getCellIdsHavingGaussLocalization(0,tmpIds); CPPUNIT_ASSERT_EQUAL(2,(int)tmpIds.size()); CPPUNIT_ASSERT(std::equal(ids2,ids2+2,tmpIds.begin())); @@ -128,7 +128,7 @@ void MEDCouplingBasicsTest2::testGaussPointNEField1() MEDCouplingUMesh *m=build2DTargetMesh_1(); MEDCouplingFieldDouble *f=MEDCouplingFieldDouble::New(ON_GAUSS_NE,NO_TIME); f->setMesh(m); - CPPUNIT_ASSERT_EQUAL(5,f->getNumberOfMeshPlacesExpected()); + CPPUNIT_ASSERT_EQUAL(ToIdType(5),f->getNumberOfMeshPlacesExpected()); f->setName("MyFirstFieldOnNE"); f->setDescription("MyDescriptionNE"); DataArrayDouble *array=DataArrayDouble::New(); @@ -154,7 +154,7 @@ void MEDCouplingBasicsTest2::testCellOrientation1() { MEDCouplingUMesh *m=build2DTargetMesh_1(); double vec[3]={0.,0.,-1.}; - std::vector res1; + std::vector res1; CPPUNIT_ASSERT_THROW(m->are2DCellsNotCorrectlyOriented(vec,false,res1),INTERP_KERNEL::Exception); m->changeSpaceDimension(3); res1.clear(); @@ -167,13 +167,13 @@ void MEDCouplingBasicsTest2::testCellOrientation1() // vec[2]=-1.; // connectivity inversion - int *conn=m->getNodalConnectivity()->getPointer(); - int tmp=conn[11]; + mcIdType *conn=m->getNodalConnectivity()->getPointer(); + mcIdType tmp=conn[11]; conn[11]=conn[12]; conn[12]=tmp; m->are2DCellsNotCorrectlyOriented(vec,false,res1); CPPUNIT_ASSERT_EQUAL(1,(int)res1.size()); - CPPUNIT_ASSERT_EQUAL(2,res1[0]); + CPPUNIT_ASSERT_EQUAL(ToIdType(2),res1[0]); res1.clear(); m->orientCorrectly2DCells(vec,false); m->are2DCellsNotCorrectlyOriented(vec,false,res1); @@ -191,7 +191,7 @@ void MEDCouplingBasicsTest2::testCellOrientation2() MEDCouplingUMesh *m1=0; MEDCouplingUMesh *m2=build3DExtrudedUMesh_1(m1); m1->decrRef(); - std::vector res1; + std::vector res1; m2->arePolyhedronsNotCorrectlyOriented(res1); CPPUNIT_ASSERT_EQUAL(6,(int)res1.size()); m2->orientCorrectlyPolyhedrons(); @@ -200,8 +200,8 @@ void MEDCouplingBasicsTest2::testCellOrientation2() CPPUNIT_ASSERT(res1.empty()); m2->checkConsistencyLight(); CPPUNIT_ASSERT_EQUAL(18,(int)m2->getNumberOfCells()); - int cellIds[3]={0,6,12}; - std::vector cellIds2(cellIds,cellIds+3); + mcIdType cellIds[3]={0,6,12}; + std::vector cellIds2(cellIds,cellIds+3); m2->convertToPolyTypes(&cellIds2[0],&cellIds2[0]+cellIds2.size()); m2->orientCorrectlyPolyhedrons(); res1.clear(); @@ -212,8 +212,8 @@ void MEDCouplingBasicsTest2::testCellOrientation2() MEDCouplingUMesh *m3=build2DTargetMesh_1(); double vec[3]={0.,0.,1.}; m3->changeSpaceDimension(3); - const int ids1[5]={0,1,2,3,4}; - std::vector ids2(ids1,ids1+5); + const mcIdType ids1[5]={0,1,2,3,4}; + std::vector ids2(ids1,ids1+5); m3->convertToPolyTypes(&ids2[0],&ids2[0]+ids2.size()); m3->orientCorrectly2DCells(vec,false); MEDCouplingUMesh *m4=buildCU1DMesh_U(); @@ -271,7 +271,7 @@ void MEDCouplingBasicsTest2::testCellOrientation3() coords[4] = cos(5*M_PI/4.0); coords[5] = sin(5*M_PI/4.0); coords[6] = cos(M_PI/4.0); coords[7] = sin(M_PI/4.0); - int conn[4]= { 0,1,2,3 }; + mcIdType conn[4]= { 0,1,2,3 }; double vec[3]={0.,0.,-1.}; m->allocateCells(1); m->insertNextCell(INTERP_KERNEL::NORM_QPOLYG,4,conn); @@ -283,7 +283,7 @@ void MEDCouplingBasicsTest2::testCellOrientation3() myCoords->decrRef(); m->changeSpaceDimension(3); - std::vector res1; + std::vector res1; m->are2DCellsNotCorrectlyOriented(vec,false,res1); CPPUNIT_ASSERT(res1.empty()); vec[2] = 1.0; @@ -298,7 +298,7 @@ void MEDCouplingBasicsTest2::testCellOrientation3() */ void MEDCouplingBasicsTest2::testPolyhedronBarycenter() { - int connN[]={0,3,2,1, -1, 4,5,6,7, -1, 0,4,7,3, -1, 3,7,6,2, -1, 2,6,5,1, -1, 1,5,4,0}; + mcIdType connN[]={0,3,2,1, -1, 4,5,6,7, -1, 0,4,7,3, -1, 3,7,6,2, -1, 2,6,5,1, -1, 1,5,4,0}; double coords[]={0.,0.,0., 1.,0.,0., 1.,1.,0., 0.,1.,0., 0.,0.,1., 1.,0.,1., 1.,1.,1., 0.,1.,1., 0.5, 0.5, 0.5}; MEDCouplingUMesh *meshN=MEDCouplingUMesh::New(); meshN->setName("ForBary"); @@ -313,7 +313,7 @@ void MEDCouplingBasicsTest2::testPolyhedronBarycenter() myCoords->decrRef(); meshN->checkConsistencyLight(); // - std::vector res1; + std::vector res1; meshN->arePolyhedronsNotCorrectlyOriented(res1); meshN->orientCorrectlyPolyhedrons(); CPPUNIT_ASSERT(res1.empty()); @@ -574,7 +574,7 @@ void MEDCouplingBasicsTest2::testAreaBary3D() 0.167803379307 , -0.207851396623 , -0.088802726124 , 0.12868717152 , -0.230920439715 , 0.00760508389036 , -0.0372812069535 , -0.286740286332 , 0.00963701291166 }; - int connN [] = { /*polyhedron 0*/ + mcIdType connN [] = { /*polyhedron 0*/ 0 , 1 , 3 , 4 , 2 , -1 , 1 , 5 , 6 , 7 , 0 , -1 , 0 , 7 , 8 , 10 , 11 , 9 , 2 , -1 , 1 , 5 , 12 , 14 , 15 , 13 , 3 , -1 , 16 , 9 , 2 , 4 , 17 , -1 , 4 , 3 , 13 , 18 , 17 , -1 , 5 , 6 , 19 , 21 , 20 , 12 , -1 , 6 , 7 , 8 , 23 , 22 , 19 , -1 , 23 , 24 , 10 , 8 , -1 , 25 , 11 , 9 , 16 , -1 , 24 , 26 , 25 , 11 , 10 , -1 , 12 , 14 , 20 , -1 , 27 , 28 , 29 , 15 , 13 , 18 , -1 , 14 , 15 , 29 , 30 , 21 , 20 , -1 , 26 , 27 , 18 , 17 , 16 , 25 , -1 @@ -612,7 +612,7 @@ void MEDCouplingBasicsTest2::testAreaBary3D() meshN->setCoords(myCoords); myCoords->decrRef(); meshN->checkConsistencyLight(); - std::vector res1; + std::vector res1; meshN->arePolyhedronsNotCorrectlyOriented(res1); meshN->orientCorrectlyPolyhedrons(); res1.clear(); @@ -641,7 +641,7 @@ void MEDCouplingBasicsTest2::testRenumberCellsForFields() arr->decrRef(); const double values1[15]={7.,107.,10007.,8.,108.,10008.,9.,109.,10009.,10.,110.,10010.,11.,111.,10011.}; std::copy(values1,values1+15,arr->getPointer()); - const int renumber1[5]={3,1,0,4,2}; + const mcIdType renumber1[5]={3,1,0,4,2}; double res[3]; const double loc[]={-0.05,-0.05, 0.55,-0.25, 0.55,0.15, -0.05,0.45, 0.45,0.45}; for(int j=0;j<5;j++) @@ -697,7 +697,7 @@ void MEDCouplingBasicsTest2::testRenumberCellsForFields() ptr=f->getArray()->getConstPointer(); for(int i=0;i<36;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],ptr[i],1e-12); - const int renumber2[5]={2,1,4,0,3};//reverse renumber1 + const mcIdType renumber2[5]={2,1,4,0,3};//reverse renumber1 f->renumberCells(renumber2,false); CPPUNIT_ASSERT(f->isEqual(fCpy,1e-12,1e-12)); fCpy->decrRef(); @@ -733,16 +733,16 @@ void MEDCouplingBasicsTest2::testRenumberNodesForFields() MEDCouplingUMesh *m=build2DTargetMesh_1(); MEDCouplingFieldDouble *f=MEDCouplingFieldDouble::New(ON_NODES,NO_TIME); f->setMesh(m); - CPPUNIT_ASSERT_EQUAL(9,f->getNumberOfMeshPlacesExpected()); + CPPUNIT_ASSERT_EQUAL(ToIdType(9),f->getNumberOfMeshPlacesExpected()); DataArrayDouble *arr=DataArrayDouble::New(); - int nbOfNodes=m->getNumberOfNodes(); + mcIdType nbOfNodes=m->getNumberOfNodes(); arr->alloc(nbOfNodes,3); f->setArray(arr); arr->decrRef(); const double values1[27]={7.,107.,10007.,8.,108.,10008.,9.,109.,10009.,10.,110.,10010.,11.,111.,10011.,12.,112.,10012.,13.,113.,10013.,14.,114.,10014.,15.,115.,10015.}; std::copy(values1,values1+27,arr->getPointer()); f->checkConsistencyLight(); - const int renumber1[9]={0,4,1,3,5,2,6,7,8}; + const mcIdType renumber1[9]={0,4,1,3,5,2,6,7,8}; double res[3]; const double loc[]={0.5432,-0.2432, 0.5478,0.1528}; const double expected1[6]={9.0272, 109.0272, 10009.0272, 11.4124,111.4124,10011.4124}; @@ -765,7 +765,7 @@ void MEDCouplingBasicsTest2::testRenumberNodesForFields() const double expected2[27]={7.,107.,10007.,9.,109.,10009.,12.,112.,10012.,10.,110.,10010.,8.,108.,10008.,11.,111.,10011.,13.,113.,10013.,14.,114.,10014.,15.,115.,10015.}; for(int i=0;i<27;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],f->getArray()->getConstPointer()[i],1e-12); - const int renumber2[9]={0,2,5,3,1,4,6,7,8};//reverse of renumber2 + const mcIdType renumber2[9]={0,2,5,3,1,4,6,7,8};//reverse of renumber2 f->renumberNodes(renumber2); CPPUNIT_ASSERT(f->isEqual(fCpy,1e-12,1e-12)); fCpy->decrRef(); @@ -784,7 +784,7 @@ void MEDCouplingBasicsTest2::testConvertQuadraticCellsToLinear() std::set expected1Bis(expected1,expected1+5); CPPUNIT_ASSERT(expected1Bis==types); CPPUNIT_ASSERT(mesh->isPresenceOfQuadratic()); - CPPUNIT_ASSERT_EQUAL(62,mesh->getNodalConnectivityArrayLen()); + CPPUNIT_ASSERT_EQUAL(ToIdType(62),mesh->getNodalConnectivityArrayLen()); MEDCouplingFieldDouble *f1=mesh->getMeasureField(false); // mesh->convertQuadraticCellsToLinear(); @@ -793,7 +793,7 @@ void MEDCouplingBasicsTest2::testConvertQuadraticCellsToLinear() mesh->checkConsistencyLight(); MEDCouplingFieldDouble *f2=mesh->getMeasureField(false); CPPUNIT_ASSERT(f1->getArray()->isEqual(*f2->getArray(),1e-12)); - CPPUNIT_ASSERT_EQUAL(48,mesh->getNodalConnectivityArrayLen()); + CPPUNIT_ASSERT_EQUAL(ToIdType(48),mesh->getNodalConnectivityArrayLen()); std::set types2=mesh->getAllGeoTypes(); CPPUNIT_ASSERT_EQUAL(3,(int)types2.size()); INTERP_KERNEL::NormalizedCellType expected2[3]={INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4}; @@ -809,7 +809,7 @@ void MEDCouplingBasicsTest2::testCheckGeoEquivalWith() { MEDCouplingUMesh *mesh1=build2DTargetMesh_3(); MEDCouplingUMesh *mesh2=build2DTargetMesh_3(); - DataArrayInt *cellCor,*nodeCor; + DataArrayIdType *cellCor,*nodeCor; //First test mesh1 mesh1->checkGeoEquivalWith(mesh1,0,1e-12,cellCor,nodeCor);//deepEqual CPPUNIT_ASSERT(cellCor==0); @@ -831,7 +831,7 @@ void MEDCouplingBasicsTest2::testCheckGeoEquivalWith() CPPUNIT_ASSERT(cellCor==0); CPPUNIT_ASSERT(nodeCor==0); //Third test : cell permutation by keeping the first the middle and the last as it is. - const int renum[]={0,2,1,3,4,5,6,8,7,9}; + const mcIdType renum[]={0,2,1,3,4,5,6,8,7,9}; mesh2->renumberCells(renum,false); CPPUNIT_ASSERT_THROW(mesh1->checkGeoEquivalWith(mesh2,0,1e-12,cellCor,nodeCor),INTERP_KERNEL::Exception);//deepEqual fails CPPUNIT_ASSERT(cellCor==0); @@ -851,7 +851,7 @@ void MEDCouplingBasicsTest2::testCheckGeoEquivalWith() //4th test : cell and node permutation by keeping the first the middle and the last as it is. mesh2->decrRef(); mesh2=build2DTargetMesh_3(); - const int renum2[]={0,2,1,3,4,5,6,8,7,9,10}; + const mcIdType renum2[]={0,2,1,3,4,5,6,8,7,9,10}; mesh2->renumberCells(renum,false); mesh2->renumberNodes(renum2,11); CPPUNIT_ASSERT_THROW(mesh1->checkGeoEquivalWith(mesh2,0,1e-12,cellCor,nodeCor),INTERP_KERNEL::Exception);//deepEqual fails @@ -876,7 +876,7 @@ void MEDCouplingBasicsTest2::testCheckGeoEquivalWith() //5th test : modification of the last cell to check fastCheck detection. mesh2->decrRef(); mesh2=build2DTargetMesh_3(); - const int renum3[]={0,2,1,3,4,5,6,8,9,7}; + const mcIdType renum3[]={0,2,1,3,4,5,6,8,9,7}; mesh2->renumberCells(renum3,false); mesh2->renumberNodes(renum2,11); bool isExcep=false; @@ -914,11 +914,11 @@ void MEDCouplingBasicsTest2::testCheckGeoEquivalWith2() { MEDCouplingUMesh *mesh1=build2DTargetMesh_4(); MEDCouplingUMesh *mesh2=build2DTargetMesh_1(); - DataArrayInt *cellCor,*nodeCor; + DataArrayIdType *cellCor,*nodeCor; mesh1->checkGeoEquivalWith(mesh2,10,1e-12,cellCor,nodeCor); CPPUNIT_ASSERT(cellCor==0); CPPUNIT_ASSERT(nodeCor!=0); - const int expected1[9]={0, 1, 3, 4, 5, 6, 7, 8, 9}; + const mcIdType expected1[9]={0, 1, 3, 4, 5, 6, 7, 8, 9}; for(int i=0;i<9;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],nodeCor->getIJ(i,0)); nodeCor->decrRef(); @@ -933,7 +933,7 @@ void MEDCouplingBasicsTest2::testCopyTinyStringsFromOnFields() std::size_t nbOfCells=m->getNumberOfCells(); MEDCouplingFieldDouble *f=MEDCouplingFieldDouble::New(ON_CELLS,LINEAR_TIME); f->setMesh(m); - CPPUNIT_ASSERT_EQUAL(5,f->getNumberOfMeshPlacesExpected()); + CPPUNIT_ASSERT_EQUAL(ToIdType(5),f->getNumberOfMeshPlacesExpected()); f->setName("a"); f->setDescription("b"); DataArrayDouble *a1=DataArrayDouble::New(); @@ -998,7 +998,7 @@ void MEDCouplingBasicsTest2::testTryToShareSameCoordsPermute() m->tryToShareSameCoordsPermute(*m2,1e-12); CPPUNIT_ASSERT(m->getCoords()==m2->getCoords()); CPPUNIT_ASSERT(m2->isEqual(m,1e-12)); - const int renum1[9]={1,2,0,5,8,7,4,3,6}; + const mcIdType renum1[9]={1,2,0,5,8,7,4,3,6}; m->renumberNodes(renum1,9); CPPUNIT_ASSERT(m->getCoords()!=m2->getCoords()); CPPUNIT_ASSERT(!m2->isEqual(m,1e-12)); @@ -1013,7 +1013,7 @@ void MEDCouplingBasicsTest2::testTryToShareSameCoordsPermute2() { MEDCouplingUMesh *m1=build2DTargetMesh_4(); double targetCoords[8]={-0.3,-0.3, 0.2,-0.3, -0.3,0.2, 0.2,0.2 }; - int targetConn[4]={0,2,3,1}; + mcIdType targetConn[4]={0,2,3,1}; MEDCouplingUMesh *m2=MEDCouplingUMesh::New(); m2->setMeshDimension(2); m2->allocateCells(1); @@ -1068,7 +1068,7 @@ void MEDCouplingBasicsTest2::testChangeUnderlyingMesh1() f1->setArray(array); array->decrRef(); // - const int renum[]={0,2,1,3,4,5,6,8,7,9}; + const mcIdType renum[]={0,2,1,3,4,5,6,8,7,9}; mesh2->renumberCells(renum,false); CPPUNIT_ASSERT(f1->getMesh()==mesh1); f1->changeUnderlyingMesh(mesh1,10,1e-12);// nothing done only to check that nothing done. @@ -1089,7 +1089,7 @@ void MEDCouplingBasicsTest2::testChangeUnderlyingMesh1() f1->setArray(array); array->decrRef(); // - const int renum2[]={0,2,10,3,4,5,6,8,7,9,1}; + const mcIdType renum2[]={0,2,10,3,4,5,6,8,7,9,1}; mesh2->renumberNodes(renum2,11); CPPUNIT_ASSERT(f1->getMesh()==mesh1); f1->changeUnderlyingMesh(mesh2,10,1e-12); @@ -1156,7 +1156,7 @@ void MEDCouplingBasicsTest2::testSubstractInPlaceDM1() CPPUNIT_ASSERT_EQUAL(2,(int)f1->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(20,(int)f1->getNumberOfValues()); // - const int renum[]={0,2,3,1,4,5,6,8,7,9}; + const mcIdType renum[]={0,2,3,1,4,5,6,8,7,9}; mesh2->renumberCells(renum,false); // MEDCouplingFieldDouble *f2=MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME); @@ -1307,14 +1307,14 @@ void MEDCouplingBasicsTest2::testGetIdsInRange1() array->decrRef(); // f1->checkConsistencyLight(); - DataArrayInt *da=f1->findIdsInRange(2.9,7.1); - CPPUNIT_ASSERT_EQUAL((std::size_t)5,da->getNbOfElems()); - const int expected1[5]={2,3,5,7,9}; + DataArrayIdType *da=f1->findIdsInRange(2.9,7.1); + CPPUNIT_ASSERT_EQUAL(ToIdType(5),da->getNbOfElems()); + const mcIdType expected1[5]={2,3,5,7,9}; CPPUNIT_ASSERT(std::equal(expected1,expected1+5,da->getConstPointer())); da->decrRef(); da=f1->findIdsInRange(8.,12.); - CPPUNIT_ASSERT_EQUAL((std::size_t)4,da->getNbOfElems()); - const int expected2[4]={1,4,6,8}; + CPPUNIT_ASSERT_EQUAL(ToIdType(4),da->getNbOfElems()); + const mcIdType expected2[4]={1,4,6,8}; CPPUNIT_ASSERT(std::equal(expected2,expected2+4,da->getConstPointer())); da->decrRef(); // @@ -1335,7 +1335,7 @@ void MEDCouplingBasicsTest2::testBuildSubPart1() f1->setArray(array); array->decrRef(); // - const int part1[3]={2,1,4}; + const mcIdType part1[3]={2,1,4}; MEDCouplingFieldDouble *f2=f1->buildSubPart(part1,part1+3); f2->zipCoords(); CPPUNIT_ASSERT_EQUAL(3,(int)f2->getNumberOfTuples()); @@ -1348,7 +1348,7 @@ void MEDCouplingBasicsTest2::testBuildSubPart1() CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension()); CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension()); MEDCouplingUMesh *m2C=dynamic_cast(const_cast(f2->getMesh())); - CPPUNIT_ASSERT_EQUAL(13,m2C->getNodalConnectivityArrayLen()); + CPPUNIT_ASSERT_EQUAL(ToIdType(13),m2C->getNodalConnectivityArrayLen()); const double expected2[12]={0.2, -0.3, 0.7, -0.3, 0.2, 0.2, 0.7, 0.2, 0.2, 0.7, 0.7, 0.7}; for(int i=0;i<12;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12); @@ -1368,7 +1368,7 @@ void MEDCouplingBasicsTest2::testBuildSubPart1() std::copy(arr2,arr2+18,array->getPointer()); f1->setArray(array); array->decrRef(); - const int part2[2]={1,2}; + const mcIdType part2[2]={1,2}; f2=f1->buildSubPart(part2,part2+2); CPPUNIT_ASSERT_EQUAL(4,(int)f2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)f2->getNumberOfComponents()); @@ -1376,11 +1376,11 @@ void MEDCouplingBasicsTest2::testBuildSubPart1() for(int i=0;i<8;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(f2->getIJ(0,i),expected5[i],1e-12); CPPUNIT_ASSERT_EQUAL(2,(int)f2->getMesh()->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(4,f2->getMesh()->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(4,(int)f2->getMesh()->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension()); CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension()); m2C=dynamic_cast(const_cast(f2->getMesh())); - CPPUNIT_ASSERT_EQUAL(8,m2C->getNodalConnectivityArrayLen()); + CPPUNIT_ASSERT_EQUAL(ToIdType(8),m2C->getNodalConnectivityArrayLen()); for(int i=0;i<8;i++)//8 is not an error CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12); CPPUNIT_ASSERT(std::equal(expected3,expected3+4,m2C->getNodalConnectivity()->getConstPointer()+4)); @@ -1388,8 +1388,8 @@ void MEDCouplingBasicsTest2::testBuildSubPart1() CPPUNIT_ASSERT(std::equal(expected4,expected4+3,m2C->getNodalConnectivityIndex()->getConstPointer())); f2->decrRef(); //idem previous because nodes of cell#4 are not fully present in part3 - const int part3[2]={1,2}; - DataArrayInt *arrr=DataArrayInt::New(); + const mcIdType part3[2]={1,2}; + DataArrayIdType *arrr=DataArrayIdType::New(); arrr->alloc(2,1); std::copy(part3,part3+2,arrr->getPointer()); f2=f1->buildSubPart(arrr); @@ -1399,11 +1399,11 @@ void MEDCouplingBasicsTest2::testBuildSubPart1() for(int i=0;i<8;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(f2->getIJ(0,i),expected5[i],1e-12); CPPUNIT_ASSERT_EQUAL(2,(int)f2->getMesh()->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(4,f2->getMesh()->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(4,(int)f2->getMesh()->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension()); CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension()); m2C=dynamic_cast(const_cast(f2->getMesh())); - CPPUNIT_ASSERT_EQUAL(8,m2C->getNodalConnectivityArrayLen()); + CPPUNIT_ASSERT_EQUAL(ToIdType(8),m2C->getNodalConnectivityArrayLen()); for(int i=0;i<8;i++)//8 is not an error CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12); CPPUNIT_ASSERT(std::equal(expected3,expected3+4,m2C->getNodalConnectivity()->getConstPointer()+4)); @@ -1411,7 +1411,7 @@ void MEDCouplingBasicsTest2::testBuildSubPart1() CPPUNIT_ASSERT(std::equal(expected4,expected4+3,m2C->getNodalConnectivityIndex()->getConstPointer())); f2->decrRef(); // - const int part4[3]={1,2,4}; + const mcIdType part4[3]={1,2,4}; f2=f1->buildSubPart(part4,part4+3); CPPUNIT_ASSERT_EQUAL(6,(int)f2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)f2->getNumberOfComponents()); @@ -1419,11 +1419,11 @@ void MEDCouplingBasicsTest2::testBuildSubPart1() for(int i=0;i<12;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(f2->getIJ(0,i),expected6[i],1e-12); CPPUNIT_ASSERT_EQUAL(3,(int)f2->getMesh()->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(6,f2->getMesh()->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(6,(int)f2->getMesh()->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension()); CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension()); m2C=dynamic_cast(const_cast(f2->getMesh())); - CPPUNIT_ASSERT_EQUAL(13,m2C->getNodalConnectivityArrayLen()); + CPPUNIT_ASSERT_EQUAL(ToIdType(13),m2C->getNodalConnectivityArrayLen()); for(int i=0;i<12;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12); CPPUNIT_ASSERT(std::equal(expected3,expected3+4,m2C->getNodalConnectivity()->getConstPointer()+4)); @@ -1847,11 +1847,11 @@ void MEDCouplingBasicsTest2::testMaxPerTuple1() CPPUNIT_ASSERT_DOUBLES_EQUAL(5.6,f2->getIJ(i,0),1e-13); f2->decrRef(); // - DataArrayInt *d2I=0; + DataArrayIdType *d2I=0; DataArrayDouble *d2=array->maxPerTupleWithCompoId(d2I); CPPUNIT_ASSERT_EQUAL(1,(int)d2->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(5,(int)d2->getNumberOfTuples()); - const int expected2[5]={4,3,2,0,1}; + const mcIdType expected2[5]={4,3,2,0,1}; for(int i=0;i<5;i++) { CPPUNIT_ASSERT_DOUBLES_EQUAL(5.6,d2->getIJ(i,0),1e-13); @@ -1942,7 +1942,7 @@ void MEDCouplingBasicsTest2::testIsEqualWithoutConsideringStr1() { MEDCouplingUMesh *mesh1=build2DTargetMesh_1(); MEDCouplingUMesh *mesh2=build2DTargetMesh_1(); - DataArrayInt *da1,*da2; + DataArrayIdType *da1,*da2; // CPPUNIT_ASSERT(mesh1->isEqual(mesh2,1e-12)); CPPUNIT_ASSERT(mesh1->isEqualWithoutConsideringStr(mesh2,1e-12)); @@ -1973,7 +1973,7 @@ void MEDCouplingBasicsTest2::testIsEqualWithoutConsideringStr1() mesh2->getCoords()->setIJ(0,3,tmp); CPPUNIT_ASSERT(mesh1->isEqual(mesh2,1e-12)); CPPUNIT_ASSERT(mesh1->isEqualWithoutConsideringStr(mesh2,1e-12)); - int tmp2=mesh2->getNodalConnectivity()->getIJ(0,4); + mcIdType tmp2=mesh2->getNodalConnectivity()->getIJ(0,4); mesh2->getNodalConnectivity()->setIJ(0,4,0); CPPUNIT_ASSERT(!mesh1->isEqual(mesh2,1e-12)); CPPUNIT_ASSERT(!mesh1->isEqualWithoutConsideringStr(mesh2,1e-12)); @@ -2016,12 +2016,12 @@ void MEDCouplingBasicsTest2::testIsEqualWithoutConsideringStr1() void MEDCouplingBasicsTest2::testGetNodeIdsOfCell1() { MEDCouplingUMesh *mesh1=build2DTargetMesh_1(); - std::vector nodeIds; + std::vector nodeIds; mesh1->getNodeIdsOfCell(1,nodeIds); CPPUNIT_ASSERT_EQUAL(3,(int)nodeIds.size()); - CPPUNIT_ASSERT_EQUAL(1,nodeIds[0]); - CPPUNIT_ASSERT_EQUAL(4,nodeIds[1]); - CPPUNIT_ASSERT_EQUAL(2,nodeIds[2]); + CPPUNIT_ASSERT_EQUAL(1,(int)nodeIds[0]); + CPPUNIT_ASSERT_EQUAL(4,(int)nodeIds[1]); + CPPUNIT_ASSERT_EQUAL(2,(int)nodeIds[2]); std::vector coords; mesh1->getCoordinatesOfNode(4,coords); CPPUNIT_ASSERT_EQUAL(2,(int)coords.size()); @@ -2237,7 +2237,7 @@ void MEDCouplingBasicsTest2::testAreaBary3D2() mesh->setCoords(coo); coo->decrRef(); // - int tmpConn[8]={0,1,2,3,4,5,6,7}; + mcIdType tmpConn[8]={0,1,2,3,4,5,6,7}; mesh->allocateCells(3); mesh->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,tmpConn); std::transform(tmpConn,tmpConn+8,tmpConn,std::bind2nd(std::plus(),8)); @@ -2247,10 +2247,10 @@ void MEDCouplingBasicsTest2::testAreaBary3D2() mesh->finishInsertingCells(); mesh->checkConsistencyLight(); bool isMerged; - int newNebOfNodes; - DataArrayInt *da=mesh->mergeNodes(1e-7,isMerged,newNebOfNodes); + mcIdType newNebOfNodes; + DataArrayIdType *da=mesh->mergeNodes(1e-7,isMerged,newNebOfNodes); da->decrRef(); - CPPUNIT_ASSERT_EQUAL(12,newNebOfNodes); + CPPUNIT_ASSERT_EQUAL(ToIdType(12),newNebOfNodes); MEDCouplingFieldDouble *vols=mesh->getMeasureField(true); CPPUNIT_ASSERT_EQUAL(3,(int)vols->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)vols->getNumberOfComponents()); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx index 0708244e6..3841f4fd7 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx @@ -44,7 +44,7 @@ void MEDCouplingBasicsTest3::testGetMeasureFieldCMesh1() m->setCoordsAt(0,da); da->decrRef(); m->checkConsistencyLight(); - CPPUNIT_ASSERT_EQUAL(4,m->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(4,(int)m->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(3,(int)m->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(1,m->getSpaceDimension()); MEDCouplingFieldDouble *f=m->getMeasureField(true); @@ -74,7 +74,7 @@ void MEDCouplingBasicsTest3::testGetMeasureFieldCMesh1() m->setCoordsAt(1,da); da->decrRef(); m->checkConsistencyLight(); - CPPUNIT_ASSERT_EQUAL(12,m->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(12,(int)m->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(6,(int)m->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(2,m->getSpaceDimension()); f=m->getMeasureField(true); @@ -105,7 +105,7 @@ void MEDCouplingBasicsTest3::testGetMeasureFieldCMesh1() m->setCoordsAt(2,da); da->decrRef(); m->checkConsistencyLight(); - CPPUNIT_ASSERT_EQUAL(60,m->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(60,(int)m->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(24,(int)m->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(3,m->getSpaceDimension()); f=m->getMeasureField(true); @@ -175,7 +175,7 @@ void MEDCouplingBasicsTest3::testFieldDoubleZipConnectivity1() { MEDCouplingUMesh *m1=build2DTargetMesh_1(); MEDCouplingUMesh *m2=build2DTargetMesh_1(); - const int cells1[3]={2,3,4}; + const mcIdType cells1[3]={2,3,4}; MEDCouplingPointSet *m3_1=m2->buildPartOfMySelf(cells1,cells1+3,true); MEDCouplingUMesh *m3=dynamic_cast(m3_1); CPPUNIT_ASSERT(m3); @@ -189,11 +189,11 @@ void MEDCouplingBasicsTest3::testFieldDoubleZipConnectivity1() m5->decrRef(); // CPPUNIT_ASSERT_EQUAL(10,(int)m6->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(22,m6->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(22,(int)m6->getNumberOfNodes()); bool areNodesMerged; - int newNbOfNodes; - DataArrayInt *arr=m6->mergeNodes(1e-13,areNodesMerged,newNbOfNodes); - CPPUNIT_ASSERT_EQUAL(9,m6->getNumberOfNodes()); + mcIdType newNbOfNodes; + DataArrayIdType *arr=m6->mergeNodes(1e-13,areNodesMerged,newNbOfNodes); + CPPUNIT_ASSERT_EQUAL(9,(int)m6->getNumberOfNodes()); arr->decrRef(); MEDCouplingFieldDouble *f=m6->fillFromAnalytic(ON_CELLS,2,"x"); MEDCouplingFieldDouble *f2=m6->fillFromAnalytic(ON_NODES,2,"x"); @@ -244,7 +244,7 @@ void MEDCouplingBasicsTest3::testDaDoubleRenumber1() const double arr1[14]={1.1,11.1,2.1,12.1,3.1,13.1,4.1,14.1,5.1,15.1,6.1,16.1,7.1,17.1}; std::copy(arr1,arr1+14,a->getPointer()); // - const int arr2[7]={3,1,0,6,5,4,2}; + const mcIdType arr2[7]={3,1,0,6,5,4,2}; DataArrayDouble *b=a->renumber(arr2); CPPUNIT_ASSERT_EQUAL(7,(int)b->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)b->getNumberOfComponents()); @@ -256,18 +256,18 @@ void MEDCouplingBasicsTest3::testDaDoubleRenumber1() b->decrRef(); a->decrRef(); // - DataArrayInt *c=DataArrayInt::New(); + DataArrayIdType *c=DataArrayIdType::New(); c->alloc(7,2); c->setInfoOnComponent(0,"toto"); c->setInfoOnComponent(1,"tata"); - const int arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; + const mcIdType arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; std::copy(arr3,arr3+14,c->getPointer()); - DataArrayInt *d=c->renumber(arr2); + DataArrayIdType *d=c->renumber(arr2); CPPUNIT_ASSERT_EQUAL(7,(int)d->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)d->getNumberOfComponents()); CPPUNIT_ASSERT(std::string(d->getInfoOnComponent(0))=="toto"); CPPUNIT_ASSERT(std::string(d->getInfoOnComponent(1))=="tata"); - const int expected2[14]={3, 13, 2, 12, 7, 17, 1, 11, 6, 16, 5, 15, 4, 14}; + const mcIdType expected2[14]={3, 13, 2, 12, 7, 17, 1, 11, 6, 16, 5, 15, 4, 14}; for(int i=0;i<14;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],d->getIJ(0,i)); c->decrRef(); @@ -283,7 +283,7 @@ void MEDCouplingBasicsTest3::testDaDoubleRenumberAndReduce1() const double arr1[14]={1.1,11.1,2.1,12.1,3.1,13.1,4.1,14.1,5.1,15.1,6.1,16.1,7.1,17.1}; std::copy(arr1,arr1+14,a->getPointer()); // - const int arr2[7]={2,-1,1,-1,0,4,3}; + const mcIdType arr2[7]={2,-1,1,-1,0,4,3}; DataArrayDouble *b=a->renumberAndReduce(arr2,5); CPPUNIT_ASSERT_EQUAL(5,(int)b->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)b->getNumberOfComponents()); @@ -295,18 +295,18 @@ void MEDCouplingBasicsTest3::testDaDoubleRenumberAndReduce1() b->decrRef(); a->decrRef(); // - DataArrayInt *c=DataArrayInt::New(); + DataArrayIdType *c=DataArrayIdType::New(); c->alloc(7,2); c->setInfoOnComponent(0,"toto"); c->setInfoOnComponent(1,"tata"); - const int arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; + const mcIdType arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; std::copy(arr3,arr3+14,c->getPointer()); - DataArrayInt *d=c->renumberAndReduce(arr2,5); + DataArrayIdType *d=c->renumberAndReduce(arr2,5); CPPUNIT_ASSERT_EQUAL(5,(int)d->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)d->getNumberOfComponents()); CPPUNIT_ASSERT(std::string(d->getInfoOnComponent(0))=="toto"); CPPUNIT_ASSERT(std::string(d->getInfoOnComponent(1))=="tata"); - const int expected2[10]={5,15,3,13,1,11,7,17,6,16}; + const mcIdType expected2[10]={5,15,3,13,1,11,7,17,6,16}; for(int i=0;i<10;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],d->getIJ(0,i)); c->decrRef(); @@ -320,7 +320,7 @@ void MEDCouplingBasicsTest3::testDaDoubleRenumberInPlace1() const double arr1[14]={1.1,11.1,2.1,12.1,3.1,13.1,4.1,14.1,5.1,15.1,6.1,16.1,7.1,17.1}; std::copy(arr1,arr1+14,a->getPointer()); // - const int arr2[7]={3,1,0,6,5,4,2}; + const mcIdType arr2[7]={3,1,0,6,5,4,2}; a->renumberInPlace(arr2); CPPUNIT_ASSERT_EQUAL(7,(int)a->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)a->getNumberOfComponents()); @@ -329,14 +329,14 @@ void MEDCouplingBasicsTest3::testDaDoubleRenumberInPlace1() CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],a->getIJ(0,i),1e-14); a->decrRef(); // - DataArrayInt *c=DataArrayInt::New(); + DataArrayIdType *c=DataArrayIdType::New(); c->alloc(7,2); - const int arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; + const mcIdType arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; std::copy(arr3,arr3+14,c->getPointer()); c->renumberInPlace(arr2); CPPUNIT_ASSERT_EQUAL(7,(int)c->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)c->getNumberOfComponents()); - const int expected2[14]={3, 13, 2, 12, 7, 17, 1, 11, 6, 16, 5, 15, 4, 14}; + const mcIdType expected2[14]={3, 13, 2, 12, 7, 17, 1, 11, 6, 16, 5, 15, 4, 14}; for(int i=0;i<14;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],c->getIJ(0,i)); c->decrRef(); @@ -351,7 +351,7 @@ void MEDCouplingBasicsTest3::testDaDoubleRenumberR1() const double arr1[14]={1.1,11.1,2.1,12.1,3.1,13.1,4.1,14.1,5.1,15.1,6.1,16.1,7.1,17.1}; std::copy(arr1,arr1+14,a->getPointer()); // - const int arr2[7]={3,1,0,6,5,4,2}; + const mcIdType arr2[7]={3,1,0,6,5,4,2}; DataArrayDouble *b=a->renumberR(arr2); CPPUNIT_ASSERT_EQUAL(7,(int)b->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)b->getNumberOfComponents()); @@ -363,18 +363,18 @@ void MEDCouplingBasicsTest3::testDaDoubleRenumberR1() b->decrRef(); a->decrRef(); // - DataArrayInt *c=DataArrayInt::New(); + DataArrayIdType *c=DataArrayIdType::New(); c->alloc(7,2); c->setInfoOnComponent(0,"toto"); c->setInfoOnComponent(1,"tata"); - const int arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; + const mcIdType arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; std::copy(arr3,arr3+14,c->getPointer()); - DataArrayInt *d=c->renumberR(arr2); + DataArrayIdType *d=c->renumberR(arr2); CPPUNIT_ASSERT_EQUAL(7,(int)d->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)d->getNumberOfComponents()); CPPUNIT_ASSERT(std::string(d->getInfoOnComponent(0))=="toto"); CPPUNIT_ASSERT(std::string(d->getInfoOnComponent(1))=="tata"); - const int expected2[14]={4, 14, 2, 12, 1, 11, 7, 17, 6, 16, 5, 15, 3, 13}; + const mcIdType expected2[14]={4, 14, 2, 12, 1, 11, 7, 17, 6, 16, 5, 15, 3, 13}; for(int i=0;i<14;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],d->getIJ(0,i)); c->decrRef(); @@ -388,7 +388,7 @@ void MEDCouplingBasicsTest3::testDaDoubleRenumberInPlaceR1() const double arr1[14]={1.1,11.1,2.1,12.1,3.1,13.1,4.1,14.1,5.1,15.1,6.1,16.1,7.1,17.1}; std::copy(arr1,arr1+14,a->getPointer()); // - const int arr2[7]={3,1,0,6,5,4,2}; + const mcIdType arr2[7]={3,1,0,6,5,4,2}; a->renumberInPlaceR(arr2); CPPUNIT_ASSERT_EQUAL(7,(int)a->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)a->getNumberOfComponents()); @@ -397,14 +397,14 @@ void MEDCouplingBasicsTest3::testDaDoubleRenumberInPlaceR1() CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],a->getIJ(0,i),1e-14); a->decrRef(); // - DataArrayInt *c=DataArrayInt::New(); + DataArrayIdType *c=DataArrayIdType::New(); c->alloc(7,2); - const int arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; + const mcIdType arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; std::copy(arr3,arr3+14,c->getPointer()); c->renumberInPlaceR(arr2); CPPUNIT_ASSERT_EQUAL(7,(int)c->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)c->getNumberOfComponents()); - const int expected2[14]={4, 14, 2, 12, 1, 11, 7, 17, 6, 16, 5, 15, 3, 13}; + const mcIdType expected2[14]={4, 14, 2, 12, 1, 11, 7, 17, 6, 16, 5, 15, 3, 13}; for(int i=0;i<14;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],c->getIJ(0,i)); c->decrRef(); @@ -419,7 +419,7 @@ void MEDCouplingBasicsTest3::testDaDoubleSelectByTupleId1() const double arr1[14]={1.1,11.1,2.1,12.1,3.1,13.1,4.1,14.1,5.1,15.1,6.1,16.1,7.1,17.1}; std::copy(arr1,arr1+14,a->getPointer()); // - const int arr2[7]={4,2,0,6,5}; + const mcIdType arr2[7]={4,2,0,6,5}; DataArrayDouble *b=a->selectByTupleId(arr2,arr2+5); CPPUNIT_ASSERT_EQUAL(5,(int)b->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)b->getNumberOfComponents()); @@ -431,18 +431,18 @@ void MEDCouplingBasicsTest3::testDaDoubleSelectByTupleId1() b->decrRef(); a->decrRef(); // - DataArrayInt *c=DataArrayInt::New(); + DataArrayIdType *c=DataArrayIdType::New(); c->alloc(7,2); c->setInfoOnComponent(0,"toto"); c->setInfoOnComponent(1,"tata"); - const int arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; + const mcIdType arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; std::copy(arr3,arr3+14,c->getPointer()); - DataArrayInt *d=c->selectByTupleId(arr2,arr2+5); + DataArrayIdType *d=c->selectByTupleId(arr2,arr2+5); CPPUNIT_ASSERT_EQUAL(5,(int)d->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)d->getNumberOfComponents()); CPPUNIT_ASSERT(std::string(d->getInfoOnComponent(0))=="toto"); CPPUNIT_ASSERT(std::string(d->getInfoOnComponent(1))=="tata"); - const int expected2[10]={5,15,3,13,1,11,7,17,6,16}; + const mcIdType expected2[10]={5,15,3,13,1,11,7,17,6,16}; for(int i=0;i<10;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],d->getIJ(0,i)); c->decrRef(); @@ -455,16 +455,16 @@ void MEDCouplingBasicsTest3::testDaDoubleGetMinMaxValues1() a->alloc(9,1); const double arr1[9]={2.34,4.56,-6.77,4.55,4.56,2.24,2.34,1.02,4.56}; std::copy(arr1,arr1+9,a->getPointer()); - int where; + mcIdType where; double m=a->getMaxValue(where); - CPPUNIT_ASSERT_EQUAL(1,where); + CPPUNIT_ASSERT_EQUAL(ToIdType(1),where); CPPUNIT_ASSERT_DOUBLES_EQUAL(4.56,m,1e-12); - DataArrayInt *ws; + DataArrayIdType *ws; m=a->getMaxValue2(ws); CPPUNIT_ASSERT_DOUBLES_EQUAL(4.56,m,1e-12); CPPUNIT_ASSERT_EQUAL(3,(int)ws->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)ws->getNumberOfComponents()); - const int expected1[3]={1,4,8}; + const mcIdType expected1[3]={1,4,8}; for(int i=0;i<3;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],ws->getIJ(i,0)); ws->decrRef(); @@ -475,7 +475,7 @@ void MEDCouplingBasicsTest3::testDaDoubleGetMinMaxValues1() std::copy(arr2,arr2+9,a->getPointer()); where=-2; m=a->getMinValue(where); - CPPUNIT_ASSERT_EQUAL(1,where); + CPPUNIT_ASSERT_EQUAL(ToIdType(1),where); CPPUNIT_ASSERT_DOUBLES_EQUAL(-4.56,m,1e-12); m=a->getMinValue2(ws); CPPUNIT_ASSERT_DOUBLES_EQUAL(-4.56,m,1e-12); @@ -505,12 +505,12 @@ void MEDCouplingBasicsTest3::testFieldDoubleGetMinMaxValues2() f->checkConsistencyLight(); double m=f->getMaxValue(); CPPUNIT_ASSERT_DOUBLES_EQUAL(8.71,m,1e-12); - DataArrayInt *ws; + DataArrayIdType *ws; m=f->getMaxValue2(ws); CPPUNIT_ASSERT_DOUBLES_EQUAL(8.71,m,1e-12); CPPUNIT_ASSERT_EQUAL(4,(int)ws->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)ws->getNumberOfComponents()); - const int expected1[4]={0,3,7,17}; + const mcIdType expected1[4]={0,3,7,17}; for(int i=0;i<4;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],ws->getIJ(i,0)); ws->decrRef(); @@ -545,15 +545,15 @@ void MEDCouplingBasicsTest3::testBuildUnstructuredCMesh1() da->decrRef(); m->checkConsistencyLight(); double pos=2.4; - CPPUNIT_ASSERT_EQUAL(0,m->getCellContainingPoint(&pos,1e-12)); + CPPUNIT_ASSERT_EQUAL(ToIdType(0),m->getCellContainingPoint(&pos,1e-12)); pos=3.7; - CPPUNIT_ASSERT_EQUAL(1,m->getCellContainingPoint(&pos,1e-12)); + CPPUNIT_ASSERT_EQUAL(ToIdType(1),m->getCellContainingPoint(&pos,1e-12)); pos=5.9; - CPPUNIT_ASSERT_EQUAL(2,m->getCellContainingPoint(&pos,1e-12)); + CPPUNIT_ASSERT_EQUAL(ToIdType(2),m->getCellContainingPoint(&pos,1e-12)); pos=10.3; - CPPUNIT_ASSERT_EQUAL(-1,m->getCellContainingPoint(&pos,1e-12)); + CPPUNIT_ASSERT_EQUAL(ToIdType(-1),m->getCellContainingPoint(&pos,1e-12)); pos=1.3; - CPPUNIT_ASSERT_EQUAL(-1,m->getCellContainingPoint(&pos,1e-12)); + CPPUNIT_ASSERT_EQUAL(ToIdType(-1),m->getCellContainingPoint(&pos,1e-12)); // MEDCouplingUMesh *m2=m->buildUnstructured(); m2->checkConsistencyLight(); @@ -607,7 +607,7 @@ void MEDCouplingBasicsTest3::testBuildUnstructuredCMesh1() f2->decrRef(); // double pos1[3]={5.,30.,2.}; - CPPUNIT_ASSERT_EQUAL(16,m->getCellContainingPoint(pos1,1e-12)); + CPPUNIT_ASSERT_EQUAL(ToIdType(16),m->getCellContainingPoint(pos1,1e-12)); // const double pt[3]={2.4,12.7,-3.4}; m->scale(pt,3.7); @@ -622,31 +622,31 @@ void MEDCouplingBasicsTest3::testBuildUnstructuredCMesh1() void MEDCouplingBasicsTest3::testDataArrayIntInvertO2NNO21() { - const int arr1[6]={2,0,4,1,5,3}; - DataArrayInt *da=DataArrayInt::New(); + const mcIdType arr1[6]={2,0,4,1,5,3}; + DataArrayIdType *da=DataArrayIdType::New(); da->alloc(6,1); std::copy(arr1,arr1+6,da->getPointer()); - DataArrayInt *da2=da->invertArrayO2N2N2O(6); + DataArrayIdType *da2=da->invertArrayO2N2N2O(6); CPPUNIT_ASSERT_EQUAL(6,(int)da2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); - const int expected1[6]={1,3,0,5,2,4}; + const mcIdType expected1[6]={1,3,0,5,2,4}; for(int i=0;i<6;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],da2->getIJ(i,0)); - DataArrayInt *da3=da2->invertArrayN2O2O2N(6); + DataArrayIdType *da3=da2->invertArrayN2O2O2N(6); for(int i=0;i<6;i++) CPPUNIT_ASSERT_EQUAL(arr1[i],da3->getIJ(i,0)); da3->decrRef(); da2->decrRef(); da->decrRef(); // - const int arr2[10]={3,-1,5,4,-1,0,-1,1,2,-1}; - da=DataArrayInt::New(); + const mcIdType arr2[10]={3,-1,5,4,-1,0,-1,1,2,-1}; + da=DataArrayIdType::New(); da->alloc(10,1); std::copy(arr2,arr2+10,da->getPointer()); da2=da->invertArrayO2N2N2O(6); CPPUNIT_ASSERT_EQUAL(6,(int)da2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); - const int expected2[10]={5,7,8,0,3,2}; + const mcIdType expected2[10]={5,7,8,0,3,2}; for(int i=0;i<6;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],da2->getIJ(i,0)); da3=da2->invertArrayN2O2O2N(10); @@ -667,8 +667,8 @@ void MEDCouplingBasicsTest3::testKeepSetSelectedComponent1() a1->setInfoOnComponent(1,"bbbb"); a1->setInfoOnComponent(2,"cccc"); a1->setInfoOnComponent(3,"dddd"); - const int arr2[6]={1,2,1,2,0,0}; - std::vector arr2V(arr2,arr2+6); + const mcIdType arr2[6]={1,2,1,2,0,0}; + std::vector arr2V(arr2,arr2+6); DataArrayDouble *a2=static_cast(a1->keepSelectedComponents(arr2V)); CPPUNIT_ASSERT_EQUAL(6,(int)a2->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(5,(int)a2->getNumberOfTuples()); @@ -681,8 +681,8 @@ void MEDCouplingBasicsTest3::testKeepSetSelectedComponent1() const double expected1[30]={2.,3.,2.,3.,1.,1., 12.,13.,12.,13.,11.,11., 22.,23.,22.,23.,21.,21., 32.,33.,32.,33.,31.,31., 42.,43.,42.,43.,41.,41.}; for(int i=0;i<30;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],a2->getIJ(0,i),1e-14); - MCAuto a3(a1->convertToIntArr()); - DataArrayInt *a4=static_cast(a3->keepSelectedComponents(arr2V)); + MCAuto a3(a1->convertToIntArr()); + DataArrayIdType *a4=static_cast(a3->keepSelectedComponents(arr2V)); CPPUNIT_ASSERT_EQUAL(6,(int)a4->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(5,(int)a4->getNumberOfTuples()); CPPUNIT_ASSERT(std::string(a4->getInfoOnComponent(0))=="bbbb"); @@ -692,15 +692,15 @@ void MEDCouplingBasicsTest3::testKeepSetSelectedComponent1() CPPUNIT_ASSERT(std::string(a4->getInfoOnComponent(4))=="aaaa"); CPPUNIT_ASSERT(std::string(a4->getInfoOnComponent(5))=="aaaa"); for(int i=0;i<30;i++) - CPPUNIT_ASSERT_EQUAL(int(expected1[i]),a4->getIJ(0,i)); + CPPUNIT_ASSERT_EQUAL(ToIdType(expected1[i]),a4->getIJ(0,i)); // setSelectedComponents - const int arr3[2]={3,2}; - std::vector arr3V(arr3,arr3+2); + const mcIdType arr3[2]={3,2}; + std::vector arr3V(arr3,arr3+2); DataArrayDouble *a5=static_cast(a1->keepSelectedComponents(arr3V)); a5->setInfoOnComponent(0,"eeee"); a5->setInfoOnComponent(1,"ffff"); - const int arr4[2]={1,2}; - std::vector arr4V(arr4,arr4+2); + const mcIdType arr4[2]={1,2}; + std::vector arr4V(arr4,arr4+2); a2->setSelectedComponents(a5,arr4V); CPPUNIT_ASSERT_EQUAL(6,(int)a2->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(5,(int)a2->getNumberOfTuples()); @@ -713,7 +713,7 @@ void MEDCouplingBasicsTest3::testKeepSetSelectedComponent1() const double expected2[30]={2.,4.,3.,3.,1.,1., 12.,14.,13.,13.,11.,11., 22.,24.,23.,23.,21.,21., 32.,34.,33.,33.,31.,31., 42.,44.,43.,43.,41.,41.}; for(int i=0;i<30;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],a2->getIJ(0,i),1e-14); - MCAuto a6=a5->convertToIntArr(); + MCAuto a6=a5->convertToIntArr(); a6->setInfoOnComponent(0,"eeee"); a6->setInfoOnComponent(1,"ffff"); a4->setSelectedComponents(a6,arr4V); @@ -726,14 +726,14 @@ void MEDCouplingBasicsTest3::testKeepSetSelectedComponent1() CPPUNIT_ASSERT(std::string(a4->getInfoOnComponent(4))=="aaaa"); CPPUNIT_ASSERT(std::string(a4->getInfoOnComponent(5))=="aaaa"); for(int i=0;i<30;i++) - CPPUNIT_ASSERT_EQUAL(int(expected2[i]),a4->getIJ(0,i)); + CPPUNIT_ASSERT_EQUAL(expected2[i],(double)a4->getIJ(0,i)); // test of throw - const int arr5[3]={2,3,6}; - const int arr6[3]={2,7,5}; - const int arr7[4]={2,1,4,6}; - std::vector arr5V(arr5,arr5+3); - std::vector arr6V(arr6,arr6+3); - std::vector arr7V(arr7,arr7+4); + const mcIdType arr5[3]={2,3,6}; + const mcIdType arr6[3]={2,7,5}; + const mcIdType arr7[4]={2,1,4,6}; + std::vector arr5V(arr5,arr5+3); + std::vector arr6V(arr6,arr6+3); + std::vector arr7V(arr7,arr7+4); CPPUNIT_ASSERT_THROW(a2->keepSelectedComponents(arr5V),INTERP_KERNEL::Exception); CPPUNIT_ASSERT_THROW(a2->keepSelectedComponents(arr6V),INTERP_KERNEL::Exception); CPPUNIT_ASSERT_THROW(a2->setSelectedComponents(a1,arr7V),INTERP_KERNEL::Exception); @@ -764,7 +764,7 @@ void MEDCouplingBasicsTest3::testKeepSetSelectedComponent2() f1->setArray(a1); f1->checkConsistencyLight(); // - const int arr2[6]={1,2,1,2,0,0}; + const mcIdType arr2[6]={1,2,1,2,0,0}; std::vector arr2V(arr2,arr2+6); MEDCouplingFieldDouble *f2=f1->keepSelectedComponents(arr2V); CPPUNIT_ASSERT(f2->getMesh()==f1->getMesh()); @@ -786,14 +786,14 @@ void MEDCouplingBasicsTest3::testKeepSetSelectedComponent2() for(int i=0;i<30;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f2->getIJ(0,i),1e-14); //setSelectedComponents - const int arr3[2]={3,2}; + const mcIdType arr3[2]={3,2}; std::vector arr3V(arr3,arr3+2); MEDCouplingFieldDouble *f5=f1->keepSelectedComponents(arr3V); f5->setTime(6.7,8,9); f5->getArray()->setInfoOnComponent(0,"eeee"); f5->getArray()->setInfoOnComponent(1,"ffff"); f5->checkConsistencyLight(); - const int arr4[2]={1,2}; + const mcIdType arr4[2]={1,2}; std::vector arr4V(arr4,arr4+2); f2->setSelectedComponents(f5,arr4V); CPPUNIT_ASSERT_EQUAL(6,(int)f2->getNumberOfComponents()); @@ -820,7 +820,7 @@ void MEDCouplingBasicsTest3::testKeepSetSelectedComponent2() void MEDCouplingBasicsTest3::testElementaryDAThrowAndSpecialCases() { - DataArrayInt *da=DataArrayInt::New(); + DataArrayIdType *da=DataArrayIdType::New(); CPPUNIT_ASSERT_THROW(da->checkAllocated(),INTERP_KERNEL::Exception); CPPUNIT_ASSERT_THROW(da->fillWithValue(1),INTERP_KERNEL::Exception); CPPUNIT_ASSERT_THROW(da->iota(1),INTERP_KERNEL::Exception); @@ -828,7 +828,7 @@ void MEDCouplingBasicsTest3::testElementaryDAThrowAndSpecialCases() da->fillWithValue(11); //11,11,11,11... da->iota(10); //10,11,12,13... - DataArrayInt *db=DataArrayInt::New(); + DataArrayIdType *db=DataArrayIdType::New(); db->alloc(7,2); DataArrayDouble *dbl2=DataArrayDouble::New(); @@ -859,7 +859,7 @@ void MEDCouplingBasicsTest3::testElementaryDAThrowAndSpecialCases() CPPUNIT_ASSERT(!dbl->isMonotonic(false, 1.1)); CPPUNIT_ASSERT(!dbl->isMonotonic(false, -1.1)); - DataArrayInt *dc=DataArrayInt::New(); + DataArrayIdType *dc=DataArrayIdType::New(); dc->alloc(14,1); DataArrayDouble *dd=DataArrayDouble::New(); @@ -878,7 +878,7 @@ void MEDCouplingBasicsTest3::testElementaryDAThrowAndSpecialCases() CPPUNIT_ASSERT_THROW(db->copyStringInfoFrom(*da),INTERP_KERNEL::Exception); CPPUNIT_ASSERT_THROW(db->copyStringInfoFrom(*da),INTERP_KERNEL::Exception); - std::vector cIds(2,2); + std::vector cIds(2,2); CPPUNIT_ASSERT_THROW(da->copyPartOfStringInfoFrom(*db,cIds),INTERP_KERNEL::Exception); cIds[0]=1; cIds[0]=-1; @@ -919,9 +919,9 @@ void MEDCouplingBasicsTest3::testElementaryDAThrowAndSpecialCases() CPPUNIT_ASSERT_THROW(db->GetNumberOfItemGivenBES(10,9,1,"theMessageInThrow"),INTERP_KERNEL::Exception); CPPUNIT_ASSERT_THROW(db->GetNumberOfItemGivenBES(0,1,-1,"theMessageInThrow"),INTERP_KERNEL::Exception); - CPPUNIT_ASSERT_EQUAL(10,db->GetNumberOfItemGivenBES(0,10,1,"theMessageInThrow")); - CPPUNIT_ASSERT_EQUAL(5,db->GetNumberOfItemGivenBES(0,10,2,"theMessageInThrow")); - CPPUNIT_ASSERT_EQUAL(6,db->GetNumberOfItemGivenBES(0,11,2,"theMessageInThrow")); + CPPUNIT_ASSERT_EQUAL(ToIdType(10),db->GetNumberOfItemGivenBES(0,10,1,"theMessageInThrow")); + CPPUNIT_ASSERT_EQUAL(ToIdType(5),db->GetNumberOfItemGivenBES(0,10,2,"theMessageInThrow")); + CPPUNIT_ASSERT_EQUAL(ToIdType(6),db->GetNumberOfItemGivenBES(0,11,2,"theMessageInThrow")); //std::cout<<"\n!!!!!!!!!\n"<repr()<<"\n!!!!!!!!!\n"; CPPUNIT_ASSERT(!((da->repr().find("Number of components : 1"))==std::string::npos)); @@ -945,12 +945,12 @@ void MEDCouplingBasicsTest3::testElementaryDAThrowAndSpecialCases() CPPUNIT_ASSERT_THROW(dbl->meldWith(dd),INTERP_KERNEL::Exception); CPPUNIT_ASSERT_THROW(dbl->setPartOfValuesAdv(dbl2,da),INTERP_KERNEL::Exception); //dbl dbl2 not have the same number of components - CPPUNIT_ASSERT_THROW(dbl->setPartOfValuesAdv(dd,da),INTERP_KERNEL::Exception); //da tuple selector DataArrayInt instance not have exactly 2 components + CPPUNIT_ASSERT_THROW(dbl->setPartOfValuesAdv(dd,da),INTERP_KERNEL::Exception); //da tuple selector DataArrayIdType instance not have exactly 2 components DataArrayDouble *dbl3=DataArrayDouble::New(); dbl3->alloc(6,2); dbl3->fillWithValue(11.); - int tupleId; + mcIdType tupleId; //bad number of components CPPUNIT_ASSERT_THROW(dbl3->getMaxValue(tupleId),INTERP_KERNEL::Exception); CPPUNIT_ASSERT_THROW(dd->getMaxValue(tupleId),INTERP_KERNEL::Exception); @@ -1023,14 +1023,14 @@ void MEDCouplingBasicsTest3::testElementaryDAThrowAndSpecialCases() void MEDCouplingBasicsTest3::testDAIGetIdsEqual1() { - const int tab1[7]={5,-2,-4,-2,3,2,-2}; - DataArrayInt *da=DataArrayInt::New(); + const mcIdType tab1[7]={5,-2,-4,-2,3,2,-2}; + DataArrayIdType *da=DataArrayIdType::New(); da->alloc(7,1); std::copy(tab1,tab1+7,da->getPointer()); - DataArrayInt *da2=da->findIdsEqual(-2); + DataArrayIdType *da2=da->findIdsEqual(-2); CPPUNIT_ASSERT_EQUAL(3,(int)da2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); - const int expected1[3]={1,3,6}; + const mcIdType expected1[3]={1,3,6}; CPPUNIT_ASSERT(std::equal(expected1,expected1+3,da2->getConstPointer())); da2->decrRef(); da->decrRef(); @@ -1038,16 +1038,16 @@ void MEDCouplingBasicsTest3::testDAIGetIdsEqual1() void MEDCouplingBasicsTest3::testDAIGetIdsEqualList1() { - const int tab1[7]={5,-2,-4,-2,3,2,-2}; - DataArrayInt *da=DataArrayInt::New(); + const mcIdType tab1[7]={5,-2,-4,-2,3,2,-2}; + DataArrayIdType *da=DataArrayIdType::New(); da->alloc(7,1); std::copy(tab1,tab1+7,da->getPointer()); - const int tab2[3]={3,-2,0}; - std::vector tab2V(tab2,tab2+3); - DataArrayInt *da2=da->findIdsEqualList(&tab2V[0],&tab2V[0]+tab2V.size()); + const mcIdType tab2[3]={3,-2,0}; + std::vector tab2V(tab2,tab2+3); + DataArrayIdType *da2=da->findIdsEqualList(&tab2V[0],&tab2V[0]+tab2V.size()); CPPUNIT_ASSERT_EQUAL(4,(int)da2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); - const int expected1[4]={1,3,4,6}; + const mcIdType expected1[4]={1,3,4,6}; CPPUNIT_ASSERT(std::equal(expected1,expected1+4,da2->getConstPointer())); da2->decrRef(); da->decrRef(); @@ -1055,12 +1055,12 @@ void MEDCouplingBasicsTest3::testDAIGetIdsEqualList1() void MEDCouplingBasicsTest3::testDAFromNoInterlace1() { - const int tab1[15]={1,11,21,31,41,2,12,22,32,42,3,13,23,33,43}; - DataArrayInt *da=DataArrayInt::New(); + const mcIdType tab1[15]={1,11,21,31,41,2,12,22,32,42,3,13,23,33,43}; + DataArrayIdType *da=DataArrayIdType::New(); da->alloc(5,3); std::copy(tab1,tab1+15,da->getPointer()); - DataArrayInt *da2=da->fromNoInterlace(); - const int expected1[15]={1,2,3,11,12,13,21,22,23,31,32,33,41,42,43}; + DataArrayIdType *da2=da->fromNoInterlace(); + const mcIdType expected1[15]={1,2,3,11,12,13,21,22,23,31,32,33,41,42,43}; CPPUNIT_ASSERT_EQUAL(5,(int)da2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(3,(int)da2->getNumberOfComponents());// it's not a bug. Avoid to have 1 million components ! CPPUNIT_ASSERT(std::equal(expected1,expected1+15,da2->getConstPointer())); @@ -1077,12 +1077,12 @@ void MEDCouplingBasicsTest3::testDAFromNoInterlace1() void MEDCouplingBasicsTest3::testDAToNoInterlace1() { - const int tab1[15]={1,2,3,11,12,13,21,22,23,31,32,33,41,42,43}; - DataArrayInt *da=DataArrayInt::New(); + const mcIdType tab1[15]={1,2,3,11,12,13,21,22,23,31,32,33,41,42,43}; + DataArrayIdType *da=DataArrayIdType::New(); da->alloc(5,3); std::copy(tab1,tab1+15,da->getPointer()); - DataArrayInt *da2=da->toNoInterlace(); - const int expected1[15]={1,11,21,31,41,2,12,22,32,42,3,13,23,33,43}; + DataArrayIdType *da2=da->toNoInterlace(); + const mcIdType expected1[15]={1,11,21,31,41,2,12,22,32,42,3,13,23,33,43}; CPPUNIT_ASSERT_EQUAL(5,(int)da2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(3,(int)da2->getNumberOfComponents());// it's not a bug. Avoid to have 1 million components ! CPPUNIT_ASSERT(std::equal(expected1,expected1+15,da2->getConstPointer())); @@ -1099,8 +1099,8 @@ void MEDCouplingBasicsTest3::testDAToNoInterlace1() void MEDCouplingBasicsTest3::testDAIsUniform1() { - const int tab1[5]={1,1,1,1,1}; - DataArrayInt *da=DataArrayInt::New(); + const mcIdType tab1[5]={1,1,1,1,1}; + DataArrayIdType *da=DataArrayIdType::New(); da->alloc(5,1); std::copy(tab1,tab1+5,da->getPointer()); CPPUNIT_ASSERT(da->isUniform(1)); @@ -1161,8 +1161,8 @@ void MEDCouplingBasicsTest3::testDADFromSpherToCart1() void MEDCouplingBasicsTest3::testUnPolyze1() { - const int elts[8]={0,1,2,3,4,5,6,7}; - std::vector eltsV(elts,elts+8); + const mcIdType elts[8]={0,1,2,3,4,5,6,7}; + std::vector eltsV(elts,elts+8); MEDCouplingUMesh *mesh=build3DTargetMesh_1(); mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size()); mesh->unPolyze(); @@ -1208,7 +1208,7 @@ void MEDCouplingBasicsTest3::testUnPolyze1() void MEDCouplingBasicsTest3::testConvertDegeneratedCells1() { MEDCouplingUMesh *mesh=build3DTargetMesh_1(); - int conn[32]={0,1,3,3,9,10,12,12, 0,1,3,4,9,9,9,9, 1,1,1,1,10,12,9,10, 10,11,12,9,1,1,1,1}; + mcIdType conn[32]={0,1,3,3,9,10,12,12, 0,1,3,4,9,9,9,9, 1,1,1,1,10,12,9,10, 10,11,12,9,1,1,1,1}; mesh->allocateCells(4); mesh->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn); mesh->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+8); @@ -1250,24 +1250,24 @@ void MEDCouplingBasicsTest3::testGetNodeIdsNearPoints1() mesh->setCoords(tmp2); tmp2->decrRef(); const double pts[6]={0.2,0.2,0.1,0.3,-0.3,0.7}; - DataArrayInt *c=mesh->getNodeIdsNearPoint(pts,1e-7); + DataArrayIdType *c=mesh->getNodeIdsNearPoint(pts,1e-7); CPPUNIT_ASSERT_EQUAL(3,(int)c->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(4,c->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(9,c->getIJ(1,0)); - CPPUNIT_ASSERT_EQUAL(11,c->getIJ(2,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(4),c->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(9),c->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(11),c->getIJ(2,0)); c->decrRef(); - DataArrayInt *cI=0; + DataArrayIdType *cI=0; mesh->getNodeIdsNearPoints(pts,3,1e-7,c,cI); - CPPUNIT_ASSERT_EQUAL(4,(int)cI->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(4,(int)c->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(4,c->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(9,c->getIJ(1,0)); - CPPUNIT_ASSERT_EQUAL(11,c->getIJ(2,0)); - CPPUNIT_ASSERT_EQUAL(6,c->getIJ(3,0)); - CPPUNIT_ASSERT_EQUAL(0,cI->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(3,cI->getIJ(1,0)); - CPPUNIT_ASSERT_EQUAL(3,cI->getIJ(2,0)); - CPPUNIT_ASSERT_EQUAL(4,cI->getIJ(3,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(4),cI->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(4),c->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(4),c->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(9),c->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(11),c->getIJ(2,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(6),c->getIJ(3,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(0),cI->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),cI->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),cI->getIJ(2,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(4),cI->getIJ(3,0)); c->decrRef(); cI->decrRef(); mesh->decrRef(); @@ -1392,17 +1392,17 @@ void MEDCouplingBasicsTest3::testExtrudedMesh5() DataArrayDouble *h=g->fromPolarToCart(); f->setCoords(h); MEDCouplingUMesh *i=c->buildExtrudedMesh(f,1); - CPPUNIT_ASSERT_EQUAL(52,i->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(52,(int)i->getNumberOfNodes()); bool tmp2; - int tmp3; - DataArrayInt *tmp=i->mergeNodes(1e-9,tmp2,tmp3); + mcIdType tmp3; + DataArrayIdType *tmp=i->mergeNodes(1e-9,tmp2,tmp3); CPPUNIT_ASSERT(tmp2); - CPPUNIT_ASSERT_EQUAL(37,tmp3); + CPPUNIT_ASSERT_EQUAL(ToIdType(37),tmp3); tmp->decrRef(); i->convertDegeneratedCells(); i->checkConsistencyLight(); CPPUNIT_ASSERT_EQUAL(36,(int)i->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(37,i->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(37,(int)i->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(12,(int)i->getNumberOfCellsWithType(INTERP_KERNEL::NORM_TRI3)); CPPUNIT_ASSERT_EQUAL(24,(int)i->getNumberOfCellsWithType(INTERP_KERNEL::NORM_QUAD4)); const double expected1[3]={0.25,0.75,2.0625}; @@ -1504,12 +1504,12 @@ void MEDCouplingBasicsTest3::testExtrudedMesh7() DataArrayDouble *h=g->fromPolarToCart(); f->setCoords(h); MEDCouplingUMesh *i=c->buildExtrudedMesh(f,1); - CPPUNIT_ASSERT_EQUAL(52,i->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(52,(int)i->getNumberOfNodes()); bool tmp2; - int tmp3; - DataArrayInt *tmp=i->mergeNodes(1e-9,tmp2,tmp3); + mcIdType tmp3; + DataArrayIdType *tmp=i->mergeNodes(1e-9,tmp2,tmp3); CPPUNIT_ASSERT(tmp2); - CPPUNIT_ASSERT_EQUAL(37,tmp3); + CPPUNIT_ASSERT_EQUAL(ToIdType(37),tmp3); tmp->decrRef(); i->convertDegeneratedCells(); const double vec1[3]={10.,0.,0.}; @@ -1521,7 +1521,7 @@ void MEDCouplingBasicsTest3::testExtrudedMesh7() MEDCouplingFieldDouble *f2=i3->getMeasureField(true); tmp=i->mergeNodes(1e-9,tmp2,tmp3); CPPUNIT_ASSERT(tmp2); - CPPUNIT_ASSERT_EQUAL(444,tmp3); + CPPUNIT_ASSERT_EQUAL(ToIdType(444),tmp3); tmp->decrRef(); const double expected1[36]={1.327751058489274, 4.2942574094314701, 13.024068164857139, 1.3069177251569044, 4.1484240761012954, 12.297505664866796, 1.270833333332571, 3.8958333333309674, 11.039062499993179, 1.2291666666659207, 3.6041666666644425, 9.585937499993932, 1.1930822748415895, 3.3515759238941376, 8.3274943351204556, 1.1722489415082769, 3.2057425905609289, 7.6009318351210622, 1.1722489415082862, 3.2057425905609884, 7.6009318351213713, 1.1930822748416161, 3.3515759238943001, 8.3274943351212727, 1.2291666666659564, 3.6041666666646734, 9.5859374999950777, 1.2708333333326081, 3.8958333333311868, 11.039062499994293, 1.3069177251569224, 4.1484240761014384, 12.297505664867627, 1.3277510584902354, 4.2942574094346071, 13.024068164866796}; int kk=0; @@ -1546,13 +1546,13 @@ void MEDCouplingBasicsTest3::testExtrudedMesh7() void MEDCouplingBasicsTest3::testSimplexize1() { MEDCouplingUMesh *m=build3DSurfTargetMesh_1(); - std::vector v(1); + std::vector v(1); v[0]=3; m->convertToPolyTypes(&v[0],&v[0]+v.size()); - DataArrayInt *da=m->simplexize(0); + DataArrayIdType *da=m->simplexize(0); CPPUNIT_ASSERT_EQUAL(7,(int)da->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da->getNumberOfComponents()); - const int expected2[7]={0,0,1,2,3,4,4}; + const mcIdType expected2[7]={0,0,1,2,3,4,4}; for(int i=0;i<7;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],da->getIJ(i,0)); m->checkConsistencyLight(); @@ -1608,7 +1608,7 @@ void MEDCouplingBasicsTest3::testSimplexize1() void MEDCouplingBasicsTest3::testSimplexize2() { MEDCouplingUMesh *m=build3DSurfTargetMesh_1(); - std::vector v(1); + std::vector v(1); v[0]=3; m->convertToPolyTypes(&v[0],&v[0]+v.size()); MEDCouplingFieldDouble *f1=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME); @@ -1665,8 +1665,8 @@ void MEDCouplingBasicsTest3::testDAMeld1() for(int i=0;i<35;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],da1->getIJ(0,i),1e-10); // - MCAuto dai1=da1C->convertToIntArr(); - MCAuto dai3=da3->convertToIntArr(); + MCAuto dai1=da1C->convertToIntArr(); + MCAuto dai3=da3->convertToIntArr(); dai1->meldWith(dai3); CPPUNIT_ASSERT_EQUAL(5,(int)dai1->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(7,(int)dai1->getNumberOfTuples()); @@ -1676,7 +1676,7 @@ void MEDCouplingBasicsTest3::testDAMeld1() CPPUNIT_ASSERT(dai1->getInfoOnComponent(3)=="c1da3"); CPPUNIT_ASSERT(dai1->getInfoOnComponent(4)=="c2da3"); for(int i=0;i<35;i++) - CPPUNIT_ASSERT_EQUAL((int)expected1[i],dai1->getIJ(0,i)); + CPPUNIT_ASSERT_EQUAL(ToIdType(expected1[i]),dai1->getIJ(0,i)); // test of static method DataArrayDouble::meld DataArrayDouble *da4=DataArrayDouble::Meld(da1C,da3); CPPUNIT_ASSERT_EQUAL(5,(int)da4->getNumberOfComponents()); @@ -1688,9 +1688,9 @@ void MEDCouplingBasicsTest3::testDAMeld1() CPPUNIT_ASSERT(da4->getInfoOnComponent(4)=="c2da3"); for(int i=0;i<35;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],da4->getIJ(0,i),1e-10); - // test of static method DataArrayInt::meld + // test of static method DataArrayIdType::meld dai1=da1C->convertToIntArr(); - DataArrayInt *dai4=DataArrayInt::Meld(dai1,dai3); + DataArrayIdType *dai4=DataArrayIdType::Meld(dai1,dai3); CPPUNIT_ASSERT_EQUAL(5,(int)dai4->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(7,(int)dai4->getNumberOfTuples()); CPPUNIT_ASSERT(dai4->getInfoOnComponent(0)=="c0da1"); @@ -1699,7 +1699,7 @@ void MEDCouplingBasicsTest3::testDAMeld1() CPPUNIT_ASSERT(dai4->getInfoOnComponent(3)=="c1da3"); CPPUNIT_ASSERT(dai4->getInfoOnComponent(4)=="c2da3"); for(int i=0;i<35;i++) - CPPUNIT_ASSERT_EQUAL((int)expected1[i],dai4->getIJ(0,i)); + CPPUNIT_ASSERT_EQUAL(expected1[i],(double)dai4->getIJ(0,i)); // dai4->decrRef(); da4->decrRef(); @@ -1781,9 +1781,9 @@ void MEDCouplingBasicsTest3::testMergeNodes2() tmp[1]=m2; MEDCouplingUMesh *m3=MEDCouplingUMesh::MergeUMeshes(tmp); bool b; - int newNbOfNodes; - DataArrayInt *da=m3->mergeNodesCenter(0.01,b,newNbOfNodes); - CPPUNIT_ASSERT_EQUAL(9,m3->getNumberOfNodes()); + mcIdType newNbOfNodes; + DataArrayIdType *da=m3->mergeNodesCenter(0.01,b,newNbOfNodes); + CPPUNIT_ASSERT_EQUAL(9,(int)m3->getNumberOfNodes()); const double expected1[18]={-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(int i=0;i<18;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],m3->getCoords()->getIJ(0,i),1e-13); @@ -1836,14 +1836,14 @@ void MEDCouplingBasicsTest3::testMergeField2() void MEDCouplingBasicsTest3::testDAIBuildComplement1() { - DataArrayInt *a=DataArrayInt::New(); - const int tab[4]={3,1,7,8}; + DataArrayIdType *a=DataArrayIdType::New(); + const mcIdType tab[4]={3,1,7,8}; a->alloc(4,1); std::copy(tab,tab+4,a->getPointer()); - DataArrayInt *b=a->buildComplement(12); + DataArrayIdType *b=a->buildComplement(12); CPPUNIT_ASSERT_EQUAL(8,(int)b->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)b->getNumberOfComponents()); - const int expected1[8]={0,2,4,5,6,9,10,11}; + const mcIdType expected1[8]={0,2,4,5,6,9,10,11}; for(int i=0;i<8;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],b->getIJ(0,i)); b->decrRef(); @@ -1852,18 +1852,18 @@ void MEDCouplingBasicsTest3::testDAIBuildComplement1() void MEDCouplingBasicsTest3::testDAIBuildUnion1() { - DataArrayInt *a=DataArrayInt::New(); - const int tab1[4]={3,1,7,8}; + DataArrayIdType *a=DataArrayIdType::New(); + const mcIdType tab1[4]={3,1,7,8}; a->alloc(4,1); std::copy(tab1,tab1+4,a->getPointer()); - DataArrayInt *c=DataArrayInt::New(); - const int tab2[5]={5,3,0,18,8}; + DataArrayIdType *c=DataArrayIdType::New(); + const mcIdType tab2[5]={5,3,0,18,8}; c->alloc(5,1); std::copy(tab2,tab2+5,c->getPointer()); - DataArrayInt *b=a->buildUnion(c); + DataArrayIdType *b=a->buildUnion(c); CPPUNIT_ASSERT_EQUAL(7,(int)b->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)b->getNumberOfComponents()); - const int expected1[7]={0,1,3,5,7,8,18}; + const mcIdType expected1[7]={0,1,3,5,7,8,18}; for(int i=0;i<7;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],b->getIJ(0,i)); c->decrRef(); @@ -1873,18 +1873,18 @@ void MEDCouplingBasicsTest3::testDAIBuildUnion1() void MEDCouplingBasicsTest3::testDAIBuildIntersection1() { - DataArrayInt *a=DataArrayInt::New(); - const int tab1[4]={3,1,7,8}; + DataArrayIdType *a=DataArrayIdType::New(); + const mcIdType tab1[4]={3,1,7,8}; a->alloc(4,1); std::copy(tab1,tab1+4,a->getPointer()); - DataArrayInt *c=DataArrayInt::New(); - const int tab2[5]={5,3,0,18,8}; + DataArrayIdType *c=DataArrayIdType::New(); + const mcIdType tab2[5]={5,3,0,18,8}; c->alloc(5,1); std::copy(tab2,tab2+5,c->getPointer()); - DataArrayInt *b=a->buildIntersection(c); + DataArrayIdType *b=a->buildIntersection(c); CPPUNIT_ASSERT_EQUAL(2,(int)b->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)b->getNumberOfComponents()); - const int expected1[2]={3,8}; + const mcIdType expected1[2]={3,8}; for(int i=0;i<2;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],b->getIJ(0,i)); c->decrRef(); @@ -1894,14 +1894,14 @@ void MEDCouplingBasicsTest3::testDAIBuildIntersection1() void MEDCouplingBasicsTest3::testDAIDeltaShiftIndex1() { - DataArrayInt *a=DataArrayInt::New(); - const int tab[7]={1,3,6,7,7,9,15}; + DataArrayIdType *a=DataArrayIdType::New(); + const mcIdType tab[7]={1,3,6,7,7,9,15}; a->alloc(7,1); std::copy(tab,tab+7,a->getPointer()); - DataArrayInt *b=a->deltaShiftIndex(); + DataArrayIdType *b=a->deltaShiftIndex(); CPPUNIT_ASSERT_EQUAL(6,(int)b->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)b->getNumberOfComponents()); - const int expected1[6]={2,3,1,0,2,6}; + const mcIdType expected1[6]={2,3,1,0,2,6}; for(int i=0;i<6;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],b->getIJ(0,i)); b->decrRef(); @@ -1917,7 +1917,7 @@ void MEDCouplingBasicsTest3::testDaDoubleSelectByTupleIdSafe1() const double arr1[14]={1.1,11.1,2.1,12.1,3.1,13.1,4.1,14.1,5.1,15.1,6.1,16.1,7.1,17.1}; std::copy(arr1,arr1+14,a->getPointer()); // - const int arr2[7]={4,2,0,6,5}; + const mcIdType arr2[7]={4,2,0,6,5}; DataArrayDouble *b=a->selectByTupleIdSafe(arr2,arr2+5); CPPUNIT_ASSERT_EQUAL(5,(int)b->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)b->getNumberOfComponents()); @@ -1926,25 +1926,25 @@ void MEDCouplingBasicsTest3::testDaDoubleSelectByTupleIdSafe1() const double expected1[10]={5.1,15.1,3.1,13.1,1.1,11.1,7.1,17.1,6.1,16.1}; for(int i=0;i<10;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],b->getIJ(0,i),1e-14); - const int arr4[5]={4,-1,0,6,5}; + const mcIdType arr4[5]={4,-1,0,6,5}; CPPUNIT_ASSERT_THROW(a->selectByTupleIdSafe(arr4,arr4+5),INTERP_KERNEL::Exception); - const int arr5[5]={4,2,0,6,7}; + const mcIdType arr5[5]={4,2,0,6,7}; CPPUNIT_ASSERT_THROW(a->selectByTupleIdSafe(arr5,arr5+5),INTERP_KERNEL::Exception); b->decrRef(); a->decrRef(); // - DataArrayInt *c=DataArrayInt::New(); + DataArrayIdType *c=DataArrayIdType::New(); c->alloc(7,2); c->setInfoOnComponent(0,"toto"); c->setInfoOnComponent(1,"tata"); - const int arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; + const mcIdType arr3[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; std::copy(arr3,arr3+14,c->getPointer()); - DataArrayInt *d=c->selectByTupleIdSafe(arr2,arr2+5); + DataArrayIdType *d=c->selectByTupleIdSafe(arr2,arr2+5); CPPUNIT_ASSERT_EQUAL(5,(int)d->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)d->getNumberOfComponents()); CPPUNIT_ASSERT(std::string(d->getInfoOnComponent(0))=="toto"); CPPUNIT_ASSERT(std::string(d->getInfoOnComponent(1))=="tata"); - const int expected2[10]={5,15,3,13,1,11,7,17,6,16}; + const mcIdType expected2[10]={5,15,3,13,1,11,7,17,6,16}; for(int i=0;i<10;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],d->getIJ(0,i)); CPPUNIT_ASSERT_THROW(c->selectByTupleIdSafe(arr4,arr4+5),INTERP_KERNEL::Exception); @@ -1956,9 +1956,9 @@ void MEDCouplingBasicsTest3::testDaDoubleSelectByTupleIdSafe1() void MEDCouplingBasicsTest3::testAreCellsIncludedIn1() { MEDCouplingUMesh *m=build3DSurfTargetMesh_1(); - const int pt[2]={1,3}; + const mcIdType pt[2]={1,3}; MEDCouplingUMesh *m2=(MEDCouplingUMesh *)m->buildPartOfMySelf(pt,pt+2,true); - DataArrayInt *tmp; + DataArrayIdType *tmp; CPPUNIT_ASSERT(m->areCellsIncludedIn(m2,0,tmp)); CPPUNIT_ASSERT_EQUAL(2,(int)tmp->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)tmp->getNumberOfComponents()); @@ -1973,19 +1973,19 @@ void MEDCouplingBasicsTest3::testAreCellsIncludedIn1() void MEDCouplingBasicsTest3::testDAIBuildSubstraction1() { - DataArrayInt *a=DataArrayInt::New(); - const int aa[]={2,3,6,8,9}; + DataArrayIdType *a=DataArrayIdType::New(); + const mcIdType aa[]={2,3,6,8,9}; a->alloc(5,1); std::copy(aa,aa+5,a->getPointer()); - DataArrayInt *b=DataArrayInt::New(); - const int bb[]={1,3,5,9,11}; + DataArrayIdType *b=DataArrayIdType::New(); + const mcIdType bb[]={1,3,5,9,11}; b->alloc(5,1); std::copy(bb,bb+5,b->getPointer()); // - DataArrayInt *c=a->buildSubstraction(b); + DataArrayIdType *c=a->buildSubstraction(b); CPPUNIT_ASSERT_EQUAL(3,(int)c->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)c->getNumberOfComponents()); - const int expected1[3]={2,6,8}; + const mcIdType expected1[3]={2,6,8}; CPPUNIT_ASSERT(std::equal(expected1,expected1+3,c->getConstPointer())); // c->decrRef(); @@ -1996,10 +1996,10 @@ void MEDCouplingBasicsTest3::testDAIBuildSubstraction1() void MEDCouplingBasicsTest3::testBuildOrthogonalField2() { MEDCouplingUMesh *m=build2DTargetMesh_1(); - DataArrayInt *d1=DataArrayInt::New(); - DataArrayInt *d2=DataArrayInt::New(); - DataArrayInt *d3=DataArrayInt::New(); - DataArrayInt *d4=DataArrayInt::New(); + DataArrayIdType *d1=DataArrayIdType::New(); + DataArrayIdType *d2=DataArrayIdType::New(); + DataArrayIdType *d3=DataArrayIdType::New(); + DataArrayIdType *d4=DataArrayIdType::New(); MEDCouplingUMesh *m1=m->buildDescendingConnectivity(d1,d2,d3,d4); // MEDCouplingFieldDouble *f1=m1->buildOrthogonalField(); @@ -2023,7 +2023,7 @@ void MEDCouplingBasicsTest3::testBuildOrthogonalField2() void MEDCouplingBasicsTest3::testUMInsertNextCell1() { double targetCoords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 }; - int targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + mcIdType targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->allocateCells(5); CPPUNIT_ASSERT_THROW(targetMesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn),INTERP_KERNEL::Exception); @@ -2049,10 +2049,10 @@ void MEDCouplingBasicsTest3::testUMInsertNextCell1() void MEDCouplingBasicsTest3::testFieldOperatorDivDiffComp1() { MEDCouplingUMesh *m=build2DTargetMesh_1(); - DataArrayInt *d1=DataArrayInt::New(); - DataArrayInt *d2=DataArrayInt::New(); - DataArrayInt *d3=DataArrayInt::New(); - DataArrayInt *d4=DataArrayInt::New(); + DataArrayIdType *d1=DataArrayIdType::New(); + DataArrayIdType *d2=DataArrayIdType::New(); + DataArrayIdType *d3=DataArrayIdType::New(); + DataArrayIdType *d4=DataArrayIdType::New(); MEDCouplingUMesh *m1=m->buildDescendingConnectivity(d1,d2,d3,d4); // MEDCouplingFieldDouble *f1=m1->buildOrthogonalField(); @@ -2089,58 +2089,58 @@ void MEDCouplingBasicsTest3::testFieldOperatorDivDiffComp1() void MEDCouplingBasicsTest3::testDARearrange1() { - DataArrayInt *da1=DataArrayInt::New(); + DataArrayIdType *da1=DataArrayIdType::New(); da1->alloc(12,1); da1->iota(0); - const int *ptr=da1->getConstPointer(); + const mcIdType *ptr=da1->getConstPointer(); // - CPPUNIT_ASSERT_EQUAL((std::size_t)12,da1->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(12),da1->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(1,(int)da1->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(12,(int)da1->getNumberOfTuples()); da1->rearrange(4); CPPUNIT_ASSERT(ptr==da1->getConstPointer()); - CPPUNIT_ASSERT_EQUAL((std::size_t)12,da1->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(12),da1->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(4,(int)da1->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(3,(int)da1->getNumberOfTuples()); - for(int i=0;i<12;i++) + for(mcIdType i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(i,da1->getIJ(0,i)); // da1->rearrange(6); CPPUNIT_ASSERT(ptr==da1->getConstPointer()); - CPPUNIT_ASSERT_EQUAL((std::size_t)12,da1->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(12),da1->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(6,(int)da1->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(2,(int)da1->getNumberOfTuples()); - for(int i=0;i<12;i++) + for(mcIdType i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(i,da1->getIJ(0,i)); // CPPUNIT_ASSERT_THROW(da1->rearrange(7),INTERP_KERNEL::Exception); // da1->rearrange(12); CPPUNIT_ASSERT(ptr==da1->getConstPointer()); - CPPUNIT_ASSERT_EQUAL((std::size_t)12,da1->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(12),da1->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(12,(int)da1->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(1,(int)da1->getNumberOfTuples()); - for(int i=0;i<12;i++) + for(mcIdType i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(i,da1->getIJ(0,i)); // da1->rearrange(3); CPPUNIT_ASSERT(ptr==da1->getConstPointer()); - CPPUNIT_ASSERT_EQUAL((std::size_t)12,da1->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(12),da1->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(3,(int)da1->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(4,(int)da1->getNumberOfTuples()); - for(int i=0;i<12;i++) + for(mcIdType i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(i,da1->getIJ(0,i)); //double MCAuto da2=da1->convertToDblArr(); da1->decrRef(); const double *ptr2=da2->getConstPointer(); // - CPPUNIT_ASSERT_EQUAL((std::size_t)12,da2->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(12),da2->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(3,(int)da2->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(4,(int)da2->getNumberOfTuples()); da2->rearrange(4); CPPUNIT_ASSERT(ptr2==da2->getConstPointer()); - CPPUNIT_ASSERT_EQUAL((std::size_t)12,da2->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(12),da2->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(4,(int)da2->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(3,(int)da2->getNumberOfTuples()); for(int i=0;i<12;i++) @@ -2148,7 +2148,7 @@ void MEDCouplingBasicsTest3::testDARearrange1() // da2->rearrange(6); CPPUNIT_ASSERT(ptr2==da2->getConstPointer()); - CPPUNIT_ASSERT_EQUAL((std::size_t)12,da2->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(12),da2->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(6,(int)da2->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(2,(int)da2->getNumberOfTuples()); for(int i=0;i<12;i++) @@ -2158,7 +2158,7 @@ void MEDCouplingBasicsTest3::testDARearrange1() // da2->rearrange(1); CPPUNIT_ASSERT(ptr2==da2->getConstPointer()); - CPPUNIT_ASSERT_EQUAL((std::size_t)12,da2->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(12),da2->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(12,(int)da2->getNumberOfTuples()); for(int i=0;i<12;i++) @@ -2166,7 +2166,7 @@ void MEDCouplingBasicsTest3::testDARearrange1() // da2->rearrange(3); CPPUNIT_ASSERT(ptr2==da2->getConstPointer()); - CPPUNIT_ASSERT_EQUAL((std::size_t)12,da2->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(12),da2->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(3,(int)da2->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(4,(int)da2->getNumberOfTuples()); for(int i=0;i<12;i++) @@ -2175,12 +2175,12 @@ void MEDCouplingBasicsTest3::testDARearrange1() void MEDCouplingBasicsTest3::testGetDifferentValues1() { - DataArrayInt *da1=DataArrayInt::New(); - const int arr[12]={1,2,3,2,2,3,5,1,5,5,2,2}; + DataArrayIdType *da1=DataArrayIdType::New(); + const mcIdType arr[12]={1,2,3,2,2,3,5,1,5,5,2,2}; da1->alloc(4,3); std::copy(arr,arr+12,da1->getPointer()); - DataArrayInt *s=da1->getDifferentValues(); - const int expected1[4]={1,2,3,5}; + DataArrayIdType *s=da1->getDifferentValues(); + const mcIdType expected1[4]={1,2,3,5}; CPPUNIT_ASSERT_EQUAL(4,(int)s->getNumberOfTuples()); CPPUNIT_ASSERT(std::equal(expected1,expected1+4,s->begin())); da1->decrRef(); @@ -2189,16 +2189,16 @@ void MEDCouplingBasicsTest3::testGetDifferentValues1() void MEDCouplingBasicsTest3::testDAIBuildPermutationArr1() { - DataArrayInt *a=DataArrayInt::New(); - const int vala[5]={4,5,6,7,8}; + DataArrayIdType *a=DataArrayIdType::New(); + const mcIdType vala[5]={4,5,6,7,8}; a->alloc(5,1); std::copy(vala,vala+5,a->getPointer()); - DataArrayInt *b=DataArrayInt::New(); - const int valb[5]={5,4,8,6,7}; + DataArrayIdType *b=DataArrayIdType::New(); + const mcIdType valb[5]={5,4,8,6,7}; b->alloc(5,1); std::copy(valb,valb+5,b->getPointer()); - DataArrayInt *c=a->buildPermutationArr(*b); - const int expect1[5]={1,0,4,2,3}; + DataArrayIdType *c=a->buildPermutationArr(*b); + const mcIdType expect1[5]={1,0,4,2,3}; CPPUNIT_ASSERT_EQUAL(5,(int)c->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)c->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(expect1,expect1+5,c->getConstPointer())); @@ -2212,11 +2212,11 @@ void MEDCouplingBasicsTest3::testDAIBuildPermutationArr1() CPPUNIT_ASSERT(a->isEqualWithoutConsideringStrAndOrder(*b)); c->decrRef(); c=a->buildPermutationArr(*b); - const int expect2[5]={1,3,4,2,3}; + const mcIdType expect2[5]={1,3,4,2,3}; CPPUNIT_ASSERT(std::equal(expect2,expect2+5,c->getConstPointer())); MCAuto d=b->convertToDblArr(); b->sort(); - const int expect3[5]={4,4,5,6,8}; + const mcIdType expect3[5]={4,4,5,6,8}; CPPUNIT_ASSERT(std::equal(expect3,expect3+5,b->getConstPointer())); d->sort(); CPPUNIT_ASSERT_EQUAL(5,(int)d->getNumberOfTuples()); @@ -2238,7 +2238,7 @@ void MEDCouplingBasicsTest3::testAreCellsIncludedIn2() CPPUNIT_ASSERT_EQUAL(3,m2->getSpaceDimension()); CPPUNIT_ASSERT_EQUAL(2,m2->getMeshDimension()); m2->setName(myName); - DataArrayInt *tmp; + DataArrayIdType *tmp; CPPUNIT_ASSERT(m->areCellsIncludedIn(m2,0,tmp)); CPPUNIT_ASSERT(std::string(myName)==tmp->getName()); CPPUNIT_ASSERT_EQUAL(0,(int)tmp->getNumberOfTuples()); @@ -2251,7 +2251,7 @@ void MEDCouplingBasicsTest3::testAreCellsIncludedIn2() void MEDCouplingBasicsTest3::testUMeshGetPartBarycenterAndOwner1() { MEDCouplingUMesh *m1=build2DTargetMesh_1(); - const int part[3]={1,0,4}; + const mcIdType part[3]={1,0,4}; DataArrayDouble *b=m1->getPartBarycenterAndOwner(part,part+3); CPPUNIT_ASSERT_EQUAL(2,(int)b->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(3,(int)b->getNumberOfTuples()); @@ -2265,7 +2265,7 @@ void MEDCouplingBasicsTest3::testUMeshGetPartBarycenterAndOwner1() void MEDCouplingBasicsTest3::testUMeshGetPartMeasureField1() { MEDCouplingUMesh *m1=build2DTargetMesh_1(); - const int part[3]={1,0,4}; + const mcIdType part[3]={1,0,4}; DataArrayDouble *b=m1->getPartMeasureField(true,part,part+3); CPPUNIT_ASSERT_EQUAL(1,(int)b->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(3,(int)b->getNumberOfTuples()); @@ -2280,7 +2280,7 @@ void MEDCouplingBasicsTest3::testUMeshBuildPartOrthogonalField1() { MEDCouplingUMesh *m1=build2DTargetMesh_1(); m1->changeSpaceDimension(3); - const int part[3]={1,0,4}; + const mcIdType part[3]={1,0,4}; MEDCouplingFieldDouble *b=m1->buildPartOrthogonalField(part,part+3); CPPUNIT_ASSERT_EQUAL(3,(int)b->getArray()->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(3,(int)b->getArray()->getNumberOfTuples()); @@ -2294,16 +2294,16 @@ void MEDCouplingBasicsTest3::testUMeshBuildPartOrthogonalField1() void MEDCouplingBasicsTest3::testUMeshGetTypesOfPart1() { MEDCouplingUMesh *m1=build2DTargetMesh_1(); - const int part1[]={0,3,4}; + const mcIdType part1[]={0,3,4}; std::set s; s=m1->getTypesOfPart(part1,part1+3); CPPUNIT_ASSERT(s.size()==1); CPPUNIT_ASSERT(*s.begin()==INTERP_KERNEL::NORM_QUAD4); - const int part2[]={2,2,2,1}; + const mcIdType part2[]={2,2,2,1}; s=m1->getTypesOfPart(part2,part2+4); CPPUNIT_ASSERT(s.size()==1); CPPUNIT_ASSERT(*s.begin()==INTERP_KERNEL::NORM_TRI3); - const int part3[]={3,2,1}; + const mcIdType part3[]={3,2,1}; s=m1->getTypesOfPart(part3,part3+3); CPPUNIT_ASSERT(s.size()==2); CPPUNIT_ASSERT(*s.begin()==INTERP_KERNEL::NORM_TRI3); @@ -2314,26 +2314,26 @@ void MEDCouplingBasicsTest3::testUMeshGetTypesOfPart1() void MEDCouplingBasicsTest3::testUMeshKeepCellIdsByType1() { MEDCouplingUMesh *m1=build2DTargetMesh_1(); - const int part1[3]={0,3,4}; - DataArrayInt *a=m1->keepCellIdsByType(INTERP_KERNEL::NORM_TRI3,part1,part1+3); + const mcIdType part1[3]={0,3,4}; + DataArrayIdType *a=m1->keepCellIdsByType(INTERP_KERNEL::NORM_TRI3,part1,part1+3); CPPUNIT_ASSERT_EQUAL(1,(int)a->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(0,(int)a->getNumberOfTuples()); a->decrRef(); // - const int part2[5]={3,2,0,2,4}; + const mcIdType part2[5]={3,2,0,2,4}; a=m1->keepCellIdsByType(INTERP_KERNEL::NORM_TRI3,part2,part2+5); CPPUNIT_ASSERT_EQUAL(1,(int)a->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(2,(int)a->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(2,a->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(2,a->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(2,(int)a->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(2,(int)a->getIJ(1,0)); a->decrRef(); // a=m1->keepCellIdsByType(INTERP_KERNEL::NORM_QUAD4,part2,part2+5); CPPUNIT_ASSERT_EQUAL(1,(int)a->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(3,(int)a->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(3,a->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(0,a->getIJ(1,0)); - CPPUNIT_ASSERT_EQUAL(4,a->getIJ(2,0)); + CPPUNIT_ASSERT_EQUAL(3,(int)a->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(0,(int)a->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(4,(int)a->getIJ(2,0)); // a->decrRef(); m1->decrRef(); @@ -2341,24 +2341,24 @@ void MEDCouplingBasicsTest3::testUMeshKeepCellIdsByType1() void MEDCouplingBasicsTest3::testDAIAggregateMulti1() { - DataArrayInt *a=DataArrayInt::New(); + DataArrayIdType *a=DataArrayIdType::New(); a->setName("aa"); a->alloc(4,1); a->iota(0); a->rearrange(2); - DataArrayInt *b=DataArrayInt::New(); + DataArrayIdType *b=DataArrayIdType::New(); b->setName("bb"); b->alloc(6,1); b->iota(0); b->rearrange(2); // - std::vector v(2); + std::vector v(2); v[0]=a; v[1]=b; - DataArrayInt *c=DataArrayInt::Aggregate(v); + DataArrayIdType *c=DataArrayIdType::Aggregate(v); CPPUNIT_ASSERT_EQUAL(5,(int)c->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)c->getNumberOfComponents()); CPPUNIT_ASSERT(c->getName()=="aa"); - const int expect1[10]={0,1,2,3,0,1,2,3,4,5}; + const mcIdType expect1[10]={0,1,2,3,0,1,2,3,4,5}; for(int i=0;i<10;i++) CPPUNIT_ASSERT_EQUAL(expect1[i],c->getIJ(0,i)); // @@ -2373,9 +2373,9 @@ void MEDCouplingBasicsTest3::testMergeUMeshes2() MEDCouplingUMesh *m2=build3DSurfTargetMesh_1(); MEDCouplingUMesh *m3=build3DSurfTargetMesh_1(); // - const int vec1[3]={0,2,3}; + const mcIdType vec1[3]={0,2,3}; MEDCouplingUMesh *m2_2=(MEDCouplingUMesh *)m2->buildPartOfMySelf(vec1,vec1+3,false); - const int vec2[2]={1,1}; + const mcIdType vec2[2]={1,1}; MEDCouplingUMesh *m3_2=(MEDCouplingUMesh *)m3->buildPartOfMySelf(vec2,vec2+2,false); // std::vector ms(3); @@ -2386,32 +2386,32 @@ void MEDCouplingBasicsTest3::testMergeUMeshes2() MEDCouplingUMesh *m4=MEDCouplingUMesh::MergeUMeshes(ms); m4->checkConsistencyLight(); CPPUNIT_ASSERT_EQUAL(10,(int)m4->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(20,m4->getNumberOfNodes()); - CPPUNIT_ASSERT_EQUAL(45,m4->getNodalConnectivityArrayLen()); + CPPUNIT_ASSERT_EQUAL(20,(int)m4->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(45,(int)m4->getNodalConnectivityArrayLen()); // MEDCouplingMesh *m4bis=MEDCouplingMesh::MergeMeshes(ms2); CPPUNIT_ASSERT(m4->isEqual(m4bis,1e-12)); m4bis->decrRef(); // - const int vec3[5]={0,1,2,3,4}; + const mcIdType vec3[5]={0,1,2,3,4}; MEDCouplingUMesh *m4_1=(MEDCouplingUMesh *)m4->buildPartOfMySelf(vec3,vec3+5,false); m4_1->setName(m1->getName().c_str()); CPPUNIT_ASSERT(m4_1->isEqual(m1,1e-12)); m4_1->decrRef(); // - const int vec4[3]={5,6,7}; + const mcIdType vec4[3]={5,6,7}; MEDCouplingUMesh *m4_2=(MEDCouplingUMesh *)m4->buildPartOfMySelf(vec4,vec4+3,false); - DataArrayInt *cellCor=0; - DataArrayInt *nodeCor=0; + DataArrayIdType *cellCor=0; + DataArrayIdType *nodeCor=0; m4_2->checkGeoEquivalWith(m2_2,10,1e-12,cellCor,nodeCor); CPPUNIT_ASSERT(cellCor==0); CPPUNIT_ASSERT(nodeCor==0); m4_2->decrRef(); // - const int vec5[2]={8,9}; + const mcIdType vec5[2]={8,9}; MEDCouplingUMesh *m4_3=(MEDCouplingUMesh *)m4->buildPartOfMySelf(vec5,vec5+2,false); CPPUNIT_ASSERT_EQUAL(2,(int)m4_3->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(3,m4_3->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(3,(int)m4_3->getNumberOfNodes()); m3_2->zipCoords(); m4_3->setName(m3_2->getName().c_str()); CPPUNIT_ASSERT(m4_3->isEqual(m3_2,1e-12)); @@ -2434,7 +2434,7 @@ void MEDCouplingBasicsTest3::testBuild0DMeshFromCoords1() std::copy(sourceCoords,sourceCoords+12,coo->getPointer()); MEDCouplingUMesh *m=MEDCouplingUMesh::Build0DMeshFromCoords(coo); m->checkConsistencyLight(); - CPPUNIT_ASSERT_EQUAL(4,m->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(4,(int)m->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(4,(int)m->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(3,m->getSpaceDimension()); CPPUNIT_ASSERT_EQUAL(0,m->getMeshDimension()); @@ -2443,10 +2443,10 @@ void MEDCouplingBasicsTest3::testBuild0DMeshFromCoords1() CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_POINT1,*types.begin()); for(int i=0;i<4;i++) { - std::vector conn; + std::vector conn; m->getNodeIdsOfCell(i,conn); CPPUNIT_ASSERT_EQUAL(1,(int)conn.size()); - CPPUNIT_ASSERT_EQUAL(i,conn[0]); + CPPUNIT_ASSERT_EQUAL(i,(int)conn[0]); CPPUNIT_ASSERT(INTERP_KERNEL::NORM_POINT1==m->getTypeOfCell(i)); } CPPUNIT_ASSERT(std::string(m->getName())=="My0D"); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx index 743fef5d5..126a949e8 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx @@ -160,30 +160,30 @@ void MEDCouplingBasicsTest4::testFieldOverTime1() void MEDCouplingBasicsTest4::testDAICheckAndPreparePermutation1() { - const int vals1[]={9,10,0,6,4,11,3,7}; - const int expect1[]={5,6,0,3,2,7,1,4}; - const int vals2[]={9,10,0,6,10,11,3,7}; - DataArrayInt *da=DataArrayInt::New(); + const mcIdType vals1[]={9,10,0,6,4,11,3,7}; + const mcIdType expect1[]={5,6,0,3,2,7,1,4}; + const mcIdType vals2[]={9,10,0,6,10,11,3,7}; + DataArrayIdType *da=DataArrayIdType::New(); da->alloc(8,1); std::copy(vals1,vals1+8,da->getPointer()); - DataArrayInt *da2=da->checkAndPreparePermutation(); - CPPUNIT_ASSERT_EQUAL(8,(int)da2->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); + DataArrayIdType *da2=da->checkAndPreparePermutation(); + CPPUNIT_ASSERT_EQUAL(8,(int)da2->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); for(int i=0;i<8;i++) CPPUNIT_ASSERT_EQUAL(expect1[i],da2->getIJ(i,0)); da2->decrRef(); da->decrRef(); // - da=DataArrayInt::New(); + da=DataArrayIdType::New(); da->alloc(8,1); da->iota(0); da2=da->checkAndPreparePermutation(); - CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); CPPUNIT_ASSERT(da2->isIota(8)); da2->decrRef(); da->decrRef(); // - da=DataArrayInt::New(); + da=DataArrayIdType::New(); da->alloc(8,1); std::copy(vals2,vals2+8,da->getPointer()); CPPUNIT_ASSERT_THROW(da->checkAndPreparePermutation(),INTERP_KERNEL::Exception); @@ -192,14 +192,14 @@ void MEDCouplingBasicsTest4::testDAICheckAndPreparePermutation1() void MEDCouplingBasicsTest4::testDAIChangeSurjectiveFormat1() { - const int vals1[8]={0,3,2,3,2,2,1,2}; - const int expected1[5]={0,1,2,6,8}; - const int expected2[8]={0, 6, 2,4,5,7, 1,3}; - DataArrayInt *da=DataArrayInt::New(); + const mcIdType vals1[8]={0,3,2,3,2,2,1,2}; + const mcIdType expected1[5]={0,1,2,6,8}; + const mcIdType expected2[8]={0, 6, 2,4,5,7, 1,3}; + DataArrayIdType *da=DataArrayIdType::New(); da->alloc(8,1); std::copy(vals1,vals1+8,da->getPointer()); // - DataArrayInt *da2,*da2I; + DataArrayIdType *da2,*da2I; da->changeSurjectiveFormat(4,da2,da2I); CPPUNIT_ASSERT_EQUAL(5,(int)da2I->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(8,(int)da2->getNumberOfTuples()); @@ -216,18 +216,18 @@ void MEDCouplingBasicsTest4::testDAIChangeSurjectiveFormat1() void MEDCouplingBasicsTest4::testUMeshGetCellIdsLyingOnNodes1() { MEDCouplingUMesh *m=build3DSurfTargetMesh_1(); - const int nodeIds1[5]={1,2,3,4,6}; - const int nodeIds2[2]={6,7}; - DataArrayInt *da=m->getCellIdsLyingOnNodes(nodeIds1,nodeIds1+5,true); - CPPUNIT_ASSERT_EQUAL(1,(int)da->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)da->getNumberOfComponents()); - CPPUNIT_ASSERT_EQUAL(1,da->getIJ(0,0)); + const mcIdType nodeIds1[5]={1,2,3,4,6}; + const mcIdType nodeIds2[2]={6,7}; + DataArrayIdType *da=m->getCellIdsLyingOnNodes(nodeIds1,nodeIds1+5,true); + CPPUNIT_ASSERT_EQUAL(1,(int)da->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)da->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(1,(int)da->getIJ(0,0)); da->decrRef(); da=m->getCellIdsLyingOnNodes(nodeIds2,nodeIds2+2,false); - CPPUNIT_ASSERT_EQUAL(2,(int)da->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)da->getNumberOfComponents()); - CPPUNIT_ASSERT_EQUAL(3,da->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(4,da->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(2,(int)da->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)da->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(3,(int)da->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(4,(int)da->getIJ(1,0)); da->decrRef(); // m->decrRef(); @@ -236,7 +236,7 @@ void MEDCouplingBasicsTest4::testUMeshGetCellIdsLyingOnNodes1() void MEDCouplingBasicsTest4::testUMeshFindCellIdsOnBoundary1() { MEDCouplingUMesh *m=build3DSurfTargetMesh_1(); - DataArrayInt *da5=m->findCellIdsOnBoundary(); + DataArrayIdType *da5=m->findCellIdsOnBoundary(); CPPUNIT_ASSERT(da5->isIota(5)); // da5->decrRef(); @@ -406,8 +406,8 @@ void MEDCouplingBasicsTest4::testFillFromAnalyticTwo1() CPPUNIT_ASSERT_DOUBLES_EQUAL(3.4,f1->getTime(a,b),1.e-14); CPPUNIT_ASSERT_EQUAL(5,a); CPPUNIT_ASSERT_EQUAL(6,b); CPPUNIT_ASSERT_EQUAL(std::string(f1->getTimeUnit()),std::string("us")); - CPPUNIT_ASSERT_EQUAL(1,(int)f1->getNumberOfComponents()); - CPPUNIT_ASSERT_EQUAL(9,(int)f1->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)f1->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(9,(int)f1->getNumberOfTuples()); const double expected1[9]={0.2, 0.7, 1.2, 0.7, 1.2, 1.7, 1.2, 1.7, 2.2}; for(int i=0;i<9;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f1->getArray()->getIJ(0,i),1e-12); @@ -664,7 +664,7 @@ void MEDCouplingBasicsTest4::testP2Localization1() { MEDCouplingUMesh *m=MEDCouplingUMesh::New("testP2",2); const double coords[12]={0.,2.,3.5,0.,4.5,1.5,1.2,0.32,3.4,1.,2.1,2.4}; - const int conn[6]={0,1,2,3,4,5}; + const mcIdType conn[6]={0,1,2,3,4,5}; DataArrayDouble *coo=DataArrayDouble::New(); coo->alloc(6,2); std::copy(coords,coords+12,coo->getPointer()); @@ -698,7 +698,7 @@ void MEDCouplingBasicsTest4::testP2Localization2() { MEDCouplingUMesh *m=MEDCouplingUMesh::New("testP2_2",3); const double coords[30]={0.33312787792955395, -0.35155740179580952, -0.03567564825034563, 1.307146326477638, -0.57234557776250305, -0.08608044208272235, 0.5551834466499993, 0.62324964668794192, -0.014638951108536295, 0.37761817224442129, -0.38324019806913578, 0.96283164472856886, 0.79494856035658679, -0.40628057809270046, 0.0021004190225864614, 1.023740446371799, 0.07665912970471335, -0.072889657161871096, 0.54564584619517376, 0.11132872093429744, 0.039647326652013051, 0.27164784387819052, -0.42018012100866675, 0.46563376500745146, 0.89501965094896418, -0.56148455362735061, 0.43337469695473035, 0.49118025152924394, 0.093884938060727313, 0.47216346905220891}; - const int conn[10]={0,1,2,3,4,5,6,7,8,9}; + const mcIdType conn[10]={0,1,2,3,4,5,6,7,8,9}; DataArrayDouble *coo=DataArrayDouble::New(); coo->alloc(10,3); std::copy(coords,coords+30,coo->getPointer()); @@ -753,7 +753,7 @@ void MEDCouplingBasicsTest4::testGetValueOn2() f=MEDCouplingFieldDouble::New(ON_NODES,NO_TIME); f->setMesh(m); arr=DataArrayDouble::New(); - int nbOfNodes=m->getNumberOfNodes(); + mcIdType nbOfNodes=m->getNumberOfNodes(); arr->alloc(nbOfNodes,3); f->setArray(arr); arr->decrRef(); @@ -775,25 +775,25 @@ void MEDCouplingBasicsTest4::testGetValueOn2() void MEDCouplingBasicsTest4::testDAIGetIdsNotEqual1() { - DataArrayInt *d=DataArrayInt::New(); - const int vals1[10]={2,3,5,6,8,5,5,6,1,-5}; + DataArrayIdType *d=DataArrayIdType::New(); + const mcIdType vals1[10]={2,3,5,6,8,5,5,6,1,-5}; d->alloc(10,1); std::copy(vals1,vals1+10,d->getPointer()); - DataArrayInt *d2=d->findIdsNotEqual(5); + DataArrayIdType *d2=d->findIdsNotEqual(5); CPPUNIT_ASSERT_EQUAL(7,(int)d2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)d2->getNumberOfComponents()); - const int expected1[7]={0,1,3,4,7,8,9}; + const mcIdType expected1[7]={0,1,3,4,7,8,9}; for(int i=0;i<7;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],d2->getIJ(0,i)); d->rearrange(2); CPPUNIT_ASSERT_THROW(d->findIdsNotEqual(5),INTERP_KERNEL::Exception); - const int vals2[3]={-4,5,6}; - std::vector vals3(vals2,vals2+3); + const mcIdType vals2[3]={-4,5,6}; + std::vector vals3(vals2,vals2+3); d->rearrange(1); - DataArrayInt *d3=d->findIdsNotEqualList(&vals3[0],&vals3[0]+vals3.size()); + DataArrayIdType *d3=d->findIdsNotEqualList(&vals3[0],&vals3[0]+vals3.size()); CPPUNIT_ASSERT_EQUAL(5,(int)d3->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)d3->getNumberOfComponents()); - const int expected2[5]={0,1,4,8,9}; + const mcIdType expected2[5]={0,1,4,8,9}; for(int i=0;i<5;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],d3->getIJ(0,i)); d3->decrRef(); @@ -803,9 +803,9 @@ void MEDCouplingBasicsTest4::testDAIGetIdsNotEqual1() void MEDCouplingBasicsTest4::testDAIComputeOffsets1() { - DataArrayInt *d=DataArrayInt::New(); - const int vals1[6]={3,5,1,2,0,8}; - const int expected1[6]={0,3,8,9,11,11}; + DataArrayIdType *d=DataArrayIdType::New(); + const mcIdType vals1[6]={3,5,1,2,0,8}; + const mcIdType expected1[6]={0,3,8,9,11,11}; d->alloc(6,1); std::copy(vals1,vals1+6,d->getPointer()); d->computeOffsets(); @@ -822,7 +822,7 @@ void MEDCouplingBasicsTest4::testUMeshHexagonPrism1() 0.8660254037844386, 0.5, 0.0, 0.0, 1.0, 0.0, -0.8660254037844386, 0.5, 0.0, -0.8660254037844386, -0.5, 0.0, 0.0, -1.0, 0.0, 0.8660254037844386, -0.5, 0.0, 0.8660254037844386, 0.5, 2.0, 0.0, 1.0, 2.0, -0.8660254037844386, 0.5, 2.0, -0.8660254037844386, -0.5, 2.0, 0.0, -1.0, 2.0, 0.8660254037844386, -0.5, 2.0 }; - const int conn[12]={1,2,3,4,5,0,7,8,9,10,11,6}; + const mcIdType conn[12]={1,2,3,4,5,0,7,8,9,10,11,6}; MEDCouplingUMesh *mesh=MEDCouplingUMesh::New("MyFirstHexagonalPrism",3); DataArrayDouble *coo=DataArrayDouble::New(); coo->alloc(12,3); @@ -844,19 +844,19 @@ void MEDCouplingBasicsTest4::testUMeshHexagonPrism1() const double expected1[3]={0.,0.,1.}; for(int i=0;i<3;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],bary->getIJ(0,i),1e-12); - DataArrayInt *d1=DataArrayInt::New(); - DataArrayInt *d2=DataArrayInt::New(); - DataArrayInt *d3=DataArrayInt::New(); - DataArrayInt *d4=DataArrayInt::New(); + DataArrayIdType *d1=DataArrayIdType::New(); + DataArrayIdType *d2=DataArrayIdType::New(); + DataArrayIdType *d3=DataArrayIdType::New(); + DataArrayIdType *d4=DataArrayIdType::New(); MEDCouplingUMesh *m2=mesh->buildDescendingConnectivity(d1,d2,d3,d4); CPPUNIT_ASSERT_EQUAL(8,(int)m2->getNumberOfCells()); - const int expected4[8][6]={{1,2,3,4,5,0},{7,6,11,10,9,8},{1,7,8,2},{2,8,9,3},{3,9,10,4},{4,10,11,5},{5,11,6,0},{0,6,7,1}}; + const mcIdType expected4[8][6]={{1,2,3,4,5,0},{7,6,11,10,9,8},{1,7,8,2},{2,8,9,3},{3,9,10,4},{4,10,11,5},{5,11,6,0},{0,6,7,1}}; const INTERP_KERNEL::NormalizedCellType expected2[8]={INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_QUAD4}; - const int expected3[8]={6,6,4,4,4,4,4,4}; + const mcIdType expected3[8]={6,6,4,4,4,4,4,4}; for(int i=0;i<8;i++) { CPPUNIT_ASSERT(m2->getTypeOfCell(i)==expected2[i]); - std::vector v; + std::vector v; m2->getNodeIdsOfCell(i,v); CPPUNIT_ASSERT((int)v.size()==expected3[i]); CPPUNIT_ASSERT(std::equal(expected4[i],expected4[i]+expected3[i],v.begin())); @@ -871,7 +871,7 @@ void MEDCouplingBasicsTest4::testUMeshHexagonPrism1() CPPUNIT_ASSERT(INTERP_KERNEL::NORM_POLYHED==mesh->getTypeOfCell(0)); mesh->unPolyze(); CPPUNIT_ASSERT(INTERP_KERNEL::NORM_HEXGP12==mesh->getTypeOfCell(0)); - CPPUNIT_ASSERT_EQUAL(13,mesh->getNodalConnectivityArrayLen()); + CPPUNIT_ASSERT_EQUAL(ToIdType(13),mesh->getNodalConnectivityArrayLen()); // vols->decrRef(); bary->decrRef(); @@ -915,8 +915,8 @@ void MEDCouplingBasicsTest4::testCheckCoherencyDeeper1() m->getNodalConnectivity()->setIJ(8,0,8);//OK m->checkConsistencyLight(); m->checkConsistency(); - const int elts[2]={1,5}; - std::vector eltsV(elts,elts+2); + const mcIdType elts[2]={1,5}; + std::vector eltsV(elts,elts+2); m->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size()); m->checkConsistencyLight(); m->checkConsistency(); @@ -952,18 +952,18 @@ void MEDCouplingBasicsTest4::testUnPolyze2() m->setCoords(coo); coo->decrRef(); m->allocateCells(2); - const int conn[4]={0,1,2,3}; + const mcIdType conn[4]={0,1,2,3}; m->insertNextCell(INTERP_KERNEL::NORM_TETRA4,4,conn); m->insertNextCell(INTERP_KERNEL::NORM_TETRA4,4,conn); m->finishInsertingCells(); std::vector ms(4,m); MEDCouplingUMesh *m2=MEDCouplingUMesh::MergeUMeshesOnSameCoords(ms); - std::vector temp(1,2); + std::vector temp(1,2); m2->convertToPolyTypes(&temp[0],&temp[0]+temp.size()); m2->unPolyze(); CPPUNIT_ASSERT(INTERP_KERNEL::NORM_TETRA4==m2->getTypeOfCell(2)); - CPPUNIT_ASSERT_EQUAL(40,m2->getNodalConnectivityArrayLen()); - std::vector temp2; + CPPUNIT_ASSERT_EQUAL(ToIdType(40),m2->getNodalConnectivityArrayLen()); + std::vector temp2; m2->getNodeIdsOfCell(2,temp2); CPPUNIT_ASSERT(4==(int)temp2.size()); CPPUNIT_ASSERT(std::equal(conn,conn+4,temp2.begin())); @@ -998,8 +998,8 @@ void MEDCouplingBasicsTest4::testDACpyFrom1() d1->deepCopyFrom(*d); CPPUNIT_ASSERT(d->isEqual(*d1,1e-12)); // - MCAuto d2=d->convertToIntArr(); - DataArrayInt *d4=DataArrayInt::New(); + MCAuto d2=d->convertToIntArr(); + DataArrayIdType *d4=DataArrayIdType::New(); CPPUNIT_ASSERT(!d2->isEqual(*d4)); d4->deepCopyFrom(*d2); CPPUNIT_ASSERT(d2->isEqual(*d4)); @@ -1017,13 +1017,13 @@ void MEDCouplingBasicsTest4::testDACpyFrom1() void MEDCouplingBasicsTest4::testDAITransformWithIndArr1() { - const int tab1[4]={17,18,22,19}; - const int tab2[12]={0,1,1,3,3,0,1,3,2,2,3,0}; - const int expected[12]={17,18,18,19,19,17,18,19,22,22,19,17}; - DataArrayInt *d=DataArrayInt::New(); + const mcIdType tab1[4]={17,18,22,19}; + const mcIdType tab2[12]={0,1,1,3,3,0,1,3,2,2,3,0}; + const mcIdType expected[12]={17,18,18,19,19,17,18,19,22,22,19,17}; + DataArrayIdType *d=DataArrayIdType::New(); d->alloc(4,1); std::copy(tab1,tab1+4,d->getPointer()); - DataArrayInt *d1=DataArrayInt::New(); + DataArrayIdType *d1=DataArrayIdType::New(); d1->alloc(12,1); std::copy(tab2,tab2+12,d1->getPointer()); // @@ -1039,12 +1039,12 @@ void MEDCouplingBasicsTest4::testDAITransformWithIndArr1() void MEDCouplingBasicsTest4::testDAIBuildPermArrPerLevel1() { - const int arr[12]={2,0,1,1,0,1,2,0,1,1,0,0}; - const int expected1[12]={10,0,5,6,1,7,11,2,8,9,3,4}; - DataArrayInt *da=DataArrayInt::New(); + const mcIdType arr[12]={2,0,1,1,0,1,2,0,1,1,0,0}; + const mcIdType expected1[12]={10,0,5,6,1,7,11,2,8,9,3,4}; + DataArrayIdType *da=DataArrayIdType::New(); da->alloc(12,1); std::copy(arr,arr+12,da->getPointer()); - DataArrayInt *da2=da->buildPermArrPerLevel(); + DataArrayIdType *da2=da->buildPermArrPerLevel(); CPPUNIT_ASSERT_EQUAL(12,(int)da2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); for(int i=0;i<12;i++) @@ -1055,24 +1055,24 @@ void MEDCouplingBasicsTest4::testDAIBuildPermArrPerLevel1() void MEDCouplingBasicsTest4::testDAIOperations1() { - const int arr1[12]={-1,-2,4,7,3,2,6,6,4,3,0,1}; - DataArrayInt *da=DataArrayInt::New(); + const mcIdType arr1[12]={-1,-2,4,7,3,2,6,6,4,3,0,1}; + DataArrayIdType *da=DataArrayIdType::New(); da->alloc(4,3); std::copy(arr1,arr1+12,da->getPointer()); - DataArrayInt *da1=DataArrayInt::New(); + DataArrayIdType *da1=DataArrayIdType::New(); da1->alloc(12,1); da1->iota(2); - CPPUNIT_ASSERT_THROW(DataArrayInt::Add(da,da1),INTERP_KERNEL::Exception);//not same number of tuples/Components + CPPUNIT_ASSERT_THROW(DataArrayIdType::Add(da,da1),INTERP_KERNEL::Exception);//not same number of tuples/Components da1->rearrange(3); - DataArrayInt *da2=DataArrayInt::Add(da,da1); + DataArrayIdType *da2=DataArrayIdType::Add(da,da1); CPPUNIT_ASSERT_EQUAL(4,(int)da2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(3,(int)da2->getNumberOfComponents()); - const int expected1[12]={1,1,8,12,9,9,14,15,14,14,12,14}; + const mcIdType expected1[12]={1,1,8,12,9,9,14,15,14,14,12,14}; for(int i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],da2->getIJ(0,i)); da2->decrRef(); da1->substractEqual(da); - const int expected2[12]={3,5,0,-2,3,5,2,3,6,8,12,12}; + const mcIdType expected2[12]={3,5,0,-2,3,5,2,3,6,8,12,12}; for(int i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],da1->getIJ(0,i)); da1->rearrange(1); da1->iota(2); da1->rearrange(3); @@ -1080,17 +1080,17 @@ void MEDCouplingBasicsTest4::testDAIOperations1() for(int i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],da1->getIJ(0,i)); da1->rearrange(1); da1->iota(2); da1->rearrange(3); - da2=DataArrayInt::Multiply(da,da1); + da2=DataArrayIdType::Multiply(da,da1); CPPUNIT_ASSERT_EQUAL(4,(int)da2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(3,(int)da2->getNumberOfComponents()); - const int expected3[12]={-2,-6,16,35,18,14,48,54,40,33,0,13}; + const mcIdType expected3[12]={-2,-6,16,35,18,14,48,54,40,33,0,13}; for(int i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(expected3[i],da2->getIJ(0,i)); da2->decrRef(); da->divideEqual(da1); CPPUNIT_ASSERT_EQUAL(4,(int)da->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(3,(int)da->getNumberOfComponents()); - const int expected4[12]={0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0}; + const mcIdType expected4[12]={0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0}; for(int i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(expected4[i],da->getIJ(0,i)); std::copy(arr1,arr1+12,da->getPointer()); @@ -1100,7 +1100,7 @@ void MEDCouplingBasicsTest4::testDAIOperations1() for(int i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(expected3[i],da1->getIJ(0,i)); da1->rearrange(1); da1->iota(2); da1->rearrange(3); - da2=DataArrayInt::Divide(da,da1); + da2=DataArrayIdType::Divide(da,da1); CPPUNIT_ASSERT_EQUAL(4,(int)da2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(3,(int)da2->getNumberOfComponents()); for(int i=0;i<12;i++) @@ -1109,21 +1109,21 @@ void MEDCouplingBasicsTest4::testDAIOperations1() da1->applyInv(321); CPPUNIT_ASSERT_EQUAL(4,(int)da1->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(3,(int)da1->getNumberOfComponents()); - const int expected5[12]={160,107,80,64,53,45,40,35,32,29,26,24}; + const mcIdType expected5[12]={160,107,80,64,53,45,40,35,32,29,26,24}; for(int i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(expected5[i],da1->getIJ(0,i)); da1->applyDivideBy(2); CPPUNIT_ASSERT_EQUAL(4,(int)da1->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(3,(int)da1->getNumberOfComponents()); - const int expected6[12]={80,53,40,32,26,22,20,17,16,14,13,12}; + const mcIdType expected6[12]={80,53,40,32,26,22,20,17,16,14,13,12}; for(int i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(expected6[i],da1->getIJ(0,i)); - const int expected7[12]={3,4,5,4,5,1,6,3,2,0,6,5}; + const mcIdType expected7[12]={3,4,5,4,5,1,6,3,2,0,6,5}; da1->applyModulus(7); for(int i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(expected7[i],da1->getIJ(0,i)); da1->applyLin(1,1); - const int expected8[12]={3,3,3,3,3,1,3,3,0,0,3,3}; + const mcIdType expected8[12]={3,3,3,3,3,1,3,3,0,0,3,3}; da1->applyRModulus(3); for(int i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(expected8[i],da1->getIJ(0,i)); @@ -1136,15 +1136,15 @@ void MEDCouplingBasicsTest4::testEmulateMEDMEMBDC1() { MEDCouplingUMesh *m1=0; MEDCouplingUMesh *m=buildPointe_1(m1); - DataArrayInt *da1=DataArrayInt::New(); - DataArrayInt *da2=DataArrayInt::New(); - DataArrayInt *da3=0; - DataArrayInt *da4=0; - DataArrayInt *da5=0; - DataArrayInt *da0=0; + DataArrayIdType *da1=DataArrayIdType::New(); + DataArrayIdType *da2=DataArrayIdType::New(); + DataArrayIdType *da3=0; + DataArrayIdType *da4=0; + DataArrayIdType *da5=0; + DataArrayIdType *da0=0; MEDCouplingUMesh *m2=m->emulateMEDMEMBDC(m1,da1,da2,da3,da4,da5,da0); - const int expected0[47]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,36,37,32,33,34,35,38,39,40,41,42,43,44,45,46}; - const int expected1[6]={1,32,29,23,41,36}; + const mcIdType expected0[47]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,36,37,32,33,34,35,38,39,40,41,42,43,44,45,46}; + const mcIdType expected1[6]={1,32,29,23,41,36}; CPPUNIT_ASSERT_EQUAL(47,(int)da0->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da0->getNumberOfComponents()); for(int i=0;i<47;i++) @@ -1153,23 +1153,23 @@ void MEDCouplingBasicsTest4::testEmulateMEDMEMBDC1() CPPUNIT_ASSERT_EQUAL(1,(int)da5->getNumberOfComponents()); for(int i=0;i<6;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],da5->getIJ(0,i)); - const int expected2[70]={0,1,2,3,4,0,5,6,7,4,8,9,1,7,10,11,12,13,14,5,15,16,17,8,18,19,20,10,21,22,23,2,13,24,25,21,16,26,27,12,19,28,29,15,22,30,31,18,36,26,28,30,24,37,32,33,34,35,38,36,39,40,41,42,37,38,43,44,45,46}; + const mcIdType expected2[70]={0,1,2,3,4,0,5,6,7,4,8,9,1,7,10,11,12,13,14,5,15,16,17,8,18,19,20,10,21,22,23,2,13,24,25,21,16,26,27,12,19,28,29,15,22,30,31,18,36,26,28,30,24,37,32,33,34,35,38,36,39,40,41,42,37,38,43,44,45,46}; CPPUNIT_ASSERT_EQUAL(70,(int)da1->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da1->getNumberOfComponents()); for(int i=0;i<70;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],da1->getIJ(0,i)); - const int expected3[17]={0,4,8,12,16,20,24,28,32,36,40,44,48,53,58,64,70}; + const mcIdType expected3[17]={0,4,8,12,16,20,24,28,32,36,40,44,48,53,58,64,70}; CPPUNIT_ASSERT_EQUAL(17,(int)da2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); for(int i=0;i<17;i++) CPPUNIT_ASSERT_EQUAL(expected3[i],da2->getIJ(0,i)); - const int expected4[48]={0,2,4,6,7,9,11,12,14,16,17,19,20,22,24,25,27,29,30,32,34,35,37,39,40,42,43,45,46,48,49,51,52,53,54,55,56,58,60,62,63,64,65,66,67,68,69,70}; - //const int expected4[48]={0,2,4,6,7,9,11,12,14,16,17,19,20,22,24,25,27,29,30,32,34,35,37,39,40,42,43,45,46,48,49,51,52,54,56,57,58,59,60,62,63,64,65,66,67,68,69,70}; + const mcIdType expected4[48]={0,2,4,6,7,9,11,12,14,16,17,19,20,22,24,25,27,29,30,32,34,35,37,39,40,42,43,45,46,48,49,51,52,53,54,55,56,58,60,62,63,64,65,66,67,68,69,70}; + //const mcIdType expected4[48]={0,2,4,6,7,9,11,12,14,16,17,19,20,22,24,25,27,29,30,32,34,35,37,39,40,42,43,45,46,48,49,51,52,54,56,57,58,59,60,62,63,64,65,66,67,68,69,70}; CPPUNIT_ASSERT_EQUAL(48,(int)da4->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da4->getNumberOfComponents()); for(int i=0;i<48;i++) CPPUNIT_ASSERT_EQUAL(expected4[i],da4->getIJ(0,i)); - const int expected5[70]={0,1,0,3,0,7,0,1,2,1,4,1,2,3,2,5,2,3,6,3,4,9,4,8,4,5,10,5,9,5,6,11,6,10,6,7,8,7,11,7,8,12,8,9,12,9,10,12,10,11,12,11,13,13,13,13,12,14,13,15,14,15,14,14,14,14,15,15,15,15}; + const mcIdType expected5[70]={0,1,0,3,0,7,0,1,2,1,4,1,2,3,2,5,2,3,6,3,4,9,4,8,4,5,10,5,9,5,6,11,6,10,6,7,8,7,11,7,8,12,8,9,12,9,10,12,10,11,12,11,13,13,13,13,12,14,13,15,14,15,14,14,14,14,15,15,15,15}; CPPUNIT_ASSERT_EQUAL(70,(int)da3->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da3->getNumberOfComponents()); for(int i=0;i<70;i++) @@ -1192,30 +1192,30 @@ void MEDCouplingBasicsTest4::testGetLevArrPerCellTypes1() MEDCouplingUMesh *m1=0; MEDCouplingUMesh *m=buildPointe_1(m1); m1->decrRef(); - DataArrayInt *d0=DataArrayInt::New(); - DataArrayInt *d1=DataArrayInt::New(); - DataArrayInt *d2=DataArrayInt::New(); - DataArrayInt *d3=DataArrayInt::New(); + DataArrayIdType *d0=DataArrayIdType::New(); + DataArrayIdType *d1=DataArrayIdType::New(); + DataArrayIdType *d2=DataArrayIdType::New(); + DataArrayIdType *d3=DataArrayIdType::New(); m1=m->buildDescendingConnectivity(d0,d1,d2,d3); d0->decrRef(); d1->decrRef(); d2->decrRef(); d3->decrRef(); INTERP_KERNEL::NormalizedCellType order[2]={INTERP_KERNEL::NORM_TRI3,INTERP_KERNEL::NORM_QUAD4}; - DataArrayInt *da1=0; - DataArrayInt *da0=m1->getLevArrPerCellTypes(order,order+2,da1); - const int expected0[47]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1}; - const int expected1[47]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,36,37,32,33,34,35,38,39,40,41,42,43,44,45,46}; - CPPUNIT_ASSERT_EQUAL(47,(int)da0->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)da0->getNumberOfComponents()); + DataArrayIdType *da1=0; + DataArrayIdType *da0=m1->getLevArrPerCellTypes(order,order+2,da1); + const mcIdType expected0[47]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1}; + const mcIdType expected1[47]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,36,37,32,33,34,35,38,39,40,41,42,43,44,45,46}; + CPPUNIT_ASSERT_EQUAL(47,(int)da0->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)da0->getNumberOfComponents()); for(int i=0;i<47;i++) CPPUNIT_ASSERT_EQUAL(expected0[i],da0->getIJ(0,i)); - CPPUNIT_ASSERT_EQUAL(2,(int)da1->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)da1->getNumberOfComponents()); - CPPUNIT_ASSERT_EQUAL(36,da1->getIJ(0,0));//36 TRI3 - CPPUNIT_ASSERT_EQUAL(11,da1->getIJ(1,0));//11 QUAD4 + CPPUNIT_ASSERT_EQUAL(2,(int)da1->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)da1->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(36,(int)da1->getIJ(0,0));//36 TRI3 + CPPUNIT_ASSERT_EQUAL(11,(int)da1->getIJ(1,0));//11 QUAD4 // - DataArrayInt *da2=da0->buildPermArrPerLevel(); + DataArrayIdType *da2=da0->buildPermArrPerLevel(); // - CPPUNIT_ASSERT_EQUAL(47,(int)da2->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(47,(int)da2->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); for(int i=0;i<47;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],da2->getIJ(0,i)); da2->decrRef(); @@ -1232,14 +1232,14 @@ void MEDCouplingBasicsTest4::testSortCellsInMEDFileFrmt1() MEDCouplingUMesh *m=buildPointe_1(m1); MEDCouplingUMesh *m2=(MEDCouplingUMesh *)m->deepCopy(); m->setCoords(0); - const int vals[16]={0,1,2,14,3,12,4,5,15,6,7,8,9,10,11,13}; - DataArrayInt *da=DataArrayInt::New(); + const mcIdType vals[16]={0,1,2,14,3,12,4,5,15,6,7,8,9,10,11,13}; + DataArrayIdType *da=DataArrayIdType::New(); da->alloc(16,1); std::copy(vals,vals+16,da->getPointer()); - DataArrayInt *daa=da->invertArrayN2O2O2N(16); + DataArrayIdType *daa=da->invertArrayN2O2O2N(16); m->renumberCells(daa->getConstPointer(),false); daa->decrRef(); - DataArrayInt *da2=m->sortCellsInMEDFileFrmt(); + DataArrayIdType *da2=m->sortCellsInMEDFileFrmt(); CPPUNIT_ASSERT(m2->isEqual(m2,1e-12)); CPPUNIT_ASSERT(da->isEqual(*da2)); m2->decrRef(); @@ -1252,10 +1252,10 @@ void MEDCouplingBasicsTest4::testSortCellsInMEDFileFrmt1() void MEDCouplingBasicsTest4::testBuildPartAndReduceNodes1() { MEDCouplingMesh *m=build2DTargetMesh_1(); - const int arr[2]={1,0}; - DataArrayInt *da; + const mcIdType arr[2]={1,0}; + DataArrayIdType *da; MEDCouplingMesh *m2=m->buildPartAndReduceNodes(arr,arr+2,da); - CPPUNIT_ASSERT_EQUAL(5,m2->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(5,(int)m2->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(2,(int)m2->getNumberOfCells()); MEDCouplingFieldDouble *f=m2->getMeasureField(true); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125,f->getArray()->getIJ(0,0),1e-12); @@ -1268,17 +1268,17 @@ void MEDCouplingBasicsTest4::testBuildPartAndReduceNodes1() void MEDCouplingBasicsTest4::testDAITransformWithIndArrR1() { - const int tab1[6]={2,4,5,3,6,7}; - const int tab2[12]={-1,-1,0,1,2,3,4,5,-1,-1,-1,-1}; - const int expected[6]={0,3,1,2,4,5}; - DataArrayInt *d=DataArrayInt::New(); + const mcIdType tab1[6]={2,4,5,3,6,7}; + const mcIdType tab2[12]={-1,-1,0,1,2,3,4,5,-1,-1,-1,-1}; + const mcIdType expected[6]={0,3,1,2,4,5}; + DataArrayIdType *d=DataArrayIdType::New(); d->alloc(6,1); std::copy(tab1,tab1+6,d->getPointer()); - DataArrayInt *d1=DataArrayInt::New(); + DataArrayIdType *d1=DataArrayIdType::New(); d1->alloc(12,1); std::copy(tab2,tab2+12,d1->getPointer()); // - DataArrayInt *d3=d->transformWithIndArrR(d1->getConstPointer(),d1->getConstPointer()+d1->getNbOfElems()); + DataArrayIdType *d3=d->transformWithIndArrR(d1->getConstPointer(),d1->getConstPointer()+d1->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(6,(int)d3->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)d3->getNumberOfComponents()); for(int i=0;i<6;i++) @@ -1291,12 +1291,12 @@ void MEDCouplingBasicsTest4::testDAITransformWithIndArrR1() void MEDCouplingBasicsTest4::testDAISplitByValueRange1() { - const int val1[9]={6,5,0,3,2,7,8,1,4}; - const int val2[3]={0,4,9}; - DataArrayInt *d=DataArrayInt::New(); + const mcIdType val1[9]={6,5,0,3,2,7,8,1,4}; + const mcIdType val2[3]={0,4,9}; + DataArrayIdType *d=DataArrayIdType::New(); d->alloc(9,1); std::copy(val1,val1+9,d->getPointer()); - DataArrayInt *ee=0,*f=0,*g=0; + DataArrayIdType *ee=0,*f=0,*g=0; d->splitByValueRange(val2,val2+3,ee,f,g); CPPUNIT_ASSERT_EQUAL(9,(int)ee->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)ee->getNumberOfComponents()); @@ -1305,15 +1305,15 @@ void MEDCouplingBasicsTest4::testDAISplitByValueRange1() CPPUNIT_ASSERT_EQUAL(2,(int)g->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)g->getNumberOfComponents()); // - const int expected1[9]={1,1,0,0,0,1,1,0,1}; - const int expected2[9]={2,1,0,3,2,3,4,1,0}; + const mcIdType expected1[9]={1,1,0,0,0,1,1,0,1}; + const mcIdType expected2[9]={2,1,0,3,2,3,4,1,0}; for(int i=0;i<9;i++) { CPPUNIT_ASSERT_EQUAL(expected1[i],ee->getIJ(i,0)); CPPUNIT_ASSERT_EQUAL(expected2[i],f->getIJ(i,0)); } - CPPUNIT_ASSERT_EQUAL(0,g->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(1,g->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(0,(int)g->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(1,(int)g->getIJ(1,0)); // ee->decrRef(); f->decrRef(); @@ -1327,39 +1327,39 @@ void MEDCouplingBasicsTest4::testDAISplitByValueRange1() void MEDCouplingBasicsTest4::testUMeshSplitProfilePerType1() { - const int val0[5]={2,0,1,3,4}; + const mcIdType val0[5]={2,0,1,3,4}; MEDCouplingUMesh *m=build2DTargetMesh_1(); m->renumberCells(val0,false); - std::vector code; - std::vector idsInPflPerType; - std::vector pfls; + std::vector code; + std::vector idsInPflPerType; + std::vector pfls; // - const int val1[3]={0,2,3}; - DataArrayInt *d=DataArrayInt::New(); + const mcIdType val1[3]={0,2,3}; + DataArrayIdType *d=DataArrayIdType::New(); d->alloc(3,1); d->setName("sup"); std::copy(val1,val1+3,d->getPointer()); m->splitProfilePerType(d,code,idsInPflPerType,pfls); CPPUNIT_ASSERT_EQUAL(6,(int)code.size()); CPPUNIT_ASSERT_EQUAL(2,(int)idsInPflPerType.size()); - const int expected1[6]={3,1,0, 4,2,1}; + const mcIdType expected1[6]={3,1,0, 4,2,1}; for(int i=0;i<6;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],code[i]); - CPPUNIT_ASSERT_EQUAL(1,(int)idsInPflPerType[0]->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(0,idsInPflPerType[0]->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(2,(int)idsInPflPerType[1]->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,idsInPflPerType[1]->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(2,idsInPflPerType[1]->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(1,(int)idsInPflPerType[0]->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(0,(int)idsInPflPerType[0]->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(2,(int)idsInPflPerType[1]->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)idsInPflPerType[1]->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(2,(int)idsInPflPerType[1]->getIJ(1,0)); idsInPflPerType[0]->decrRef(); idsInPflPerType[1]->decrRef(); CPPUNIT_ASSERT_EQUAL(2,(int)pfls.size()); CPPUNIT_ASSERT(std::string("sup")==pfls[0]->getName()); - CPPUNIT_ASSERT_EQUAL(1,(int)pfls[0]->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(0,pfls[0]->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(1,(int)pfls[0]->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(0,(int)pfls[0]->getIJ(0,0)); CPPUNIT_ASSERT(std::string("sup")==pfls[1]->getName()); - CPPUNIT_ASSERT_EQUAL(2,(int)pfls[1]->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(0,pfls[1]->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(1,pfls[1]->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(2,(int)pfls[1]->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(0,(int)pfls[1]->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(1,(int)pfls[1]->getIJ(1,0)); pfls[0]->decrRef(); pfls[1]->decrRef(); d->decrRef(); @@ -1367,55 +1367,55 @@ void MEDCouplingBasicsTest4::testUMeshSplitProfilePerType1() pfls.clear(); code.clear(); // - const int val2[4]={0,2,3,4};// all quad4 are selected here ! So no profile for Quads - d=DataArrayInt::New(); + const mcIdType val2[4]={0,2,3,4};// all quad4 are selected here ! So no profile for Quads + d=DataArrayIdType::New(); d->alloc(4,1); std::copy(val2,val2+4,d->getPointer()); m->splitProfilePerType(d,code,idsInPflPerType,pfls); CPPUNIT_ASSERT_EQUAL(6,(int)code.size()); CPPUNIT_ASSERT_EQUAL(2,(int)idsInPflPerType.size()); - const int expected2[6]={3,1,0, 4,3,-1}; + const mcIdType expected2[6]={3,1,0, 4,3,-1}; for(int i=0;i<6;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],code[i]); - CPPUNIT_ASSERT_EQUAL(1,(int)idsInPflPerType[0]->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(0,idsInPflPerType[0]->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(3,(int)idsInPflPerType[1]->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,idsInPflPerType[1]->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(2,idsInPflPerType[1]->getIJ(1,0)); - CPPUNIT_ASSERT_EQUAL(3,idsInPflPerType[1]->getIJ(2,0)); + CPPUNIT_ASSERT_EQUAL(1,(int)idsInPflPerType[0]->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(0,(int)idsInPflPerType[0]->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(3,(int)idsInPflPerType[1]->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)idsInPflPerType[1]->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(2,(int)idsInPflPerType[1]->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(3,(int)idsInPflPerType[1]->getIJ(2,0)); idsInPflPerType[0]->decrRef(); idsInPflPerType[1]->decrRef(); CPPUNIT_ASSERT_EQUAL(1,(int)pfls.size()); - CPPUNIT_ASSERT_EQUAL(1,(int)pfls[0]->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(0,pfls[0]->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(1,(int)pfls[0]->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(0,(int)pfls[0]->getIJ(0,0)); pfls[0]->decrRef(); d->decrRef(); idsInPflPerType.clear(); pfls.clear(); code.clear(); // - const int val3[3]={1,0,2};// all tri3 are selected here but not in the same order ! Profile requested for Tri3 - d=DataArrayInt::New(); + const mcIdType val3[3]={1,0,2};// all tri3 are selected here but not in the same order ! Profile requested for Tri3 + d=DataArrayIdType::New(); d->alloc(3,1); std::copy(val3,val3+3,d->getPointer()); m->splitProfilePerType(d,code,idsInPflPerType,pfls); CPPUNIT_ASSERT_EQUAL(6,(int)code.size()); CPPUNIT_ASSERT_EQUAL(2,(int)idsInPflPerType.size()); - const int expected3[6]={3,2,0, 4,1,1}; + const mcIdType expected3[6]={3,2,0, 4,1,1}; for(int i=0;i<6;i++) CPPUNIT_ASSERT_EQUAL(expected3[i],code[i]); - CPPUNIT_ASSERT_EQUAL(2,(int)idsInPflPerType[0]->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(0,idsInPflPerType[0]->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(1,idsInPflPerType[0]->getIJ(1,0)); - CPPUNIT_ASSERT_EQUAL(1,(int)idsInPflPerType[1]->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(2,idsInPflPerType[1]->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(2,(int)idsInPflPerType[0]->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(0,(int)idsInPflPerType[0]->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(1,(int)idsInPflPerType[0]->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(1,(int)idsInPflPerType[1]->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(2,(int)idsInPflPerType[1]->getIJ(0,0)); idsInPflPerType[0]->decrRef(); idsInPflPerType[1]->decrRef(); CPPUNIT_ASSERT_EQUAL(2,(int)pfls.size()); - CPPUNIT_ASSERT_EQUAL(2,(int)pfls[0]->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,pfls[0]->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(0,pfls[0]->getIJ(1,0)); - CPPUNIT_ASSERT_EQUAL(0,pfls[1]->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(2,(int)pfls[0]->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)pfls[0]->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(0,(int)pfls[0]->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(0,(int)pfls[1]->getIJ(0,0)); pfls[0]->decrRef(); pfls[1]->decrRef(); d->decrRef(); @@ -1423,24 +1423,24 @@ void MEDCouplingBasicsTest4::testUMeshSplitProfilePerType1() pfls.clear(); code.clear(); // - const int val4[2]={3,4};// all tri3 are selected here but not in the same order ! Profile requested for Tri3 - d=DataArrayInt::New(); + const mcIdType val4[2]={3,4};// all tri3 are selected here but not in the same order ! Profile requested for Tri3 + d=DataArrayIdType::New(); d->alloc(2,1); std::copy(val4,val4+2,d->getPointer()); m->splitProfilePerType(d,code,idsInPflPerType,pfls); CPPUNIT_ASSERT_EQUAL(3,(int)code.size()); CPPUNIT_ASSERT_EQUAL(1,(int)idsInPflPerType.size()); - const int expected4[3]={4,2,0}; + const mcIdType expected4[3]={4,2,0}; for(int i=0;i<3;i++) CPPUNIT_ASSERT_EQUAL(expected4[i],code[i]); - CPPUNIT_ASSERT_EQUAL(2,(int)idsInPflPerType[0]->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(0,idsInPflPerType[0]->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(1,idsInPflPerType[0]->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(2,(int)idsInPflPerType[0]->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(0,(int)idsInPflPerType[0]->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(1,(int)idsInPflPerType[0]->getIJ(1,0)); idsInPflPerType[0]->decrRef(); CPPUNIT_ASSERT_EQUAL(1,(int)pfls.size()); - CPPUNIT_ASSERT_EQUAL(2,(int)pfls[0]->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,pfls[0]->getIJ(0,0)); - CPPUNIT_ASSERT_EQUAL(2,pfls[0]->getIJ(1,0)); + CPPUNIT_ASSERT_EQUAL(2,(int)pfls[0]->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)pfls[0]->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(2,(int)pfls[0]->getIJ(1,0)); pfls[0]->decrRef(); d->decrRef(); idsInPflPerType.clear(); @@ -1452,19 +1452,19 @@ void MEDCouplingBasicsTest4::testUMeshSplitProfilePerType1() void MEDCouplingBasicsTest4::testDAIBuildExplicitArrByRanges1() { - DataArrayInt *d=DataArrayInt::New(); + DataArrayIdType *d=DataArrayIdType::New(); d->alloc(3,1); - const int vals1[3]={0,2,3}; + const mcIdType vals1[3]={0,2,3}; std::copy(vals1,vals1+3,d->getPointer()); - DataArrayInt *e=DataArrayInt::New(); + DataArrayIdType *e=DataArrayIdType::New(); e->alloc(6,1); - const int vals2[6]={0,3,6,10,14,20}; + const mcIdType vals2[6]={0,3,6,10,14,20}; std::copy(vals2,vals2+6,e->getPointer()); // - DataArrayInt *f=d->buildExplicitArrByRanges(e); - CPPUNIT_ASSERT_EQUAL(11,(int)f->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)f->getNumberOfComponents()); - const int expected1[11]={0,1,2,6,7,8,9,10,11,12,13}; + DataArrayIdType *f=d->buildExplicitArrByRanges(e); + CPPUNIT_ASSERT_EQUAL(11,(int)f->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)f->getNumberOfComponents()); + const mcIdType expected1[11]={0,1,2,6,7,8,9,10,11,12,13}; for(int i=0;i<11;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],f->getIJ(i,0)); // @@ -1475,14 +1475,14 @@ void MEDCouplingBasicsTest4::testDAIBuildExplicitArrByRanges1() void MEDCouplingBasicsTest4::testDAIComputeOffsets2() { - DataArrayInt *d=DataArrayInt::New(); - const int vals1[6]={3,5,1,2,0,8}; - const int expected1[7]={0,3,8,9,11,11,19}; + DataArrayIdType *d=DataArrayIdType::New(); + const mcIdType vals1[6]={3,5,1,2,0,8}; + const mcIdType expected1[7]={0,3,8,9,11,11,19}; d->alloc(6,1); std::copy(vals1,vals1+6,d->getPointer()); d->computeOffsetsFull(); - CPPUNIT_ASSERT_EQUAL(7,(int)d->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(7,(int)d->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); for(int i=0;i<7;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],d->getIJ(0,i)); d->decrRef(); @@ -1519,17 +1519,17 @@ void MEDCouplingBasicsTest4::testMergeField3() void MEDCouplingBasicsTest4::testGetDistributionOfTypes1() { MEDCouplingUMesh *m=build2DTargetMesh_1(); - const int tab1[5]={2,0,1,3,4}; + const mcIdType tab1[5]={2,0,1,3,4}; CPPUNIT_ASSERT_THROW(m->getDistributionOfTypes(),INTERP_KERNEL::Exception); m->renumberCells(tab1,false); - std::vector code=m->getDistributionOfTypes(); + std::vector code=m->getDistributionOfTypes(); CPPUNIT_ASSERT_EQUAL(6,(int)code.size()); - CPPUNIT_ASSERT_EQUAL(3,code[0]); - CPPUNIT_ASSERT_EQUAL(2,code[1]); - CPPUNIT_ASSERT_EQUAL(-1,code[2]); - CPPUNIT_ASSERT_EQUAL(4,code[3]); - CPPUNIT_ASSERT_EQUAL(3,code[4]); - CPPUNIT_ASSERT_EQUAL(-1,code[5]); + CPPUNIT_ASSERT_EQUAL(3,(int)code[0]); + CPPUNIT_ASSERT_EQUAL(2,(int)code[1]); + CPPUNIT_ASSERT_EQUAL(-1,(int)code[2]); + CPPUNIT_ASSERT_EQUAL(4,(int)code[3]); + CPPUNIT_ASSERT_EQUAL(3,(int)code[4]); + CPPUNIT_ASSERT_EQUAL(-1,(int)code[5]); m->decrRef(); } @@ -1591,9 +1591,9 @@ void MEDCouplingBasicsTest4::testNormMax1() void MEDCouplingBasicsTest4::testFindAndCorrectBadOriented3DExtrudedCells1() { const double coords[38*3]={0.0011180339887498999, -0.0011755705045849499, 0.0, -0.0012331070204200001, -0.0011755705045849499, 0.0, -0.00067557050458494599, -0.00145964954842536, 0.0, -0.00050000000000000001, -0.00086602540378443902, 0.0, 0.00140211303259031, -0.00061803398874989504, 0.0, 0.00086602540378443902, -0.00050000000000000001, 0.0, 0.001, 0.0, 0.0, 0.00034561537182258202, 0.000269164072574575, 0.0, 0.0, 0.001, 0.0, -0.00050000000000000001, 0.00086602540378443902, 0.0, -0.000269164072574575, 0.00034561537182258202, 0.0, -0.001, 0.0, 0.0, -0.00086602540378443902, -0.00050000000000000001, 0.0, -0.00034561537182258202, -0.000269164072574575, 0.0, 0.0, -0.001, 0.0, 0.00050000000000000001, -0.00086602540378443902, 0.0, 0.000269164072574575, -0.00034561537182258202, 0.0, 0.0015, -6.01853107621011e-36, 0.0, 0.00056049747291484397, -0.00145964954842536, 0.0, 0.0011180339887498999, -0.0011755705045849499, 0.00050000000000000001, -0.0012331070204200001, -0.0011755705045849499, 0.00050000000000000001, -0.00067557050458494599, -0.00145964954842536, 0.00050000000000000001, -0.00050000000000000001, -0.00086602540378443902, 0.00050000000000000001, 0.00140211303259031, -0.00061803398874989504, 0.00050000000000000001, 0.00086602540378443902, -0.00050000000000000001, 0.00050000000000000001, 0.001, 0.0, 0.00050000000000000001, 0.00034561537182258202, 0.000269164072574575, 0.00050000000000000001, 0.0, 0.001, 0.00050000000000000001, -0.00050000000000000001, 0.00086602540378443902, 0.00050000000000000001, -0.000269164072574575, 0.00034561537182258202, 0.00050000000000000001, -0.001, 0.0, 0.00050000000000000001, -0.00086602540378443902, -0.00050000000000000001, 0.00050000000000000001, -0.00034561537182258202, -0.000269164072574575, 0.00050000000000000001, 0.0, -0.001, 0.00050000000000000001, 0.00050000000000000001, -0.00086602540378443902, 0.00050000000000000001, 0.000269164072574575, -0.00034561537182258202, 0.00050000000000000001, 0.0015, -6.01853107621011e-36, 0.00050000000000000001, 0.00056049747291484397, -0.00145964954842536, 0.00050000000000000001}; - const int conn[56]={2, 1, 3, 21, 20, 22, 4, 0, 5, 23, 19, 24, 8, 9, 10, 27, 28, 29, 11, 12, 13, 30, 31, 32, 0, 18, 15, 5, 19, 37, 34, 24, 6, 17, 4, 5, 25, 36, 23, 24, 3, 14, 16, 13, 22, 33, 35, 32, 13, 16, 7, 10, 32, 35, 26, 29}; - const int connExp[64]={16, 2, 1, 3, 21, 20, 22, 16, 4, 0, 5, 23, 19, 24, 16, 8, 10, 9, 27, 29, 28, 16, 11, 13, 12, 30, 32, 31, 18, 0, 18, 15, 5, 19, 37, 34, 24,18, 6, 17, 4, 5, 25, 36, 23, 24, 18, 3, 13, 16, 14, 22, 32, 35, 33, 18, 13, 10, 7, 16, 32, 29, 26, 35}; - const int invalidCells[4]={2,3,6,7}; + const mcIdType conn[56]={2, 1, 3, 21, 20, 22, 4, 0, 5, 23, 19, 24, 8, 9, 10, 27, 28, 29, 11, 12, 13, 30, 31, 32, 0, 18, 15, 5, 19, 37, 34, 24, 6, 17, 4, 5, 25, 36, 23, 24, 3, 14, 16, 13, 22, 33, 35, 32, 13, 16, 7, 10, 32, 35, 26, 29}; + const mcIdType connExp[64]={16, 2, 1, 3, 21, 20, 22, 16, 4, 0, 5, 23, 19, 24, 16, 8, 10, 9, 27, 29, 28, 16, 11, 13, 12, 30, 32, 31, 18, 0, 18, 15, 5, 19, 37, 34, 24,18, 6, 17, 4, 5, 25, 36, 23, 24, 18, 3, 13, 16, 14, 22, 32, 35, 33, 18, 13, 10, 7, 16, 32, 29, 26, 35}; + const mcIdType invalidCells[4]={2,3,6,7}; MEDCouplingUMesh *m=MEDCouplingUMesh::New("Example",3); DataArrayDouble *coo=DataArrayDouble::New(); coo->alloc(38,3); @@ -1611,7 +1611,7 @@ void MEDCouplingBasicsTest4::testFindAndCorrectBadOriented3DExtrudedCells1() m->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+48); m->finishInsertingCells(); // - DataArrayInt *v=m->findAndCorrectBadOriented3DExtrudedCells(); + DataArrayIdType *v=m->findAndCorrectBadOriented3DExtrudedCells(); CPPUNIT_ASSERT_EQUAL(4,(int)v->getNumberOfTuples()); CPPUNIT_ASSERT(std::equal(v->begin(),v->end(),invalidCells)); CPPUNIT_ASSERT(std::equal(connExp,connExp+64,m->getNodalConnectivity()->getConstPointer())); @@ -1622,7 +1622,7 @@ void MEDCouplingBasicsTest4::testFindAndCorrectBadOriented3DExtrudedCells1() void MEDCouplingBasicsTest4::testConvertExtrudedPolyhedra1() { - const int conn[72]={1,2,3,4, 5,6,7,8,9,10,11,12, 13,14,15,16, 17,18,19,20,21,22, 23,24,25,26,27,28, 29,30,31,32,33,34,35,36,37,38, 39,40,41,42,43,44,45,46, 47,48,49,50,51,52,53,54,55,56,57,58, 59,60,61,62,63,64,65,66,67,68,69,70,71,72}; + const mcIdType conn[72]={1,2,3,4, 5,6,7,8,9,10,11,12, 13,14,15,16, 17,18,19,20,21,22, 23,24,25,26,27,28, 29,30,31,32,33,34,35,36,37,38, 39,40,41,42,43,44,45,46, 47,48,49,50,51,52,53,54,55,56,57,58, 59,60,61,62,63,64,65,66,67,68,69,70,71,72}; MEDCouplingUMesh *m=MEDCouplingUMesh::New("Example",3); DataArrayDouble *coo=DataArrayDouble::New(); coo->alloc(73,3); @@ -1642,12 +1642,12 @@ void MEDCouplingBasicsTest4::testConvertExtrudedPolyhedra1() m->finishInsertingCells(); // m->convertExtrudedPolyhedra(); - DataArrayInt *da=m->getNodalConnectivity(); - DataArrayInt *dai=m->getNodalConnectivityIndex(); - CPPUNIT_ASSERT_EQUAL((std::size_t)10,dai->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)159,da->getNbOfElems()); + DataArrayIdType *da=m->getNodalConnectivity(); + DataArrayIdType *dai=m->getNodalConnectivityIndex(); + CPPUNIT_ASSERT_EQUAL(ToIdType(10),dai->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(159),da->getNbOfElems()); // - const int expected1[159]={14,1,2,3,4, + const mcIdType expected1[159]={14,1,2,3,4, 18,5,6,7,8,9,10,11,12, 14,13,14,15,16, 31,17,18,19,-1,20,22,21,-1,17,20,21,18,-1,18,21,22,19,-1,19,22,20,17, @@ -1656,7 +1656,7 @@ void MEDCouplingBasicsTest4::testConvertExtrudedPolyhedra1() 18,39,40,41,42,43,44,45,46, 22,47,48,49,50,51,52,53,54,55,56,57,58, 31,59,60,61,62,63,64,65,-1,66,72,71,70,69,68,67,-1,59,66,67,60,-1,60,67,68,61,-1,61,68,69,62,-1,62,69,70,63,-1,63,70,71,64,-1,64,71,72,65,-1,65,72,66,59}; - const int expected2[10]={0,5,14,19,42,49,86,95,108,159}; + const mcIdType expected2[10]={0,5,14,19,42,49,86,95,108,159}; CPPUNIT_ASSERT(std::equal(expected1,expected1+159,da->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected2,expected2+10,dai->getConstPointer())); m->checkConsistency(); @@ -1683,14 +1683,14 @@ void MEDCouplingBasicsTest4::testDaDSetPartOfValuesAdv1() { const double tab1[18]={3.,4.,5., 13.,14.,15., 23.,24.,25., 33.,34.,35., 43.,44.,45., 53.,54.,55.}; const double tab2[9]={6.,7.,8., 16.,17.,18., 26.,27.,28.}; - const int tab3[6]={4,1, 2,2, 3,0}; + const mcIdType tab3[6]={4,1, 2,2, 3,0}; DataArrayDouble *a=DataArrayDouble::New(); a->alloc(6,3); std::copy(tab1,tab1+18,a->getPointer()); DataArrayDouble *b=DataArrayDouble::New(); b->alloc(3,3); std::copy(tab2,tab2+9,b->getPointer()); - DataArrayInt *c=DataArrayInt::New(); + DataArrayIdType *c=DataArrayIdType::New(); c->alloc(3,2); std::copy(tab3,tab3+6,c->getPointer()); // @@ -1715,7 +1715,7 @@ void MEDCouplingBasicsTest4::testUMeshBuildSetInstanceFromThis1() // m=MEDCouplingUMesh::New("toto",2); m2=m->buildSetInstanceFromThis(3); - CPPUNIT_ASSERT_EQUAL(0,m2->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(0,(int)m2->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(0,(int)m2->getNumberOfCells()); m->decrRef(); m2->decrRef(); @@ -1751,15 +1751,15 @@ void MEDCouplingBasicsTest4::testChangeUnderlyingMeshWithCMesh1() coordsZ->decrRef(); MEDCouplingMesh *mesh2=mesh->deepCopy(); // - static const int ids1[9]={0,1,2,10,11,12,20,21,22}; - for(const int *myId=ids1;myId!=ids1+9;myId++) + static const mcIdType ids1[9]={0,1,2,10,11,12,20,21,22}; + for(const mcIdType *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++) + for(const mcIdType *myId=ids1+1;myId!=ids1+9;myId++) { MEDCouplingFieldDouble *f=mesh->getMeasureField(true); f->changeUnderlyingMesh(mesh2,*myId,1e-12); @@ -1776,23 +1776,23 @@ void MEDCouplingBasicsTest4::testDADFindCommonTuples1() da->alloc(6,1); const double array1[6]={2.3,1.2,1.3,2.3,2.301,0.8}; std::copy(array1,array1+6,da->getPointer()); - DataArrayInt *c=0,*cI=0; + DataArrayIdType *c=0,*cI=0; // nbOftuples=1 da->findCommonTuples(1e-2,-1,c,cI); - const int expected1[3]={0,3,4}; - const int expected2[2]={0,3}; - CPPUNIT_ASSERT_EQUAL((std::size_t)3,c->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)2,cI->getNbOfElems()); + const mcIdType expected1[3]={0,3,4}; + const mcIdType expected2[2]={0,3}; + CPPUNIT_ASSERT_EQUAL(ToIdType(3),c->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(2),cI->getNbOfElems()); CPPUNIT_ASSERT(std::equal(expected1,expected1+3,c->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected2,expected2+2,cI->getConstPointer())); c->decrRef(); cI->decrRef(); // da->findCommonTuples(2e-1,-1,c,cI); - const int expected3[5]={0,3,4,1,2}; - const int expected4[3]={0,3,5}; - CPPUNIT_ASSERT_EQUAL((std::size_t)5,c->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)3,cI->getNbOfElems()); + const mcIdType expected3[5]={0,3,4,1,2}; + const mcIdType expected4[3]={0,3,5}; + CPPUNIT_ASSERT_EQUAL(ToIdType(5),c->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),cI->getNbOfElems()); CPPUNIT_ASSERT(std::equal(expected3,expected3+5,c->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected4,expected4+3,cI->getConstPointer())); c->decrRef(); @@ -1802,16 +1802,16 @@ void MEDCouplingBasicsTest4::testDADFindCommonTuples1() const double array2[12]={2.3,2.3,1.2,1.2,1.3,1.3,2.3,2.3,2.301,2.301,0.8,0.8}; std::copy(array2,array2+12,da->getPointer()); da->findCommonTuples(1e-2,-1,c,cI); - CPPUNIT_ASSERT_EQUAL((std::size_t)3,c->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)2,cI->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),c->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(2),cI->getNbOfElems()); CPPUNIT_ASSERT(std::equal(expected1,expected1+3,c->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected2,expected2+2,cI->getConstPointer())); c->decrRef(); cI->decrRef(); // da->findCommonTuples(2e-1,-1,c,cI); - CPPUNIT_ASSERT_EQUAL((std::size_t)5,c->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)3,cI->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(5),c->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),cI->getNbOfElems()); CPPUNIT_ASSERT(std::equal(expected3,expected3+5,c->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected4,expected4+3,cI->getConstPointer())); c->decrRef(); @@ -1821,16 +1821,16 @@ void MEDCouplingBasicsTest4::testDADFindCommonTuples1() const double array3[18]={2.3,2.3,2.3,1.2,1.2,1.2,1.3,1.3,1.3,2.3,2.3,2.3,2.301,2.301,2.301,0.8,0.8,0.8}; std::copy(array3,array3+18,da->getPointer()); da->findCommonTuples(1e-2,-1,c,cI); - CPPUNIT_ASSERT_EQUAL((std::size_t)3,c->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)2,cI->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),c->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(2),cI->getNbOfElems()); CPPUNIT_ASSERT(std::equal(expected1,expected1+3,c->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected2,expected2+2,cI->getConstPointer())); c->decrRef(); cI->decrRef(); // da->findCommonTuples(2e-1,-1,c,cI); - CPPUNIT_ASSERT_EQUAL((std::size_t)5,c->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)3,cI->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(5),c->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),cI->getNbOfElems()); CPPUNIT_ASSERT(std::equal(expected3,expected3+5,c->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected4,expected4+3,cI->getConstPointer())); c->decrRef(); @@ -1841,9 +1841,9 @@ void MEDCouplingBasicsTest4::testDADFindCommonTuples1() std::copy(array11,array11+6,da->getPointer()); // nbOftuples=1, no common groups da->findCommonTuples(1e-2,-1,c,cI); - CPPUNIT_ASSERT_EQUAL((std::size_t)0,c->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)1,cI->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL(0,cI->getIJ(0,0)); + CPPUNIT_ASSERT_EQUAL(ToIdType(0),c->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(1),cI->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(0),cI->getIJ(0,0)); da->alloc(6,5); //bad NumberOfComponents CPPUNIT_ASSERT_THROW(da->findCommonTuples(1e-2,-1,c,cI),INTERP_KERNEL::Exception); @@ -1866,11 +1866,11 @@ void MEDCouplingBasicsTest4::testDABack1() CPPUNIT_ASSERT_THROW(da->back(),INTERP_KERNEL::Exception); da->decrRef(); // - DataArrayInt *da2=DataArrayInt::New(); + DataArrayIdType *da2=DataArrayIdType::New(); da2->alloc(4,1); - const int array2[4]={4,7,8,2}; + const mcIdType array2[4]={4,7,8,2}; std::copy(array2,array2+4,da2->getPointer()); - CPPUNIT_ASSERT_EQUAL(2,da2->back()); + CPPUNIT_ASSERT_EQUAL(ToIdType(2),da2->back()); da2->rearrange(2); CPPUNIT_ASSERT_THROW(da2->back(),INTERP_KERNEL::Exception); da2->alloc(0,1); @@ -1887,14 +1887,14 @@ void MEDCouplingBasicsTest4::testDADGetDifferentValues1() // const double expected1[4]={2.301,1.2,1.3,0.8}; DataArrayDouble *dv=da->getDifferentValues(1e-2); - CPPUNIT_ASSERT_EQUAL((std::size_t)4,dv->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(4),dv->getNbOfElems()); for(int i=0;i<4;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],dv->getIJ(i,0),1e-14); dv->decrRef(); // dv=da->getDifferentValues(2e-1); const double expected2[3]={2.301,1.3,0.8}; - CPPUNIT_ASSERT_EQUAL((std::size_t)3,dv->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),dv->getNbOfElems()); for(int i=0;i<3;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],dv->getIJ(i,0),1e-14); dv->decrRef(); @@ -1903,22 +1903,22 @@ void MEDCouplingBasicsTest4::testDADGetDifferentValues1() void MEDCouplingBasicsTest4::testDAIBuildOld2NewArrayFromSurjectiveFormat2() { - const int arr[5]={0,3, 5,7,9}; - const int arrI[3]={0,2,5}; - DataArrayInt *a=DataArrayInt::New(); + const mcIdType arr[5]={0,3, 5,7,9}; + const mcIdType arrI[3]={0,2,5}; + DataArrayIdType *a=DataArrayIdType::New(); a->alloc(5,1); std::copy(arr,arr+5,a->getPointer()); - DataArrayInt *b=DataArrayInt::New(); + DataArrayIdType *b=DataArrayIdType::New(); b->alloc(3,1); std::copy(arrI,arrI+3,b->getPointer()); - int newNbTuple=-1; - DataArrayInt *ret=DataArrayInt::ConvertIndexArrayToO2N(10,a->begin(),b->begin(),b->end(),newNbTuple); - const int expected[10]={0,1,2,0,3,4,5,4,6,4}; - CPPUNIT_ASSERT_EQUAL((std::size_t)10,ret->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL(7,newNbTuple); - CPPUNIT_ASSERT_EQUAL(1,(int)ret->getNumberOfComponents()); + mcIdType newNbTuple=-1; + DataArrayIdType *ret=DataArrayIdType::ConvertIndexArrayToO2N(10,a->begin(),b->begin(),b->end(),newNbTuple); + const mcIdType expected[10]={0,1,2,0,3,4,5,4,6,4}; + CPPUNIT_ASSERT_EQUAL(ToIdType(10),ret->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(7),newNbTuple); + CPPUNIT_ASSERT_EQUAL(1,(int)ret->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(expected,expected+10,ret->getConstPointer())); - CPPUNIT_ASSERT_THROW(DataArrayInt::ConvertIndexArrayToO2N(9,a->begin(),b->begin(),b->end(),newNbTuple),INTERP_KERNEL::Exception); + CPPUNIT_ASSERT_THROW(DataArrayIdType::ConvertIndexArrayToO2N(9,a->begin(),b->begin(),b->end(),newNbTuple),INTERP_KERNEL::Exception); ret->decrRef(); b->decrRef(); a->decrRef(); @@ -1926,11 +1926,11 @@ void MEDCouplingBasicsTest4::testDAIBuildOld2NewArrayFromSurjectiveFormat2() void MEDCouplingBasicsTest4::testDADIReverse1() { - const int arr[6]={0,3,5,7,9,2}; - DataArrayInt *a=DataArrayInt::New(); + const mcIdType arr[6]={0,3,5,7,9,2}; + DataArrayIdType *a=DataArrayIdType::New(); a->alloc(6,1); std::copy(arr,arr+6,a->getPointer()); - CPPUNIT_ASSERT_EQUAL(2,a->back()); + CPPUNIT_ASSERT_EQUAL(ToIdType(2),a->back()); a->reverse(); for(int i=0;i<6;i++) CPPUNIT_ASSERT_EQUAL(arr[5-i],a->getIJ(i,0)); @@ -1960,17 +1960,17 @@ void MEDCouplingBasicsTest4::testDADIReverse1() void MEDCouplingBasicsTest4::testGetNodeIdsInUse1() { MEDCouplingUMesh *m0=build2DTargetMesh_1(); - const int CellIds[2]={1,2}; + const mcIdType CellIds[2]={1,2}; MEDCouplingUMesh *m1=static_cast(m0->buildPartOfMySelf(CellIds,CellIds+2,true)); - int newNbOfNodes=-1; - DataArrayInt *arr=m1->getNodeIdsInUse(newNbOfNodes); - const int expected[9]={-1,0,1,-1,2,3,-1,-1,-1}; - CPPUNIT_ASSERT_EQUAL(4,newNbOfNodes); - CPPUNIT_ASSERT_EQUAL((std::size_t)9,arr->getNbOfElems()); + mcIdType newNbOfNodes=-1; + DataArrayIdType *arr=m1->getNodeIdsInUse(newNbOfNodes); + const mcIdType expected[9]={-1,0,1,-1,2,3,-1,-1,-1}; + CPPUNIT_ASSERT_EQUAL(ToIdType(4),newNbOfNodes); + CPPUNIT_ASSERT_EQUAL(ToIdType(9),arr->getNbOfElems()); CPPUNIT_ASSERT(std::equal(expected,expected+9,arr->getConstPointer())); - DataArrayInt *arr2=arr->invertArrayO2N2N2O(newNbOfNodes); - CPPUNIT_ASSERT_EQUAL((std::size_t)4,arr2->getNbOfElems()); - const int expected2[4]={1,2,4,5}; + DataArrayIdType *arr2=arr->invertArrayO2N2N2O(newNbOfNodes); + CPPUNIT_ASSERT_EQUAL(ToIdType(4),arr2->getNbOfElems()); + const mcIdType expected2[4]={1,2,4,5}; CPPUNIT_ASSERT(std::equal(expected2,expected2+4,arr2->getConstPointer())); arr2->decrRef(); arr->decrRef(); @@ -1981,32 +1981,32 @@ void MEDCouplingBasicsTest4::testGetNodeIdsInUse1() void MEDCouplingBasicsTest4::testBuildDescendingConnec2() { MEDCouplingUMesh *mesh=build2DTargetMesh_1(); - DataArrayInt *desc=DataArrayInt::New(); - DataArrayInt *descIndx=DataArrayInt::New(); - DataArrayInt *revDesc=DataArrayInt::New(); - DataArrayInt *revDescIndx=DataArrayInt::New(); + DataArrayIdType *desc=DataArrayIdType::New(); + DataArrayIdType *descIndx=DataArrayIdType::New(); + DataArrayIdType *revDesc=DataArrayIdType::New(); + DataArrayIdType *revDescIndx=DataArrayIdType::New(); // MEDCouplingUMesh *mesh2=mesh->buildDescendingConnectivity2(desc,descIndx,revDesc,revDescIndx); mesh2->checkConsistencyLight(); CPPUNIT_ASSERT_EQUAL(1,mesh2->getMeshDimension()); CPPUNIT_ASSERT_EQUAL(13,(int)mesh2->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL((std::size_t)14,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(14,(int)revDescIndx->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)6,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(6,(int)descIndx->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)18,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)desc->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)18,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)revDesc->getNumberOfTuples()); - const int expected1[18]={1,2,3,4,-3,5,6, 7,8,-5,9,10,-2,11, 12,13,-7,-10}; + CPPUNIT_ASSERT_EQUAL(ToIdType(14),revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(14,(int)revDescIndx->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(6),descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(6,(int)descIndx->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(18),desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)desc->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(18),revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)revDesc->getNumberOfTuples()); + const mcIdType expected1[18]={1,2,3,4,-3,5,6, 7,8,-5,9,10,-2,11, 12,13,-7,-10}; CPPUNIT_ASSERT(std::equal(expected1,expected1+18,desc->getConstPointer())); - const int expected2[6]={0,4,7,10,14,18}; + const mcIdType expected2[6]={0,4,7,10,14,18}; CPPUNIT_ASSERT(std::equal(expected2,expected2+6,descIndx->getConstPointer())); - const int expected3[14]={0,1,3,5,6,8,9,11,12,13,15,16,17,18}; + const mcIdType expected3[14]={0,1,3,5,6,8,9,11,12,13,15,16,17,18}; CPPUNIT_ASSERT(std::equal(expected3,expected3+14,revDescIndx->getConstPointer())); - const int expected4[18]={0, 0,3, 0,1, 0, 1,2, 1, 2,4, 2, 3, 3,4, 3, 4, 4}; + const mcIdType expected4[18]={0, 0,3, 0,1, 0, 1,2, 1, 2,4, 2, 3, 3,4, 3, 4, 4}; CPPUNIT_ASSERT(std::equal(expected4,expected4+18,revDesc->getConstPointer())); - DataArrayInt *conn=mesh2->getNodalConnectivity(); - DataArrayInt *connIndex=mesh2->getNodalConnectivityIndex(); - const int expected5[14]={0,3,6,9,12,15,18,21,24,27,30,33,36,39}; + DataArrayIdType *conn=mesh2->getNodalConnectivity(); + DataArrayIdType *connIndex=mesh2->getNodalConnectivityIndex(); + const mcIdType expected5[14]={0,3,6,9,12,15,18,21,24,27,30,33,36,39}; CPPUNIT_ASSERT(std::equal(expected5,expected5+14,connIndex->getConstPointer())); - const int expected6[39]={1, 0, 3, 1, 3, 4, 1, 4, 1, 1, 1, 0, 1, 4, 2, 1, 2, 1, 1, 4, 5, 1, 5, 2, 1, 6, 7, 1, 7, 4, 1, 3, 6, 1, 7, 8, 1, 8, 5}; + const mcIdType expected6[39]={1, 0, 3, 1, 3, 4, 1, 4, 1, 1, 1, 0, 1, 4, 2, 1, 2, 1, 1, 4, 5, 1, 5, 2, 1, 6, 7, 1, 7, 4, 1, 3, 6, 1, 7, 8, 1, 8, 5}; CPPUNIT_ASSERT(std::equal(expected6,expected6+39,conn->getConstPointer())); // desc->decrRef(); @@ -2031,27 +2031,27 @@ void MEDCouplingBasicsTest4::testIntersect2DMeshesTmp1() std::copy(arrY,arrY+4,coordY->getPointer()); m1c->setCoordsAt(1,coordY); MEDCouplingUMesh *m1=m1c->buildUnstructured(); - const int subPart1[3]={3,4,5}; + const mcIdType subPart1[3]={3,4,5}; MEDCouplingUMesh *m1bis=static_cast(m1->buildPartOfMySelf(subPart1,subPart1+3,false)); MEDCouplingUMesh *m2tmp=static_cast(m1->deepCopy()); - const int subPart2[3]={0,1,2}; + const mcIdType subPart2[3]={0,1,2}; MEDCouplingUMesh *m2=static_cast(m2tmp->buildPartOfMySelf(subPart2,subPart2+3,false)); const double vec[2]={0.5,0.5}; m2->translate(vec); // End of construction of input meshes m1bis and m2 -> start of specific part of the test - DataArrayInt *d1=0,*d2=0; + DataArrayIdType *d1=0,*d2=0; MEDCouplingUMesh *m3=MEDCouplingUMesh::Intersect2DMeshes(m1bis,m2,1e-10,d1,d2); - const int expected1[8]={0,0,1,1,1,2,2,2}; - const int expected2[8]={0,-1,0,1,-1,1,2,-1}; + const mcIdType expected1[8]={0,0,1,1,1,2,2,2}; + const mcIdType expected2[8]={0,-1,0,1,-1,1,2,-1}; CPPUNIT_ASSERT_EQUAL(8,(int)d1->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(8,(int)d2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(8,(int)m3->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(22,m3->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(22,(int)m3->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(2,m3->getSpaceDimension()); CPPUNIT_ASSERT(std::equal(expected1,expected1+8,d1->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected2,expected2+8,d2->getConstPointer())); - const int expected3[44]={5,17,1,16,12,5,16,0,4,5,17,12,5,18,1,17,13,5,19,2,18,13,5,17,5,6,19,13,5,20,2,19,14,5,21,3,20,14,5,19,6,7,21,14}; - const int expected4[9]={0,5,12,17,22,28,33,38,44}; + const mcIdType expected3[44]={5,17,1,16,12,5,16,0,4,5,17,12,5,18,1,17,13,5,19,2,18,13,5,17,5,6,19,13,5,20,2,19,14,5,21,3,20,14,5,19,6,7,21,14}; + const mcIdType expected4[9]={0,5,12,17,22,28,33,38,44}; const double expected5[44]={-1.0,2.0,1.0,2.0,2.0,2.0,4.0,2.0,-1.0,4.0,1.0,4.0,2.0,4.0,4.0,4.0,-0.5,-1.5,1.5,-1.5,2.5,-1.5,4.5,-1.5,-0.5,2.5,1.5,2.5,2.5,2.5,4.5,2.5,-0.5,2.0,1.0,2.5,1.5,2.0,2.0,2.5,2.5,2.0,4.0,2.5}; CPPUNIT_ASSERT_EQUAL(44,(int)m3->getNodalConnectivity()->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(9,(int)m3->getNodalConnectivityIndex()->getNumberOfTuples()); @@ -2081,8 +2081,8 @@ void MEDCouplingBasicsTest4::testFindNodesOnLine1() const double vec[2]={0.,1.}; const double vec2[3]={1.,0.,0.}; const double vec3[3]={0.,1.,1.}; - const int expected1[3]={0,3,6}; - std::vector res; + const mcIdType expected1[3]={0,3,6}; + std::vector res; mesh->findNodesOnLine(pt,vec,1e-12,res); CPPUNIT_ASSERT_EQUAL(3,(int)res.size()); CPPUNIT_ASSERT(std::equal(expected1,expected1+3,res.begin())); @@ -2125,19 +2125,19 @@ void MEDCouplingBasicsTest4::testIntersect2DMeshesTmp2() m2c->setCoordsAt(1,coordsY2); MEDCouplingUMesh *m2=m2c->buildUnstructured(); // - DataArrayInt *d1=0,*d2=0; + DataArrayIdType *d1=0,*d2=0; MEDCouplingUMesh *m3=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,1e-10,d1,d2); - const int expected1[9]={0,0,1,1,2,2,3,4,5}; - const int expected2[9]={0,2,1,3,1,3,2,3,3}; + const mcIdType expected1[9]={0,0,1,1,2,2,3,4,5}; + const mcIdType expected2[9]={0,2,1,3,1,3,2,3,3}; CPPUNIT_ASSERT_EQUAL(9,(int)d1->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(9,(int)d2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(9,(int)m3->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(22,m3->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(22,(int)m3->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(2,m3->getSpaceDimension()); CPPUNIT_ASSERT(std::equal(expected1,expected1+9,d1->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected2,expected2+9,d2->getConstPointer())); - const int expected3[45]={5,16,13,12,15,5,15,4,5,16,5,21,2,13,16,5,16,5,6,21,5,17,14,2,21,5,21,6,7,17,5,4,18,19,5,5,5,19,10,6,5,6,10,20,7}; - const int expected4[10]={0,5,10,15,20,25,30,35,40,45}; + const mcIdType expected3[45]={5,16,13,12,15,5,15,4,5,16,5,21,2,13,16,5,16,5,6,21,5,17,14,2,21,5,21,6,7,17,5,4,18,19,5,5,5,19,10,6,5,6,10,20,7}; + const mcIdType expected4[10]={0,5,10,15,20,25,30,35,40,45}; const double expected5[44]={0.0,0.0,1.0,0.0,1.5,0.0,2.0,0.0,0.0,1.5,1.0,1.5,1.5,1.5,2.0,1.5,0.0,3.0,1.0,3.0,1.5,3.0,2.0,3.0,0.0,0.0,1.0,0.0,2.0,0.0,0.0,1.0,1.0,1.0,2.0,1.0,0.0,3.0,1.0,3.0,2.0,3.0,1.5,1.0}; CPPUNIT_ASSERT_EQUAL(45,(int)m3->getNodalConnectivity()->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(10,(int)m3->getNodalConnectivityIndex()->getNumberOfTuples()); @@ -2162,8 +2162,8 @@ void MEDCouplingBasicsTest4::testIntersect2DMeshesTmp2() void MEDCouplingBasicsTest4::testBuildPartOfMySelfSafe1() { MEDCouplingUMesh *mesh=build2DTargetMesh_1(); - const int input1[4]={0,-1,4,2}; - const int input2[4]={0,4,5,4}; + const mcIdType input1[4]={0,-1,4,2}; + const mcIdType input2[4]={0,4,5,4}; CPPUNIT_ASSERT_THROW(mesh->buildPartOfMySelf(input1,input1+4,true),INTERP_KERNEL::Exception); CPPUNIT_ASSERT_THROW(mesh->buildPartOfMySelf(input2,input2+4,true),INTERP_KERNEL::Exception); mesh->decrRef(); @@ -2172,7 +2172,7 @@ void MEDCouplingBasicsTest4::testBuildPartOfMySelfSafe1() void MEDCouplingBasicsTest4::testIntersect2DMeshesTmp3() { double m1Coords[50]={0.,0.,1.,0.,1.5,0.,0.,1.,0.,1.5,-1.,0.,-1.5,0.,0.,-1,0.,-1.5,0.5,0.,1.25,0.,0.70710678118654757,0.70710678118654757,1.0606601717798214,1.0606601717798214,0.,0.5,0.,1.25,-0.70710678118654757,0.70710678118654757,-1.0606601717798214,1.0606601717798214,-0.5,0.,-1.25,0.,-0.70710678118654757,-0.70710678118654757,-1.0606601717798214,-1.0606601717798214,0.,-0.5,0.,-1.25,0.70710678118654757,-0.70710678118654757,1.0606601717798214,-1.0606601717798214}; - int m1Conn[56]={0,3,1,13,11,9, 3,4,2,1,14,12,10,11, 5,3,0,15,13,17, 6,4,3,5,16,14,15,18, 5,0,7,17,21,19, 6,5,7,8,18,19,22,20, 0,1,7,9,23,21, 1,2,8,7,10,24,22,23}; + mcIdType m1Conn[56]={0,3,1,13,11,9, 3,4,2,1,14,12,10,11, 5,3,0,15,13,17, 6,4,3,5,16,14,15,18, 5,0,7,17,21,19, 6,5,7,8,18,19,22,20, 0,1,7,9,23,21, 1,2,8,7,10,24,22,23}; MEDCouplingUMesh *m1=MEDCouplingUMesh::New(); m1->setMeshDimension(2); m1->allocateCells(8); @@ -2192,7 +2192,7 @@ void MEDCouplingBasicsTest4::testIntersect2DMeshesTmp3() myCoords1->decrRef(); // double m2Coords[30]={0.,0.,1.1,0.,1.1,1.,0.,1.,1.7,0.,1.7,1.,-1.1,1.,-1.1,0.,-1.7,0.,-1.7,1.,-1.7,-1,-1.1,-1.,0.,-1.,1.1,-1,1.7,-1.}; - int m2Conn[32]={0,3,2,1, 1,2,5,4, 7,6,3,0, 8,9,6,7, 7,0,12,11, 8,7,11,10, 0,1,13,12, 1,4,14,13}; + mcIdType m2Conn[32]={0,3,2,1, 1,2,5,4, 7,6,3,0, 8,9,6,7, 7,0,12,11, 8,7,11,10, 0,1,13,12, 1,4,14,13}; MEDCouplingUMesh *m2=MEDCouplingUMesh::New(); m2->setMeshDimension(2); m2->allocateCells(8); @@ -2205,20 +2205,20 @@ void MEDCouplingBasicsTest4::testIntersect2DMeshesTmp3() m2->setCoords(myCoords2); myCoords2->decrRef(); // - DataArrayInt *d1=0,*d2=0; + DataArrayIdType *d1=0,*d2=0; MEDCouplingUMesh *m3=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,1e-10,d1,d2); m3->unPolyze(); - const int expected1[16]={0,1,1,1,2,3,3,3,4,5,5,5,6,7,7,7}; - const int expected2[16]={0,0,1,-1,2,2,3,-1,4,4,5,-1,6,6,7,-1}; - CPPUNIT_ASSERT_EQUAL(16,(int)d1->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(16,(int)d2->getNumberOfTuples()); + const mcIdType expected1[16]={0,1,1,1,2,3,3,3,4,5,5,5,6,7,7,7}; + const mcIdType expected2[16]={0,0,1,-1,2,2,3,-1,4,4,5,-1,6,6,7,-1}; + CPPUNIT_ASSERT_EQUAL(16,(int)d1->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(16,(int)d2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(16,(int)m3->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(104,m3->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(104,(int)m3->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(2,m3->getSpaceDimension()); CPPUNIT_ASSERT(std::equal(expected1,expected1+16,d1->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected2,expected2+16,d2->getConstPointer())); - const int expected3[136]={6,28,1,25,44,45,46,8,26,1,28,27,47,48,49,50,8,40,2,26,27,51,52,53,54,8,28,4,40,27,55,56,57,58,6,28,25,5,59,60,61,8,28,5,32,31,62,63,64,65,8,32,6,41,31,66,67,68,69,8,41,4,28,31,70,71,72,73,6,25,37,5,74,75,76,8,32,5,37,36,77,78,79,80,8,42,6,32,36,81,82,83,84,8,37,8,42,36,85,86,87,88,6,1,37,25,89,90,91,8,37,1,26,38,92,93,94,95,8,26,2,43,38,96,97,98,99,8,43,8,37,38,100,101,102,103}; - const int expected4[17]={0,7,16,25,34,41,50,59,68,75,84,93,102,109,118,127,136}; + const mcIdType expected3[136]={6,28,1,25,44,45,46,8,26,1,28,27,47,48,49,50,8,40,2,26,27,51,52,53,54,8,28,4,40,27,55,56,57,58,6,28,25,5,59,60,61,8,28,5,32,31,62,63,64,65,8,32,6,41,31,66,67,68,69,8,41,4,28,31,70,71,72,73,6,25,37,5,74,75,76,8,32,5,37,36,77,78,79,80,8,42,6,32,36,81,82,83,84,8,37,8,42,36,85,86,87,88,6,1,37,25,89,90,91,8,37,1,26,38,92,93,94,95,8,26,2,43,38,96,97,98,99,8,43,8,37,38,100,101,102,103}; + const mcIdType expected4[17]={0,7,16,25,34,41,50,59,68,75,84,93,102,109,118,127,136}; const double expected5[208]={0.,0.,1.,0.,1.5,0.,0.,1.,0.,1.5,-1.,0.,-1.5,0.,0.,-1.,0.,-1.5,0.5,0.,1.25,0.,0.7071067811865476,0.7071067811865476,1.0606601717798214,1.0606601717798214,0.,0.5,0.,1.25,-0.7071067811865476,0.7071067811865476,-1.0606601717798214,1.0606601717798214,-0.5,0.,-1.25,0.,-0.7071067811865476,-0.7071067811865476,-1.0606601717798214,-1.0606601717798214,0.,-0.5,0.,-1.25,0.7071067811865476,-0.7071067811865476,1.0606601717798214,-1.0606601717798214,0.,0.,1.1,0.,1.1,1.,0.,1.,1.7,0.,1.7,1.,-1.1,1.,-1.1,0.,-1.7,0.,-1.7,1.,-1.7,-1.,-1.1,-1.,0.,-1.,1.1,-1.,1.7,-1.,1.118033988749895,1.,-1.118033988749895,1.,-1.118033988749895,-1.,1.118033988749895,-1.,0.7071067811865477,0.7071067811865476,0.5,0.,0.,0.5,1.05,0.,0.7071067811865475,0.7071067811865477,0.55,1.,1.1,0.5,1.4012585384440737,0.535233134659635,1.3,0.,1.1,0.5,1.1090169943749475,1.,0.,1.25,0.6123724356957946,1.369306393762915,1.1090169943749475,1.,0.55,1.,0.,0.5,-0.5,0.,-0.7071067811865477,0.7071067811865476,-0.7071067811865475,0.7071067811865477,-1.05,0.,-1.1,0.5,-0.55,1.,-1.3,0.,-1.4012585384440737,0.5352331346596344,-1.1090169943749475,1.,-1.1,0.5,-0.6123724356957941,1.3693063937629155,0.,1.25,-0.55,1.,-1.1090169943749475,1.,0.,-0.5,-0.7071067811865475,-0.7071067811865477,-0.5,0.,-1.05,0.,-0.7071067811865478,-0.7071067811865475,-0.55,-1.,-1.1,-0.5,-1.4012585384440734,-0.5352331346596354,-1.3,0.,-1.1,-0.5,-1.1090169943749475,-1.,0.,-1.25,-0.6123724356957945,-1.369306393762915,-1.1090169943749475,-1.,-0.55,-1.,0.7071067811865475,-0.7071067811865477,0.,-0.5,0.5,0.,0.7071067811865477,-0.7071067811865475,1.05,0.,1.1,-0.5,0.55,-1.,1.3,0.,1.4012585384440737,-0.535233134659635,1.1090169943749475,-1.,1.1,-0.5,0.6123724356957946,-1.369306393762915,0.,-1.25,0.55,-1.,1.1090169943749475,-1.0}; CPPUNIT_ASSERT_EQUAL(136,(int)m3->getNodalConnectivity()->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(17,(int)m3->getNodalConnectivityIndex()->getNumberOfTuples()); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx index 8aa080b22..935a25517 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx @@ -37,7 +37,7 @@ using namespace MEDCoupling; void MEDCouplingBasicsTest5::testUMeshTessellate2D1() { double m1Coords[50]={0.,0.,1.,0.,1.5,0.,0.,1.,0.,1.5,-1.,0.,-1.5,0.,0.,-1,0.,-1.5,0.5,0.,1.25,0.,0.70710678118654757,0.70710678118654757,1.0606601717798214,1.0606601717798214,0.,0.5,0.,1.25,-0.70710678118654757,0.70710678118654757,-1.0606601717798214,1.0606601717798214,-0.5,0.,-1.25,0.,-0.70710678118654757,-0.70710678118654757,-1.0606601717798214,-1.0606601717798214,0.,-0.5,0.,-1.25,0.70710678118654757,-0.70710678118654757,1.0606601717798214,-1.0606601717798214}; - int m1Conn[56]={0,3,1,13,11,9, 3,4,2,1,14,12,10,11, 5,3,0,15,13,17, 6,4,3,5,16,14,15,18, 5,0,7,17,21,19, 6,5,7,8,18,19,22,20, 0,1,7,9,23,21, 1,2,8,7,10,24,22,23}; + mcIdType m1Conn[56]={0,3,1,13,11,9, 3,4,2,1,14,12,10,11, 5,3,0,15,13,17, 6,4,3,5,16,14,15,18, 5,0,7,17,21,19, 6,5,7,8,18,19,22,20, 0,1,7,9,23,21, 1,2,8,7,10,24,22,23}; MEDCouplingUMesh *m1=MEDCouplingUMesh::New(); m1->setMeshDimension(2); m1->allocateCells(8); @@ -59,8 +59,8 @@ void MEDCouplingBasicsTest5::testUMeshTessellate2D1() MEDCouplingUMesh *m11=static_cast(m1->deepCopy()); m11->tessellate2D(1.); CPPUNIT_ASSERT(m11->getCoords()->isEqual(*m11->getCoords(),1e-12)); - const int expected1[48]={5,0,3,11,1,5,3,4,12,2,1,11,5,5,15,3,0,5,6,16,4,3,15,5,5,5,0,7,19,5,6,5,19,7,8,20,5,0,1,23,7,5,1,2,24,8,7,23}; - const int expected2[9]={0,5,12,17,24,29,36,41,48}; + const mcIdType expected1[48]={5,0,3,11,1,5,3,4,12,2,1,11,5,5,15,3,0,5,6,16,4,3,15,5,5,5,0,7,19,5,6,5,19,7,8,20,5,0,1,23,7,5,1,2,24,8,7,23}; + const mcIdType expected2[9]={0,5,12,17,24,29,36,41,48}; CPPUNIT_ASSERT_EQUAL(48,(int)m11->getNodalConnectivity()->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(9,(int)m11->getNodalConnectivityIndex()->getNumberOfTuples()); CPPUNIT_ASSERT(std::equal(expected1,expected1+48,m11->getNodalConnectivity()->getConstPointer())); @@ -69,9 +69,9 @@ void MEDCouplingBasicsTest5::testUMeshTessellate2D1() // MEDCouplingUMesh *m12=static_cast(m1->deepCopy()); m12->tessellate2D(0.5); - CPPUNIT_ASSERT_EQUAL(41,m12->getNumberOfNodes()); - const int expected3[60]={5,0,3,25,26,1,5,3,4,27,28,2,1,26,25,5,5,29,30,3,0,5,6,31,32,4,3,30,29,5,5,5,0,7,33,34,5,6,5,34,33,7,8,35,36,5,0,1,37,38,7,5,1,2,39,40,8,7,38,37}; - const int expected4[9]={0,6,15,21,30,36,45,51,60}; + CPPUNIT_ASSERT_EQUAL(ToIdType(41),m12->getNumberOfNodes()); + const mcIdType expected3[60]={5,0,3,25,26,1,5,3,4,27,28,2,1,26,25,5,5,29,30,3,0,5,6,31,32,4,3,30,29,5,5,5,0,7,33,34,5,6,5,34,33,7,8,35,36,5,0,1,37,38,7,5,1,2,39,40,8,7,38,37}; + const mcIdType expected4[9]={0,6,15,21,30,36,45,51,60}; const double expected5[82]={0.,0.,1.,0.,1.5,0.,0.,1.,0.,1.5,-1.,0.,-1.5,0.,0.,-1.,0.,-1.5,0.5,0.,1.25,0.,0.7071067811865476,0.7071067811865476,1.0606601717798214,1.0606601717798214,0.,0.5,0.,1.25,-0.7071067811865476,0.7071067811865476,-1.0606601717798214,1.0606601717798214,-0.5,0.,-1.25,0.,-0.7071067811865476,-0.7071067811865476,-1.0606601717798214,-1.0606601717798214,0.,-0.5,0.,-1.25,0.7071067811865476,-0.7071067811865476,1.0606601717798214,-1.0606601717798214,0.479425538604203,0.8775825618903728,0.8414709848078964,0.54030230586814,0.7191383079063044,1.3163738428355591,1.2622064772118446,0.8104534588022099,-0.877582561890373,0.4794255386042027,-0.5403023058681399,0.8414709848078964,-1.3163738428355596,0.7191383079063038,-0.8104534588022098,1.2622064772118446,-0.4794255386042031,-0.8775825618903728,-0.8414709848078965,-0.5403023058681399,-0.7191383079063045,-1.3163738428355591,-1.2622064772118449,-0.8104534588022098,0.8775825618903729,-0.47942553860420295,0.54030230586814,-0.8414709848078964,1.3163738428355594,-0.7191383079063043,0.8104534588022099,-1.2622064772118446}; for(int i=0;i<82;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected5[i],m12->getCoords()->getIJ(0,i),1e-12); @@ -88,7 +88,7 @@ void MEDCouplingBasicsTest5::testUMeshTessellate2DCurve1() { // A quarter of circle: double mcoords[6] = {0.4,0.0, 0.0,-0.4, 0.283,-0.283}; - int mconnec[3] = {0,1,2}; + mcIdType mconnec[3] = {0,1,2}; MEDCouplingUMesh *m1 = MEDCouplingUMesh::New(); m1->setMeshDimension(1); @@ -114,7 +114,7 @@ void MEDCouplingBasicsTest5::testUMeshTessellate2DCurve1() void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp4() { double m1Coords[50]={0.,0.,1.,0.,1.5,0.,0.,1.,0.,1.5,-1.,0.,-1.5,0.,0.,-1,0.,-1.5,0.5,0.,1.25,0.,0.70710678118654757,0.70710678118654757,1.0606601717798214,1.0606601717798214,0.,0.5,0.,1.25,-0.70710678118654757,0.70710678118654757,-1.0606601717798214,1.0606601717798214,-0.5,0.,-1.25,0.,-0.70710678118654757,-0.70710678118654757,-1.0606601717798214,-1.0606601717798214,0.,-0.5,0.,-1.25,0.70710678118654757,-0.70710678118654757,1.0606601717798214,-1.0606601717798214}; - int m1Conn[56]={0,3,1,13,11,9, 3,4,2,1,14,12,10,11, 5,3,0,15,13,17, 6,4,3,5,16,14,15,18, 5,0,7,17,21,19, 6,5,7,8,18,19,22,20, 0,1,7,9,23,21, 1,2,8,7,10,24,22,23}; + mcIdType m1Conn[56]={0,3,1,13,11,9, 3,4,2,1,14,12,10,11, 5,3,0,15,13,17, 6,4,3,5,16,14,15,18, 5,0,7,17,21,19, 6,5,7,8,18,19,22,20, 0,1,7,9,23,21, 1,2,8,7,10,24,22,23}; MEDCouplingUMesh *m1=MEDCouplingUMesh::New(); m1->setMeshDimension(2); m1->allocateCells(8); @@ -134,7 +134,7 @@ void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp4() myCoords1->decrRef(); // double m2Coords[30]={0.,0.,1.1,0.,1.1,1.,0.,1.,1.7,0.,1.7,1.,-1.1,1.,-1.1,0.,-1.7,0.,-1.7,1.,-1.7,-1,-1.1,-1.,0.,-1.,1.1,-1,1.7,-1.}; - int m2Conn[32]={0,3,2,1, 1,2,5,4, 7,6,3,0, 8,9,6,7, 7,0,12,11, 8,7,11,10, 0,1,13,12, 1,4,14,13}; + mcIdType m2Conn[32]={0,3,2,1, 1,2,5,4, 7,6,3,0, 8,9,6,7, 7,0,12,11, 8,7,11,10, 0,1,13,12, 1,4,14,13}; MEDCouplingUMesh *m2=MEDCouplingUMesh::New(); m2->setMeshDimension(2); m2->allocateCells(8); @@ -147,20 +147,20 @@ void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp4() m2->setCoords(myCoords2); myCoords2->decrRef(); // - DataArrayInt *d1=0,*d2=0; + DataArrayIdType *d1=0,*d2=0; MEDCouplingUMesh *m3=MEDCouplingUMesh::Intersect2DMeshes(m2,m1,1e-10,d1,d2); m3->unPolyze(); - const int expected1[16]={0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7}; - const int expected2[16]={0,1,1,-1,2,3,3,-1,4,5,5,-1,6,7,7,-1}; + const mcIdType expected1[16]={0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7}; + const mcIdType expected2[16]={0,1,1,-1,2,3,3,-1,4,5,5,-1,6,7,7,-1}; CPPUNIT_ASSERT_EQUAL(16,(int)d1->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(16,(int)d2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(16,(int)m3->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(104,m3->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(104,(int)m3->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(2,m3->getSpaceDimension()); CPPUNIT_ASSERT(std::equal(expected1,expected1+16,d1->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected2,expected2+16,d2->getConstPointer())); - const int expected3[136]={6,16,15,18,44,45,46,8,18,2,1,16,47,48,49,50,8,17,1,2,40,51,52,53,54,8,40,5,4,17,55,56,57,58,6,18,15,20,59,60,61,8,20,7,6,18,62,63,64,65,8,41,6,7,21,66,67,68,69,8,21,8,9,41,70,71,72,73,6,20,15,22,74,75,76,8,22,11,7,20,77,78,79,80,8,21,7,11,42,81,82,83,84,8,42,10,8,21,85,86,87,88,6,22,15,16,89,90,91,8,16,1,13,22,92,93,94,95,8,43,13,1,17,96,97,98,99,8,17,4,14,43,100,101,102,103}; - const int expected4[17]={0,7,16,25,34,41,50,59,68,75,84,93,102,109,118,127,136}; + const mcIdType expected3[136]={6,16,15,18,44,45,46,8,18,2,1,16,47,48,49,50,8,17,1,2,40,51,52,53,54,8,40,5,4,17,55,56,57,58,6,18,15,20,59,60,61,8,20,7,6,18,62,63,64,65,8,41,6,7,21,66,67,68,69,8,21,8,9,41,70,71,72,73,6,20,15,22,74,75,76,8,22,11,7,20,77,78,79,80,8,21,7,11,42,81,82,83,84,8,42,10,8,21,85,86,87,88,6,22,15,16,89,90,91,8,16,1,13,22,92,93,94,95,8,43,13,1,17,96,97,98,99,8,17,4,14,43,100,101,102,103}; + const mcIdType expected4[17]={0,7,16,25,34,41,50,59,68,75,84,93,102,109,118,127,136}; const double expected5[208]={0.,0.,1.1, 0.,1.1,1.,0.,1.,1.7,0.,1.7,1.,-1.1,1.,-1.1,0.,-1.7,0.,-1.7,1.,-1.7,-1.,-1.1,-1.,0.,-1.,1.1,-1.,1.7,-1.,0.,0.,1.,0.,1.5,0.,0.,1.,0.,1.5,-1.,0.,-1.5,0.,0.,-1.,0.,-1.5,0.5,0.,1.25,0.,0.7071067811865476,0.7071067811865476,1.0606601717798214,1.0606601717798214,0.,0.5,0.,1.25,-0.7071067811865476,0.7071067811865476,-1.0606601717798214,1.0606601717798214,-0.5,0.,-1.25,0.,-0.7071067811865476,-0.7071067811865476,-1.0606601717798214,-1.0606601717798214,0.,-0.5,0.,-1.25,0.7071067811865476,-0.7071067811865476,1.0606601717798214,-1.0606601717798214,1.1180339887498951,1.,-1.1180339887498951,1.,-1.1180339887498951,-1.,1.1180339887498951,-1.,0.5,0.,0.,0.5,0.7071067811865477,0.7071067811865476,0.55,1.,1.1,0.5,1.05,0.,0.7071067811865477,0.7071067811865475,1.3,0.,1.1,0.5,1.1090169943749475,1.,1.4012585384440737,0.535233134659635,1.4090169943749475,1.,1.7,0.5,1.6,0.,1.4012585384440737,0.535233134659635,0.,0.5,-0.5,0.,-0.7071067811865477,0.7071067811865476,-1.05,0.,-1.1,0.5,-0.55,1.,-0.7071067811865478,0.7071067811865475,-1.1090169943749475,1.,-1.1,0.5,-1.3,0.,-1.4012585384440737,0.5352331346596344,-1.6,0.,-1.7,0.5,-1.4090169943749475,1.,-1.4012585384440737,0.5352331346596344,-0.5,0.,0.,-0.5,-0.7071067811865475,-0.7071067811865477,-0.55,-1.,-1.1,-0.5,-1.05,0.,-0.7071067811865475,-0.7071067811865477,-1.3,0.,-1.1,-0.5,-1.1090169943749475,-1.,-1.4012585384440734,-0.5352331346596354,-1.4090169943749475,-1.,-1.7,-0.5,-1.6,0.,-1.4012585384440732,-0.5352331346596354,0.,-0.5,0.5,0.,0.7071067811865475,-0.7071067811865477,1.05,0.,1.1,-0.5,0.55,-1.,0.7071067811865475,-0.7071067811865477,1.1090169943749475,-1.,1.1,-0.5,1.3,0.,1.4012585384440737,-0.535233134659635,1.6,0.,1.7,-0.5,1.4090169943749475,-1.,1.4012585384440737,-0.535233134659635}; CPPUNIT_ASSERT_EQUAL(136,(int)m3->getNodalConnectivity()->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(17,(int)m3->getNodalConnectivityIndex()->getNumberOfTuples()); @@ -182,13 +182,13 @@ void MEDCouplingBasicsTest5::testGetCellIdsCrossingPlane1() MEDCouplingUMesh *mesh3D=build3DExtrudedUMesh_1(mesh2D); const double vec[3]={-0.07,1.,0.07}; const double origin[3]={1.524,1.4552,1.74768}; - DataArrayInt *ids1=mesh3D->getCellIdsCrossingPlane(origin,vec,1e-10); + DataArrayIdType *ids1=mesh3D->getCellIdsCrossingPlane(origin,vec,1e-10); CPPUNIT_ASSERT_EQUAL(9,(int)ids1->getNumberOfTuples()); - const int expected1[9]={1,3,4,7,9,10,13,15,16}; + const mcIdType expected1[9]={1,3,4,7,9,10,13,15,16}; CPPUNIT_ASSERT(std::equal(expected1,expected1+9,ids1->getConstPointer())); const double vec2[3]={0.,0.,1.}; - DataArrayInt *ids2=mesh3D->getCellIdsCrossingPlane(origin,vec2,1e-10); - const int expected2[6]={6,7,8,9,10,11}; + DataArrayIdType *ids2=mesh3D->getCellIdsCrossingPlane(origin,vec2,1e-10); + const mcIdType expected2[6]={6,7,8,9,10,11}; CPPUNIT_ASSERT_EQUAL(6,(int)ids2->getNumberOfTuples()); CPPUNIT_ASSERT(std::equal(expected2,expected2+6,ids2->getConstPointer())); ids1->decrRef(); @@ -205,15 +205,15 @@ void MEDCouplingBasicsTest5::testBuildSlice3D1() // First slice in the middle of 3D cells const double vec1[3]={-0.07,1.,0.07}; const double origin1[3]={1.524,1.4552,1.74768}; - DataArrayInt *ids=0; + DataArrayIdType *ids=0; MEDCouplingUMesh *slice1=mesh3D->buildSlice3D(origin1,vec1,1e-10,ids); - const int expected1[9]={1,3,4,7,9,10,13,15,16}; - const int expected2[47]={5,42,41,40,43,44,5,42,46,45,41,5,44,43,40,47,48,5,49,42,44,50,5,49,51,46,42,5,50,44,48,52,5,53,49,50,54,5,53,55,51,49,5,54,50,52,56}; - const int expected3[10]={0,6,11,17,22,27,32,37,42,47}; + const mcIdType expected1[9]={1,3,4,7,9,10,13,15,16}; + const mcIdType expected2[47]={5,42,41,40,43,44,5,42,46,45,41,5,44,43,40,47,48,5,49,42,44,50,5,49,51,46,42,5,50,44,48,52,5,53,49,50,54,5,53,55,51,49,5,54,50,52,56}; + const mcIdType expected3[10]={0,6,11,17,22,27,32,37,42,47}; const double expected4[171]={1.,1.,0.,1.,1.25,0.,1.,1.5,0.,2.,1.,0.,1.,2.,0.,0.,2.,0.,3.,1.,0.,3.,2.,0.,0.,1.,0.,2.,2.,0.,1.,1.,1.,1.,1.25,1.,1.,1.5,1.,2.,1.,1.,1.,2.,1.,0.,2.,1.,3.,1.,1.,3.,2.,1.,0.,1.,1.,2.,2.,1.,1.,1.,2.,1.,1.25,2.,1.,1.5,2.,2.,1.,2.,1.,2.,2.,0.,2.,2.,3.,1.,2.,3.,2.,2.,0.,1.,2.,2.,2.,2.,1.,1.,3.,1.,1.25,3.,1.,1.5,3.,2.,1.,3.,1.,2.,3.,0.,2.,3.,3.,1.,3.,3.,2.,3.,0.,1.,3.,2.,2.,3.,1.,1.5408576,0.,2.,1.6108576000000001,0.,2.,1.5408576,1.,1.,1.5,0.5836800000000008,1.,1.4708576,1.,3.,1.6808576,0.,3.,1.6108576000000001,1.,0.,1.4708576,0.,0.,1.4008576,1.,2.,1.4708576,2.,1.,1.4008576000000001,2.,3.,1.5408575999999998,2.,0.,1.3308575999999999,2.,2.,1.4008576,3.,1.,1.3308576,3.,3.,1.4708576,3.,0.,1.2608576,3.}; CPPUNIT_ASSERT_EQUAL(2,slice1->getMeshDimension()); CPPUNIT_ASSERT_EQUAL(3,slice1->getSpaceDimension()); - CPPUNIT_ASSERT_EQUAL(57,slice1->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(57,(int)slice1->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(9,(int)slice1->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(9,(int)ids->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(47,(int)slice1->getNodalConnectivity()->getNumberOfTuples()); @@ -229,12 +229,12 @@ void MEDCouplingBasicsTest5::testBuildSlice3D1() const double vec2[3]={0.,3.,1.}; const double origin2[3]={2.5,1.,3.}; slice1=mesh3D->buildSlice3D(origin2,vec2,1e-10,ids); - const int expected5[49]={5,50,10,4,51,5,50,52,7,10,5,51,4,5,53,5,54,50,51,55,56,5,54,57,52,50,5,56,55,51,53,58,5,38,59,56,54,43,5,54,57,46,43,5,38,59,56,58,48}; - const int expected6[10]={0,5,10,15,21,26,32,38,43,49}; + const mcIdType expected5[49]={5,50,10,4,51,5,50,52,7,10,5,51,4,5,53,5,54,50,51,55,56,5,54,57,52,50,5,56,55,51,53,58,5,38,59,56,54,43,5,54,57,46,43,5,38,59,56,58,48}; + const mcIdType expected6[10]={0,5,10,15,21,26,32,38,43,49}; const double expected7[180]={1.,1.,0.,1.,1.25,0.,1.,1.5,0.,2.,1.,0.,1.,2.,0.,0.,2.,0.,3.,1.,0.,3.,2.,0.,0.,1.,0.,1.,3.,0.,2.,2.,0.,2.,3.,0.,1.,1.,1.,1.,1.25,1.,1.,1.5,1.,2.,1.,1.,1.,2.,1.,0.,2.,1.,3.,1.,1.,3.,2.,1.,0.,1.,1.,1.,3.,1.,2.,2.,1.,2.,3.,1.,0.,0.,2.,1.,1.,2.,1.,1.25,2.,1.,0.,2.,1.,1.5,2.,2.,0.,2.,2.,1.,2.,1.,2.,2.,0.,2.,2.,3.,1.,2.,3.,2.,2.,0.,1.,2.,2.,2.,2.,0.,0.,3.,1.,1.,3.,1.,1.25,3.,1.,0.,3.,1.,1.5,3.,2.,0.,3.,2.,1.,3.,1.,2.,3.,0.,2.,3.,3.,1.,3.,3.,2.,3.,0.,1.,3.,2.,2.,3.,2.,1.6666666666666667,1.,1.,1.6666666666666667,1.,3.,1.6666666666666667,1.,0.,1.6666666666666667,1.,2.,1.3333333333333335,2.,1.,1.5,1.5,1.,1.3333333333333333,2.,3.,1.3333333333333335,2.,0.,1.3333333333333335,2.,1.,1.25,2.25}; CPPUNIT_ASSERT_EQUAL(2,slice1->getMeshDimension()); CPPUNIT_ASSERT_EQUAL(3,slice1->getSpaceDimension()); - CPPUNIT_ASSERT_EQUAL(60,slice1->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(60,(int)slice1->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(9,(int)slice1->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(9,(int)ids->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(49,(int)slice1->getNodalConnectivity()->getNumberOfTuples()); @@ -250,13 +250,13 @@ void MEDCouplingBasicsTest5::testBuildSlice3D1() const double vec3[3]={0.,0.,1.}; const double origin3[3]={2.5,1.,2.}; slice1=mesh3D->buildSlice3D(origin3,vec3,1e-10,ids); - const int expected8[12]={6,7,8,9,10,11,12,13,14,15,16,17}; - const int expected9[68]={5,15,26,16,18,5,16,21,28,22,19,17,5,18,20,21,16,5,21,24,25,28,5,26,16,17,19,22,23,5,22,27,29,28,5,15,26,16,18,5,16,21,28,22,19,17,5,18,20,21,16,5,21,24,25,28,5,26,16,17,19,22,23,5,22,27,29,28}; - const int expected10[13]={0,5,12,17,22,29,34,39,46,51,56,63,68}; + const mcIdType expected8[12]={6,7,8,9,10,11,12,13,14,15,16,17}; + const mcIdType expected9[68]={5,15,26,16,18,5,16,21,28,22,19,17,5,18,20,21,16,5,21,24,25,28,5,26,16,17,19,22,23,5,22,27,29,28,5,15,26,16,18,5,16,21,28,22,19,17,5,18,20,21,16,5,21,24,25,28,5,26,16,17,19,22,23,5,22,27,29,28}; + const mcIdType expected10[13]={0,5,12,17,22,29,34,39,46,51,56,63,68}; const double expected11[135]={0.,0.,1.,1.,1.,1.,1.,1.25, 1.,1.,0.,1.,1.,1.5, 1.,2.,0.,1.,2.,1.,1.,1.,2.,1.,0.,2.,1.,3.,1.,1.,3.,2.,1.,0.,1.,1.,1.,3.,1.,2.,2.,1.,2.,3.,1.,0.,0.,2.,1.,1.,2.,1.,1.25, 2.,1.,0.,2.,1.,1.5, 2.,2.,0.,2.,2.,1.,2.,1.,2.,2.,0.,2.,2.,3.,1.,2.,3.,2.,2.,0.,1.,2.,1.,3.,2.,2.,2.,2.,2.,3.,2.,0.,0.,3.,1.,1.,3.,1.,1.25, 3.,1.,0.,3.,1.,1.5, 3.,2.,0.,3.,2.,1.,3.,1.,2.,3.,0.,2.,3.,3.,1.,3.,3.,2.,3.,0.,1.,3.,1.,3.,3.,2.,2.,3.,2.,3.,3.}; CPPUNIT_ASSERT_EQUAL(2,slice1->getMeshDimension()); CPPUNIT_ASSERT_EQUAL(3,slice1->getSpaceDimension()); - CPPUNIT_ASSERT_EQUAL(45,slice1->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(45,(int)slice1->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(12,(int)slice1->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(12,(int)ids->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(68,(int)slice1->getNodalConnectivity()->getNumberOfTuples()); @@ -277,22 +277,22 @@ void MEDCouplingBasicsTest5::testBuildSlice3DSurf1() MEDCouplingUMesh *mesh2D=0; MEDCouplingUMesh *mesh3D=build3DExtrudedUMesh_1(mesh2D); mesh2D->decrRef(); - DataArrayInt *a=DataArrayInt::New(),*b=DataArrayInt::New(),*c=DataArrayInt::New(),*d=DataArrayInt::New(); + DataArrayIdType *a=DataArrayIdType::New(),*b=DataArrayIdType::New(),*c=DataArrayIdType::New(),*d=DataArrayIdType::New(); mesh2D=mesh3D->buildDescendingConnectivity(a,b,c,d); a->decrRef(); b->decrRef(); c->decrRef(); d->decrRef(); mesh3D->decrRef(); // const double vec1[3]={-0.07,1.,0.07}; const double origin1[3]={1.524,1.4552,1.74768}; - DataArrayInt *ids=0; + DataArrayIdType *ids=0; MEDCouplingUMesh *slice1=mesh2D->buildSlice3DSurf(origin1,vec1,1e-10,ids); - const int expected1[25]={6,8,10,11,13,18,19,21,23,25,26,38,41,43,47,49,52,53,64,67,69,73,75,78,79}; - const int expected2[75]={1,40,41,1,42,41,1,40,43,1,44,43,1,42,44,1,45,41,1,42,46,1,46,45,1,47,40,1,47,48,1,44,48,1,49,42,1,44,50,1,49,50,1,49,51,1,51,46,1,48,52,1,50,52,1,53,49,1,50,54,1,53,54,1,53,55,1,55,51,1,52,56,1,54,56}; - const int expected3[26]={0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75}; + const mcIdType expected1[25]={6,8,10,11,13,18,19,21,23,25,26,38,41,43,47,49,52,53,64,67,69,73,75,78,79}; + const mcIdType expected2[75]={1,40,41,1,42,41,1,40,43,1,44,43,1,42,44,1,45,41,1,42,46,1,46,45,1,47,40,1,47,48,1,44,48,1,49,42,1,44,50,1,49,50,1,49,51,1,51,46,1,48,52,1,50,52,1,53,49,1,50,54,1,53,54,1,53,55,1,55,51,1,52,56,1,54,56}; + const mcIdType expected3[26]={0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75}; const double expected4[171]={1.,1.,0.,1.,1.25,0.,1.,1.5,0.,2.,1.,0.,1.,2.,0.,0.,2.,0.,3.,1.,0.,3.,2.,0.,0.,1.,0.,2.,2.,0.,1.,1.,1.,1.,1.25,1.,1.,1.5,1.,2.,1.,1.,1.,2.,1.,0.,2.,1.,3.,1.,1.,3.,2.,1.,0.,1.,1.,2.,2.,1.,1.,1.,2.,1.,1.25,2.,1.,1.5,2.,2.,1.,2.,1.,2.,2.,0.,2.,2.,3.,1.,2.,3.,2.,2.,0.,1.,2.,2.,2.,2.,1.,1.,3.,1.,1.25,3.,1.,1.5,3.,2.,1.,3.,1.,2.,3.,0.,2.,3.,3.,1.,3.,3.,2.,3.,0.,1.,3.,2.,2.,3.,1.,1.5408576,0.,2.,1.6108576000000001,0.,2.,1.5408576,1.,1.,1.5,0.5836800000000008,1.,1.4708576,1.,3.,1.6808576,0.,3.,1.6108576000000001,1.,0.,1.4708576,0.,0.,1.4008576,1.,2.,1.4708576,2.,1.,1.4008576000000001,2.,3.,1.5408575999999998,2.,0.,1.3308575999999999,2.,2.,1.4008576,3.,1.,1.3308576,3.,3.,1.4708576,3.,0.,1.2608576,3.}; CPPUNIT_ASSERT_EQUAL(1,slice1->getMeshDimension()); CPPUNIT_ASSERT_EQUAL(3,slice1->getSpaceDimension()); - CPPUNIT_ASSERT_EQUAL(57,slice1->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(57,(int)slice1->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(25,(int)slice1->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(25,(int)ids->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(75,(int)slice1->getNodalConnectivity()->getNumberOfTuples()); @@ -308,13 +308,13 @@ void MEDCouplingBasicsTest5::testBuildSlice3DSurf1() const double vec2[3]={0.,0.,1.}; const double origin2[3]={2.5,1.,2.}; slice1=mesh2D->buildSlice3DSurf(origin2,vec2,1e-10,ids); - const int expected5[68]={32,32,32,32,33,34,35,36,37,38,39,40,41,42,43,43,43,43,43,43,44,44,44,44,45,46,47,47,47,47,48,49,50,51,52,53,53,53,53,53,53,54,54,54,54,55,56,57,59,60,61,62,63,64,65,66,67,68,71,72,74,75,76,77,78,81,82,83}; - const int expected6[204]={1,15,18,1,18,16,1,16,26,1,26,15,1,26,15,1,16,26,1,18,16,1,15,18,1,16,21,1,21,28,1,22,28,1,19,22,1,17,19,1,16,17,1,16,21,1,21,28,1,28,22,1,22,19,1,19,17,1,17,16,1,16,18,1,18,20,1,20,21,1,21,16,1,20,21,1,18,20,1,28,21,1,21,24,1,24,25,1,25,28,1,25,28,1,24,25,1,21,24,1,23,22,1,26,23,1,26,16,1,16,17,1,17,19,1,19,22,1,22,23,1,23,26,1,22,28,1,28,29,1,29,27,1,27,22,1,27,22,1,29,27,1,28,29,1,26,15,1,16,26,1,18,16,1,15,18,1,16,21,1,21,28,1,22,28,1,19,22,1,17,19,1,16,17,1,20,21,1,18,20,1,25,28,1,24,25,1,21,24,1,23,22,1,26,23,1,27,22,1,29,27,1,28,29}; - const int expected7[69]={0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177,180,183,186,189,192,195,198,201,204}; + const mcIdType expected5[68]={32,32,32,32,33,34,35,36,37,38,39,40,41,42,43,43,43,43,43,43,44,44,44,44,45,46,47,47,47,47,48,49,50,51,52,53,53,53,53,53,53,54,54,54,54,55,56,57,59,60,61,62,63,64,65,66,67,68,71,72,74,75,76,77,78,81,82,83}; + const mcIdType expected6[204]={1,15,18,1,18,16,1,16,26,1,26,15,1,26,15,1,16,26,1,18,16,1,15,18,1,16,21,1,21,28,1,22,28,1,19,22,1,17,19,1,16,17,1,16,21,1,21,28,1,28,22,1,22,19,1,19,17,1,17,16,1,16,18,1,18,20,1,20,21,1,21,16,1,20,21,1,18,20,1,28,21,1,21,24,1,24,25,1,25,28,1,25,28,1,24,25,1,21,24,1,23,22,1,26,23,1,26,16,1,16,17,1,17,19,1,19,22,1,22,23,1,23,26,1,22,28,1,28,29,1,29,27,1,27,22,1,27,22,1,29,27,1,28,29,1,26,15,1,16,26,1,18,16,1,15,18,1,16,21,1,21,28,1,22,28,1,19,22,1,17,19,1,16,17,1,20,21,1,18,20,1,25,28,1,24,25,1,21,24,1,23,22,1,26,23,1,27,22,1,29,27,1,28,29}; + const mcIdType expected7[69]={0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177,180,183,186,189,192,195,198,201,204}; const double expected8[135]={0.,0.,1.,1.,1.,1.,1.,1.25, 1.,1.,0.,1.,1.,1.5, 1.,2.,0.,1.,2.,1.,1.,1.,2.,1.,0.,2.,1.,3.,1.,1.,3.,2.,1.,0.,1.,1.,1.,3.,1.,2.,2.,1.,2.,3.,1.,0.,0.,2.,1.,1.,2.,1.,1.25, 2.,1.,0.,2.,1.,1.5, 2.,2.,0.,2.,2.,1.,2.,1.,2.,2.,0.,2.,2.,3.,1.,2.,3.,2.,2.,0.,1.,2.,1.,3.,2.,2.,2.,2.,2.,3.,2.,0.,0.,3.,1.,1.,3.,1.,1.25, 3.,1.,0.,3.,1.,1.5, 3.,2.,0.,3.,2.,1.,3.,1.,2.,3.,0.,2.,3.,3.,1.,3.,3.,2.,3.,0.,1.,3.,1.,3.,3.,2.,2.,3.,2.,3.,3.}; CPPUNIT_ASSERT_EQUAL(1,slice1->getMeshDimension()); CPPUNIT_ASSERT_EQUAL(3,slice1->getSpaceDimension()); - CPPUNIT_ASSERT_EQUAL(45,slice1->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(45,(int)slice1->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(68,(int)slice1->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(68,(int)ids->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(204,(int)slice1->getNodalConnectivity()->getNumberOfTuples()); @@ -345,7 +345,7 @@ void MEDCouplingBasicsTest5::testDataArrayDoubleAdvSetting1() CPPUNIT_ASSERT_THROW(da->setInfoAndChangeNbOfCompo(compsCpp),INTERP_KERNEL::Exception); std::copy(data1,data1+14,da->getPointer()); // - std::vector > p(3); + std::vector > p(3); p[0].first=0; p[0].second=3; p[1].first=3; p[1].second=5; p[2].first=5; p[2].second=7; tmp=dynamic_cast(da->selectByTupleRanges(p)); CPPUNIT_ASSERT(tmp->isEqual(*da,1e-14)); @@ -392,7 +392,7 @@ void MEDCouplingBasicsTest5::testDataArrayDoubleAdvSetting1() CPPUNIT_ASSERT_DOUBLES_EQUAL(expected4[i],dac->getIJ(0,i),1e-14); dac->decrRef(); // - DataArrayInt *ids=DataArrayInt::New(); + DataArrayIdType *ids=DataArrayIdType::New(); ids->alloc(3,1); dac=da->deepCopy(); ids->setIJ(0,0,2); ids->setIJ(1,0,0); ids->setIJ(2,0,4); @@ -426,12 +426,12 @@ void MEDCouplingBasicsTest5::testDataArrayDoubleAdvSetting1() void MEDCouplingBasicsTest5::testDataArrayIntAdvSetting1() { - const int data1[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; - const int data2[10]={8,38,9,39,0,30,11,41,12,42}; + const mcIdType data1[14]={1,11,2,12,3,13,4,14,5,15,6,16,7,17}; + const mcIdType data2[10]={8,38,9,39,0,30,11,41,12,42}; const char *comps[2]={"comp1","comp2"}; std::vector compsCpp(comps,comps+2); - DataArrayInt *da=DataArrayInt::New(); - DataArrayInt *tmp=0; + DataArrayIdType *da=DataArrayIdType::New(); + DataArrayIdType *tmp=0; da->setInfoAndChangeNbOfCompo(compsCpp); da->setName("da"); da->alloc(7,2); @@ -439,22 +439,22 @@ void MEDCouplingBasicsTest5::testDataArrayIntAdvSetting1() CPPUNIT_ASSERT_THROW(da->setInfoAndChangeNbOfCompo(compsCpp),INTERP_KERNEL::Exception); std::copy(data1,data1+14,da->getPointer()); // - std::vector > p(3); + std::vector > p(3); p[0].first=0; p[0].second=3; p[1].first=3; p[1].second=5; p[2].first=5; p[2].second=7; - tmp=dynamic_cast(da->selectByTupleRanges(p)); + tmp=dynamic_cast(da->selectByTupleRanges(p)); CPPUNIT_ASSERT(tmp->isEqual(*da)); tmp->decrRef(); p[0].first=0; p[0].second=2; p[1].first=3; p[1].second=4; p[2].first=5; p[2].second=7; - tmp=dynamic_cast(da->selectByTupleRanges(p)); - const int expected1[10]={1,11,2,12,4,14,6,16,7,17}; + tmp=dynamic_cast(da->selectByTupleRanges(p)); + const mcIdType expected1[10]={1,11,2,12,4,14,6,16,7,17}; CPPUNIT_ASSERT_EQUAL(5,(int)tmp->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)tmp->getNumberOfComponents()); for(int i=0;i<10;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],tmp->getIJ(0,i)); tmp->decrRef(); p[0].first=0; p[0].second=2; p[1].first=0; p[1].second=2; p[2].first=5; p[2].second=6; - tmp=dynamic_cast(da->selectByTupleRanges(p)); - const int expected2[10]={1,11,2,12,1,11,2,12,6,16}; + tmp=dynamic_cast(da->selectByTupleRanges(p)); + const mcIdType expected2[10]={1,11,2,12,1,11,2,12,6,16}; CPPUNIT_ASSERT_EQUAL(5,(int)tmp->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(2,(int)tmp->getNumberOfComponents()); for(int i=0;i<10;i++) @@ -465,13 +465,13 @@ void MEDCouplingBasicsTest5::testDataArrayIntAdvSetting1() p[0].first=0; p[0].second=2; p[1].first=0; p[1].second=2; p[2].first=5; p[2].second=8; CPPUNIT_ASSERT_THROW(da->selectByTupleRanges(p),INTERP_KERNEL::Exception); // - DataArrayInt *da2=DataArrayInt::New(); + DataArrayIdType *da2=DataArrayIdType::New(); da2->alloc(5,2); std::copy(data2,data2+10,da2->getPointer()); // - DataArrayInt *dac=da->deepCopy(); + DataArrayIdType *dac=da->deepCopy(); dac->setContigPartOfSelectedValuesSlice(1,da2,2,4,1); - const int expected3[14]={1,11,0,30,11,41,4,14,5,15,6,16,7,17}; + const mcIdType expected3[14]={1,11,0,30,11,41,4,14,5,15,6,16,7,17}; for(int i=0;i<14;i++) CPPUNIT_ASSERT_EQUAL(expected3[i],dac->getIJ(0,i)); dac->decrRef(); @@ -481,17 +481,17 @@ void MEDCouplingBasicsTest5::testDataArrayIntAdvSetting1() CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValuesSlice(0,da2,4,6,1),INTERP_KERNEL::Exception); CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValuesSlice(3,da2,5,0,1),INTERP_KERNEL::Exception); dac->setContigPartOfSelectedValuesSlice(3,da2,1,5,1); - const int expected4[14]={1,11,2,12,3,13,9,39,0,30,11,41,12,42}; + const mcIdType expected4[14]={1,11,2,12,3,13,9,39,0,30,11,41,12,42}; for(int i=0;i<14;i++) CPPUNIT_ASSERT_EQUAL(expected4[i],dac->getIJ(0,i)); dac->decrRef(); // - DataArrayInt *ids=DataArrayInt::New(); + DataArrayIdType *ids=DataArrayIdType::New(); ids->alloc(3,1); dac=da->deepCopy(); ids->setIJ(0,0,2); ids->setIJ(1,0,0); ids->setIJ(2,0,4); dac->setContigPartOfSelectedValues(2,da2,ids); - const int expected5[14]={1,11,2,12,0,30,8,38,12,42,6,16,7,17}; + const mcIdType expected5[14]={1,11,2,12,0,30,8,38,12,42,6,16,7,17}; for(int i=0;i<14;i++) CPPUNIT_ASSERT_EQUAL(expected5[i],dac->getIJ(0,i)); dac->decrRef(); @@ -508,7 +508,7 @@ void MEDCouplingBasicsTest5::testDataArrayIntAdvSetting1() ids->setIJ(0,0,2); ids->setIJ(1,0,2); ids->setIJ(2,0,1); dac=da->deepCopy(); dac->setContigPartOfSelectedValues(4,da2,ids); - const int expected6[14]={1,11,2,12,3,13,4,14,0,30,0,30,9,39}; + const mcIdType expected6[14]={1,11,2,12,3,13,4,14,0,30,0,30,9,39}; for(int i=0;i<14;i++) CPPUNIT_ASSERT_EQUAL(expected6[i],dac->getIJ(0,i)); dac->decrRef(); @@ -521,32 +521,32 @@ void MEDCouplingBasicsTest5::testDataArrayIntAdvSetting1() void MEDCouplingBasicsTest5::testBuildDescendingConnec2Of3DMesh1() { MEDCouplingUMesh *mesh=build3DSourceMesh_1(); - DataArrayInt *desc=DataArrayInt::New(); - DataArrayInt *descIndx=DataArrayInt::New(); - DataArrayInt *revDesc=DataArrayInt::New(); - DataArrayInt *revDescIndx=DataArrayInt::New(); + DataArrayIdType *desc=DataArrayIdType::New(); + DataArrayIdType *descIndx=DataArrayIdType::New(); + DataArrayIdType *revDesc=DataArrayIdType::New(); + DataArrayIdType *revDescIndx=DataArrayIdType::New(); // MEDCouplingUMesh *mesh2=mesh->buildDescendingConnectivity2(desc,descIndx,revDesc,revDescIndx); mesh2->checkConsistencyLight(); CPPUNIT_ASSERT_EQUAL(2,mesh2->getMeshDimension()); CPPUNIT_ASSERT_EQUAL(30,(int)mesh2->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL((std::size_t)31,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(31,(int)revDescIndx->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)13,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(13,(int)descIndx->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)48,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)desc->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL((std::size_t)48,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)revDesc->getNumberOfTuples()); - const int expected1[48]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,-10,15,-5,-13,16,17,-14,18,-4,19,-2,20,21,22,23,24,25,-11,26,-1,-12,-25,-22,27,28,-7,-20,-24,29,-16,-18,30,-8,-28}; + CPPUNIT_ASSERT_EQUAL(ToIdType(31),revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(31,(int)revDescIndx->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(13),descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(13,(int)descIndx->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(48),desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)desc->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(48),revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)revDesc->getNumberOfTuples()); + const mcIdType expected1[48]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,-10,15,-5,-13,16,17,-14,18,-4,19,-2,20,21,22,23,24,25,-11,26,-1,-12,-25,-22,27,28,-7,-20,-24,29,-16,-18,30,-8,-28}; CPPUNIT_ASSERT(std::equal(expected1,expected1+48,desc->getConstPointer())); - const int expected2[13]={0,4,8,12,16,20,24,28,32,36,40,44,48}; + const mcIdType expected2[13]={0,4,8,12,16,20,24,28,32,36,40,44,48}; CPPUNIT_ASSERT(std::equal(expected2,expected2+13,descIndx->getConstPointer())); - const int expected3[31]={0,2,4,5,7,9,10,12,14,15,17,19,21,23,25,26,28,29,31,32,34,35,37,38,40,42,43,44,46,47,48}; + const mcIdType expected3[31]={0,2,4,5,7,9,10,12,14,15,17,19,21,23,25,26,28,29,31,32,34,35,37,38,40,42,43,44,46,47,48}; CPPUNIT_ASSERT(std::equal(expected3,expected3+31,revDescIndx->getConstPointer())); - const int expected4[48]={0,8,0,6,0,0,5,1,4,1,1,9,1,11,2,2,3,2,7,2,8,3,4,3,5,3,4,10,4,5,11,5,6,10,6,6,9,7,7,10,7,8,8,9,9,11,10,11}; + const mcIdType expected4[48]={0,8,0,6,0,0,5,1,4,1,1,9,1,11,2,2,3,2,7,2,8,3,4,3,5,3,4,10,4,5,11,5,6,10,6,6,9,7,7,10,7,8,8,9,9,11,10,11}; CPPUNIT_ASSERT(std::equal(expected4,expected4+48,revDesc->getConstPointer())); - DataArrayInt *conn=mesh2->getNodalConnectivity(); - DataArrayInt *connIndex=mesh2->getNodalConnectivityIndex(); - const int expected5[31]={0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120}; + DataArrayIdType *conn=mesh2->getNodalConnectivity(); + DataArrayIdType *connIndex=mesh2->getNodalConnectivityIndex(); + const mcIdType expected5[31]={0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120}; CPPUNIT_ASSERT(std::equal(expected5,expected5+31,connIndex->getConstPointer())); - const int expected6[120]={3,8,1,7,3,8,3,1,3,1,3,7,3,7,3,8,3,6,0,8,3,6,2,0,3,0,2,8,3,8,2,6,3,7,4,5,3,7,8,4,3,4,8,5,3,5,8,7,3,6,8,4,3,6,7,8,3,4,7,6,3,8,4,0,3,0,4,6,3,6,3,8,3,7,3,6,3,8,0,1,3,1,0,3,3,3,0,8,3,4,1,5,3,4,8,1,3,1,8,5,3,1,7,5,3,0,2,3,3,3,2,8,3,1,4,0,3,3,2,6}; + const mcIdType expected6[120]={3,8,1,7,3,8,3,1,3,1,3,7,3,7,3,8,3,6,0,8,3,6,2,0,3,0,2,8,3,8,2,6,3,7,4,5,3,7,8,4,3,4,8,5,3,5,8,7,3,6,8,4,3,6,7,8,3,4,7,6,3,8,4,0,3,0,4,6,3,6,3,8,3,7,3,6,3,8,0,1,3,1,0,3,3,3,0,8,3,4,1,5,3,4,8,1,3,1,8,5,3,1,7,5,3,0,2,3,3,3,2,8,3,1,4,0,3,3,2,6}; CPPUNIT_ASSERT(std::equal(expected6,expected6+120,conn->getConstPointer())); // desc->decrRef(); @@ -560,7 +560,7 @@ void MEDCouplingBasicsTest5::testBuildDescendingConnec2Of3DMesh1() void MEDCouplingBasicsTest5::testAre2DCellsNotCorrectlyOriented1() { double m1Coords[8]={1.,1.,-1.,-1.,-1.,-1.,1.,-1.}; - int m1Conn[4]={0,3,1,2}; + mcIdType m1Conn[4]={0,3,1,2}; MEDCouplingUMesh *m1=MEDCouplingUMesh::New(); m1->setMeshDimension(2); m1->allocateCells(1); @@ -580,13 +580,13 @@ void MEDCouplingBasicsTest5::testAre2DCellsNotCorrectlyOriented1() vec2[1]=3.*sin(M_PI/9.*i); MEDCouplingUMesh *m1Cpy=static_cast(m1->deepCopy()); m1Cpy->translate(vec2); - std::vector res; + std::vector res; CPPUNIT_ASSERT_THROW(m1Cpy->are2DCellsNotCorrectlyOriented(vec1,false,res),INTERP_KERNEL::Exception); res.clear(); m1Cpy->changeSpaceDimension(3); m1Cpy->are2DCellsNotCorrectlyOriented(vec1,false,res); CPPUNIT_ASSERT_EQUAL(1,(int)res.size()); - CPPUNIT_ASSERT_EQUAL(0,res[0]); + CPPUNIT_ASSERT_EQUAL(0,(int)res[0]); m1Cpy->decrRef(); } delete [] vec2; @@ -601,13 +601,13 @@ void MEDCouplingBasicsTest5::testDataArrayAbs1() const double expected1[12]={2.,3.,5.,6.,7.,8.,9.,10.,11.,12.,13.,15.}; d1->alloc(6,2); std::copy(val1,val1+12,d1->getPointer()); - MCAuto d2=d1->convertToIntArr(); + MCAuto d2=d1->convertToIntArr(); // d1->abs(); for(int i=0;i<12;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],d1->getIJ(0,i),1e-14); // - const int expected2[12]={2,3,5,6,7,8,9,10,11,12,13,15}; + const mcIdType expected2[12]={2,3,5,6,7,8,9,10,11,12,13,15}; d2->abs(); for(int i=0;i<12;i++) CPPUNIT_ASSERT_EQUAL(expected2[i],d2->getIJ(0,i)); @@ -621,15 +621,15 @@ void MEDCouplingBasicsTest5::testGetValueOn3() const double v2[5]={0.7,1.25,0.,2.,1.5}; const double disp[12]={5.,50.,500.,6.,60.,600.,7.,70.,700.,8.,80.,800.}; MEDCouplingUMesh *m=MEDCouplingUMesh::New("myMesh",1); - const int nbNodes=4; - const int nbCells=nbNodes-1; + const mcIdType nbNodes=4; + const mcIdType nbCells=nbNodes-1; m->allocateCells(nbCells); DataArrayDouble *coords=DataArrayDouble::New(); coords->alloc(nbNodes,1); std::copy(v,v+nbNodes,coords->getPointer()); m->setCoords(coords); coords->decrRef(); - const int conn[6]={0,1,2,1,2,3}; + const mcIdType conn[6]={0,1,2,1,2,3}; m->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,conn); m->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,conn+2); m->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,conn+4); @@ -667,10 +667,10 @@ void MEDCouplingBasicsTest5::testGetNodeIdsOfCell2() // test in 1D m1c->setCoordsAt(0,coordsX); CPPUNIT_ASSERT_EQUAL(4,(int)m1c->getNumberOfCells()); - const int expected1[4][2]={{0,1},{1,2},{2,3},{3,4}}; + const mcIdType expected1[4][2]={{0,1},{1,2},{2,3},{3,4}}; for(int i=0;i<4;i++) { - std::vector v; + std::vector v; m1c->getNodeIdsOfCell(i,v); CPPUNIT_ASSERT((int)v.size()==2); std::equal(v.begin(),v.end(),expected1[i]); @@ -678,10 +678,10 @@ void MEDCouplingBasicsTest5::testGetNodeIdsOfCell2() // test in 2D m1c->setCoordsAt(1,coordsY); CPPUNIT_ASSERT_EQUAL(12,(int)m1c->getNumberOfCells()); - const int expected2[12][4]={{0,1,6,5},{1,2,7,6},{2,3,8,7},{3,4,9,8},{4,5,11,10},{5,6,12,11},{6,7,13,12},{7,8,14,13},{8,9,16,15},{9,10,17,16},{10,11,18,17},{11,12,19,18}}; + const mcIdType expected2[12][4]={{0,1,6,5},{1,2,7,6},{2,3,8,7},{3,4,9,8},{4,5,11,10},{5,6,12,11},{6,7,13,12},{7,8,14,13},{8,9,16,15},{9,10,17,16},{10,11,18,17},{11,12,19,18}}; for(int i=0;i<12;i++) { - std::vector v; + std::vector v; m1c->getNodeIdsOfCell(i,v); CPPUNIT_ASSERT((int)v.size()==4); std::equal(v.begin(),v.end(),expected2[i]); @@ -689,10 +689,10 @@ void MEDCouplingBasicsTest5::testGetNodeIdsOfCell2() // test in 3D m1c->setCoordsAt(2,coordsZ); CPPUNIT_ASSERT_EQUAL(24,(int)m1c->getNumberOfCells()); - const int expected3[24][8]={{0,1,6,5,20,21,26,25},{1,2,7,6,21,22,27,26},{2,3,8,7,22,23,28,27},{3,4,9,8,23,24,29,28},{4,5,11,10,24,25,31,30},{5,6,12,11,25,26,32,31},{6,7,13,12,26,27,33,32},{7,8,14,13,27,28,34,33},{8,9,16,15,28,29,36,35},{9,10,17,16,29,30,37,36},{10,11,18,17,30,31,38,37},{11,12,19,18,31,32,39,38},{20,21,26,25,40,41,46,45},{21,22,27,26,41,42,47,46},{22,23,28,27,42,43,48,47},{23,24,29,28,43,44,49,48},{24,25,31,30,44,45,51,50},{25,26,32,31,45,46,52,51},{26,27,33,32,46,47,53,52},{27,28,34,33,47,48,54,53},{28,29,36,35,48,49,56,55},{29,30,37,36,49,50,57,56},{30,31,38,37,50,51,58,57},{31,32,39,38,51,52,59,58}}; + const mcIdType expected3[24][8]={{0,1,6,5,20,21,26,25},{1,2,7,6,21,22,27,26},{2,3,8,7,22,23,28,27},{3,4,9,8,23,24,29,28},{4,5,11,10,24,25,31,30},{5,6,12,11,25,26,32,31},{6,7,13,12,26,27,33,32},{7,8,14,13,27,28,34,33},{8,9,16,15,28,29,36,35},{9,10,17,16,29,30,37,36},{10,11,18,17,30,31,38,37},{11,12,19,18,31,32,39,38},{20,21,26,25,40,41,46,45},{21,22,27,26,41,42,47,46},{22,23,28,27,42,43,48,47},{23,24,29,28,43,44,49,48},{24,25,31,30,44,45,51,50},{25,26,32,31,45,46,52,51},{26,27,33,32,46,47,53,52},{27,28,34,33,47,48,54,53},{28,29,36,35,48,49,56,55},{29,30,37,36,49,50,57,56},{30,31,38,37,50,51,58,57},{31,32,39,38,51,52,59,58}}; for(int i=0;i<12;i++) { - std::vector v; + std::vector v; m1c->getNodeIdsOfCell(i,v); CPPUNIT_ASSERT((int)v.size()==8); std::equal(v.begin(),v.end(),expected3[i]); @@ -707,7 +707,7 @@ void MEDCouplingBasicsTest5::testGetNodeIdsOfCell2() void MEDCouplingBasicsTest5::testRenumberNodesInConn1() { double mesh2DCoords[27]={-0.3,-0.3,0., 0.2,-0.3,0., 0.7,-0.3,0., -0.3,0.2,0., 0.2,0.2,0., 0.7,0.2,0., -0.3,0.7,0., 0.2,0.7,0., 0.7,0.7,0. }; - int mesh2DConn[18]={1,4,2, 4,5,2, 0,3,4,1, 6,7,4,3, 7,8,5,4}; + mcIdType mesh2DConn[18]={1,4,2, 4,5,2, 0,3,4,1, 6,7,4,3, 7,8,5,4}; MEDCouplingUMesh *mesh2D=MEDCouplingUMesh::New("mesh",2); mesh2D->allocateCells(5); mesh2D->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,mesh2DConn); @@ -724,7 +724,7 @@ void MEDCouplingBasicsTest5::testRenumberNodesInConn1() mesh2D->checkConsistencyLight(); // double mesh3DCoords[24]={-0.3,-0.3,0., -0.3,0.2,0., 0.2,0.2,0., 0.2,-0.3,0., -0.3,-0.3,1., -0.3,0.2,1., 0.2,0.2,1., 0.2,-0.3,1. }; - int mesh3DConn[8]={0,1,2,3,4,5,6,7}; + mcIdType mesh3DConn[8]={0,1,2,3,4,5,6,7}; MEDCouplingUMesh *mesh3D=MEDCouplingUMesh::New("mesh",3); mesh3D->allocateCells(1); mesh3D->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,mesh3DConn); @@ -740,8 +740,8 @@ void MEDCouplingBasicsTest5::testRenumberNodesInConn1() MEDCouplingUMesh *mesh2D_2=dynamic_cast(mesh2D->deepCopy()); MEDCouplingUMesh *mesh3D_4=dynamic_cast(mesh3D->deepCopy()); MEDCouplingUMesh *mesh2D_4=dynamic_cast(mesh2D->deepCopy()); - DataArrayInt *renumNodes=DataArrayInt::New(); - int oldNbOf3DNodes=mesh3D->getNumberOfNodes(); + DataArrayIdType *renumNodes=DataArrayIdType::New(); + mcIdType oldNbOf3DNodes=mesh3D->getNumberOfNodes(); renumNodes->alloc(mesh2D->getNumberOfNodes(),1); renumNodes->iota(oldNbOf3DNodes); DataArrayDouble *coo=DataArrayDouble::Aggregate(mesh3D->getCoords(),mesh2D->getCoords()); @@ -755,12 +755,12 @@ void MEDCouplingBasicsTest5::testRenumberNodesInConn1() CPPUNIT_ASSERT(mesh2D_3->isEqual(mesh2D,1e-12)); mesh2D_3->decrRef(); // - DataArrayInt *da1,*da2; + DataArrayIdType *da1,*da2; mesh3D->checkGeoEquivalWith(mesh3D_2,10,1e-12,da1,da2); CPPUNIT_ASSERT(da1==0); CPPUNIT_ASSERT_EQUAL(8,(int)da2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); - const int expected1[8]={8,11,12,9,4,5,6,7}; + const mcIdType expected1[8]={8,11,12,9,4,5,6,7}; for(int i=0;i<8;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],da2->getIJ(i,0)); da2->decrRef(); @@ -769,7 +769,7 @@ void MEDCouplingBasicsTest5::testRenumberNodesInConn1() CPPUNIT_ASSERT(da1==0); CPPUNIT_ASSERT_EQUAL(9,(int)da2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da2->getNumberOfComponents()); - for(int i=0;i<9;i++) + for(mcIdType i=0;i<9;i++) CPPUNIT_ASSERT_EQUAL(8+i,da2->getIJ(i,0)); da2->decrRef(); // @@ -782,14 +782,14 @@ void MEDCouplingBasicsTest5::testRenumberNodesInConn1() CPPUNIT_ASSERT(mesh3D_4->getCoords()==mesh2D_4->getCoords()); CPPUNIT_ASSERT(mesh2D_4->getCoords()==mesh2D_5->getCoords()); mesh3D_4->checkConsistencyLight(); mesh2D_4->checkConsistencyLight(); mesh2D_5->checkConsistencyLight(); - CPPUNIT_ASSERT_EQUAL(26,mesh3D_4->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(26,(int)mesh3D_4->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(3,mesh3D_4->getSpaceDimension()); CPPUNIT_ASSERT_EQUAL(9,(int)mesh3D_4->getNodalConnectivity()->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(23,(int)mesh2D_4->getNodalConnectivity()->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(23,(int)mesh2D_5->getNodalConnectivity()->getNumberOfTuples()); - const int expected2[9]={18,0,1,2,3,4,5,6,7}; - const int expected3[23]={3,9,12,10, 3,12,13,10, 4,8,11,12,9, 4,14,15,12,11, 4,15,16,13,12}; - const int expected4[23]={3,18,21,19, 3,21,22,19, 4,17,20,21,18, 4,23,24,21,20, 4,24,25,22,21}; + const mcIdType expected2[9]={18,0,1,2,3,4,5,6,7}; + const mcIdType expected3[23]={3,9,12,10, 3,12,13,10, 4,8,11,12,9, 4,14,15,12,11, 4,15,16,13,12}; + const mcIdType expected4[23]={3,18,21,19, 3,21,22,19, 4,17,20,21,18, 4,23,24,21,20, 4,24,25,22,21}; const double expected5[78]={-0.3,-0.3,0., -0.3,0.2,0., 0.2,0.2,0., 0.2,-0.3,0., -0.3,-0.3,1., -0.3,0.2,1., 0.2,0.2,1., 0.2,-0.3,1., -0.3,-0.3,0., 0.2,-0.3,0., 0.7,-0.3,0., -0.3,0.2,0., 0.2,0.2,0., 0.7,0.2,0., -0.3,0.7,0., 0.2,0.7,0., 0.7,0.7,0., 0.7, -0.3, 0.0, 1.2, -0.3, 0.0, 1.7, -0.3, 0.0, 0.7, 0.2, 0.0, 1.2, 0.2, 0.0, 1.7, 0.2, 0.0, 0.7, 0.7, 0.0, 1.2, 0.7, 0.0, 1.7, 0.7, 0.0}; CPPUNIT_ASSERT(std::equal(expected2,expected2+9,mesh3D_4->getNodalConnectivity()->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected3,expected3+23,mesh2D_4->getNodalConnectivity()->getConstPointer())); @@ -801,14 +801,14 @@ void MEDCouplingBasicsTest5::testRenumberNodesInConn1() mesh3D_4->checkConsistencyLight(); mesh2D_4->checkConsistencyLight(); mesh2D_5->checkConsistencyLight(); CPPUNIT_ASSERT(mesh3D_4->getCoords()==mesh2D_4->getCoords()); CPPUNIT_ASSERT(mesh2D_4->getCoords()==mesh2D_5->getCoords()); - CPPUNIT_ASSERT_EQUAL(19,mesh3D_4->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(19,(int)mesh3D_4->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(3,mesh3D_4->getSpaceDimension()); CPPUNIT_ASSERT_EQUAL(9,(int)mesh3D_4->getNodalConnectivity()->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(23,(int)mesh2D_4->getNodalConnectivity()->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(23,(int)mesh2D_5->getNodalConnectivity()->getNumberOfTuples()); - const int expected6[9]={18,0,1,2,3,4,5,6,7}; - const int expected7[23]={3,3,2,8, 3,2,9,8, 4,0,1,2,3, 4,10,11,2,1, 4,11,12,9,2}; - const int expected8[23]={3,13,15,14, 3,15,16,14, 4,8,9,15,13, 4,12,17,15,9, 4,17,18,16,15}; + const mcIdType expected6[9]={18,0,1,2,3,4,5,6,7}; + const mcIdType expected7[23]={3,3,2,8, 3,2,9,8, 4,0,1,2,3, 4,10,11,2,1, 4,11,12,9,2}; + const mcIdType expected8[23]={3,13,15,14, 3,15,16,14, 4,8,9,15,13, 4,12,17,15,9, 4,17,18,16,15}; const double expected9[57]={-0.3, -0.3, 0., -0.3, 0.2, 0., 0.2, 0.2, 0., 0.2, -0.3, 0., -0.3, -0.3, 1., -0.3, 0.2, 1., 0.2, 0.2, 1., 0.2, -0.3, 1., 0.7, -0.3, 0., 0.7, 0.2, 0., -0.3, 0.7, 0., 0.2, 0.7, 0., 0.7, 0.7, 0., 1.2, -0.3, 0., 1.7, -0.3, 0., 1.2, 0.2, 0., 1.7, 0.2, 0., 1.2, 0.7, 0., 1.7, 0.7, 0.}; @@ -831,12 +831,12 @@ void MEDCouplingBasicsTest5::testRenumberNodesInConn1() void MEDCouplingBasicsTest5::testComputeNeighborsOfCells1() { MEDCouplingUMesh *m=build2DTargetMesh_1(); - DataArrayInt *d1=0,*d2=0; + DataArrayIdType *d1=0,*d2=0; m->computeNeighborsOfCells(d1,d2); CPPUNIT_ASSERT_EQUAL(6,(int)d2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(10,(int)d1->getNumberOfTuples()); - const int expected1[6]={0,2,4,6,8,10}; - const int expected2[10]={3,1,0,2,4,1,4,0,2,3}; + const mcIdType expected1[6]={0,2,4,6,8,10}; + const mcIdType expected2[10]={3,1,0,2,4,1,4,0,2,3}; CPPUNIT_ASSERT(std::equal(expected1,expected1+6,d2->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected2,expected2+10,d1->getConstPointer())); d1->decrRef(); @@ -847,7 +847,7 @@ void MEDCouplingBasicsTest5::testComputeNeighborsOfCells1() void MEDCouplingBasicsTest5::testCheckButterflyCellsBug1() { double mesh2DCoords[10]={323.85,120.983748908684,317.5,131.982271536747,336.55,120.983748908686,330.2,131.982271536751,323.85,142.98079416481}; - int mesh2DConn[5]={4,1,0,2,3}; + mcIdType mesh2DConn[5]={4,1,0,2,3}; MEDCouplingUMesh *mesh2D=MEDCouplingUMesh::New("mesh",2); mesh2D->allocateCells(1); mesh2D->insertNextCell(INTERP_KERNEL::NORM_POLYGON,5,mesh2DConn); @@ -859,7 +859,7 @@ void MEDCouplingBasicsTest5::testCheckButterflyCellsBug1() myCoords->decrRef(); mesh2D->checkConsistencyLight(); // - std::vector v; + std::vector v; mesh2D->checkButterflyCells(v); CPPUNIT_ASSERT_EQUAL(0,(int)v.size()); // @@ -868,66 +868,66 @@ void MEDCouplingBasicsTest5::testCheckButterflyCellsBug1() void MEDCouplingBasicsTest5::testDataArrayIntRange1() { - DataArrayInt *d=DataArrayInt::Range(2,17,7); - const int expected1[3]={2,9,16}; - CPPUNIT_ASSERT_EQUAL(3,(int)d->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); + DataArrayIdType *d=DataArrayIdType::Range(2,17,7); + const mcIdType expected1[3]={2,9,16}; + CPPUNIT_ASSERT_EQUAL(3,(int)d->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(expected1,expected1+3,d->getConstPointer())); d->decrRef(); // - d=DataArrayInt::Range(2,23,7); - CPPUNIT_ASSERT_EQUAL(3,(int)d->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); + d=DataArrayIdType::Range(2,23,7); + CPPUNIT_ASSERT_EQUAL(3,(int)d->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(expected1,expected1+3,d->getConstPointer())); d->decrRef(); // - d=DataArrayInt::Range(2,24,7); - const int expected2[4]={2,9,16,23}; - CPPUNIT_ASSERT_EQUAL(4,(int)d->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); + d=DataArrayIdType::Range(2,24,7); + const mcIdType expected2[4]={2,9,16,23}; + CPPUNIT_ASSERT_EQUAL(4,(int)d->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(expected2,expected2+4,d->getConstPointer())); d->decrRef(); // - d=DataArrayInt::Range(24,2,-7); - const int expected3[4]={24,17,10,3}; - CPPUNIT_ASSERT_EQUAL(4,(int)d->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); + d=DataArrayIdType::Range(24,2,-7); + const mcIdType expected3[4]={24,17,10,3}; + CPPUNIT_ASSERT_EQUAL(4,(int)d->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(expected3,expected3+4,d->getConstPointer())); d->decrRef(); // - d=DataArrayInt::Range(23,2,-7); - const int expected4[3]={23,16,9}; - CPPUNIT_ASSERT_EQUAL(3,(int)d->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); + d=DataArrayIdType::Range(23,2,-7); + const mcIdType expected4[3]={23,16,9}; + CPPUNIT_ASSERT_EQUAL(3,(int)d->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(expected4,expected4+3,d->getConstPointer())); d->decrRef(); // - d=DataArrayInt::Range(23,22,-7); - CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); - CPPUNIT_ASSERT_EQUAL(23,d->getIJ(0,0)); + d=DataArrayIdType::Range(23,22,-7); + CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(23,(int)d->getIJ(0,0)); d->decrRef(); // - d=DataArrayInt::Range(22,23,7); - CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); - CPPUNIT_ASSERT_EQUAL(22,d->getIJ(0,0)); + d=DataArrayIdType::Range(22,23,7); + CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(22,(int)d->getIJ(0,0)); d->decrRef(); // - d=DataArrayInt::Range(22,22,7); - CPPUNIT_ASSERT_EQUAL(0,(int)d->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); + d=DataArrayIdType::Range(22,22,7); + CPPUNIT_ASSERT_EQUAL(0,(int)d->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); d->decrRef(); // - d=DataArrayInt::Range(22,22,-7); - CPPUNIT_ASSERT_EQUAL(0,(int)d->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); + d=DataArrayIdType::Range(22,22,-7); + CPPUNIT_ASSERT_EQUAL(0,(int)d->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,(int)d->getNumberOfComponents()); d->decrRef(); // - CPPUNIT_ASSERT_THROW(DataArrayInt::Range(22,23,-7),INTERP_KERNEL::Exception); - CPPUNIT_ASSERT_THROW(DataArrayInt::Range(23,22,7),INTERP_KERNEL::Exception); - CPPUNIT_ASSERT_THROW(DataArrayInt::Range(23,22,0),INTERP_KERNEL::Exception); - CPPUNIT_ASSERT_THROW(DataArrayInt::Range(22,23,0),INTERP_KERNEL::Exception); + CPPUNIT_ASSERT_THROW(DataArrayIdType::Range(22,23,-7),INTERP_KERNEL::Exception); + CPPUNIT_ASSERT_THROW(DataArrayIdType::Range(23,22,7),INTERP_KERNEL::Exception); + CPPUNIT_ASSERT_THROW(DataArrayIdType::Range(23,22,0),INTERP_KERNEL::Exception); + CPPUNIT_ASSERT_THROW(DataArrayIdType::Range(22,23,0),INTERP_KERNEL::Exception); } void MEDCouplingBasicsTest5::testDataArrayDoubleGetMinMaxPerComponent1() @@ -964,13 +964,13 @@ void MEDCouplingBasicsTest5::testDataArrayDoubleGetMinMaxPerComponent1() void MEDCouplingBasicsTest5::testDataArrayIntGetHashCode1() { - DataArrayInt *d1=DataArrayInt::New(); d1->alloc(3545,1); d1->iota(0); - DataArrayInt *d2=DataArrayInt::New(); d2->alloc(3545,1); d2->iota(0); + DataArrayIdType *d1=DataArrayIdType::New(); d1->alloc(3545,1); d1->iota(0); + DataArrayIdType *d2=DataArrayIdType::New(); d2->alloc(3545,1); d2->iota(0); // CPPUNIT_ASSERT_EQUAL(d1->getHashCode(),d2->getHashCode()); - CPPUNIT_ASSERT_EQUAL(232341068,d1->getHashCode()); + CPPUNIT_ASSERT_EQUAL(ToIdType(232341068),d1->getHashCode()); d1->setIJ(886,0,6); - CPPUNIT_ASSERT_EQUAL(232340188,d1->getHashCode()); + CPPUNIT_ASSERT_EQUAL(ToIdType(232340188),d1->getHashCode()); // d1->decrRef(); d2->decrRef(); @@ -979,10 +979,10 @@ void MEDCouplingBasicsTest5::testDataArrayIntGetHashCode1() void MEDCouplingBasicsTest5::testZipConnectivityPol1() { MEDCouplingUMesh *m1=build2DTargetMesh_1(); - const int cells1[3]={2,3,4}; + const mcIdType cells1[3]={2,3,4}; MEDCouplingPointSet *m2_1=m1->buildPartOfMySelf(cells1,cells1+3,true); MEDCouplingUMesh *m2=dynamic_cast(m2_1); - DataArrayInt *arr=0; + DataArrayIdType *arr=0; CPPUNIT_ASSERT(m2); // no permutation policy 0 CPPUNIT_ASSERT(m1->areCellsIncludedIn(m2,0,arr)); @@ -1003,10 +1003,10 @@ void MEDCouplingBasicsTest5::testZipConnectivityPol1() CPPUNIT_ASSERT(std::equal(cells1,cells1+3,arr->getConstPointer())); arr->decrRef(); // some modification into m2 - const int modif1[3]={2,4,5}; + const mcIdType modif1[3]={2,4,5}; std::copy(modif1,modif1+3,m2->getNodalConnectivity()->getPointer()+1); //policy 0 fails because cell0 in m2 has same orientation be not same connectivity - const int expected1[3]={5,3,4}; + const mcIdType expected1[3]={5,3,4}; CPPUNIT_ASSERT(!m1->areCellsIncludedIn(m2,0,arr)); CPPUNIT_ASSERT_EQUAL(3,(int)arr->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)arr->getNumberOfComponents()); @@ -1025,7 +1025,7 @@ void MEDCouplingBasicsTest5::testZipConnectivityPol1() CPPUNIT_ASSERT(std::equal(cells1,cells1+3,arr->getConstPointer())); arr->decrRef(); //some new modification into m2 - const int modif2[3]={2,5,4}; + const mcIdType modif2[3]={2,5,4}; std::copy(modif2,modif2+3,m2->getNodalConnectivity()->getPointer()+1); //policy 0 fails because cell0 in m2 has not exactly the same conn CPPUNIT_ASSERT(!m1->areCellsIncludedIn(m2,0,arr)); @@ -1048,7 +1048,7 @@ void MEDCouplingBasicsTest5::testZipConnectivityPol1() m1->decrRef(); m2->decrRef(); // Now 1D - const int cells2[2]={3,2}; + const mcIdType cells2[2]={3,2}; m1=build1DSourceMesh_2(); m2_1=m1->buildPartOfMySelf(cells2,cells2+2,true); m2=dynamic_cast(m2_1); @@ -1073,10 +1073,10 @@ void MEDCouplingBasicsTest5::testZipConnectivityPol1() CPPUNIT_ASSERT(std::equal(cells2,cells2+2,arr->getConstPointer())); arr->decrRef(); // some modification into m2 - const int modif3[2]={4,3}; + const mcIdType modif3[2]={4,3}; std::copy(modif3,modif3+2,m2->getNodalConnectivity()->getPointer()+1); //policy 0 fails because cell0 in m2 has not exactly the same conn - const int expected2[2]={4,2}; + const mcIdType expected2[2]={4,2}; CPPUNIT_ASSERT(!m1->areCellsIncludedIn(m2,0,arr)); CPPUNIT_ASSERT_EQUAL(2,(int)arr->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)arr->getNumberOfComponents()); @@ -1101,8 +1101,8 @@ void MEDCouplingBasicsTest5::testZipConnectivityPol1() void MEDCouplingBasicsTest5::testConvexEnvelop2D1() { const double coords[662]={7.54758495819e-14,-1.12270326253e-12,8.43143594193,-1.02835845055e-12,4.21571797096,7.30183771609,-4.21571797097,7.30183771609,-8.43143594193,-1.09439981894e-12,-4.21571797097,-7.30183771609,4.21571797097,-7.30183771609,16.8628718839,-1.02835845055e-12,12.6471539129,7.30183771609,8.43143594193,14.6036754322,2.26427548746e-13,14.6036754322,-8.43143594193,14.6036754322,-12.6471539129,7.30183771609,-16.8628718839,-1.39630321727e-12,-12.6471539129,-7.30183771609,-8.43143594193,-14.6036754322,3.7737924791e-14,-14.6036754322,8.43143594193,-14.6036754322,12.6471539129,-7.30183771609,25.2943078258,-1.07553085654e-12,21.0785898548,7.30183771609,16.8628718839,14.6036754322,12.6471539129,21.9055131483,4.21571797096,21.9055131483,-4.21571797097,21.9055131483,-12.6471539129,21.9055131483,-16.8628718839,14.6036754322,-21.0785898548,7.30183771609,-25.2943078258,-1.02835845055e-12,-21.0785898548,-7.30183771609,-16.8628718839,-14.6036754322,-12.6471539129,-21.9055131483,-4.21571797097,-21.9055131483,4.21571797097,-21.9055131483,12.6471539129,-21.9055131483,16.8628718839,-14.6036754322,21.0785898548,-7.30183771609,33.7257437677,-7.45324014622e-13,29.5100257968,7.30183771609,25.2943078258,14.6036754322,21.0785898548,21.9055131483,16.8628718839,29.2073508644,8.43143594193,29.2073508644,-1.20761359331e-12,29.2073508644,-8.43143594193,29.2073508644,-16.8628718839,29.2073508644,-21.0785898548,21.9055131483,-25.2943078258,14.6036754322,-29.5100257968,7.30183771609,-33.7257437677,-7.26455052226e-13,-29.5100257968,-7.30183771609,-25.2943078258,-14.6036754322,-21.0785898548,-21.9055131483,-16.8628718839,-29.2073508644,-8.43143594193,-29.2073508644,4.15117172701e-13,-29.2073508644,8.43143594193,-29.2073508644,16.8628718839,-29.2073508644,21.0785898548,-21.9055131483,25.2943078258,-14.6036754322,29.5100257968,-7.30183771609,42.1571797097,-1.86802727715e-12,37.9414617387,7.30183771609,33.7257437677,14.6036754322,29.5100257968,21.9055131483,25.2943078258,29.2073508644,21.0785898548,36.5091885805,12.6471539129,36.5091885805,4.21571797096,36.5091885805,-4.21571797096,36.5091885805,-12.6471539129,36.5091885805,-21.0785898548,36.5091885805,-25.2943078258,29.2073508644,-29.5100257968,21.9055131483,-33.7257437677,14.6036754322,-37.9414617387,7.30183771609,-42.1571797097,-9.81186044565e-13,-37.9414617387,-7.30183771609,-33.7257437677,-14.6036754322,-29.5100257968,-21.9055131483,-25.2943078258,-29.2073508644,-21.0785898548,-36.5091885805,-12.6471539129,-36.5091885805,-4.21571797097,-36.5091885805,4.21571797097,-36.5091885805,12.6471539129,-36.5091885805,21.0785898548,-36.5091885805,25.2943078258,-29.2073508644,29.5100257968,-21.9055131483,33.7257437677,-14.6036754322,37.9414617387,-7.30183771609,50.5886156516,-6.98151608633e-13,46.3728976806,7.30183771609,42.1571797097,14.6036754322,37.9414617387,21.9055131483,33.7257437677,29.2073508644,29.5100257968,36.5091885805,25.2943078258,43.8110262966,16.8628718839,43.8110262966,8.43143594193,43.8110262966,-1.84915831476e-12,43.8110262966,-8.43143594193,43.8110262966,-16.8628718839,43.8110262966,-25.2943078258,43.8110262966,-29.5100257968,36.5091885805,-33.7257437677,29.2073508644,-37.9414617387,21.9055131483,-42.1571797097,14.6036754322,-46.3728976806,7.30183771609,-50.5886156516,-1.47177906685e-12,-46.3728976806,-7.30183771609,-42.1571797097,-14.6036754322,-37.9414617387,-21.9055131483,-33.7257437677,-29.2073508644,-29.5100257968,-36.5091885805,-25.2943078258,-43.8110262966,-16.8628718839,-43.8110262966,-8.43143594193,-43.8110262966,7.54758495819e-14,-43.8110262966,8.43143594193,-43.8110262966,16.8628718839,-43.8110262966,25.2943078258,-43.8110262966,29.5100257968,-36.5091885805,33.7257437677,-29.2073508644,37.9414617387,-21.9055131483,42.1571797097,-14.6036754322,46.3728976806,-7.30183771609,59.0200515935,-7.9249642061e-13,54.8043336225,7.30183771609,50.5886156516,14.6036754322,46.3728976806,21.9055131483,42.1571797097,29.2073508644,37.9414617387,36.5091885805,33.7257437677,43.8110262966,29.5100257968,51.1128640127,21.0785898548,51.1128640127,12.6471539129,51.1128640127,4.21571797096,51.1128640127,-4.21571797096,51.1128640127,-12.6471539129,51.1128640127,-21.0785898548,51.1128640127,-29.5100257968,51.1128640127,-33.7257437677,43.8110262966,-37.9414617387,36.5091885805,-42.1571797097,29.2073508644,-46.3728976806,21.9055131483,-50.5886156516,14.6036754322,-54.8043336226,7.30183771609,-59.0200515935,-1.31139288649e-12,-54.8043336226,-7.30183771609,-50.5886156516,-14.6036754322,-46.3728976806,-21.9055131483,-42.1571797097,-29.2073508644,-37.9414617387,-36.5091885805,-33.7257437677,-43.8110262966,-29.5100257968,-51.1128640127,-21.0785898548,-51.1128640127,-12.6471539129,-51.1128640127,-4.21571797097,-51.1128640127,4.21571797097,-51.1128640127,12.6471539129,-51.1128640127,21.0785898548,-51.1128640127,29.5100257968,-51.1128640127,33.7257437677,-43.8110262966,37.9414617387,-36.5091885805,42.1571797097,-29.2073508644,46.3728976806,-21.9055131483,50.5886156516,-14.6036754322,54.8043336225,-7.30183771609,67.4514875354,-2.14162723189e-12,63.2357695645,7.30183771609,59.0200515935,14.6036754322,54.8043336226,21.9055131483,50.5886156516,29.2073508644,46.3728976806,36.5091885805,42.1571797097,43.8110262966,37.9414617387,51.1128640127,33.7257437677,58.4147017287,25.2943078258,58.4147017287,16.8628718839,58.4147017287,8.43143594193,58.4147017287,6.79282646237e-13,58.4147017287,-8.43143594193,58.4147017287,-16.8628718839,58.4147017287,-25.2943078258,58.4147017287,-33.7257437677,58.4147017287,-37.9414617387,51.1128640127,-42.1571797097,43.8110262966,-46.3728976806,36.5091885805,-50.5886156516,29.2073508644,-54.8043336226,21.9055131483,-59.0200515935,14.6036754322,-63.2357695645,7.30183771609,-67.4514875354,-1.16044118732e-12,-63.2357695645,-7.30183771609,-59.0200515935,-14.6036754322,-54.8043336226,-21.9055131483,-50.5886156516,-29.2073508644,-46.3728976806,-36.5091885805,-42.1571797097,-43.8110262966,-37.9414617387,-51.1128640127,-33.7257437677,-58.4147017287,-25.2943078258,-58.4147017287,-16.8628718839,-58.4147017287,-8.43143594193,-58.4147017287,-5.66068871864e-14,-58.4147017287,8.43143594193,-58.4147017287,16.8628718839,-58.4147017287,25.2943078258,-58.4147017287,33.7257437677,-58.4147017287,37.9414617387,-51.1128640127,42.1571797097,-43.8110262966,46.3728976806,-36.5091885805,50.5886156516,-29.2073508644,54.8043336226,-21.9055131483,59.0200515935,-14.6036754322,63.2357695645,-7.30183771609,75.8829234774,-2.29257893105e-12,71.6672055064,7.30183771609,67.4514875354,14.6036754322,63.2357695645,21.9055131483,59.0200515935,29.2073508644,54.8043336226,36.5091885805,50.5886156516,43.8110262966,46.3728976806,51.1128640127,42.1571797097,58.4147017287,37.9414617387,65.7165394448,29.5100257968,65.7165394448,21.0785898548,65.7165394448,12.6471539129,65.7165394448,4.21571797097,65.7165394448,-4.21571797096,65.7165394448,-12.6471539129,65.7165394448,-21.0785898548,65.7165394448,-29.5100257968,65.7165394448,-37.9414617387,65.7165394448,-42.1571797097,58.4147017287,-46.3728976806,51.1128640127,-50.5886156516,43.8110262966,-54.8043336226,36.5091885805,-59.0200515935,29.2073508644,-63.2357695645,21.9055131483,-67.4514875354,14.6036754322,-71.6672055064,7.30183771609,-75.8829234774,-1.31139288649e-12,-71.6672055064,-7.30183771609,-67.4514875354,-14.6036754322,-63.2357695645,-21.9055131483,-59.0200515935,-29.2073508644,-54.8043336226,-36.5091885805,-50.5886156516,-43.8110262966,-46.3728976806,-51.1128640127,-42.1571797097,-58.4147017287,-37.9414617387,-65.7165394448,-29.5100257968,-65.7165394448,-21.0785898548,-65.7165394448,-12.6471539129,-65.7165394448,-4.21571797097,-65.7165394448,4.21571797097,-65.7165394448,12.6471539129,-65.7165394448,21.0785898548,-65.7165394448,29.5100257968,-65.7165394448,37.9414617387,-65.7165394448,42.1571797097,-58.4147017287,46.3728976806,-51.1128640127,50.5886156516,-43.8110262966,54.8043336226,-36.5091885805,59.0200515935,-29.2073508644,63.2357695645,-21.9055131483,67.4514875354,-14.6036754322,71.6672055064,-7.30183771609,84.3143594193,-1.49064802924e-12,80.0986414483,7.30183771609,75.8829234774,14.6036754322,71.6672055064,21.9055131483,67.4514875354,29.2073508644,63.2357695645,36.5091885805,59.0200515935,43.8110262966,54.8043336226,51.1128640127,50.5886156516,58.4147017287,46.3728976806,65.7165394448,42.1571797097,73.0183771609,33.7257437677,73.0183771609,25.2943078258,73.0183771609,16.8628718839,73.0183771609,8.43143594193,73.0183771609,2.0755858635e-12,73.0183771609,-8.43143594193,73.0183771609,-16.8628718839,73.0183771609,-25.2943078258,73.0183771609,-33.7257437677,73.0183771609,-42.1571797097,73.0183771609,-46.3728976806,65.7165394448,-50.5886156516,58.4147017287,-54.8043336226,51.1128640127,-59.0200515935,43.8110262966,-63.2357695645,36.5091885805,-67.4514875354,29.2073508644,-71.6672055064,21.9055131483,-75.8829234774,14.6036754322,-80.0986414483,7.30183771609,-84.3143594193,-1.11326878133e-12,-80.0986414483,-7.30183771609,-75.8829234774,-14.6036754322,-71.6672055064,-21.9055131483,-67.4514875354,-29.2073508644,-63.2357695645,-36.5091885805,-59.0200515935,-43.8110262966,-54.8043336226,-51.1128640127,-50.5886156516,-58.4147017287,-46.3728976806,-65.7165394448,-42.1571797097,-73.0183771609,-33.7257437677,-73.0183771609,-25.2943078258,-73.0183771609,-16.8628718839,-73.0183771609,-8.43143594193,-73.0183771609,-5.66068871864e-14,-73.0183771609,8.43143594193,-73.0183771609,16.8628718839,-73.0183771609,25.2943078258,-73.0183771609,33.7257437677,-73.0183771609,42.1571797097,-73.0183771609,46.3728976806,-65.7165394448,50.5886156516,-58.4147017287,54.8043336226,-51.1128640127,59.0200515935,-43.8110262966,63.2357695645,-36.5091885805,67.4514875354,-29.2073508644,71.6672055064,-21.9055131483,75.8829234774,-14.6036754322,80.0986414483,-7.3018377161}; - const int conn[2137]={0,2,3,4,5,6,1,1,8,2,0,6,18,7,2,9,10,3,0,1,8,3,10,11,12,4,0,2,4,3,12,13,14,5,0,5,0,4,14,15,16,6,6,1,0,5,16,17,18,7,20,8,1,18,36,19,8,21,9,2,1,7,20,9,22,23,10,2,8,21,10,23,24,11,3,2,9,11,24,25,26,12,3,10,12,11,26,27,13,4,3,13,12,27,28,29,14,4,14,4,13,29,30,15,5,15,5,14,30,31,32,16,16,6,5,15,32,33,17,17,18,6,16,33,34,35,18,7,1,6,17,35,36,19,38,20,7,36,60,37,20,39,21,8,7,19,38,21,40,22,9,8,20,39,22,41,42,23,9,21,40,23,42,43,24,10,9,22,24,43,44,25,11,10,23,25,44,45,46,26,11,24,26,25,46,47,27,12,11,27,26,47,48,28,13,12,28,27,48,49,50,29,13,29,13,28,50,51,30,14,30,14,29,51,52,31,15,31,15,30,52,53,54,32,32,16,15,31,54,55,33,33,17,16,32,55,56,34,34,35,17,33,56,57,58,35,36,18,17,34,58,59,36,19,7,18,35,59,60,37,62,38,19,60,90,61,38,63,39,20,19,37,62,39,64,40,21,20,38,63,40,65,41,22,21,39,64,41,66,67,42,22,40,65,42,67,68,43,23,22,41,43,68,69,44,24,23,42,44,69,70,45,25,24,43,45,70,71,72,46,25,44,46,45,72,73,47,26,25,47,46,73,74,48,27,26,48,47,74,75,49,28,27,49,48,75,76,77,50,28,50,28,49,77,78,51,29,51,29,50,78,79,52,30,52,30,51,79,80,53,31,53,31,52,80,81,82,54,54,32,31,53,82,83,55,55,33,32,54,83,84,56,56,34,33,55,84,85,57,57,58,34,56,85,86,87,58,59,35,34,57,87,88,59,60,36,35,58,88,89,60,37,19,36,59,89,90,61,92,62,37,90,126,91,62,93,63,38,37,61,92,63,94,64,39,38,62,93,64,95,65,40,39,63,94,65,96,66,41,40,64,95,66,97,98,67,41,65,96,67,98,99,68,42,41,66,68,99,100,69,43,42,67,69,100,101,70,44,43,68,70,101,102,71,45,44,69,71,102,103,104,72,45,70,72,71,104,105,73,46,45,73,72,105,106,74,47,46,74,73,106,107,75,48,47,75,74,107,108,76,49,48,76,75,108,109,110,77,49,77,49,76,110,111,78,50,78,50,77,111,112,79,51,79,51,78,112,113,80,52,80,52,79,113,114,81,53,81,53,80,114,115,116,82,82,54,53,81,116,117,83,83,55,54,82,117,118,84,84,56,55,83,118,119,85,85,57,56,84,119,120,86,86,87,57,85,120,121,122,87,88,58,57,86,122,123,88,89,59,58,87,123,124,89,90,60,59,88,124,125,90,61,37,60,89,125,126,91,128,92,61,126,168,127,92,129,93,62,61,91,128,93,130,94,63,62,92,129,94,131,95,64,63,93,130,95,132,96,65,64,94,131,96,133,97,66,65,95,132,97,134,135,98,66,96,133,98,135,136,99,67,66,97,99,136,137,100,68,67,98,100,137,138,101,69,68,99,101,138,139,102,70,69,100,102,139,140,103,71,70,101,103,140,141,142,104,71,102,104,103,142,143,105,72,71,105,104,143,144,106,73,72,106,105,144,145,107,74,73,107,106,145,146,108,75,74,108,107,146,147,109,76,75,109,108,147,148,149,110,76,110,76,109,149,150,111,77,111,77,110,150,151,112,78,112,78,111,151,152,113,79,113,79,112,152,153,114,80,114,80,113,153,154,115,81,115,81,114,154,155,156,116,116,82,81,115,156,157,117,117,83,82,116,157,158,118,118,84,83,117,158,159,119,119,85,84,118,159,160,120,120,86,85,119,160,161,121,121,122,86,120,161,162,163,122,123,87,86,121,163,164,123,124,88,87,122,164,165,124,125,89,88,123,165,166,125,126,90,89,124,166,167,126,91,61,90,125,167,168,127,170,128,91,168,216,169,128,171,129,92,91,127,170,129,172,130,93,92,128,171,130,173,131,94,93,129,172,131,174,132,95,94,130,173,132,175,133,96,95,131,174,133,176,134,97,96,132,175,134,177,178,135,97,133,176,135,178,179,136,98,97,134,136,179,180,137,99,98,135,137,180,181,138,100,99,136,138,181,182,139,101,100,137,139,182,183,140,102,101,138,140,183,184,141,103,102,139,141,184,185,186,142,103,140,142,141,186,187,143,104,103,143,142,187,188,144,105,104,144,143,188,189,145,106,105,145,144,189,190,146,107,106,146,145,190,191,147,108,107,147,146,191,192,148,109,108,148,147,192,193,194,149,109,149,109,148,194,195,150,110,150,110,149,195,196,151,111,151,111,150,196,197,152,112,152,112,151,197,198,153,113,153,113,152,198,199,154,114,154,114,153,199,200,155,115,155,115,154,200,201,202,156,156,116,115,155,202,203,157,157,117,116,156,203,204,158,158,118,117,157,204,205,159,159,119,118,158,205,206,160,160,120,119,159,206,207,161,161,121,120,160,207,208,162,162,163,121,161,208,209,210,163,164,122,121,162,210,211,164,165,123,122,163,211,212,165,166,124,123,164,212,213,166,167,125,124,165,213,214,167,168,126,125,166,214,215,168,127,91,126,167,215,216,169,218,170,127,216,270,217,170,219,171,128,127,169,218,171,220,172,129,128,170,219,172,221,173,130,129,171,220,173,222,174,131,130,172,221,174,223,175,132,131,173,222,175,224,176,133,132,174,223,176,225,177,134,133,175,224,177,226,227,178,134,176,225,178,227,228,179,135,134,177,179,228,229,180,136,135,178,180,229,230,181,137,136,179,181,230,231,182,138,137,180,182,231,232,183,139,138,181,183,232,233,184,140,139,182,184,233,234,185,141,140,183,185,234,235,236,186,141,184,186,185,236,237,187,142,141,187,186,237,238,188,143,142,188,187,238,239,189,144,143,189,188,239,240,190,145,144,190,189,240,241,191,146,145,191,190,241,242,192,147,146,192,191,242,243,193,148,147,193,192,243,244,245,194,148,194,148,193,245,246,195,149,195,149,194,246,247,196,150,196,150,195,247,248,197,151,197,151,196,248,249,198,152,198,152,197,249,250,199,153,199,153,198,250,251,200,154,200,154,199,251,252,201,155,201,155,200,252,253,254,202,202,156,155,201,254,255,203,203,157,156,202,255,256,204,204,158,157,203,256,257,205,205,159,158,204,257,258,206,206,160,159,205,258,259,207,207,161,160,206,259,260,208,208,162,161,207,260,261,209,209,210,162,208,261,262,263,210,211,163,162,209,263,264,211,212,164,163,210,264,265,212,213,165,164,211,265,266,213,214,166,165,212,266,267,214,215,167,166,213,267,268,215,216,168,167,214,268,269,216,169,127,168,215,269,270,217,272,218,169,270,330,271,218,273,219,170,169,217,272,219,274,220,171,170,218,273,220,275,221,172,171,219,274,221,276,222,173,172,220,275,222,277,223,174,173,221,276,223,278,224,175,174,222,277,224,279,225,176,175,223,278,225,280,226,177,176,224,279,226,281,282,227,177,225,280,227,282,283,228,178,177,226,228,283,284,229,179,178,227,229,284,285,230,180,179,228,230,285,286,231,181,180,229,231,286,287,232,182,181,230,232,287,288,233,183,182,231,233,288,289,234,184,183,232,234,289,290,235,185,184,233,235,290,291,292,236,185,234,236,235,292,293,237,186,185,237,236,293,294,238,187,186,238,237,294,295,239,188,187,239,238,295,296,240,189,188,240,239,296,297,241,190,189,241,240,297,298,242,191,190,242,241,298,299,243,192,191,243,242,299,300,244,193,192,244,243,300,301,302,245,193,245,193,244,302,303,246,194,246,194,245,303,304,247,195,247,195,246,304,305,248,196,248,196,247,305,306,249,197,249,197,248,306,307,250,198,250,198,249,307,308,251,199,251,199,250,308,309,252,200,252,200,251,309,310,253,201,253,201,252,310,311,312,254,254,202,201,253,312,313,255,255,203,202,254,313,314,256,256,204,203,255,314,315,257,257,205,204,256,315,316,258,258,206,205,257,316,317,259,259,207,206,258,317,318,260,260,208,207,259,318,319,261,261,209,208,260,319,320,262,262,263,209,261,320,321,322,263,264,210,209,262,322,323,264,265,211,210,263,323,324,265,266,212,211,264,324,325,266,267,213,212,265,325,326,267,268,214,213,266,326,327,268,269,215,214,267,327,328,269,270,216,215,268,328,329,270,217,169,216,269,329,330,271,272,217,330,273,218,217,271,274,219,218,272,275,220,219,273,276,221,220,274,277,222,221,275,278,223,222,276,279,224,223,277,280,225,224,278,281,226,225,279,281,282,226,280,283,227,226,281,284,228,227,282,285,229,228,283,286,230,229,284,287,231,230,285,288,232,231,286,289,233,232,287,290,234,233,288,291,235,234,289,291,292,235,290,291,293,236,235,292,294,237,236,293,295,238,237,294,296,239,238,295,297,240,239,296,298,241,240,297,299,242,241,298,300,243,242,299,301,244,243,301,300,302,244,244,301,303,245,245,302,304,246,246,303,305,247,247,304,306,248,248,305,307,249,249,306,308,250,250,307,309,251,251,308,310,252,252,309,311,253,311,253,310,312,254,253,311,313,255,254,312,314,256,255,313,315,257,256,314,316,258,257,315,317,259,258,316,318,260,259,317,319,261,260,318,320,262,261,319,321,321,322,262,320,323,263,262,321,324,264,263,322,325,265,264,323,326,266,265,324,327,267,266,325,328,268,267,326,329,269,268,327,330,270,269,328,271,217,270,329}; - const int connI[332]={0,7,14,21,28,35,42,49,56,63,70,77,84,91,98,105,112,119,126,133,140,147,154,161,168,175,182,189,196,203,210,217,224,231,238,245,252,259,266,273,280,287,294,301,308,315,322,329,336,343,350,357,364,371,378,385,392,399,406,413,420,427,434,441,448,455,462,469,476,483,490,497,504,511,518,525,532,539,546,553,560,567,574,581,588,595,602,609,616,623,630,637,644,651,658,665,672,679,686,693,700,707,714,721,728,735,742,749,756,763,770,777,784,791,798,805,812,819,826,833,840,847,854,861,868,875,882,889,896,903,910,917,924,931,938,945,952,959,966,973,980,987,994,1001,1008,1015,1022,1029,1036,1043,1050,1057,1064,1071,1078,1085,1092,1099,1106,1113,1120,1127,1134,1141,1148,1155,1162,1169,1176,1183,1190,1197,1204,1211,1218,1225,1232,1239,1246,1253,1260,1267,1274,1281,1288,1295,1302,1309,1316,1323,1330,1337,1344,1351,1358,1365,1372,1379,1386,1393,1400,1407,1414,1421,1428,1435,1442,1449,1456,1463,1470,1477,1484,1491,1498,1505,1512,1519,1526,1533,1540,1547,1554,1561,1568,1575,1582,1589,1596,1603,1610,1617,1624,1631,1638,1645,1652,1659,1666,1673,1680,1687,1694,1701,1708,1715,1722,1729,1736,1743,1750,1757,1764,1771,1778,1785,1792,1799,1806,1813,1820,1827,1834,1841,1848,1855,1862,1869,1876,1883,1890,1897,1901,1905,1909,1913,1917,1921,1925,1929,1933,1937,1941,1945,1949,1953,1957,1961,1965,1969,1973,1977,1981,1985,1989,1993,1997,2001,2005,2009,2013,2017,2021,2025,2029,2033,2037,2041,2045,2049,2053,2057,2061,2065,2069,2073,2077,2081,2085,2089,2093,2097,2101,2105,2109,2113,2117,2121,2125,2129,2133,2137}; + const mcIdType conn[2137]={0,2,3,4,5,6,1,1,8,2,0,6,18,7,2,9,10,3,0,1,8,3,10,11,12,4,0,2,4,3,12,13,14,5,0,5,0,4,14,15,16,6,6,1,0,5,16,17,18,7,20,8,1,18,36,19,8,21,9,2,1,7,20,9,22,23,10,2,8,21,10,23,24,11,3,2,9,11,24,25,26,12,3,10,12,11,26,27,13,4,3,13,12,27,28,29,14,4,14,4,13,29,30,15,5,15,5,14,30,31,32,16,16,6,5,15,32,33,17,17,18,6,16,33,34,35,18,7,1,6,17,35,36,19,38,20,7,36,60,37,20,39,21,8,7,19,38,21,40,22,9,8,20,39,22,41,42,23,9,21,40,23,42,43,24,10,9,22,24,43,44,25,11,10,23,25,44,45,46,26,11,24,26,25,46,47,27,12,11,27,26,47,48,28,13,12,28,27,48,49,50,29,13,29,13,28,50,51,30,14,30,14,29,51,52,31,15,31,15,30,52,53,54,32,32,16,15,31,54,55,33,33,17,16,32,55,56,34,34,35,17,33,56,57,58,35,36,18,17,34,58,59,36,19,7,18,35,59,60,37,62,38,19,60,90,61,38,63,39,20,19,37,62,39,64,40,21,20,38,63,40,65,41,22,21,39,64,41,66,67,42,22,40,65,42,67,68,43,23,22,41,43,68,69,44,24,23,42,44,69,70,45,25,24,43,45,70,71,72,46,25,44,46,45,72,73,47,26,25,47,46,73,74,48,27,26,48,47,74,75,49,28,27,49,48,75,76,77,50,28,50,28,49,77,78,51,29,51,29,50,78,79,52,30,52,30,51,79,80,53,31,53,31,52,80,81,82,54,54,32,31,53,82,83,55,55,33,32,54,83,84,56,56,34,33,55,84,85,57,57,58,34,56,85,86,87,58,59,35,34,57,87,88,59,60,36,35,58,88,89,60,37,19,36,59,89,90,61,92,62,37,90,126,91,62,93,63,38,37,61,92,63,94,64,39,38,62,93,64,95,65,40,39,63,94,65,96,66,41,40,64,95,66,97,98,67,41,65,96,67,98,99,68,42,41,66,68,99,100,69,43,42,67,69,100,101,70,44,43,68,70,101,102,71,45,44,69,71,102,103,104,72,45,70,72,71,104,105,73,46,45,73,72,105,106,74,47,46,74,73,106,107,75,48,47,75,74,107,108,76,49,48,76,75,108,109,110,77,49,77,49,76,110,111,78,50,78,50,77,111,112,79,51,79,51,78,112,113,80,52,80,52,79,113,114,81,53,81,53,80,114,115,116,82,82,54,53,81,116,117,83,83,55,54,82,117,118,84,84,56,55,83,118,119,85,85,57,56,84,119,120,86,86,87,57,85,120,121,122,87,88,58,57,86,122,123,88,89,59,58,87,123,124,89,90,60,59,88,124,125,90,61,37,60,89,125,126,91,128,92,61,126,168,127,92,129,93,62,61,91,128,93,130,94,63,62,92,129,94,131,95,64,63,93,130,95,132,96,65,64,94,131,96,133,97,66,65,95,132,97,134,135,98,66,96,133,98,135,136,99,67,66,97,99,136,137,100,68,67,98,100,137,138,101,69,68,99,101,138,139,102,70,69,100,102,139,140,103,71,70,101,103,140,141,142,104,71,102,104,103,142,143,105,72,71,105,104,143,144,106,73,72,106,105,144,145,107,74,73,107,106,145,146,108,75,74,108,107,146,147,109,76,75,109,108,147,148,149,110,76,110,76,109,149,150,111,77,111,77,110,150,151,112,78,112,78,111,151,152,113,79,113,79,112,152,153,114,80,114,80,113,153,154,115,81,115,81,114,154,155,156,116,116,82,81,115,156,157,117,117,83,82,116,157,158,118,118,84,83,117,158,159,119,119,85,84,118,159,160,120,120,86,85,119,160,161,121,121,122,86,120,161,162,163,122,123,87,86,121,163,164,123,124,88,87,122,164,165,124,125,89,88,123,165,166,125,126,90,89,124,166,167,126,91,61,90,125,167,168,127,170,128,91,168,216,169,128,171,129,92,91,127,170,129,172,130,93,92,128,171,130,173,131,94,93,129,172,131,174,132,95,94,130,173,132,175,133,96,95,131,174,133,176,134,97,96,132,175,134,177,178,135,97,133,176,135,178,179,136,98,97,134,136,179,180,137,99,98,135,137,180,181,138,100,99,136,138,181,182,139,101,100,137,139,182,183,140,102,101,138,140,183,184,141,103,102,139,141,184,185,186,142,103,140,142,141,186,187,143,104,103,143,142,187,188,144,105,104,144,143,188,189,145,106,105,145,144,189,190,146,107,106,146,145,190,191,147,108,107,147,146,191,192,148,109,108,148,147,192,193,194,149,109,149,109,148,194,195,150,110,150,110,149,195,196,151,111,151,111,150,196,197,152,112,152,112,151,197,198,153,113,153,113,152,198,199,154,114,154,114,153,199,200,155,115,155,115,154,200,201,202,156,156,116,115,155,202,203,157,157,117,116,156,203,204,158,158,118,117,157,204,205,159,159,119,118,158,205,206,160,160,120,119,159,206,207,161,161,121,120,160,207,208,162,162,163,121,161,208,209,210,163,164,122,121,162,210,211,164,165,123,122,163,211,212,165,166,124,123,164,212,213,166,167,125,124,165,213,214,167,168,126,125,166,214,215,168,127,91,126,167,215,216,169,218,170,127,216,270,217,170,219,171,128,127,169,218,171,220,172,129,128,170,219,172,221,173,130,129,171,220,173,222,174,131,130,172,221,174,223,175,132,131,173,222,175,224,176,133,132,174,223,176,225,177,134,133,175,224,177,226,227,178,134,176,225,178,227,228,179,135,134,177,179,228,229,180,136,135,178,180,229,230,181,137,136,179,181,230,231,182,138,137,180,182,231,232,183,139,138,181,183,232,233,184,140,139,182,184,233,234,185,141,140,183,185,234,235,236,186,141,184,186,185,236,237,187,142,141,187,186,237,238,188,143,142,188,187,238,239,189,144,143,189,188,239,240,190,145,144,190,189,240,241,191,146,145,191,190,241,242,192,147,146,192,191,242,243,193,148,147,193,192,243,244,245,194,148,194,148,193,245,246,195,149,195,149,194,246,247,196,150,196,150,195,247,248,197,151,197,151,196,248,249,198,152,198,152,197,249,250,199,153,199,153,198,250,251,200,154,200,154,199,251,252,201,155,201,155,200,252,253,254,202,202,156,155,201,254,255,203,203,157,156,202,255,256,204,204,158,157,203,256,257,205,205,159,158,204,257,258,206,206,160,159,205,258,259,207,207,161,160,206,259,260,208,208,162,161,207,260,261,209,209,210,162,208,261,262,263,210,211,163,162,209,263,264,211,212,164,163,210,264,265,212,213,165,164,211,265,266,213,214,166,165,212,266,267,214,215,167,166,213,267,268,215,216,168,167,214,268,269,216,169,127,168,215,269,270,217,272,218,169,270,330,271,218,273,219,170,169,217,272,219,274,220,171,170,218,273,220,275,221,172,171,219,274,221,276,222,173,172,220,275,222,277,223,174,173,221,276,223,278,224,175,174,222,277,224,279,225,176,175,223,278,225,280,226,177,176,224,279,226,281,282,227,177,225,280,227,282,283,228,178,177,226,228,283,284,229,179,178,227,229,284,285,230,180,179,228,230,285,286,231,181,180,229,231,286,287,232,182,181,230,232,287,288,233,183,182,231,233,288,289,234,184,183,232,234,289,290,235,185,184,233,235,290,291,292,236,185,234,236,235,292,293,237,186,185,237,236,293,294,238,187,186,238,237,294,295,239,188,187,239,238,295,296,240,189,188,240,239,296,297,241,190,189,241,240,297,298,242,191,190,242,241,298,299,243,192,191,243,242,299,300,244,193,192,244,243,300,301,302,245,193,245,193,244,302,303,246,194,246,194,245,303,304,247,195,247,195,246,304,305,248,196,248,196,247,305,306,249,197,249,197,248,306,307,250,198,250,198,249,307,308,251,199,251,199,250,308,309,252,200,252,200,251,309,310,253,201,253,201,252,310,311,312,254,254,202,201,253,312,313,255,255,203,202,254,313,314,256,256,204,203,255,314,315,257,257,205,204,256,315,316,258,258,206,205,257,316,317,259,259,207,206,258,317,318,260,260,208,207,259,318,319,261,261,209,208,260,319,320,262,262,263,209,261,320,321,322,263,264,210,209,262,322,323,264,265,211,210,263,323,324,265,266,212,211,264,324,325,266,267,213,212,265,325,326,267,268,214,213,266,326,327,268,269,215,214,267,327,328,269,270,216,215,268,328,329,270,217,169,216,269,329,330,271,272,217,330,273,218,217,271,274,219,218,272,275,220,219,273,276,221,220,274,277,222,221,275,278,223,222,276,279,224,223,277,280,225,224,278,281,226,225,279,281,282,226,280,283,227,226,281,284,228,227,282,285,229,228,283,286,230,229,284,287,231,230,285,288,232,231,286,289,233,232,287,290,234,233,288,291,235,234,289,291,292,235,290,291,293,236,235,292,294,237,236,293,295,238,237,294,296,239,238,295,297,240,239,296,298,241,240,297,299,242,241,298,300,243,242,299,301,244,243,301,300,302,244,244,301,303,245,245,302,304,246,246,303,305,247,247,304,306,248,248,305,307,249,249,306,308,250,250,307,309,251,251,308,310,252,252,309,311,253,311,253,310,312,254,253,311,313,255,254,312,314,256,255,313,315,257,256,314,316,258,257,315,317,259,258,316,318,260,259,317,319,261,260,318,320,262,261,319,321,321,322,262,320,323,263,262,321,324,264,263,322,325,265,264,323,326,266,265,324,327,267,266,325,328,268,267,326,329,269,268,327,330,270,269,328,271,217,270,329}; + const mcIdType connI[332]={0,7,14,21,28,35,42,49,56,63,70,77,84,91,98,105,112,119,126,133,140,147,154,161,168,175,182,189,196,203,210,217,224,231,238,245,252,259,266,273,280,287,294,301,308,315,322,329,336,343,350,357,364,371,378,385,392,399,406,413,420,427,434,441,448,455,462,469,476,483,490,497,504,511,518,525,532,539,546,553,560,567,574,581,588,595,602,609,616,623,630,637,644,651,658,665,672,679,686,693,700,707,714,721,728,735,742,749,756,763,770,777,784,791,798,805,812,819,826,833,840,847,854,861,868,875,882,889,896,903,910,917,924,931,938,945,952,959,966,973,980,987,994,1001,1008,1015,1022,1029,1036,1043,1050,1057,1064,1071,1078,1085,1092,1099,1106,1113,1120,1127,1134,1141,1148,1155,1162,1169,1176,1183,1190,1197,1204,1211,1218,1225,1232,1239,1246,1253,1260,1267,1274,1281,1288,1295,1302,1309,1316,1323,1330,1337,1344,1351,1358,1365,1372,1379,1386,1393,1400,1407,1414,1421,1428,1435,1442,1449,1456,1463,1470,1477,1484,1491,1498,1505,1512,1519,1526,1533,1540,1547,1554,1561,1568,1575,1582,1589,1596,1603,1610,1617,1624,1631,1638,1645,1652,1659,1666,1673,1680,1687,1694,1701,1708,1715,1722,1729,1736,1743,1750,1757,1764,1771,1778,1785,1792,1799,1806,1813,1820,1827,1834,1841,1848,1855,1862,1869,1876,1883,1890,1897,1901,1905,1909,1913,1917,1921,1925,1929,1933,1937,1941,1945,1949,1953,1957,1961,1965,1969,1973,1977,1981,1985,1989,1993,1997,2001,2005,2009,2013,2017,2021,2025,2029,2033,2037,2041,2045,2049,2053,2057,2061,2065,2069,2073,2077,2081,2085,2089,2093,2097,2101,2105,2109,2113,2117,2121,2125,2129,2133,2137}; // MEDCouplingUMesh *m=MEDCouplingUMesh::New("convexhull",2); m->allocateCells(331); @@ -1116,13 +1116,13 @@ void MEDCouplingBasicsTest5::testConvexEnvelop2D1() coordsDa->decrRef(); m->checkConsistencyLight(); // - DataArrayInt *da=m->convexEnvelop2D(); + DataArrayIdType *da=m->convexEnvelop2D(); m->checkConsistencyLight(); CPPUNIT_ASSERT(coordsDa==m->getCoords()); - DataArrayInt *daC=da->buildComplement(331); + DataArrayIdType *daC=da->buildComplement(331); da->decrRef(); - const int expected[58]={271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,302,303,304,305,306,307,308,309,310,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330}; - DataArrayInt *expected2=DataArrayInt::New(); + const mcIdType expected[58]={271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,302,303,304,305,306,307,308,309,310,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330}; + DataArrayIdType *expected2=DataArrayIdType::New(); expected2->alloc(58,1); std::copy(expected,expected+58,expected2->getPointer()); CPPUNIT_ASSERT(expected2->isEqual(*daC)); @@ -1137,7 +1137,7 @@ void MEDCouplingBasicsTest5::testConvexEnvelop2D1() vals->substractEqual(ref2); ref2->decrRef(); vals->abs(); - DataArrayInt *theTest=vals->findIdsInRange(-1.,1e-7); + DataArrayIdType *theTest=vals->findIdsInRange(-1.,1e-7); CPPUNIT_ASSERT(theTest->isIota(331)); theTest->decrRef(); valsF->decrRef(); @@ -1147,24 +1147,24 @@ void MEDCouplingBasicsTest5::testConvexEnvelop2D1() void MEDCouplingBasicsTest5::testDataArraySort1() { - DataArrayInt *arr=DataArrayInt::New(); + DataArrayIdType *arr=DataArrayIdType::New(); CPPUNIT_ASSERT_THROW(arr->sort(true),INTERP_KERNEL::Exception);//no allocation CPPUNIT_ASSERT_THROW(arr->sort(false),INTERP_KERNEL::Exception);//no allocation - const int values[6]={2,1,6,5,4,7}; + const mcIdType values[6]={2,1,6,5,4,7}; arr->alloc(3,2); CPPUNIT_ASSERT_THROW(arr->sort(true),INTERP_KERNEL::Exception);//no one component CPPUNIT_ASSERT_THROW(arr->sort(false),INTERP_KERNEL::Exception);//no one component arr->rearrange(1); std::copy(values,values+6,arr->getPointer()); - DataArrayInt *arr1=arr->deepCopy(); - DataArrayInt *arr2=arr->deepCopy(); + DataArrayIdType *arr1=arr->deepCopy(); + DataArrayIdType *arr2=arr->deepCopy(); arr1->sort(true); - const int expected1[6]={1,2,4,5,6,7}; + const mcIdType expected1[6]={1,2,4,5,6,7}; CPPUNIT_ASSERT_EQUAL(6,(int)arr1->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)arr1->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(expected1,expected1+6,arr1->begin())); arr2->sort(false); - const int expected2[6]={7,6,5,4,2,1}; + const mcIdType expected2[6]={7,6,5,4,2,1}; CPPUNIT_ASSERT_EQUAL(6,(int)arr2->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)arr2->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(expected2,expected2+6,arr2->begin())); @@ -1203,20 +1203,20 @@ void MEDCouplingBasicsTest5::testDataArraySort1() void MEDCouplingBasicsTest5::testPartitionBySpreadZone1() { MEDCouplingUMesh *m=build2DTargetMesh_1(); - const int part0[3]={2,3,4}; - const int part1[2]={0,1}; + const mcIdType part0[3]={2,3,4}; + const mcIdType part1[2]={0,1}; MEDCouplingUMesh *m1=static_cast(m->buildPartOfMySelf(part0,part0+3)); MEDCouplingUMesh *m2=static_cast(m->buildPartOfMySelf(part1,part1+2)); std::vector v(3); v[0]=m; v[1]=m1; v[2]=m2; MEDCouplingUMesh *m4=MEDCouplingUMesh::MergeUMeshes(v); - const int renum[10]={5,2,9,6,4,7,0,1,3,8}; + const mcIdType renum[10]={5,2,9,6,4,7,0,1,3,8}; m4->renumberCells(renum); // - std::vector v2=m4->partitionBySpreadZone(); + std::vector v2=m4->partitionBySpreadZone(); CPPUNIT_ASSERT_EQUAL(3,(int)v2.size()); - const int expected0[3]={0,1,7}; - const int expected1[5]={2,4,5,6,9}; - const int expected2[2]={3,8}; + const mcIdType expected0[3]={0,1,7}; + const mcIdType expected1[5]={2,4,5,6,9}; + const mcIdType expected2[2]={3,8}; CPPUNIT_ASSERT_EQUAL(3,(int)v2[0]->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)v2[0]->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(5,(int)v2[1]->getNumberOfTuples()); @@ -1234,8 +1234,8 @@ void MEDCouplingBasicsTest5::testPartitionBySpreadZone1() MEDCouplingUMesh *m5=m4->buildSpreadZonesWithPoly(); CPPUNIT_ASSERT_EQUAL(3,(int)m5->getNumberOfCells()); CPPUNIT_ASSERT(m5->getCoords()==m4->getCoords()); - const int expected3[23]={5,15,16,17,14,11,13,12,5,2,1,0,3,6,7,8,5,5,18,21,22,20,19}; - const int expected4[4]={0,8,17,23}; + const mcIdType expected3[23]={5,15,16,17,14,11,13,12,5,2,1,0,3,6,7,8,5,5,18,21,22,20,19}; + const mcIdType expected4[4]={0,8,17,23}; CPPUNIT_ASSERT_EQUAL(23,(int)m5->getNodalConnectivity()->getNumberOfTuples()); CPPUNIT_ASSERT(std::equal(expected3,expected3+23,m5->getNodalConnectivity()->getConstPointer())); CPPUNIT_ASSERT_EQUAL(4,(int)m5->getNodalConnectivityIndex()->getNumberOfTuples()); @@ -1250,10 +1250,10 @@ void MEDCouplingBasicsTest5::testPartitionBySpreadZone1() void MEDCouplingBasicsTest5::testGiveCellsWithType1() { - const int expected0[2]={1,2}; - const int expected1[3]={0,3,4}; + const mcIdType expected0[2]={1,2}; + const mcIdType expected1[3]={0,3,4}; MEDCouplingUMesh *m=build2DTargetMesh_1(); - DataArrayInt *da=m->giveCellsWithType(INTERP_KERNEL::NORM_TRI3); + DataArrayIdType *da=m->giveCellsWithType(INTERP_KERNEL::NORM_TRI3); CPPUNIT_ASSERT_EQUAL(2,(int)da->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)da->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(expected0,expected0+2,da->getConstPointer())); @@ -1284,7 +1284,7 @@ void MEDCouplingBasicsTest5::testBuildSlice3D2() // First slice in the middle of 3D cells const double vec1[3]={-0.07,1.,0.07}; const double origin1[3]={1.524,1.4552,1.74768}; - DataArrayInt *ids=0; + DataArrayIdType *ids=0; MEDCouplingUMesh *slice1=mesh3D->buildSlice3D(origin1,vec1,1e-10,ids); // MEDCouplingFieldDouble *f=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME); @@ -1293,8 +1293,8 @@ void MEDCouplingBasicsTest5::testBuildSlice3D2() arr->rearrange(1); arr->iota(2.); arr->rearrange(2); f->setArray(arr); f->checkConsistencyLight(); - const int exp1[9]={1,3,4,7,9,10,13,15,16}; - DataArrayInt *expected1=DataArrayInt::New(); expected1->alloc(9,1); std::copy(exp1,exp1+9,expected1->getPointer()); + const mcIdType exp1[9]={1,3,4,7,9,10,13,15,16}; + DataArrayIdType *expected1=DataArrayIdType::New(); expected1->alloc(9,1); std::copy(exp1,exp1+9,expected1->getPointer()); CPPUNIT_ASSERT(expected1->isEqual(*ids)); DataArrayDouble *arr2=arr->selectByTupleIdSafe(expected1->begin(),expected1->end()); // @@ -1325,14 +1325,14 @@ void MEDCouplingBasicsTest5::testComputeTupleIdsToSelectFromCellIds1() DataArrayDouble *arr=DataArrayDouble::New(); arr->alloc(52,2) ; arr->rearrange(1) ; arr->iota(7.); arr->rearrange(2); f->setArray(arr); // - const int subPart1[3]={1,5,9}; + const mcIdType subPart1[3]={1,5,9}; MEDCouplingFieldDouble *f2=f->buildSubPart(subPart1,subPart1+3); f2->checkConsistencyLight(); - DataArrayInt *cI=m->computeNbOfNodesPerCell(); + DataArrayIdType *cI=m->computeNbOfNodesPerCell(); cI->computeOffsetsFull(); - const int sel1[3]={1,5,9}; - DataArrayInt *sel=DataArrayInt::New(); sel->useArray(sel1,false,DeallocType::CPP_DEALLOC,3,1); - DataArrayInt *res=sel->buildExplicitArrByRanges(cI); + const mcIdType sel1[3]={1,5,9}; + DataArrayIdType *sel=DataArrayIdType::New(); sel->useArray(sel1,false,DeallocType::CPP_DEALLOC,3,1); + DataArrayIdType *res=sel->buildExplicitArrByRanges(cI); DataArrayDouble *arr2=arr->selectByTupleIdSafe(res->begin(),res->end()); const double expected1[30]={13.,14.,15.,16.,17.,18.,19.,20.,59.,60.,61.,62.,63.,64.,95.,96.,97.,98.,99.,100.,101.,102.,103.,104.,105.,106.,107.,108.,109.,110.}; DataArrayDouble *arr3=DataArrayDouble::New(); arr3->useArray(expected1,false,DeallocType::CPP_DEALLOC,15,2); @@ -1364,29 +1364,29 @@ void MEDCouplingBasicsTest5::testComputeSkin1() CPPUNIT_ASSERT_EQUAL(18,(int)skin->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(1,skin->getMeshDimension()); CPPUNIT_ASSERT(skin->getCoords()==umesh->getCoords()); - const int expected1[19]={0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54}; - const int expected2[54]={1,1,0,1,0,5,1,2,1,1,3,2,1,4,3,1,9,4,1,5,10,1,14,9,1,10,15,1,19,14,1,15,20,1,24,19,1,20,25,1,25,26,1,26,27,1,27,28,1,28,29,1,29,24}; - CPPUNIT_ASSERT_EQUAL((std::size_t)19,skin->getNodalConnectivityIndex()->getNbOfElems()); + const mcIdType expected1[19]={0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54}; + const mcIdType expected2[54]={1,1,0,1,0,5,1,2,1,1,3,2,1,4,3,1,9,4,1,5,10,1,14,9,1,10,15,1,19,14,1,15,20,1,24,19,1,20,25,1,25,26,1,26,27,1,27,28,1,28,29,1,29,24}; + CPPUNIT_ASSERT_EQUAL(ToIdType(19),skin->getNodalConnectivityIndex()->getNbOfElems()); CPPUNIT_ASSERT(std::equal(expected1,expected1+19,skin->getNodalConnectivityIndex()->getConstPointer())); - CPPUNIT_ASSERT_EQUAL((std::size_t)54,skin->getNodalConnectivity()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(54),skin->getNodalConnectivity()->getNbOfElems()); CPPUNIT_ASSERT(std::equal(expected2,expected2+54,skin->getNodalConnectivity()->getConstPointer())); - DataArrayInt *ids=skin->computeFetchedNodeIds(); - const int expected3[18]={0,1,2,3,4,5,9,10,14,15,19,20,24,25,26,27,28,29}; - CPPUNIT_ASSERT_EQUAL((std::size_t)18,ids->getNbOfElems()); + DataArrayIdType *ids=skin->computeFetchedNodeIds(); + const mcIdType expected3[18]={0,1,2,3,4,5,9,10,14,15,19,20,24,25,26,27,28,29}; + CPPUNIT_ASSERT_EQUAL(ToIdType(18),ids->getNbOfElems()); CPPUNIT_ASSERT(std::equal(expected3,expected3+18,ids->getConstPointer())); MEDCouplingUMesh *part=dynamic_cast(umesh->buildFacePartOfMySelfNode(ids->begin(),ids->end(),true)); part->setName(skin->getName().c_str()); CPPUNIT_ASSERT(part->isEqual(skin,1e-12)); MEDCouplingUMesh *part2=dynamic_cast(part->buildPartOfMySelfSlice(1,18,2,true)); - DataArrayInt *ids2=DataArrayInt::Range(0,18,2); + DataArrayIdType *ids2=DataArrayIdType::Range(0,18,2); part->setPartOfMySelf(ids2->begin(),ids2->end(),*part2); ids2->decrRef(); CPPUNIT_ASSERT(!part->isEqual(skin,1e-12)); - DataArrayInt *trad=part->zipConnectivityTraducer(0); + DataArrayIdType *trad=part->zipConnectivityTraducer(0); CPPUNIT_ASSERT_EQUAL(9,(int)part->getNumberOfCells()); - const int expected4[18]={0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8}; + const mcIdType expected4[18]={0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8}; CPPUNIT_ASSERT(std::equal(expected4,expected4+18,trad->getConstPointer())); - CPPUNIT_ASSERT_EQUAL((std::size_t)18,trad->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(18),trad->getNbOfElems()); trad->decrRef(); part->decrRef(); part2->decrRef(); @@ -1402,18 +1402,18 @@ void MEDCouplingBasicsTest5::testUMeshSetPartOfMySelf2() MEDCouplingUMesh *m=build2DTargetMesh_1(); std::set s; s.insert(INTERP_KERNEL::NORM_TRI3); s.insert(INTERP_KERNEL::NORM_QUAD4); CPPUNIT_ASSERT(s==m->getAllGeoTypes()); - const int ids1[3]={0,3,4}; + const mcIdType ids1[3]={0,3,4}; MEDCouplingUMesh *part=static_cast(m->buildPartOfMySelf(ids1,ids1+3,true)); part->simplexize(0)->decrRef(); - const int ids2[3]={1,2,5}; + const mcIdType ids2[3]={1,2,5}; MEDCouplingUMesh *part2=static_cast(part->buildPartOfMySelf(ids2,ids2+3,true)); m->setPartOfMySelf(ids1,ids1+3,*part2); - const int expected1[20]={3,0,4,1,3,1,4,2,3,4,5,2,3,6,7,4,3,7,5,4}; + const mcIdType expected1[20]={3,0,4,1,3,1,4,2,3,4,5,2,3,6,7,4,3,7,5,4}; CPPUNIT_ASSERT(std::equal(expected1,expected1+20,m->getNodalConnectivity()->getConstPointer())); - CPPUNIT_ASSERT_EQUAL((std::size_t)20,m->getNodalConnectivity()->getNbOfElems()); - const int expected2[6]={0,4,8,12,16,20}; + CPPUNIT_ASSERT_EQUAL(ToIdType(20),m->getNodalConnectivity()->getNbOfElems()); + const mcIdType expected2[6]={0,4,8,12,16,20}; CPPUNIT_ASSERT(std::equal(expected2,expected2+6,m->getNodalConnectivityIndex()->getConstPointer())); - CPPUNIT_ASSERT_EQUAL((std::size_t)6,m->getNodalConnectivityIndex()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(6),m->getNodalConnectivityIndex()->getNbOfElems()); s.clear(); s.insert(INTERP_KERNEL::NORM_TRI3); CPPUNIT_ASSERT(s==m->getAllGeoTypes()); m->decrRef(); part->decrRef(); part2->decrRef(); @@ -1422,12 +1422,12 @@ void MEDCouplingBasicsTest5::testUMeshSetPartOfMySelf2() part=static_cast(m->buildPartOfMySelf(ids1,ids1+2,true)); part->convertAllToPoly(); m->setPartOfMySelf(ids1+1,ids1+3,*part); - const int expected3[23]={4,0,3,4,1,3,1,4,2,3,4,5,2,5,0,3,4,1,5,6,7,4,3}; + const mcIdType expected3[23]={4,0,3,4,1,3,1,4,2,3,4,5,2,5,0,3,4,1,5,6,7,4,3}; CPPUNIT_ASSERT(std::equal(expected3,expected3+23,m->getNodalConnectivity()->getConstPointer())); - CPPUNIT_ASSERT_EQUAL((std::size_t)23,m->getNodalConnectivity()->getNbOfElems()); - const int expected4[6]={0,5,9,13,18,23}; + CPPUNIT_ASSERT_EQUAL(ToIdType(23),m->getNodalConnectivity()->getNbOfElems()); + const mcIdType expected4[6]={0,5,9,13,18,23}; CPPUNIT_ASSERT(std::equal(expected4,expected4+6,m->getNodalConnectivityIndex()->getConstPointer())); - CPPUNIT_ASSERT_EQUAL((std::size_t)6,m->getNodalConnectivityIndex()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(6),m->getNodalConnectivityIndex()->getNbOfElems()); s.clear(); s.insert(INTERP_KERNEL::NORM_TRI3); s.insert(INTERP_KERNEL::NORM_QUAD4); s.insert(INTERP_KERNEL::NORM_POLYGON); CPPUNIT_ASSERT(s==m->getAllGeoTypes()); m->decrRef(); part->decrRef(); @@ -1435,12 +1435,12 @@ void MEDCouplingBasicsTest5::testUMeshSetPartOfMySelf2() m=build2DTargetMesh_1(); part=static_cast(m->buildPartOfMySelfSlice(3,5,1,true)); m->setPartOfMySelfSlice(1,3,1,*part); - const int expected5[25]={4,0,3,4,1,4,6,7,4,3,4,7,8,5,4,4,6,7,4,3,4,7,8,5,4}; + const mcIdType expected5[25]={4,0,3,4,1,4,6,7,4,3,4,7,8,5,4,4,6,7,4,3,4,7,8,5,4}; CPPUNIT_ASSERT(std::equal(expected5,expected5+25,m->getNodalConnectivity()->getConstPointer())); - CPPUNIT_ASSERT_EQUAL((std::size_t)25,m->getNodalConnectivity()->getNbOfElems()); - const int expected6[6]={0,5,10,15,20,25}; + CPPUNIT_ASSERT_EQUAL(ToIdType(25),m->getNodalConnectivity()->getNbOfElems()); + const mcIdType expected6[6]={0,5,10,15,20,25}; CPPUNIT_ASSERT(std::equal(expected6,expected6+6,m->getNodalConnectivityIndex()->getConstPointer())); - CPPUNIT_ASSERT_EQUAL((std::size_t)6,m->getNodalConnectivityIndex()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(6),m->getNodalConnectivityIndex()->getNbOfElems()); s.clear(); s.insert(INTERP_KERNEL::NORM_QUAD4); CPPUNIT_ASSERT(s==m->getAllGeoTypes()); m->decrRef(); part->decrRef(); @@ -1449,12 +1449,12 @@ void MEDCouplingBasicsTest5::testUMeshSetPartOfMySelf2() part=static_cast(m->buildPartOfMySelfSlice(0,5,3,true)); part->convertAllToPoly(); m->setPartOfMySelfSlice(3,5,1,*part); - const int expected7[23]={4,0,3,4,1,3,1,4,2,3,4,5,2,5,0,3,4,1,5,6,7,4,3}; + const mcIdType expected7[23]={4,0,3,4,1,3,1,4,2,3,4,5,2,5,0,3,4,1,5,6,7,4,3}; CPPUNIT_ASSERT(std::equal(expected7,expected7+23,m->getNodalConnectivity()->getConstPointer())); - CPPUNIT_ASSERT_EQUAL((std::size_t)23,m->getNodalConnectivity()->getNbOfElems()); - const int expected8[6]={0,5,9,13,18,23}; + CPPUNIT_ASSERT_EQUAL(ToIdType(23),m->getNodalConnectivity()->getNbOfElems()); + const mcIdType expected8[6]={0,5,9,13,18,23}; CPPUNIT_ASSERT(std::equal(expected8,expected8+6,m->getNodalConnectivityIndex()->getConstPointer())); - CPPUNIT_ASSERT_EQUAL((std::size_t)6,m->getNodalConnectivityIndex()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(6),m->getNodalConnectivityIndex()->getNbOfElems()); s.clear(); s.insert(INTERP_KERNEL::NORM_TRI3); s.insert(INTERP_KERNEL::NORM_QUAD4); s.insert(INTERP_KERNEL::NORM_POLYGON); CPPUNIT_ASSERT(s==m->getAllGeoTypes()); m->decrRef(); part->decrRef(); @@ -1463,12 +1463,12 @@ s.clear(); s.insert(INTERP_KERNEL::NORM_TRI3); s.insert(INTERP_KERNEL::NORM_QUAD part=static_cast(m->buildPartOfMySelfSlice(3,-1,-3,true)); part->convertAllToPoly(); m->setPartOfMySelfSlice(4,2,-1,*part); - const int expected9[23]={4,0,3,4,1,3,1,4,2,3,4,5,2,5,0,3,4,1,5,6,7,4,3}; + const mcIdType expected9[23]={4,0,3,4,1,3,1,4,2,3,4,5,2,5,0,3,4,1,5,6,7,4,3}; CPPUNIT_ASSERT(std::equal(expected9,expected9+23,m->getNodalConnectivity()->getConstPointer())); - CPPUNIT_ASSERT_EQUAL((std::size_t)23,m->getNodalConnectivity()->getNbOfElems()); - const int expected10[6]={0,5,9,13,18,23}; + CPPUNIT_ASSERT_EQUAL(ToIdType(23),m->getNodalConnectivity()->getNbOfElems()); + const mcIdType expected10[6]={0,5,9,13,18,23}; CPPUNIT_ASSERT(std::equal(expected10,expected10+6,m->getNodalConnectivityIndex()->getConstPointer())); - CPPUNIT_ASSERT_EQUAL((std::size_t)6,m->getNodalConnectivityIndex()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(6),m->getNodalConnectivityIndex()->getNbOfElems()); s.clear(); s.insert(INTERP_KERNEL::NORM_TRI3); s.insert(INTERP_KERNEL::NORM_QUAD4); s.insert(INTERP_KERNEL::NORM_POLYGON); CPPUNIT_ASSERT(s==m->getAllGeoTypes()); part->decrRef(); @@ -1478,7 +1478,7 @@ s.clear(); s.insert(INTERP_KERNEL::NORM_TRI3); s.insert(INTERP_KERNEL::NORM_QUAD void MEDCouplingBasicsTest5::testUnPolyze3() { const double coord[18]={0.0,0.5,-0.5,-0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.0,0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5}; - const int conn[22]={1,2,5,4,-1,4,3,0,1,-1,2,0,3,5,-1,0,2,1,-1,4,5,3}; + const mcIdType conn[22]={1,2,5,4,-1,4,3,0,1,-1,2,0,3,5,-1,0,2,1,-1,4,5,3}; MEDCouplingUMesh *m=MEDCouplingUMesh::New("a mesh",3); m->allocateCells(1); m->insertNextCell(INTERP_KERNEL::NORM_POLYHED,22,conn); @@ -1500,8 +1500,8 @@ void MEDCouplingBasicsTest5::testUnPolyze3() std::set s; s.insert(INTERP_KERNEL::NORM_PENTA6); CPPUNIT_ASSERT(s==m->getAllGeoTypes()); // - const int expected1[2]={0,7}; - const int expected2[7]={16,0,2,1,3,5,4}; + const mcIdType expected1[2]={0,7}; + const mcIdType expected2[7]={16,0,2,1,3,5,4}; CPPUNIT_ASSERT_EQUAL(2,(int)m->getNodalConnectivityIndex()->getNumberOfTuples()); CPPUNIT_ASSERT(std::equal(expected1,expected1+2,m->getNodalConnectivityIndex()->getConstPointer())); CPPUNIT_ASSERT_EQUAL(7,(int)m->getNodalConnectivity()->getNumberOfTuples()); @@ -1567,11 +1567,11 @@ void MEDCouplingBasicsTest5::testDuplicateEachTupleNTimes1() d->decrRef(); d2->decrRef(); // - const int vals2[4]={9,8,7,6}; - DataArrayInt *d4=DataArrayInt::New(); d4->useArray(vals2,false,DeallocType::CPP_DEALLOC,4,1); d4->setInfoOnComponent(0,"mass [kg]") ; d4->setName("aname"); - DataArrayInt *d5=d4->duplicateEachTupleNTimes(3); - const int vals3[12]={9,9,9,8,8,8,7,7,7,6,6,6}; - DataArrayInt *d6=DataArrayInt::New(); d6->useArray(vals3,false,DeallocType::CPP_DEALLOC,4*3,1); d6->setName("aname"); d6->setInfoOnComponent(0,"mass [kg]"); + const mcIdType vals2[4]={9,8,7,6}; + DataArrayIdType *d4=DataArrayIdType::New(); d4->useArray(vals2,false,DeallocType::CPP_DEALLOC,4,1); d4->setInfoOnComponent(0,"mass [kg]") ; d4->setName("aname"); + DataArrayIdType *d5=d4->duplicateEachTupleNTimes(3); + const mcIdType vals3[12]={9,9,9,8,8,8,7,7,7,6,6,6}; + DataArrayIdType *d6=DataArrayIdType::New(); d6->useArray(vals3,false,DeallocType::CPP_DEALLOC,4*3,1); d6->setName("aname"); d6->setInfoOnComponent(0,"mass [kg]"); CPPUNIT_ASSERT(d5->isEqual(*d6)); d6->decrRef(); d4->decrRef(); d5->decrRef(); @@ -1584,12 +1584,12 @@ void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp5() const double coordsData[376]={41,0,42,0,0,42,0,41,41.5,0,29.698484809834998,29.698484809834994,0,41.5,28.991378028648452,28.991378028648445,-42,0,-41,0,-29.698484809834994,29.698484809834998,-41.5,0,-28.991378028648445,28.991378028648452,0,-42,0,-41,-29.698484809835001,-29.698484809834994,0,-41.5,-28.991378028648455,-28.991378028648445,29.698484809834987,-29.698484809835001,28.991378028648441,-28.991378028648455,43,0,0,43,42.5,0,30.405591591021544,30.40559159102154,0,42.5,-43,0,-30.40559159102154,30.405591591021544,-42.5,0,0,-43,-30.405591591021551,-30.40559159102154,0,-42.5,30.405591591021537,-30.405591591021551,44,0,0,44,43.5,0,31.112698372208094,31.112698372208087,0,43.5,-44,0,-31.112698372208087,31.112698372208094,-43.5,0,0,-44,-31.112698372208097,-31.112698372208087,0,-43.5,31.112698372208083,-31.112698372208097,45,0,0,45,44.5,0,31.81980515339464,31.819805153394636,0,44.5,-45,0,-31.819805153394636,31.81980515339464,-44.5,0,0,-45,-31.819805153394647,-31.819805153394636,0,-44.5,31.819805153394629,-31.819805153394647,47,0,0,47,46,0,33.234018715767739,33.234018715767732,0,46,-47,0,-33.234018715767732,33.234018715767739,-46,0,0,-47,-33.234018715767739,-33.234018715767732,0,-46,33.234018715767725,-33.234018715767739,49,0,0,49,48,0,34.648232278140831,34.648232278140824,0,48,-49,0,-34.648232278140824,34.648232278140831,-48,0,0,-49,-34.648232278140839,-34.648232278140824,0,-48,34.648232278140817,-34.648232278140839,51,0,0,51,50,0,36.062445840513924,36.062445840513924,0,50,-51,0,-36.062445840513924,36.062445840513924,-50,0,0,-51,-36.062445840513931,-36.062445840513924,0,-50,36.062445840513917,-36.062445840513931,53,0,0,53,52,0,37.476659402887023,37.476659402887016,0,52,-53,0,-37.476659402887016,37.476659402887023,-52,0,0,-53,-37.47665940288703,-37.476659402887016,0,-52,37.476659402887009,-37.47665940288703,55,0,0,55,54,0,38.890872965260115,38.890872965260108,0,54,-55,0,-38.890872965260108,38.890872965260115,-54,0,0,-55,-38.890872965260122,-38.890872965260108,0,-54,38.890872965260101,-38.890872965260122,59,0,0,59,57,0,41.719300090006307,41.7193000900063,0,57,-59,0,-41.7193000900063,41.719300090006307,-57,0,0,-59,-41.719300090006314,-41.7193000900063,0,-57,41.719300090006293,-41.719300090006314,63,0,0,63,61,0,44.547727214752499,44.547727214752491,0,61,-63,0,-44.547727214752491,44.547727214752499,-61,0,0,-63,-44.547727214752506,-44.547727214752491,0,-61,44.547727214752484,-44.547727214752506,67,0,0,67,65,0,47.37615433949869,47.376154339498683,0,65,-67,0,-47.376154339498683,47.37615433949869,-65,0,0,-67,-47.376154339498697,-47.376154339498683,0,-65,47.376154339498676,-47.376154339498697,71,0,0,71,69,0,50.204581464244875,50.204581464244868,0,69,-71,0,-50.204581464244868,50.204581464244875,-69,0,0,-71,-50.204581464244889,-50.204581464244868,0,-69,50.20458146424486,-50.204581464244889,75,0,0,75,73,0,53.033008588991066,53.033008588991059,0,73,-75,0,-53.033008588991059,53.033008588991066,-73,0,0,-75,-53.033008588991073,-53.033008588991059,0,-73,53.033008588991052,-53.033008588991073,80,0,0,80,77.5,0,56.568542494923804,56.568542494923797,0,77.5,-80,0,-56.568542494923797,56.568542494923804,-77.5,0,0,-80,-56.568542494923818,-56.568542494923797,0,-77.5,56.56854249492379,-56.568542494923818}; coords->useArray(coordsData,false,DeallocType::CPP_DEALLOC,188,2); coords->setName(""); - DataArrayInt *conn=DataArrayInt::New(); - const int connData[540]={8,0,1,2,3,4,5,6,7,8,3,2,8,9,6,10,11,12,8,9,8,13,14,11,15,16,17,8,14,13,1,0,16,18,4,19,8,1,20,21,2,22,23,24,5,8,2,21,25,8,24,26,27,10,8,8,25,28,13,27,29,30,15,8,13,28,20,1,30,31,22,18,8,20,32,33,21,34,35,36,23,8,21,33,37,25,36,38,39,26,8,25,37,40,28,39,41,42,29,8,28,40,32,20,42,43,34,31,8,32,44,45,33,46,47,48,35,8,33,45,49,37,48,50,51,38,8,37,49,52,40,51,53,54,41,8,40,52,44,32,54,55,46,43,8,44,56,57,45,58,59,60,47,8,45,57,61,49,60,62,63,50,8,49,61,64,52,63,65,66,53,8,52,64,56,44,66,67,58,55,8,56,68,69,57,70,71,72,59,8,57,69,73,61,72,74,75,62,8,61,73,76,64,75,77,78,65,8,64,76,68,56,78,79,70,67,8,68,80,81,69,82,83,84,71,8,69,81,85,73,84,86,87,74,8,73,85,88,76,87,89,90,77,8,76,88,80,68,90,91,82,79,8,80,92,93,81,94,95,96,83,8,81,93,97,85,96,98,99,86,8,85,97,100,88,99,101,102,89,8,88,100,92,80,102,103,94,91,8,92,104,105,93,106,107,108,95,8,93,105,109,97,108,110,111,98,8,97,109,112,100,111,113,114,101,8,100,112,104,92,114,115,106,103,8,104,116,117,105,118,119,120,107,8,105,117,121,109,120,122,123,110,8,109,121,124,112,123,125,126,113,8,112,124,116,104,126,127,118,115,8,116,128,129,117,130,131,132,119,8,117,129,133,121,132,134,135,122,8,121,133,136,124,135,137,138,125,8,124,136,128,116,138,139,130,127,8,128,140,141,129,142,143,144,131,8,129,141,145,133,144,146,147,134,8,133,145,148,136,147,149,150,137,8,136,148,140,128,150,151,142,139,8,140,152,153,141,154,155,156,143,8,141,153,157,145,156,158,159,146,8,145,157,160,148,159,161,162,149,8,148,160,152,140,162,163,154,151,8,152,164,165,153,166,167,168,155,8,153,165,169,157,168,170,171,158,8,157,169,172,160,171,173,174,161,8,160,172,164,152,174,175,166,163,8,164,176,177,165,178,179,180,167,8,165,177,181,169,180,182,183,170,8,169,181,184,172,183,185,186,173,8,172,184,176,164,186,187,178,175}; + DataArrayIdType *conn=DataArrayIdType::New(); + const mcIdType connData[540]={8,0,1,2,3,4,5,6,7,8,3,2,8,9,6,10,11,12,8,9,8,13,14,11,15,16,17,8,14,13,1,0,16,18,4,19,8,1,20,21,2,22,23,24,5,8,2,21,25,8,24,26,27,10,8,8,25,28,13,27,29,30,15,8,13,28,20,1,30,31,22,18,8,20,32,33,21,34,35,36,23,8,21,33,37,25,36,38,39,26,8,25,37,40,28,39,41,42,29,8,28,40,32,20,42,43,34,31,8,32,44,45,33,46,47,48,35,8,33,45,49,37,48,50,51,38,8,37,49,52,40,51,53,54,41,8,40,52,44,32,54,55,46,43,8,44,56,57,45,58,59,60,47,8,45,57,61,49,60,62,63,50,8,49,61,64,52,63,65,66,53,8,52,64,56,44,66,67,58,55,8,56,68,69,57,70,71,72,59,8,57,69,73,61,72,74,75,62,8,61,73,76,64,75,77,78,65,8,64,76,68,56,78,79,70,67,8,68,80,81,69,82,83,84,71,8,69,81,85,73,84,86,87,74,8,73,85,88,76,87,89,90,77,8,76,88,80,68,90,91,82,79,8,80,92,93,81,94,95,96,83,8,81,93,97,85,96,98,99,86,8,85,97,100,88,99,101,102,89,8,88,100,92,80,102,103,94,91,8,92,104,105,93,106,107,108,95,8,93,105,109,97,108,110,111,98,8,97,109,112,100,111,113,114,101,8,100,112,104,92,114,115,106,103,8,104,116,117,105,118,119,120,107,8,105,117,121,109,120,122,123,110,8,109,121,124,112,123,125,126,113,8,112,124,116,104,126,127,118,115,8,116,128,129,117,130,131,132,119,8,117,129,133,121,132,134,135,122,8,121,133,136,124,135,137,138,125,8,124,136,128,116,138,139,130,127,8,128,140,141,129,142,143,144,131,8,129,141,145,133,144,146,147,134,8,133,145,148,136,147,149,150,137,8,136,148,140,128,150,151,142,139,8,140,152,153,141,154,155,156,143,8,141,153,157,145,156,158,159,146,8,145,157,160,148,159,161,162,149,8,148,160,152,140,162,163,154,151,8,152,164,165,153,166,167,168,155,8,153,165,169,157,168,170,171,158,8,157,169,172,160,171,173,174,161,8,160,172,164,152,174,175,166,163,8,164,176,177,165,178,179,180,167,8,165,177,181,169,180,182,183,170,8,169,181,184,172,183,185,186,173,8,172,184,176,164,186,187,178,175}; conn->useArray(connData,false,DeallocType::CPP_DEALLOC,540,1); conn->setName(""); - DataArrayInt *connI=DataArrayInt::New(); - const int connIData[61]={0,9,18,27,36,45,54,63,72,81,90,99,108,117,126,135,144,153,162,171,180,189,198,207,216,225,234,243,252,261,270,279,288,297,306,315,324,333,342,351,360,369,378,387,396,405,414,423,432,441,450,459,468,477,486,495,504,513,522,531,540}; + DataArrayIdType *connI=DataArrayIdType::New(); + const mcIdType connIData[61]={0,9,18,27,36,45,54,63,72,81,90,99,108,117,126,135,144,153,162,171,180,189,198,207,216,225,234,243,252,261,270,279,288,297,306,315,324,333,342,351,360,369,378,387,396,405,414,423,432,441,450,459,468,477,486,495,504,513,522,531,540}; connI->useArray(connIData,false,DeallocType::CPP_DEALLOC,61,1); connI->setName(""); // @@ -1600,15 +1600,15 @@ void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp5() // coords=DataArrayDouble::New(); const double coordsData2[84]={46.5,-2.5,53.5,-2.5,53.5,2.5,46.5,2.5,50,-2.5,53.5,0,50,2.5,46.5,0,60.5,-2.5,60.5,2.5,57,-2.5,60.5,0,57,2.5,53.5,7.5,46.5,7.5,53.5,5,50,7.5,46.5,5,60.5,7.5,60.5,5,57,7.5,-2,47,2,47,2,53,-2,53,0,47,2,50,0,53,-2,50,6,47,6,53,4,47,6,50,4,53,2,59,-2,59,2,56,0,59,-2,56,6,59,6,56,4,59}; - coords->useArray(coordsData2,false,DeallocType::CPP_DEALLOC,42,2); + coords->useArray(coordsData2,false,DeallocType::CPP_DEALLOC,42,2); coords->setName(""); // connectivity - conn=DataArrayInt::New(); - const int connData2[72]={8,0,1,2,3,4,5,6,7,8,1,8,9,2,10,11,12,5,8,3,2,13,14,6,15,16,17,8,2,9,18,13,12,19,20,15,8,21,22,23,24,25,26,27,28,8,22,29,30,23,31,32,33,26,8,24,23,34,35,27,36,37,38,8,23,30,39,34,33,40,41,36}; + conn=DataArrayIdType::New(); + const mcIdType connData2[72]={8,0,1,2,3,4,5,6,7,8,1,8,9,2,10,11,12,5,8,3,2,13,14,6,15,16,17,8,2,9,18,13,12,19,20,15,8,21,22,23,24,25,26,27,28,8,22,29,30,23,31,32,33,26,8,24,23,34,35,27,36,37,38,8,23,30,39,34,33,40,41,36}; conn->useArray(connData2,false,DeallocType::CPP_DEALLOC,72,1); conn->setName(""); - connI=DataArrayInt::New(); - const int connIData2[9]={0,9,18,27,36,45,54,63,72}; + connI=DataArrayIdType::New(); + const mcIdType connIData2[9]={0,9,18,27,36,45,54,63,72}; connI->useArray(connIData2,false,DeallocType::CPP_DEALLOC,9,1); connI->setName(""); MEDCouplingUMesh *m2=MEDCouplingUMesh::New("Mobile",2); @@ -1616,16 +1616,16 @@ void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp5() m2->setConnectivity(conn,connI,true); coords->decrRef(); conn->decrRef(); connI->decrRef(); // - DataArrayInt *d1=0,*d2=0; + DataArrayIdType *d1=0,*d2=0; MEDCouplingUMesh *m3=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,1e-10,d1,d2); CPPUNIT_ASSERT_EQUAL(105,(int)m3->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(105,(int)d1->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(105,(int)d2->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(704,m3->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(105,(int)d1->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(105,(int)d2->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(704,(int)m3->getNumberOfNodes()); // const double areaExpected[105]={-65.18804756198824,-65.18804756198824,-65.18804756198824,-65.18804756198824,-66.75884388878285,-66.75884388878285,-66.7588438887833,-66.75884388878308,-68.32964021557768,-68.32964021557768,-68.32964021557814,-68.32964021557791,-69.9004365423732,-69.9004365423732,-69.90043654237297,-69.90043654237297,-1.194568659706448,-1.0869994447159463,-142.2316939607081,-144.51326206513068,-144.5132620651309,-1.1945686597064424,-143.3186934054243,-5.002264310862817,-10.0261332846393,-3.9727823117092953,-7.290862524642649,-124.504404940456,-3.9727823117093237,-146.82366506060032,-150.79644737231024,-5.002264310862776,-145.79418306144626,-5.00208651738126,-10.054764051268958,-4.001067863263231,-8.027932154428669,-129.99378209314813,-4.001067863263216,-153.07856481622616,-157.0796326794898,-5.0020865173811915,-152.07754616210832,-5.001928880064381,-10.050590216368969,-4.00098721602491,-8.025810856794209,-136.28350081741684,-4.000987216024939,-159.36183077064402,-163.36281798667005,-5.0019288800643285,-158.36088910660442,-1.2991516319851801,-3.702636830195414,-3.7815130030068254,-6.265364371195623,-0.02516260900254963,-0.6553944641345026,-3.975752765070567,-7.368528340442765,-142.57249927881398,-0.02516260900254963,-3.9757527650706095,-165.64508791977525,-169.64600329384803,-1.299151631985167,-3.7026368301953885,-164.6442148316677,-10.00321285677458,-20.08414323176165,-8.001644468035863,-16.042954878437143,-304.0096070742277,-8.00164446803587,-350.1399180412005,-358.1415625092368,-10.003212856774468,-348.13834965246224,-3.794150313030109,-8.65049239704272,-0.02260276689354157,-0.5885167811200915,-370.2185414798688,-0.022602766893559393,-383.2517009710623,-383.2743037379555,-3.7941503130300576,-379.48015342492505,-408.40704496667513,-408.4070449666742,-408.4070449666742,-408.4070449666742,-433.53978619538975,-433.5397861953902,-433.5397861953911,-433.53978619539066,-458.67252742410983,-458.6725274241094,-458.67252742410983,-458.6725274241089,-608.6835766330232,-608.6835766330232,-608.6835766330232,-608.6835766330241}; - const int expected1[105]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,16,16,17,18,19,19,20,20,20,20,20,21,21,22,23,23,24,24,24,24,24,25,25,26,27,27,28,28,28,28,28,29,29,30,31,31,32,32,32,32,32,32,32,32,32,33,33,33,34,35,35,35,36,36,36,36,36,37,37,38,39,39,40,40,40,40,40,41,41,42,43,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59}; - const int expected2[105]={-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,2,-1,-1,-1,0,-1,0,2,4,5,-1,4,-1,-1,0,-1,0,2,4,5,-1,4,-1,-1,0,-1,0,2,4,5,-1,4,-1,-1,0,-1,0,1,2,3,4,5,6,7,-1,4,6,-1,-1,0,1,-1,1,3,6,7,-1,6,-1,-1,1,-1,1,3,6,7,-1,6,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; + const mcIdType expected1[105]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,16,16,17,18,19,19,20,20,20,20,20,21,21,22,23,23,24,24,24,24,24,25,25,26,27,27,28,28,28,28,28,29,29,30,31,31,32,32,32,32,32,32,32,32,32,33,33,33,34,35,35,35,36,36,36,36,36,37,37,38,39,39,40,40,40,40,40,41,41,42,43,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59}; + const mcIdType expected2[105]={-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,2,-1,-1,-1,0,-1,0,2,4,5,-1,4,-1,-1,0,-1,0,2,4,5,-1,4,-1,-1,0,-1,0,2,4,5,-1,4,-1,-1,0,-1,0,1,2,3,4,5,6,7,-1,4,6,-1,-1,0,1,-1,1,3,6,7,-1,6,-1,-1,1,-1,1,3,6,7,-1,6,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; MEDCouplingFieldDouble *f3f=m3->getMeasureField(ON_CELLS); const double *f3=f3f->getArray()->getConstPointer(); for(int i=0;i<105;i++) @@ -1645,12 +1645,12 @@ void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp5() void MEDCouplingBasicsTest5::testDAIBuildUnique1() { - DataArrayInt *d=DataArrayInt::New(); - const int dData[14]={1,2,2,3,3,3,3,4,5,5,7,7,7,19}; + DataArrayIdType *d=DataArrayIdType::New(); + const mcIdType dData[14]={1,2,2,3,3,3,3,4,5,5,7,7,7,19}; d->useArray(dData,false,DeallocType::CPP_DEALLOC,14,1); - const int expectedData[7]={1,2,3,4,5,7,19}; + const mcIdType expectedData[7]={1,2,3,4,5,7,19}; // - DataArrayInt *e=d->buildUnique(); + DataArrayIdType *e=d->buildUnique(); CPPUNIT_ASSERT_EQUAL(7,(int)e->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)e->getNumberOfComponents()); for(int i=0;i<7;i++) @@ -1662,32 +1662,32 @@ void MEDCouplingBasicsTest5::testDAIBuildUnique1() void MEDCouplingBasicsTest5::testDAIPartitionByDifferentValues1() { - const int data[9]={1,0,1,2,0,2,2,-3,2}; - const int expected1[4]={-3,0,1,2}; - const int expected2_0[1]={7}; - const int expected2_1[2]={1,4}; - const int expected2_2[2]={0,2}; - const int expected2_3[4]={3,5,6,8}; - DataArrayInt *d=DataArrayInt::New(); + const mcIdType data[9]={1,0,1,2,0,2,2,-3,2}; + const mcIdType expected1[4]={-3,0,1,2}; + const mcIdType expected2_0[1]={7}; + const mcIdType expected2_1[2]={1,4}; + const mcIdType expected2_2[2]={0,2}; + const mcIdType expected2_3[4]={3,5,6,8}; + DataArrayIdType *d=DataArrayIdType::New(); d->useArray(data,false,DeallocType::CPP_DEALLOC,9,1); - std::vector f; + std::vector f; static const int nbOfOutputsExpected=4; - std::vector e=d->partitionByDifferentValues(f); + std::vector e=d->partitionByDifferentValues(f); d->decrRef(); CPPUNIT_ASSERT_EQUAL(nbOfOutputsExpected,(int)e.size()); CPPUNIT_ASSERT_EQUAL(nbOfOutputsExpected,(int)f.size()); for(int i=0;igetNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)2,e[1]->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)2,e[2]->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL((std::size_t)4,e[3]->getNbOfElems()); - CPPUNIT_ASSERT_EQUAL(1,(int)e[0]->getNumberOfComponents()); - CPPUNIT_ASSERT_EQUAL(1,(int)e[1]->getNumberOfComponents()); - CPPUNIT_ASSERT_EQUAL(1,(int)e[2]->getNumberOfComponents()); - CPPUNIT_ASSERT_EQUAL(1,(int)e[3]->getNumberOfComponents()); + { + CPPUNIT_ASSERT_EQUAL(expected1[i],f[i]); + } + CPPUNIT_ASSERT_EQUAL(ToIdType(1),e[0]->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(2),e[1]->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(2),e[2]->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(ToIdType(4),e[3]->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(1,(int)e[0]->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(1,(int)e[1]->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(1,(int)e[2]->getNumberOfComponents()); + CPPUNIT_ASSERT_EQUAL(1,(int)e[3]->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(expected2_0,expected2_0+1,e[0]->begin())); CPPUNIT_ASSERT(std::equal(expected2_1,expected2_1+2,e[1]->begin())); CPPUNIT_ASSERT(std::equal(expected2_2,expected2_2+2,e[2]->begin())); @@ -1697,11 +1697,11 @@ void MEDCouplingBasicsTest5::testDAIPartitionByDifferentValues1() void MEDCouplingBasicsTest5::testDAICheckMonotonic1() { - const int data1[6]={-1,0,2,2,4,5}; - const int data2[6]={6,2,0,-8,-9,-56}; - const int data3[6]={-1,0,3,2,4,6}; - const int data4[6]={7,5,2,3,0,-6}; - DataArrayInt *d=DataArrayInt::New(); + const mcIdType data1[6]={-1,0,2,2,4,5}; + const mcIdType data2[6]={6,2,0,-8,-9,-56}; + const mcIdType data3[6]={-1,0,3,2,4,6}; + const mcIdType data4[6]={7,5,2,3,0,-6}; + DataArrayIdType *d=DataArrayIdType::New(); d->useArray(data1,false,DeallocType::CPP_DEALLOC,6,1); CPPUNIT_ASSERT(d->isMonotonic(true)); CPPUNIT_ASSERT(!d->isMonotonic(false)); @@ -1742,11 +1742,11 @@ void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp6() const double coordsData[16]={2.7554552980815448e-15,45,-45,5.5109105961630896e-15,-31.819805153394636,31.81980515339464,2.8779199779962799e-15,47,2.8166876380389124e-15,46,-47,5.7558399559925599e-15,-33.234018715767732,33.234018715767739,-46,5.6333752760778247e-15}; coords->useArray(coordsData,false,DeallocType::CPP_DEALLOC,8,2); // connectivity - DataArrayInt *conn=DataArrayInt::New(); - const int connData[9]={8,0,3,5,1,4,6,7,2}; + DataArrayIdType *conn=DataArrayIdType::New(); + const mcIdType connData[9]={8,0,3,5,1,4,6,7,2}; conn->useArray(connData,false,DeallocType::CPP_DEALLOC,9,1); - DataArrayInt *connI=DataArrayInt::New(); - const int connIData[2]={0,9}; + DataArrayIdType *connI=DataArrayIdType::New(); + const mcIdType connIData[2]={0,9}; connI->useArray(connIData,false,DeallocType::CPP_DEALLOC,2,1); MEDCouplingUMesh *m1=MEDCouplingUMesh::New("Fixe",2); m1->setCoords(coords); @@ -1757,11 +1757,11 @@ void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp6() const double coordsData2[26]={-7.3800475508445391,41.854329503018846,-3.7041190667754655,42.338274668899189,-3.7041190667754655,45.338274668899189,-7.3800475508445382,44.854329503018839,-5.5473631693521845,42.136406608386956,-3.7041190667754655,43.838274668899189,-5.5420833088100014,45.09630208595901,-7.3800475508445382,43.354329503018839,-3.7041190667754651,52.338274668899189,-7.3800475508445382,51.854329503018839,-3.7041190667754655,48.838274668899189,-5.5420833088100014,52.09630208595901,-7.3800475508445382,48.354329503018839}; coords->useArray(coordsData2,false,DeallocType::CPP_DEALLOC,13,2); // connectivity - conn=DataArrayInt::New(); - const int connData2[18]={8,0,1,2,3,4,5,6,7,8,3,2,8,9,6,10,11,12}; + conn=DataArrayIdType::New(); + const mcIdType connData2[18]={8,0,1,2,3,4,5,6,7,8,3,2,8,9,6,10,11,12}; conn->useArray(connData2,false,DeallocType::CPP_DEALLOC,18,1); - connI=DataArrayInt::New(); - const int connIData2[3]={0,9,18}; + connI=DataArrayIdType::New(); + const mcIdType connIData2[3]={0,9,18}; connI->useArray(connIData2,false,DeallocType::CPP_DEALLOC,3,1); // MEDCouplingUMesh *m2=MEDCouplingUMesh::New("Mobile",2); @@ -1769,18 +1769,18 @@ void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp6() m2->setConnectivity(conn,connI,true); coords->decrRef(); conn->decrRef(); connI->decrRef(); // - DataArrayInt *d1=0,*d2=0; + DataArrayIdType *d1=0,*d2=0; MEDCouplingUMesh *m3=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,1e-10,d1,d2); CPPUNIT_ASSERT_EQUAL(4,(int)m3->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(4,(int)d1->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(4,(int)d2->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(43,m3->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(4,(int)d1->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(4,(int)d2->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(43,(int)m3->getNumberOfNodes()); bool areMerged=false; - int newNbOfNodes=-1; + mcIdType newNbOfNodes=-1; m3->mergeNodes(1e-12,areMerged,newNbOfNodes)->decrRef(); - CPPUNIT_ASSERT_EQUAL(35,m3->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(35,(int)m3->getNumberOfNodes()); m3->zipCoords(); - CPPUNIT_ASSERT_EQUAL(23,m3->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(23,(int)m3->getNumberOfNodes()); // MEDCouplingFieldDouble *f=m3->getMeasureField(true); const double *vals=f->getArray()->getConstPointer(); @@ -1804,11 +1804,11 @@ void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp7() const double coordsData1[16]={0.5328427124746189, -0.08284271247461905, -0.03284271247461901, 0.4828427124746191, -0.03284271247461906, -0.082842712474619, 0.5328427124746191, 0.482842712474619}; coords1->useArray(coordsData1,false,DeallocType::CPP_DEALLOC,8,2); // connectivity - DataArrayInt *conn1=DataArrayInt::New(); - const int connData1[5]={INTERP_KERNEL::NORM_QPOLYG,0,1,2,3}; + DataArrayIdType *conn1=DataArrayIdType::New(); + const mcIdType connData1[5]={INTERP_KERNEL::NORM_QPOLYG,0,1,2,3}; conn1->useArray(connData1,false,DeallocType::CPP_DEALLOC,5,1); - DataArrayInt *connI1=DataArrayInt::New(); - const int connIData1[2]={0,5}; + DataArrayIdType *connI1=DataArrayIdType::New(); + const mcIdType connIData1[2]={0,5}; connI1->useArray(connIData1,false,DeallocType::CPP_DEALLOC,2,1); MEDCouplingUMesh *m1=MEDCouplingUMesh::New("circle",2); m1->setCoords(coords1); @@ -1820,18 +1820,18 @@ void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp7() const double coordsData2[8]={-0.5,-0.5, -0.5, 0.5, 0.5, 0.5, 0.5,-0.5}; coords2->useArray(coordsData2,false,DeallocType::CPP_DEALLOC,4,2); // connectivity - DataArrayInt *conn2=DataArrayInt::New(); - const int connData2[5]={INTERP_KERNEL::NORM_POLYGON, 0,1,2,3}; + DataArrayIdType *conn2=DataArrayIdType::New(); + const mcIdType connData2[5]={INTERP_KERNEL::NORM_POLYGON, 0,1,2,3}; conn2->useArray(connData2,false,DeallocType::CPP_DEALLOC,5,1); - DataArrayInt *connI2=DataArrayInt::New(); - const int connIData2[2]={0,5}; + DataArrayIdType *connI2=DataArrayIdType::New(); + const mcIdType connIData2[2]={0,5}; connI2->useArray(connIData2,false,DeallocType::CPP_DEALLOC,2,1); MEDCouplingUMesh *m2=MEDCouplingUMesh::New("square",2); m2->setCoords(coords2); m2->setConnectivity(conn2,connI2,true); coords2->decrRef(); conn2->decrRef(); connI2->decrRef(); - DataArrayInt * resToM1 = 0, * resToM2 = 0; + DataArrayIdType * resToM1 = 0, * resToM2 = 0; MEDCouplingUMesh *m_intersec=MEDCouplingUMesh::Intersect2DMeshes(m2, m1, eps, resToM1, resToM2); m_intersec->zipCoords(); @@ -1839,10 +1839,10 @@ void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp7() -0.014575131106459124, 0.5000000000000001, 0.5, -0.11224989991991996, 0.24271243444677046, 0.5, 0.5, 0.19387505004004, \ -0.04799910280454185, -0.06682678787499614, -0.023843325638122054, 0.4915644577163915, 0.5, -0.30612494995996, 0.0, -0.5,\ -0.5, 0.0, -0.25728756555322957, 0.5, -0.023843325638122026, 0.49156445771639157, -0.04799910280454181, -0.06682678787499613}; - const int conn_tgt[22]={32, 5, 2, 6, 4, 7, 8, 9, 10, 32, 6, 3, 0, 1, 5, 4, 11, 12, 13, 14, 15, 16}; - const int connI_tgt[3]={0, 9, 22}; - const int res1_tgt[2] = {0, 0}; - const int res2_tgt[2] = {0, -1}; + const mcIdType conn_tgt[22]={32, 5, 2, 6, 4, 7, 8, 9, 10, 32, 6, 3, 0, 1, 5, 4, 11, 12, 13, 14, 15, 16}; + const mcIdType connI_tgt[3]={0, 9, 22}; + const mcIdType res1_tgt[2] = {0, 0}; + const mcIdType res2_tgt[2] = {0, -1}; CPPUNIT_ASSERT(std::equal(conn_tgt,conn_tgt+22,m_intersec->getNodalConnectivity()->getConstPointer())); CPPUNIT_ASSERT(std::equal(connI_tgt,connI_tgt+3,m_intersec->getNodalConnectivityIndex()->getConstPointer())); @@ -1856,26 +1856,26 @@ void MEDCouplingBasicsTest5::testIntersect2DMeshesTmp7() void MEDCouplingBasicsTest5::testDAIBuildSubstractionOptimized1() { - const int tab1[7]={1,3,5,6,7,9,13}; - const int tab2[3]={3,5,9}; - const int tab3[3]={1,3,5}; - DataArrayInt *da1=DataArrayInt::New(); da1->useArray(tab1,false,DeallocType::CPP_DEALLOC,7,1); - DataArrayInt *da2=DataArrayInt::New(); da2->useArray(tab2,false,DeallocType::CPP_DEALLOC,3,1); - DataArrayInt *da3=DataArrayInt::New(); da3->useArray(tab3,false,DeallocType::CPP_DEALLOC,3,1); - DataArrayInt *da4=DataArrayInt::New(); da4->useArray(tab1,false,DeallocType::CPP_DEALLOC,7,1); - // - DataArrayInt *a=0; + const mcIdType tab1[7]={1,3,5,6,7,9,13}; + const mcIdType tab2[3]={3,5,9}; + const mcIdType tab3[3]={1,3,5}; + DataArrayIdType *da1=DataArrayIdType::New(); da1->useArray(tab1,false,DeallocType::CPP_DEALLOC,7,1); + DataArrayIdType *da2=DataArrayIdType::New(); da2->useArray(tab2,false,DeallocType::CPP_DEALLOC,3,1); + DataArrayIdType *da3=DataArrayIdType::New(); da3->useArray(tab3,false,DeallocType::CPP_DEALLOC,3,1); + DataArrayIdType *da4=DataArrayIdType::New(); da4->useArray(tab1,false,DeallocType::CPP_DEALLOC,7,1); + // + DataArrayIdType *a=0; a=da1->buildSubstractionOptimized(da2); CPPUNIT_ASSERT_EQUAL(4,(int)a->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)a->getNumberOfComponents()); - const int expected1_0[4]={1,6,7,13}; + const mcIdType expected1_0[4]={1,6,7,13}; CPPUNIT_ASSERT(std::equal(expected1_0,expected1_0+4,a->begin())); a->decrRef(); // a=da1->buildSubstractionOptimized(da3); CPPUNIT_ASSERT_EQUAL(4,(int)a->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)a->getNumberOfComponents()); - const int expected2_0[4]={6,7,9,13}; + const mcIdType expected2_0[4]={6,7,9,13}; CPPUNIT_ASSERT(std::equal(expected2_0,expected2_0+4,a->begin())); a->decrRef(); // @@ -1892,8 +1892,8 @@ void MEDCouplingBasicsTest5::testDAIBuildSubstractionOptimized1() void MEDCouplingBasicsTest5::testDAIIsStrictlyMonotonic1() { - const int tab1[7]={1,3,5,6,7,9,13}; - DataArrayInt *da1=DataArrayInt::New(); da1->useArray(tab1,false,DeallocType::CPP_DEALLOC,7,1); + const mcIdType tab1[7]={1,3,5,6,7,9,13}; + DataArrayIdType *da1=DataArrayIdType::New(); da1->useArray(tab1,false,DeallocType::CPP_DEALLOC,7,1); CPPUNIT_ASSERT(da1->isStrictlyMonotonic(true)); da1->checkStrictlyMonotonic(true); CPPUNIT_ASSERT(da1->isMonotonic(true)); @@ -1904,8 +1904,8 @@ void MEDCouplingBasicsTest5::testDAIIsStrictlyMonotonic1() CPPUNIT_ASSERT_THROW(da1->checkMonotonic(false),INTERP_KERNEL::Exception); da1->decrRef(); // - int tab2[7]={1,3,5,6,6,9,13}; - da1=DataArrayInt::New(); da1->useArray(tab2,false,DeallocType::CPP_DEALLOC,7,1); + mcIdType tab2[7]={1,3,5,6,6,9,13}; + da1=DataArrayIdType::New(); da1->useArray(tab2,false,DeallocType::CPP_DEALLOC,7,1); CPPUNIT_ASSERT(!da1->isStrictlyMonotonic(true)); CPPUNIT_ASSERT_THROW(da1->checkStrictlyMonotonic(true),INTERP_KERNEL::Exception); CPPUNIT_ASSERT(da1->isMonotonic(true)); @@ -1916,8 +1916,8 @@ void MEDCouplingBasicsTest5::testDAIIsStrictlyMonotonic1() CPPUNIT_ASSERT_THROW(da1->checkMonotonic(false),INTERP_KERNEL::Exception); da1->decrRef(); // - const int tab3[7]={1,3,5,6,5,9,13}; - da1=DataArrayInt::New(); da1->useArray(tab3,false,DeallocType::CPP_DEALLOC,7,1); + const mcIdType tab3[7]={1,3,5,6,5,9,13}; + da1=DataArrayIdType::New(); da1->useArray(tab3,false,DeallocType::CPP_DEALLOC,7,1); CPPUNIT_ASSERT(!da1->isStrictlyMonotonic(true)); CPPUNIT_ASSERT_THROW(da1->checkStrictlyMonotonic(true),INTERP_KERNEL::Exception); CPPUNIT_ASSERT(!da1->isMonotonic(true)); @@ -1928,8 +1928,8 @@ void MEDCouplingBasicsTest5::testDAIIsStrictlyMonotonic1() CPPUNIT_ASSERT_THROW(da1->checkMonotonic(false),INTERP_KERNEL::Exception); da1->decrRef(); // - const int tab4[7]={13,9,7,6,5,3,1}; - da1=DataArrayInt::New(); da1->useArray(tab4,false,DeallocType::CPP_DEALLOC,7,1); + const mcIdType tab4[7]={13,9,7,6,5,3,1}; + da1=DataArrayIdType::New(); da1->useArray(tab4,false,DeallocType::CPP_DEALLOC,7,1); CPPUNIT_ASSERT(!da1->isStrictlyMonotonic(true)); CPPUNIT_ASSERT_THROW(da1->checkStrictlyMonotonic(true),INTERP_KERNEL::Exception); CPPUNIT_ASSERT(!da1->isMonotonic(true)); @@ -1940,8 +1940,8 @@ void MEDCouplingBasicsTest5::testDAIIsStrictlyMonotonic1() da1->checkMonotonic(false); da1->decrRef(); // - const int tab5[7]={13,9,6,6,5,3,1}; - da1=DataArrayInt::New(); da1->useArray(tab5,false,DeallocType::CPP_DEALLOC,7,1); + const mcIdType tab5[7]={13,9,6,6,5,3,1}; + da1=DataArrayIdType::New(); da1->useArray(tab5,false,DeallocType::CPP_DEALLOC,7,1); CPPUNIT_ASSERT(!da1->isStrictlyMonotonic(true)); CPPUNIT_ASSERT_THROW(da1->checkStrictlyMonotonic(true),INTERP_KERNEL::Exception); CPPUNIT_ASSERT(!da1->isMonotonic(true)); @@ -1952,8 +1952,8 @@ void MEDCouplingBasicsTest5::testDAIIsStrictlyMonotonic1() da1->checkMonotonic(false); da1->decrRef(); // - const int tab6[7]={13,9,5,6,5,3,1}; - da1=DataArrayInt::New(); da1->useArray(tab6,false,DeallocType::CPP_DEALLOC,7,1); + const mcIdType tab6[7]={13,9,5,6,5,3,1}; + da1=DataArrayIdType::New(); da1->useArray(tab6,false,DeallocType::CPP_DEALLOC,7,1); CPPUNIT_ASSERT(!da1->isStrictlyMonotonic(true)); CPPUNIT_ASSERT_THROW(da1->checkStrictlyMonotonic(true),INTERP_KERNEL::Exception); CPPUNIT_ASSERT(!da1->isMonotonic(true)); @@ -1964,7 +1964,7 @@ void MEDCouplingBasicsTest5::testDAIIsStrictlyMonotonic1() CPPUNIT_ASSERT_THROW(da1->checkMonotonic(false),INTERP_KERNEL::Exception); da1->decrRef(); // - da1=DataArrayInt::New(); da1->useArray(tab1,false,DeallocType::CPP_DEALLOC,0,1); + da1=DataArrayIdType::New(); da1->useArray(tab1,false,DeallocType::CPP_DEALLOC,0,1); CPPUNIT_ASSERT(da1->isStrictlyMonotonic(true)); da1->checkStrictlyMonotonic(true); CPPUNIT_ASSERT(da1->isMonotonic(true)); @@ -1975,7 +1975,7 @@ void MEDCouplingBasicsTest5::testDAIIsStrictlyMonotonic1() da1->checkMonotonic(false); da1->decrRef(); // - da1=DataArrayInt::New(); da1->useArray(tab1,false,DeallocType::CPP_DEALLOC,1,1); + da1=DataArrayIdType::New(); da1->useArray(tab1,false,DeallocType::CPP_DEALLOC,1,1); CPPUNIT_ASSERT(da1->isStrictlyMonotonic(true)); da1->checkStrictlyMonotonic(true); CPPUNIT_ASSERT(da1->isMonotonic(true)); @@ -1989,7 +1989,7 @@ void MEDCouplingBasicsTest5::testDAIIsStrictlyMonotonic1() void MEDCouplingBasicsTest5::testSimplexize3() { - const int conn[24]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}; + const mcIdType conn[24]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}; MEDCouplingUMesh *m=MEDCouplingUMesh::New("toto",3); m->allocateCells(0); m->insertNextCell(INTERP_KERNEL::NORM_TETRA4,4,conn+0); @@ -2004,7 +2004,7 @@ void MEDCouplingBasicsTest5::testSimplexize3() m->checkConsistency(); // MEDCouplingUMesh *m1=static_cast(m->deepCopy()); - DataArrayInt *d1=m1->simplexize(INTERP_KERNEL::PLANAR_FACE_5); + DataArrayIdType *d1=m1->simplexize(INTERP_KERNEL::PLANAR_FACE_5); m1->checkConsistency(); MEDCouplingFieldDouble *f1=m1->getMeasureField(ON_CELLS); const double vol1Expected[12]={1./6, 1./6, 1./6,1./6, 1./6, 1./3,1./6, 1./6, 1./6, 1./6, 1./3, 1./6}; @@ -2012,9 +2012,9 @@ void MEDCouplingBasicsTest5::testSimplexize3() CPPUNIT_ASSERT_EQUAL(12,(int)f1->getArray()->getNumberOfTuples()); for(int i=0;i<12;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(vol1Expected[i],f1->getIJ(i,0),1e-12); - const int connExpected1[60]={14,0,1,2,3,14,4,9,5,6,14,4,8,9,11,14,4,7,11,6,14,9,11,10,6,14,4,9,6,11,14,12,17,13,14,14,12,16,17,19,14,12,15,19,14,14,17,19,18,14,14,12,17,14,19,14,20,21,22,23}; - const int connIExpected1[13]={0,5,10,15,20,25,30,35,40,45,50,55,60}; - const int n2o1[12]={0,1,1,1,1,1,2,2,2,2,2,3}; + const mcIdType connExpected1[60]={14,0,1,2,3,14,4,9,5,6,14,4,8,9,11,14,4,7,11,6,14,9,11,10,6,14,4,9,6,11,14,12,17,13,14,14,12,16,17,19,14,12,15,19,14,14,17,19,18,14,14,12,17,14,19,14,20,21,22,23}; + const mcIdType connIExpected1[13]={0,5,10,15,20,25,30,35,40,45,50,55,60}; + const mcIdType n2o1[12]={0,1,1,1,1,1,2,2,2,2,2,3}; CPPUNIT_ASSERT_EQUAL(1,(int)m1->getNodalConnectivity()->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(60,(int)m1->getNodalConnectivity()->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)m1->getNodalConnectivityIndex()->getNumberOfComponents()); @@ -2029,7 +2029,7 @@ void MEDCouplingBasicsTest5::testSimplexize3() d1->decrRef(); // MEDCouplingUMesh *m2=static_cast(m->deepCopy()); - DataArrayInt *d2=m2->simplexize(INTERP_KERNEL::PLANAR_FACE_6); + DataArrayIdType *d2=m2->simplexize(INTERP_KERNEL::PLANAR_FACE_6); m2->checkConsistency(); MEDCouplingFieldDouble *f2=m2->getMeasureField(ON_CELLS); const double vol2Expected[14]={1./6, 1./6, 1./6,1./6, 1./6, 1./6,1./6,1./6, 1./6, 1./6, 1./6, 1./6,1./6,1./6}; @@ -2037,9 +2037,9 @@ void MEDCouplingBasicsTest5::testSimplexize3() CPPUNIT_ASSERT_EQUAL(14,(int)f2->getArray()->getNumberOfTuples()); for(int i=0;i<14;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(vol2Expected[i],f2->getIJ(i,0),1e-12); - const int connExpected2[70]={14,0,1,2,3,14,4,9,5,10,14,4,5,6,10,14,4,8,9,10,14,4,11,8,10,14,4,6,7,10,14,4,7,11,10,14,12,17,13,18,14,12,13,14,18,14,12,16,17,18,14,12,19,16,18,14,12,14,15,18,14,12,15,19,18,14,20,21,22,23}; - const int connIExpected2[15]={0,5,10,15,20,25,30,35,40,45,50,55,60,65,70}; - const int n2o2[14]={0,1,1,1,1,1,1,2,2,2,2,2,2,3}; + const mcIdType connExpected2[70]={14,0,1,2,3,14,4,9,5,10,14,4,5,6,10,14,4,8,9,10,14,4,11,8,10,14,4,6,7,10,14,4,7,11,10,14,12,17,13,18,14,12,13,14,18,14,12,16,17,18,14,12,19,16,18,14,12,14,15,18,14,12,15,19,18,14,20,21,22,23}; + const mcIdType connIExpected2[15]={0,5,10,15,20,25,30,35,40,45,50,55,60,65,70}; + const mcIdType n2o2[14]={0,1,1,1,1,1,1,2,2,2,2,2,2,3}; CPPUNIT_ASSERT_EQUAL(1,(int)m2->getNodalConnectivity()->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(70,(int)m2->getNodalConnectivity()->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)m2->getNodalConnectivityIndex()->getNumberOfComponents()); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTestData1.hxx b/src/MEDCoupling/Test/MEDCouplingBasicsTestData1.hxx index 52ee9b15e..756736d00 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTestData1.hxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTestData1.hxx @@ -18,7 +18,7 @@ // // Author : Anthony Geay (CEA/DEN) -int connITT[201]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000, 1029, 1058, 1087, 1116, 1145, 1174, 1203, +mcIdType connITT[201]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000, 1029, 1058, 1087, 1116, 1145, 1174, 1203, 1232, 1261, 1290, 1319, 1348, 1377, 1406, 1435, 1464, 1493, 1522, 1551, 1580, 1609, 1638, 1667, 1696, 1725, 1754, 1783, 1812, 1841, 1870, 1899, 1928, 1957, 1986, 2015, 2044, 2073, 2102, 2131, 2160, 2189, 2218, 2247, 2276, 2305, 2334, 2363, 2392, 2421, 2450, 2479, 2508, 2537, 2566, 2595, 2624, 2653, 2682, 2711, 2740, 2769, 2798, 2827, 2856, 2885, 2914, 2943, 2972, 3001, 3030, 3059, 3088, 3117, 3146, 3175, 3204, 3233, 3262, 3291, @@ -27,7 +27,7 @@ int connITT[201]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 4712, 4741, 4770, 4799, 4828, 4857, 4886, 4915, 4944, 4973, 5002, 5031, 5060, 5089, 5118, 5147, 5176, 5205, 5234, 5263, 5292, 5321, 5350, 5379, 5408, 5437, 5466, 5495, 5524, 5553, 5582, 5611, 5640, 5669, 5698, 5727, 5756, 5785, 5814, 5843, 5872, 5901, 5930, 5959, 5988, 6017, 6046, 6075, 6104, 6133, 6162, 6191, 6220}; - int connTT[6220]={0, 1, 2, 3, 4, 5, 6, -1, 0, 7, 8, 1, -1, 1, 8, 9, 2, -1, 2, 9, 10, 3, -1, 3, 10, 11, 4, -1, 4, 11, 12, 5, -1, 5, 12, 13, 6, -1, 6, 13, 7, 0, -1, 7, 13, 12, 11, 10, 9, 8, 14, 15, 16, 17, 18, 19, + mcIdType connTT[6220]={0, 1, 2, 3, 4, 5, 6, -1, 0, 7, 8, 1, -1, 1, 8, 9, 2, -1, 2, 9, 10, 3, -1, 3, 10, 11, 4, -1, 4, 11, 12, 5, -1, 5, 12, 13, 6, -1, 6, 13, 7, 0, -1, 7, 13, 12, 11, 10, 9, 8, 14, 15, 16, 17, 18, 19, 20, -1, 14, 21, 22, 15, -1, 15, 22, 23, 16, -1, 16, 23, 24, 17, -1, 17, 24, 25, 18, -1, 18, 25, 26, 19, -1, 19, 26, 27, 20, -1, 20, 27, 21, 14, -1, 21, 27, 26, 25, 24, 23, 22, 28, 29, 30, 31, 32, 33, 34, -1, 28, 35, 36, 29, -1, 29, 36, 37, 30, -1, 30, 37, 38, 31, -1, 31, 38, 39, 32, -1, 32, 39, 40, 33, -1, 33, 40, 41, 34, -1, 34, 41, 35, 28, -1, 35, 41, 40, 39, 38, 37, 36, 42, 43, 44, 45, 46, 47, 48, -1, 42, 49, 50, 43, -1, 43, 50, 51, 44, -1, 44, 51, 52, 45, -1, 45, 52, 53, 46, -1, 46, 53, 54, 47, -1, 47, 54, 55, 48, -1, 48, 55, 49, 42, -1, 49, 55, 54, 53, 52, 51, 50, 56, 57, 58, @@ -906,7 +906,7 @@ double coordsTT[5160]={ }; -const int connTFH8[2560]={ +const mcIdType connTFH8[2560]={ 1, 2, 7, 6, 28, 29, 34, 33, 2, 3, 8, 7, 29, 30, 35, 34, 3, 4, 9, 8, 30, 31, 36, 35, 4, 5, 10, 9, 31, 32, 37, 36, 6, 7, 12, 11, 33, 34, 39, 38, 7, 8, 13, 12, 34, 35, 40, 39, 8, 9, 14, 13, 35, 36, 41, 40, 9, 10, 15, 14, 36, 37, 42, 41, 11, 12, 17, 16, 38, 39, 44, 43, 12, 13, 18, 17, 39, 40, 45, 44, 13, 14, 19, 18, 40, 41, 46, 45, 14, 15, 20, 19, 41, 42, 47, 46, 16, 17, 21, 26, 43, 44, 48, 53, 17, 18, 22, 21, 44, 45, 49, 48, 18, 19, 23, 22, 45, 46, 50, 49, 19, 20, 24, 23, 46, 47, 51, 50, 28, 29, 34, 33, 55, 56, 61, 60, @@ -966,7 +966,7 @@ const int connTFH8[2560]={ 526, 531, 530, 552, 553, 558, 557, 526, 527, 532, 531, 553, 554, 559, 558, 527, 528, 533, 532, 554, 555, 560, 559, 529, 530, 534, 539, 556, 557, 561, 566, 530, 531, 535, 534, 557, 558, 562, 561, 531, 532, 536, 535, 558, 559, 563, 562, 532, 533, 537, 536, 559, 560, 564, 563}; -const int connTFPOLH[1000]={ +const mcIdType connTFPOLH[1000]={ 0, 25, 26, 16, 11, 6, 1, -1, 27, 28, 33, 38, 43, 53, 52, -1, 0, 1, 28, 27, -1, 1, 6, 33, 28, -1, 6, 11, 38, 33, -1, 11, 16, 43, 38, -1, 16, 26, 53, 43, -1, 26, 25, 52, 53, -1, 25, 0, 27, 52, 27, 52, 53, 43, 38, 33, 28, -1, 54, 55, 60, 65, 70, 80, 79, -1, 27, 28, 55, 54, -1, 28, 33, 60, 55, -1, 33, 38, 65, 60, -1, 38, 43, 70, 65, -1, 43, 53, 80, 70, -1, 53, 52, 79, 80, -1, 52, 27, 54, 79, 54, 79, 80, 70, 65, 60, 55, -1, 81, 82, 87, 92, 97, 107, 106, -1, 54, 55, 82, 81, -1, 55, 60, 87, 82, -1, 60, 65, 92, 87, -1, 65, 70, 97, 92, -1, 70, 80, 107, 97, -1, 80, 79, 106, 107, -1, 79, 54, 81, 106, 81, 106, 107, 97, 92, 87, 82, -1, 108, 109, 114, 119, 124, 134, 133, -1, 81, 82, 109, 108, -1, @@ -1164,4 +1164,4 @@ const double coordsTF[1701]={ 4.2729999999999997, 0, 0.21606, 4.2729999999999997, 0.21606, 0.21606, 4.2729999999999997 }; -const int connTFPOLH_I[21]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; +const mcIdType connTFPOLH_I[21]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTestInterp.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTestInterp.cxx index cc96fe9a6..3c5e3c858 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTestInterp.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTestInterp.cxx @@ -41,7 +41,7 @@ using namespace MEDCoupling; -typedef std::vector > IntersectionMatrix; +typedef std::vector > IntersectionMatrix; void MEDCouplingBasicsTestInterp::test2DInterpP0P0_1() { @@ -51,7 +51,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0P0_1() MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; INTERP_KERNEL::IntersectionType types[3]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Convex, INTERP_KERNEL::Geometric2D}; for(int i=0;i<3;i++) { @@ -82,7 +82,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0P0PL_1() MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; // myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); @@ -105,15 +105,15 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0P0PL_2() MEDCouplingUMesh *sourceMesh=build2DSourceMesh_1(); MEDCouplingUMesh *targetMesh=build2DTargetMesh_1(); // - std::vector cellsIds(targetMesh->getNumberOfCells()); - for(int i=0;igetNumberOfCells();i++) + std::vector cellsIds(targetMesh->getNumberOfCells()); + for(mcIdType i=0;igetNumberOfCells();i++) cellsIds[i]=i; targetMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size()); // MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; // myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); @@ -136,15 +136,15 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0P0PL_3() MEDCouplingUMesh *sourceMesh=build2DSourceMesh_1(); MEDCouplingUMesh *targetMesh=build2DTargetMesh_1(); // - std::vector cellsIds(sourceMesh->getNumberOfCells()); - for(int i=0;igetNumberOfCells();i++) + std::vector cellsIds(sourceMesh->getNumberOfCells()); + for(mcIdType i=0;igetNumberOfCells();i++) cellsIds[i]=i; sourceMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size()); // MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; // myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); @@ -167,19 +167,19 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0P0PL_4() MEDCouplingUMesh *sourceMesh=build2DSourceMesh_1(); MEDCouplingUMesh *targetMesh=build2DTargetMesh_1(); // - std::vector cellsIds(sourceMesh->getNumberOfCells()); - for(int i=0;igetNumberOfCells();i++) + std::vector cellsIds(sourceMesh->getNumberOfCells()); + for(mcIdType i=0;igetNumberOfCells();i++) cellsIds[i]=i; sourceMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size()); cellsIds.resize(targetMesh->getNumberOfCells()); - for(int i=0;igetNumberOfCells();i++) + for(mcIdType i=0;igetNumberOfCells();i++) cellsIds[i]=i; targetMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size()); // MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; // myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); @@ -205,7 +205,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0P1_1() MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D}; for(int i=0;i<2;i++) { @@ -241,7 +241,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0P1PL_1() MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P1"); @@ -270,20 +270,20 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0P1PL_2() MEDCouplingUMesh *sourceMesh=build2DSourceMesh_1(); MEDCouplingUMesh *targetMesh=build2DTargetMesh_1(); // - std::vector cellsIds(sourceMesh->getNumberOfCells()); - for(int i=0;igetNumberOfCells();i++) + std::vector cellsIds(sourceMesh->getNumberOfCells()); + for(mcIdType i=0;igetNumberOfCells();i++) cellsIds[i]=i; sourceMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size()); // cellsIds.resize(targetMesh->getNumberOfCells()); - for(int i=0;igetNumberOfCells();i++) + for(mcIdType i=0;igetNumberOfCells();i++) cellsIds[i]=i; targetMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size()); // MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P1"); @@ -315,9 +315,9 @@ void MEDCouplingBasicsTestInterp::test2DInterpP1P0_1() MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D}; - for(int i=0;i<2;i++) + for(mcIdType i=0;i<2;i++) { myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(types[i]); @@ -348,7 +348,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP1P0PL_1() MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P0"); @@ -382,15 +382,15 @@ void MEDCouplingBasicsTestInterp::test2DInterpP1P0PL_2() MEDCouplingUMesh *sourceMesh=build2DSourceMesh_1(); MEDCouplingUMesh *targetMesh=build2DTargetMesh_1(); // - std::vectorcellsIds(targetMesh->getNumberOfCells()); - for(int i=0;igetNumberOfCells();i++) + std::vectorcellsIds(targetMesh->getNumberOfCells()); + for(mcIdType i=0;igetNumberOfCells();i++) cellsIds[i]=i; targetMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size()); // MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P0"); @@ -427,7 +427,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP1P1_1() MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D}; for(int i=0;i<2;i++) { @@ -466,7 +466,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP1P1PL_1() MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P1"); @@ -500,7 +500,7 @@ void MEDCouplingBasicsTestInterp::test3DSurfInterpP0P0_1() MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3DSurf myInterpolator; - std::vector > res; + std::vector > res; INTERP_KERNEL::IntersectionType types[3]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D}; for(int i=0;i<2;i++) { @@ -531,7 +531,7 @@ void MEDCouplingBasicsTestInterp::test3DSurfInterpP0P0PL_1() MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3DSurf myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); @@ -558,7 +558,7 @@ void MEDCouplingBasicsTestInterp::test3DSurfInterpP0P1_1() MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3DSurf myInterpolator; - std::vector > res; + std::vector > res; INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D}; for(int i=0;i<2;i++) { @@ -594,7 +594,7 @@ void MEDCouplingBasicsTestInterp::test3DSurfInterpP0P1PL_1() MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3DSurf myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P1"); @@ -626,7 +626,7 @@ void MEDCouplingBasicsTestInterp::test3DSurfInterpP1P0_1() MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3DSurf myInterpolator; - std::vector > res; + std::vector > res; INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D}; for(int i=0;i<2;i++) { @@ -659,7 +659,7 @@ void MEDCouplingBasicsTestInterp::test3DSurfInterpP1P0PL_1() MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3DSurf myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P0"); @@ -696,7 +696,7 @@ void MEDCouplingBasicsTestInterp::test3DSurfInterpP1P1_1() MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3DSurf myInterpolator; - std::vector > res; + std::vector > res; INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D}; for(int i=0;i<2;i++) { @@ -735,7 +735,7 @@ void MEDCouplingBasicsTestInterp::test3DSurfInterpP1P1PL_1() MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3DSurf myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P1"); @@ -769,7 +769,7 @@ void MEDCouplingBasicsTestInterp::test3DSurfInterpP0P0_2() MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3DSurf myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::Triangulation); { @@ -832,7 +832,7 @@ void MEDCouplingBasicsTestInterp::test3DSurfInterpP0P0_2() void MEDCouplingBasicsTestInterp::test3DSurfInterpP0P0_3() { INTERP_KERNEL::Interpolation3DSurf myInterpolator; - std::vector > res; + std::vector > res; double vecTrans[3]={0.,0.,1.e-10}; double vec[3]={0.,-1.,0.}; double pt[3]={-0.3,-0.3,5.e-11}; @@ -927,7 +927,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P0_1() MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); INTERP_KERNEL::SplittingPolicy sp[] = { INTERP_KERNEL::PLANAR_FACE_5, INTERP_KERNEL::PLANAR_FACE_6, INTERP_KERNEL::GENERAL_24, INTERP_KERNEL::GENERAL_48 }; for ( int i = 0; i < 4; ++i ) @@ -995,7 +995,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P0PL_1() MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); INTERP_KERNEL::SplittingPolicy sp[] = { INTERP_KERNEL::PLANAR_FACE_5, INTERP_KERNEL::PLANAR_FACE_6, INTERP_KERNEL::GENERAL_24, INTERP_KERNEL::GENERAL_48 }; @@ -1037,7 +1037,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P0PL_2() { MEDCouplingUMesh *sourceMesh=build3DSourceMesh_1(); MEDCouplingUMesh *targetMesh=build3DTargetMesh_1(); - std::vector cellsIds(targetMesh->getNumberOfCells()); + std::vector cellsIds(targetMesh->getNumberOfCells()); for(int i=0;igetNumberOfCells();i++) cellsIds[i]=i; targetMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size()); @@ -1045,7 +1045,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P0PL_2() MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); INTERP_KERNEL::SplittingPolicy sp[] = { INTERP_KERNEL::PLANAR_FACE_5, INTERP_KERNEL::PLANAR_FACE_6, INTERP_KERNEL::GENERAL_24, INTERP_KERNEL::GENERAL_48 }; @@ -1087,7 +1087,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P0PL_3() { MEDCouplingUMesh *sourceMesh=build3DSourceMesh_1(); MEDCouplingUMesh *targetMesh=build3DTargetMesh_1(); - std::vector cellsIds(sourceMesh->getNumberOfCells()); + std::vector cellsIds(sourceMesh->getNumberOfCells()); for(int i=0;igetNumberOfCells();i++) cellsIds[i]=i; sourceMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size()); @@ -1095,7 +1095,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P0PL_3() MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); INTERP_KERNEL::SplittingPolicy sp[] = { INTERP_KERNEL::PLANAR_FACE_5, INTERP_KERNEL::PLANAR_FACE_6, INTERP_KERNEL::GENERAL_24, INTERP_KERNEL::GENERAL_48 }; @@ -1137,7 +1137,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P0PL_4() { MEDCouplingUMesh *sourceMesh=build3DSourceMesh_1(); MEDCouplingUMesh *targetMesh=build3DTargetMesh_1(); - std::vector cellsIds(sourceMesh->getNumberOfCells()); + std::vector cellsIds(sourceMesh->getNumberOfCells()); for(int i=0;igetNumberOfCells();i++) cellsIds[i]=i; sourceMesh->convertToPolyTypes(&cellsIds[0],&cellsIds[0]+cellsIds.size()); @@ -1149,7 +1149,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P0PL_4() MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); INTERP_KERNEL::SplittingPolicy sp[] = { INTERP_KERNEL::PLANAR_FACE_5, INTERP_KERNEL::PLANAR_FACE_6, INTERP_KERNEL::GENERAL_24, INTERP_KERNEL::GENERAL_48 }; @@ -1195,7 +1195,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P1_1() MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); INTERP_KERNEL::SplittingPolicy sp[] = { INTERP_KERNEL::PLANAR_FACE_5, INTERP_KERNEL::PLANAR_FACE_6, INTERP_KERNEL::GENERAL_24, INTERP_KERNEL::GENERAL_48 }; for ( int i = 0; i < 4; ++i ) @@ -1251,7 +1251,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P1PL_1() MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); INTERP_KERNEL::SplittingPolicy sp[] = { INTERP_KERNEL::PLANAR_FACE_5, INTERP_KERNEL::PLANAR_FACE_6, INTERP_KERNEL::GENERAL_24, INTERP_KERNEL::GENERAL_48 }; @@ -1285,7 +1285,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP1P0_1() MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); INTERP_KERNEL::SplittingPolicy sp[] = { INTERP_KERNEL::PLANAR_FACE_5, INTERP_KERNEL::PLANAR_FACE_6, INTERP_KERNEL::GENERAL_24, INTERP_KERNEL::GENERAL_48 }; for ( int i = 0; i < 4; ++i ) @@ -1341,7 +1341,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP1P0PL_1() MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); INTERP_KERNEL::SplittingPolicy sp[] = { INTERP_KERNEL::PLANAR_FACE_5, INTERP_KERNEL::PLANAR_FACE_6, INTERP_KERNEL::GENERAL_24, INTERP_KERNEL::GENERAL_48 }; @@ -1389,7 +1389,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP1P1_1() MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P1"); CPPUNIT_ASSERT_EQUAL(8,(int)res.size()); @@ -1404,12 +1404,12 @@ void MEDCouplingBasicsTestInterp::test3DInterpP1P1_1() int i=0; double sum = 0; //cout.precision(18); - for(std::vector >::const_iterator iter1=res.begin();iter1!=res.end();iter1++,i++) + for(std::vector >::const_iterator iter1=res.begin();iter1!=res.end();iter1++,i++) { //cout<< "res3D[" <::const_iterator iter2=(*iter1).find(j); + std::map::const_iterator iter2=(*iter1).find(j); if(iter2!=(*iter1).end()) { //cout<< iter2->second<< ", "; @@ -1439,7 +1439,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP1P1PL_1() MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P1"); @@ -1479,7 +1479,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0P0Empty() MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); //clean up @@ -1512,7 +1512,7 @@ void MEDCouplingBasicsTestInterp::testInterpolationCC() CPPUNIT_ASSERT_THROW( sourceWrapper.nbCellsAlongAxis(3), INTERP_KERNEL::Exception); INTERP_KERNEL::InterpolationCC myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); CPPUNIT_ASSERT_EQUAL(8,int( res.size())); @@ -1521,7 +1521,7 @@ void MEDCouplingBasicsTestInterp::testInterpolationCC() std::set vals; double sum = 0; for ( int i = 0; i < (int)res.size(); ++i ) - for ( std::map::iterator s_v = res[i].begin(); s_v != res[i].end(); ++s_v) + for ( std::map::iterator s_v = res[i].begin(); s_v != res[i].end(); ++s_v) { sum += s_v->second; double vvv; @@ -1568,7 +1568,7 @@ void MEDCouplingBasicsTestInterp::testInterpolationCU1D() MEDCouplingNormalizedCartesianMesh<1> sourceWrapper(meshC); MEDCouplingNormalizedUnstructuredMesh<1,1> targetWrapper(meshU); INTERP_KERNEL::InterpolationCU myInterpolator; - std::vector > res; + std::vector > res; const double precis = 1e-13; myInterpolator.setPrecision(precis); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); @@ -1606,7 +1606,7 @@ void MEDCouplingBasicsTestInterp::testInterpolationCU2D() MEDCouplingNormalizedCartesianMesh<2> sourceWrapper(meshC); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(meshU); INTERP_KERNEL::InterpolationCU myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); @@ -1675,7 +1675,7 @@ void MEDCouplingBasicsTestInterp::testInterpolationCU3D() MEDCouplingNormalizedCartesianMesh<3> sourceWrapper(meshC); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(meshU); INTERP_KERNEL::InterpolationCU myInterpolator; - std::vector > res; + std::vector > res; const double precis = 1e-13; myInterpolator.setPrecision(precis); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); @@ -1759,8 +1759,8 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0IntegralUniform() // MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; - CPPUNIT_ASSERT_EQUAL(5,myInterpolator.toIntegralUniform(targetWrapper,res,"P0")); + std::vector > res; + CPPUNIT_ASSERT_EQUAL(5,(int)myInterpolator.toIntegralUniform(targetWrapper,res,"P0")); CPPUNIT_ASSERT_EQUAL(1,(int)res.size()); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25,res[0][0],1e-12); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125,res[0][1],1e-12); @@ -1769,7 +1769,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0IntegralUniform() CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25,res[0][4],1e-12); CPPUNIT_ASSERT_DOUBLES_EQUAL(1.,sumAll(res),1e-12); res.clear(); - CPPUNIT_ASSERT_EQUAL(1,myInterpolator.fromIntegralUniform(targetWrapper,res,"P0")); + CPPUNIT_ASSERT_EQUAL(1,(int)myInterpolator.fromIntegralUniform(targetWrapper,res,"P0")); CPPUNIT_ASSERT_EQUAL(5,(int)res.size()); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25,res[0][0],1e-12); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125,res[1][0],1e-12); @@ -1784,7 +1784,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0IntegralUniform() MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper2(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator2; CPPUNIT_ASSERT(myInterpolator2.getMeasureAbsStatus()); - CPPUNIT_ASSERT_EQUAL(5,myInterpolator2.toIntegralUniform(targetWrapper2,res,"P0")); + CPPUNIT_ASSERT_EQUAL(5,(int)myInterpolator2.toIntegralUniform(targetWrapper2,res,"P0")); CPPUNIT_ASSERT_EQUAL(1,(int)res.size()); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25,res[0][0],1e-12); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125,res[0][1],1e-12); @@ -1795,7 +1795,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP0IntegralUniform() res.clear(); myInterpolator2.setMeasureAbsStatus(false); CPPUNIT_ASSERT(!myInterpolator2.getMeasureAbsStatus()); - CPPUNIT_ASSERT_EQUAL(5,myInterpolator2.toIntegralUniform(targetWrapper2,res,"P0")); + CPPUNIT_ASSERT_EQUAL(5,(int)myInterpolator2.toIntegralUniform(targetWrapper2,res,"P0")); CPPUNIT_ASSERT_EQUAL(1,(int)res.size()); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25,res[0][0],1e-12); CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.125,res[0][1],1e-12); @@ -1811,8 +1811,8 @@ void MEDCouplingBasicsTestInterp::test3DSurfInterpP0IntegralUniform() MEDCouplingUMesh *targetMesh=build3DSurfTargetMesh_1(); INTERP_KERNEL::Interpolation3DSurf myInterpolator; MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh); - std::vector > res; - CPPUNIT_ASSERT_EQUAL(5,myInterpolator.toIntegralUniform(targetWrapper,res,"P0")); + std::vector > res; + CPPUNIT_ASSERT_EQUAL(5,(int)myInterpolator.toIntegralUniform(targetWrapper,res,"P0")); CPPUNIT_ASSERT_EQUAL(1,(int)res.size()); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25*sqrt(2.),res[0][0],1e-12); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2.),res[0][1],1e-12); @@ -1821,7 +1821,7 @@ void MEDCouplingBasicsTestInterp::test3DSurfInterpP0IntegralUniform() CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25*sqrt(2.),res[0][4],1e-12); CPPUNIT_ASSERT_DOUBLES_EQUAL(1.*sqrt(2.),sumAll(res),1e-12); res.clear(); - CPPUNIT_ASSERT_EQUAL(1,myInterpolator.fromIntegralUniform(targetWrapper,res,"P0")); + CPPUNIT_ASSERT_EQUAL(1,(int)myInterpolator.fromIntegralUniform(targetWrapper,res,"P0")); CPPUNIT_ASSERT_EQUAL(5,(int)res.size()); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25*sqrt(2.),res[0][0],1e-12); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2.),res[1][0],1e-12); @@ -1837,8 +1837,8 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0IntegralUniform() MEDCouplingUMesh *targetMesh=build3DTargetMesh_1(); INTERP_KERNEL::Interpolation3D myInterpolator; MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); - std::vector > res; - CPPUNIT_ASSERT_EQUAL(8,myInterpolator.toIntegralUniform(targetWrapper,res,"P0")); + std::vector > res; + CPPUNIT_ASSERT_EQUAL(8,(int)myInterpolator.toIntegralUniform(targetWrapper,res,"P0")); CPPUNIT_ASSERT_EQUAL(1,(int)res.size()); CPPUNIT_ASSERT_DOUBLES_EQUAL(125000.,res[0][0],1e-6); CPPUNIT_ASSERT_DOUBLES_EQUAL(375000.,res[0][1],1e-6); @@ -1850,7 +1850,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP0IntegralUniform() CPPUNIT_ASSERT_DOUBLES_EQUAL(3375000.,res[0][7],1e-6); CPPUNIT_ASSERT_DOUBLES_EQUAL(8000000.,sumAll(res),1e-6); res.clear(); - CPPUNIT_ASSERT_EQUAL(1,myInterpolator.fromIntegralUniform(targetWrapper,res,"P0")); + CPPUNIT_ASSERT_EQUAL(1,(int)myInterpolator.fromIntegralUniform(targetWrapper,res,"P0")); CPPUNIT_ASSERT_EQUAL(8,(int)res.size()); CPPUNIT_ASSERT_DOUBLES_EQUAL(125000.,res[0][0],1e-6); CPPUNIT_ASSERT_DOUBLES_EQUAL(375000.,res[1][0],1e-6); @@ -1871,15 +1871,15 @@ void MEDCouplingBasicsTestInterp::test2DInterpP1IntegralUniform() // MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; - CPPUNIT_ASSERT_EQUAL(4,myInterpolator.toIntegralUniform(targetWrapper,res,"P1")); + std::vector > res; + CPPUNIT_ASSERT_EQUAL(4,(int)myInterpolator.toIntegralUniform(targetWrapper,res,"P1")); CPPUNIT_ASSERT_EQUAL(1,(int)res.size()); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.33333333333333331,res[0][0],1e-12); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.16666666666666666,res[0][1],1e-12); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.16666666666666666,res[0][2],1e-12); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.33333333333333331,res[0][3],1e-12); res.clear(); - CPPUNIT_ASSERT_EQUAL(1,myInterpolator.fromIntegralUniform(targetWrapper,res,"P1")); + CPPUNIT_ASSERT_EQUAL(1,(int)myInterpolator.fromIntegralUniform(targetWrapper,res,"P1")); CPPUNIT_ASSERT_EQUAL(4,(int)res.size()); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.33333333333333331,res[0][0],1e-12); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.16666666666666666,res[1][0],1e-12); @@ -1895,8 +1895,8 @@ void MEDCouplingBasicsTestInterp::test3DInterpP1IntegralUniform() // MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(sourceMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; - CPPUNIT_ASSERT_EQUAL(9,myInterpolator.toIntegralUniform(targetWrapper,res,"P1")); + std::vector > res; + CPPUNIT_ASSERT_EQUAL(9,(int)myInterpolator.toIntegralUniform(targetWrapper,res,"P1")); CPPUNIT_ASSERT_EQUAL(1,(int)res.size()); CPPUNIT_ASSERT_DOUBLES_EQUAL(833333.333333333,res[0][0],1e-6); CPPUNIT_ASSERT_DOUBLES_EQUAL(833333.333333333,res[0][1],1e-6); @@ -1909,7 +1909,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP1IntegralUniform() CPPUNIT_ASSERT_DOUBLES_EQUAL(2000000.,res[0][8],1e-6); CPPUNIT_ASSERT_DOUBLES_EQUAL(8000000.,sumAll(res),1e-6); res.clear(); - CPPUNIT_ASSERT_EQUAL(1,myInterpolator.fromIntegralUniform(targetWrapper,res,"P1")); + CPPUNIT_ASSERT_EQUAL(1,(int)myInterpolator.fromIntegralUniform(targetWrapper,res,"P1")); CPPUNIT_ASSERT_EQUAL(9,(int)res.size()); CPPUNIT_ASSERT_DOUBLES_EQUAL(833333.333333333,res[0][0],1e-6); CPPUNIT_ASSERT_DOUBLES_EQUAL(833333.333333333,res[1][0],1e-6); @@ -1932,7 +1932,7 @@ void MEDCouplingBasicsTestInterp::test2DInterpP1P0Bary_1() MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation2D myInterpolator; - std::vector > res; + std::vector > res; INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Barycentric,INTERP_KERNEL::BarycentricGeo2D}; for(int i=0;i<2;i++) { @@ -1973,7 +1973,7 @@ void MEDCouplingBasicsTestInterp::test3DSurfInterpP1P0Bary_1() MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3DSurf myInterpolator; - std::vector > res; + std::vector > res; INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Barycentric,INTERP_KERNEL::BarycentricGeo2D}; for(int i=0;i<2;i++) { @@ -2015,7 +2015,7 @@ void MEDCouplingBasicsTestInterp::test3DInterpP1P0Bary_1() MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::Barycentric); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P0"); @@ -2029,11 +2029,11 @@ void MEDCouplingBasicsTestInterp::test3DInterpP1P0Bary_1() double sum = 0; int i=0; - for(std::vector >::const_iterator iter1=res.begin();iter1!=res.end();iter1++,i++) + for(std::vector >::const_iterator iter1=res.begin();iter1!=res.end();iter1++,i++) { for(int j=0;j<28;j++) { - std::map::const_iterator iter2=(*iter1).find(j); + std::map::const_iterator iter2=(*iter1).find(j); if(iter2!=(*iter1).end()) { sum += iter2->second; @@ -2059,7 +2059,7 @@ void MEDCouplingBasicsTestInterp::test3DTo1DInterpP0P0PL_1() MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh); MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh); INTERP_KERNEL::Interpolation3D myInterpolator; - std::vector > res; + std::vector > res; myInterpolator.setPrecision(1e-12); myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); @@ -2097,7 +2097,7 @@ void MEDCouplingBasicsTestInterp::test1DInterp_1() myInterpolator.setPrecision(precis); // P0P0 - std::vector > res; + std::vector > res; myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); CPPUNIT_ASSERT_EQUAL( 3, int( res.size()) ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.5, res[0][0], precis); @@ -2154,7 +2154,7 @@ void MEDCouplingBasicsTestInterp::test2DCurveInterpP0P0_1() INTERP_KERNEL::Interpolation2DCurve myInterpolator; const double precis = 1e-13; myInterpolator.setPrecision(precis); - std::vector > res; + std::vector > res; myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); CPPUNIT_ASSERT_EQUAL( 2, int( res.size()) ); @@ -2178,7 +2178,7 @@ void MEDCouplingBasicsTestInterp::test2DCurveInterpP0P0_2() const double precis = 1e-13; myInterpolator.setPrecision(precis); myInterpolator.setMedianPlane(1.);// median line on target - std::vector > res; + std::vector > res; myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); double tolInters = myInterpolator.getBoundingBoxAdjustmentAbs() * sqrt(2.); @@ -2203,7 +2203,7 @@ void MEDCouplingBasicsTestInterp::test2DCurveInterpP0P1_1() INTERP_KERNEL::Interpolation2DCurve myInterpolator; const double precis = 1e-13; myInterpolator.setPrecision(precis); - std::vector > res; + std::vector > res; myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P1"); const double len1 = 1., len0 = sqrt(2.); @@ -2229,7 +2229,7 @@ void MEDCouplingBasicsTestInterp::test2DCurveInterpP1P0_1() INTERP_KERNEL::Interpolation2DCurve myInterpolator; const double precis = 1e-13; myInterpolator.setPrecision(precis); - std::vector > res; + std::vector > res; myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P0"); const double len1 = 1., len0 = sqrt(2.); @@ -2255,7 +2255,7 @@ void MEDCouplingBasicsTestInterp::test2DCurveInterpP1P1_1() INTERP_KERNEL::Interpolation2DCurve myInterpolator; const double precis = 1e-13; myInterpolator.setPrecision(precis); - std::vector > res; + std::vector > res; myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P1"); const double len1 = 1., len0 = sqrt(2.); @@ -2306,7 +2306,7 @@ void MEDCouplingBasicsTestInterp::test2D1DBasicInterpP0P0() CPPUNIT_ASSERT_EQUAL(1,(int)duplicateFaces.size()); INTERP_KERNEL::Interpolation2D3D::DuplicateFacesType correctDuplicateFaces; - std::set face6; + std::set face6; face6.insert(0); face6.insert(1); correctDuplicateFaces[6] = face6; @@ -2467,15 +2467,15 @@ void MEDCouplingBasicsTestInterp::test3D2DBasicInterpP0P0() CPPUNIT_ASSERT_EQUAL(3,(int)duplicateFaces.size()); INTERP_KERNEL::Interpolation2D3D::DuplicateFacesType correctDuplicateFaces; - std::set face2; + std::set face2; face2.insert(0); face2.insert(1); correctDuplicateFaces[2] = face2; - std::set face5; + std::set face5; face5.insert(1); face5.insert(2); correctDuplicateFaces[5] = face5; - std::set face6; + std::set face6; face6.insert(0); face6.insert(1); face6.insert(2); diff --git a/src/MEDCoupling/Test/MEDCouplingExamplesTest.cxx b/src/MEDCoupling/Test/MEDCouplingExamplesTest.cxx index dfd3751af..2549484ce 100644 --- a/src/MEDCoupling/Test/MEDCouplingExamplesTest.cxx +++ b/src/MEDCoupling/Test/MEDCouplingExamplesTest.cxx @@ -24,6 +24,7 @@ #include "MEDCouplingMappedExtrudedMesh.hxx" #include "MEDCouplingFieldDouble.hxx" #include "MEDCouplingMemArray.hxx" +#include "MEDCouplingMemArray.txx" #include "MEDCouplingMultiFields.hxx" @@ -592,7 +593,7 @@ void CppExample_MEDCouplingFieldDouble_renumberNodes() CPPUNIT_ASSERT( values->isEqualWithoutConsideringStr( *nodeCoords, 1e-13 )); //! [CppSnippet_MEDCouplingFieldDouble_renumberNodes_2] //! [CppSnippet_MEDCouplingFieldDouble_renumberNodes_3] - const int renumber[9] = { 8, 7, 6, 5, 4, 3, 2, 1, 0 }; + const mcIdType renumber[9] = { 8, 7, 6, 5, 4, 3, 2, 1, 0 }; field->renumberNodes(renumber,false); const MEDCouplingMesh* mesh2 = field->getMesh(); // field now refers to another mesh values = field->getArray(); @@ -620,7 +621,7 @@ void CppExample_MEDCouplingFieldDouble_renumberCells() CPPUNIT_ASSERT( values->isEqualWithoutConsideringStr( *bc, 1e-13 )); //! [CppSnippet_MEDCouplingFieldDouble_renumberCells_2] //! [CppSnippet_MEDCouplingFieldDouble_renumberCells_3] - const int renumber[4] = { 3, 2, 1, 0 }; + const mcIdType renumber[4] = { 3, 2, 1, 0 }; field->renumberCells(renumber,false); const MEDCouplingMesh* mesh2 = field->getMesh(); // field now refers to another mesh values = field->getArray(); @@ -776,7 +777,7 @@ void CppExample_MEDCouplingUMesh_areCellsIncludedIn() MCAuto mesh1=MEDCouplingUMesh::New(); mesh1->setMeshDimension(2); mesh1->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh1->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // #0 mesh1->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // #1 mesh1->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // #2 @@ -790,13 +791,13 @@ void CppExample_MEDCouplingUMesh_areCellsIncludedIn() mesh1->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_1] //! [CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_2] - const int cells2[3] = { 4,2,0 }; // even cells selected + const mcIdType cells2[3] = { 4,2,0 }; // even cells selected MCAuto mesh2 = (MEDCouplingUMesh*) mesh1->buildPartOfMySelf( cells2, cells2+3, true ); //! [CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_2] //! [CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_3] int compType = 0; // the strongest policy - DataArrayInt *corr2to1, *corr1to2; + DataArrayIdType *corr2to1, *corr1to2; // a larger mesh1 includes a smaller mesh2 CPPUNIT_ASSERT( mesh1->areCellsIncludedIn( mesh2, compType, corr2to1 )); CPPUNIT_ASSERT( std::equal( cells2, cells2+3, corr2to1->getConstPointer() )); @@ -804,7 +805,7 @@ void CppExample_MEDCouplingUMesh_areCellsIncludedIn() //! [CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_4] // the smaller mesh2 does NOT include the larger mesh1 CPPUNIT_ASSERT( ! mesh2->areCellsIncludedIn( mesh1, compType, corr1to2 )); - const int corr1to2Expected[5] = {2, 3, 1, 4, 0}; + const mcIdType corr1to2Expected[5] = {2, 3, 1, 4, 0}; CPPUNIT_ASSERT(std::equal( corr1to2Expected, corr1to2Expected+5, corr1to2->getConstPointer() )); //! [CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_4] corr2to1->decrRef(); @@ -831,13 +832,13 @@ void CppExample_MEDCouplingUMesh_findAndCorrectBadOriented3DExtrudedCells() mesh->setMeshDimension(3); mesh->allocateCells(2); // connectivity of reversed HEXA8 and PENTA6 - const int conn[8+6]={0,1,4,3, 5,6,9,8, 1,2,4, 6,7,9}; + const mcIdType conn[8+6]={0,1,4,3, 5,6,9,8, 1,2,4, 6,7,9}; mesh->insertNextCell(INTERP_KERNEL::NORM_HEXA8, 8,conn+0); mesh->insertNextCell(INTERP_KERNEL::NORM_PENTA6,6,conn+8); mesh->finishInsertingCells(); //! [CppSnippet_MEDCouplingUMesh_findAndCorrectBadOriented3DExtrudedCells_1] //! [CppSnippet_MEDCouplingUMesh_findAndCorrectBadOriented3DExtrudedCells_2] - MCAuto fixedCells = + MCAuto fixedCells = mesh->findAndCorrectBadOriented3DExtrudedCells(); CPPUNIT_ASSERT( fixedCells->getNumberOfTuples() == 2 ); // 2 cells fixed fixedCells = mesh->findAndCorrectBadOriented3DExtrudedCells(); @@ -865,7 +866,7 @@ void CppExample_MEDCouplingUMesh_arePolyhedronsNotCorrectlyOriented() mesh->setMeshDimension(3); mesh->allocateCells(2); // connectivity of a HEXA8 + a reversed PENTA6 - const int conn[8+6]={0,3,4,1, 5,8,9,6, 1,2,4, 6,7,9}; + const mcIdType conn[8+6]={0,3,4,1, 5,8,9,6, 1,2,4, 6,7,9}; mesh->insertNextCell(INTERP_KERNEL::NORM_POLYHED,8,conn); // "extruded" polyhedron mesh->insertNextCell(INTERP_KERNEL::NORM_POLYHED,6,conn+8); mesh->finishInsertingCells(); @@ -873,7 +874,7 @@ void CppExample_MEDCouplingUMesh_arePolyhedronsNotCorrectlyOriented() mesh->convertExtrudedPolyhedra(); //! [CppSnippet_MEDCouplingUMesh_arePolyhedronsNotCorrectlyOriented_1] //! [CppSnippet_MEDCouplingUMesh_arePolyhedronsNotCorrectlyOriented_2] - std::vector badCellIds; + std::vector badCellIds; mesh->arePolyhedronsNotCorrectlyOriented( badCellIds ); CPPUNIT_ASSERT( badCellIds.size() == 1 ); // one polyhedron is KO // fix invalid rolyherdons @@ -892,7 +893,7 @@ void CppExample_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,2,4, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,2,4, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2 @@ -908,7 +909,7 @@ void CppExample_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented() //! [CppSnippet_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented_1] //! [CppSnippet_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented_2] const double vec[3] = {0.,0.,-1.}; - std::vector badCellIds; + std::vector badCellIds; mesh->are2DCellsNotCorrectlyOriented( vec, false, badCellIds ); CPPUNIT_ASSERT( badCellIds.size() == 1 ); // one cell is reversed // fix orientation @@ -927,7 +928,7 @@ void CppExample_MEDCouplingUMesh_getCellsContainingPoints() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); @@ -945,10 +946,10 @@ void CppExample_MEDCouplingUMesh_getCellsContainingPoints() 0.3, 0.3, // point located somewhere inside the mesh coords[2], coords[3]}; // point at the node #1 const double eps = 1e-4; // ball radius - MCAuto cells, cellsIndex; + MCAuto cells, cellsIndex; mesh->getCellsContainingPoints( pos, 3, eps, cells, cellsIndex ); - const int cellsExpected[3]={4, 0, 1}; - const int cellsIndexExpected[4]={0, 0, 1, 3}; + const mcIdType cellsExpected[3]={4, 0, 1}; + const mcIdType cellsIndexExpected[4]={0, 0, 1, 3}; CPPUNIT_ASSERT(std::equal( cellsExpected, cellsExpected+3, cells->begin())); CPPUNIT_ASSERT(std::equal( cellsIndexExpected, cellsIndexExpected+4, cellsIndex->begin())); //! [CppSnippet_MEDCouplingUMesh_getCellsContainingPoints_2] @@ -961,7 +962,7 @@ void CppExample_MEDCouplingUMesh_getCellsContainingPoint() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2 @@ -978,9 +979,9 @@ void CppExample_MEDCouplingUMesh_getCellsContainingPoint() const double* coords4 = coords + 4*2; // coordinates of the node #4 const double eps = 1e-4; // ball radius const double pos[2] = { coords4[0] + eps, coords4[1] - eps }; // ball center - std::vector cellIds; + std::vector cellIds; mesh->getCellsContainingPoint( pos, eps, cellIds ); - CPPUNIT_ASSERT ( (int)cellIds.size() == mesh->getNumberOfCells() ); + CPPUNIT_ASSERT ( ToIdType(cellIds.size()) == mesh->getNumberOfCells() ); //! [CppSnippet_MEDCouplingUMesh_getCellsContainingPoint_2] } @@ -991,7 +992,7 @@ void CppExample_MEDCouplingUMesh_buildPartOrthogonalField() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2 @@ -1005,7 +1006,7 @@ void CppExample_MEDCouplingUMesh_buildPartOrthogonalField() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_buildPartOrthogonalField_1] //! [CppSnippet_MEDCouplingUMesh_buildPartOrthogonalField_2] - const int part[4] = {1,2,3,4}; // cell #0 is omitted + const mcIdType part[4] = {1,2,3,4}; // cell #0 is omitted MCAuto vecField= mesh->buildPartOrthogonalField( part, part+4 ); CPPUNIT_ASSERT ( vecField->getArray()->getNumberOfTuples() == 4 ); @@ -1020,7 +1021,7 @@ void CppExample_MEDCouplingUMesh_getPartMeasureField() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,2,4, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,2,4, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2 @@ -1035,7 +1036,7 @@ void CppExample_MEDCouplingUMesh_getPartMeasureField() //! [CppSnippet_MEDCouplingUMesh_getPartMeasureField_1] //! [CppSnippet_MEDCouplingUMesh_getPartMeasureField_2] const bool isAbs = true; - const int part[4] = {1,2,3,4}; // cell #0 is omitted + const mcIdType part[4] = {1,2,3,4}; // cell #0 is omitted MCAuto areaArr= mesh->getPartMeasureField( isAbs, part, part+4 ); CPPUNIT_ASSERT( areaArr->getIJ(0,0) > 0 ); // orientation ignored @@ -1044,11 +1045,11 @@ void CppExample_MEDCouplingUMesh_getPartMeasureField() CPPUNIT_ASSERT ( areaArr->getNumberOfTuples() == 4 ); //! [CppSnippet_MEDCouplingUMesh_getPartMeasureField_2] //! [CppSnippet_MEDCouplingUMesh_getPartMeasureField_3] - const int cellIds[4] = {1,2,3,4}; // cell #0 is omitted + const mcIdType cellIds[4] = {1,2,3,4}; // cell #0 is omitted MCAuto baryCenters= mesh->getPartBarycenterAndOwner( cellIds, cellIds+4 ); CPPUNIT_ASSERT( baryCenters->getNumberOfTuples() == 4 ); - CPPUNIT_ASSERT( baryCenters->getNumberOfComponents() == mesh->getSpaceDimension() ); + CPPUNIT_ASSERT( (int)baryCenters->getNumberOfComponents() == mesh->getSpaceDimension() ); //! [CppSnippet_MEDCouplingUMesh_getPartMeasureField_3] } @@ -1064,13 +1065,13 @@ void CppExample_MEDCouplingUMesh_getCellsInBoundingBox() coordsArr->useExternalArrayWithRWAccess(coords, 3,2); mesh->setCoords(coordsArr); mesh->allocateCells(1); - const int conn[3]={0,1,2}; + const mcIdType conn[3]={0,1,2}; mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,conn); mesh->finishInsertingCells(); //! [CppSnippet_MEDCouplingUMesh_getCellsInBoundingBox_1] //! [CppSnippet_MEDCouplingUMesh_getCellsInBoundingBox_2] const double bbox[] = {1., 1., 1.001,1.001}; // xMin, xMax, yMin, yMax - MCAuto cellIdsArr = + MCAuto cellIdsArr = mesh->getCellsInBoundingBox( bbox, 0.0 ); CPPUNIT_ASSERT( cellIdsArr->getNumberOfTuples() == 0 ); cellIdsArr = mesh->getCellsInBoundingBox( bbox, 0.1 ); @@ -1085,15 +1086,15 @@ void CppExample_MEDCouplingUMesh_renumberNodesInConn() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(1); - const int conn[4]={4,3,2,1}; + const mcIdType conn[4]={4,3,2,1}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); mesh->finishInsertingCells(); //! [CppSnippet_MEDCouplingUMesh_renumberNodesInConn_1] //! [CppSnippet_MEDCouplingUMesh_renumberNodesInConn_2] - const int old2newIds[] = {-1,3,2,1,0}; + const mcIdType old2newIds[] = {-1,3,2,1,0}; mesh->renumberNodesInConn( old2newIds ); - const int nodes0Expected[] = {0,1,2,3}; - std::vector nodes0; + const mcIdType nodes0Expected[] = {0,1,2,3}; + std::vector nodes0; mesh->getNodeIdsOfCell( 0, nodes0 ); CPPUNIT_ASSERT(std::equal( nodes0Expected, nodes0Expected+4, &nodes0[0] )); //! [CppSnippet_MEDCouplingUMesh_renumberNodesInConn_2] @@ -1113,7 +1114,7 @@ void CppExample_MEDCouplingUMesh_renumberNodes() mesh->finishInsertingCells(); //! [CppSnippet_MEDCouplingUMesh_renumberNodes_1] //! [CppSnippet_MEDCouplingUMesh_renumberNodes_2] - const int newIds[] = { 2,1,0,-1 }; + const mcIdType newIds[] = { 2,1,0,-1 }; mesh->renumberNodes(newIds, 3); coordsArr = mesh->getCoordinatesAndOwner(); // get a shorten array const double coordsExpected[3*2]={0.7,-0.3, 0.2,-0.3, -0.3,-0.3}; @@ -1123,7 +1124,7 @@ void CppExample_MEDCouplingUMesh_renumberNodes() //! [CppSnippet_MEDCouplingUMesh_renumberNodes_2] //! [CppSnippet_MEDCouplingUMesh_renumberNodes_3] coordsArr->useExternalArrayWithRWAccess(coords, 4,2); // restore old nodes - const int newIds2[] = { 2,1,0,2 }; + const mcIdType newIds2[] = { 2,1,0,2 }; mesh->renumberNodesCenter(newIds2, 3); coordsArr = mesh->getCoordinatesAndOwner(); // get a shorten array const double coordsExpected2[3*2]={0.7,-0.3, 0.2,-0.3, -0.3, 0.0}; @@ -1140,7 +1141,7 @@ void CppExample_MEDCouplingUMesh_findBoundaryNodes() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); @@ -1154,7 +1155,7 @@ void CppExample_MEDCouplingUMesh_findBoundaryNodes() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_findBoundaryNodes_1] //! [CppSnippet_MEDCouplingUMesh_findBoundaryNodes_2] - MCAuto nodeIdsArr=mesh->findBoundaryNodes(); + MCAuto nodeIdsArr=mesh->findBoundaryNodes(); CPPUNIT_ASSERT( nodeIdsArr->getNumberOfTuples() == mesh->getNumberOfNodes() - 1 ); //! [CppSnippet_MEDCouplingUMesh_findBoundaryNodes_2] } @@ -1166,7 +1167,7 @@ void CppExample_MEDCouplingUMesh_buildBoundaryMesh() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); @@ -1194,7 +1195,7 @@ void CppExample_MEDCouplingUMesh_buildFacePartOfMySelfNode() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2 @@ -1208,7 +1209,7 @@ void CppExample_MEDCouplingUMesh_buildFacePartOfMySelfNode() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_buildFacePartOfMySelfNode_1] //! [CppSnippet_MEDCouplingUMesh_buildFacePartOfMySelfNode_2] - std::vector nodes; + std::vector nodes; mesh->getNodeIdsOfCell( 0, nodes ); const bool allNodes = true; MCAuto mesh1 = @@ -1227,7 +1228,7 @@ void CppExample_MEDCouplingUMesh_buildPartOfMySelfNode() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2 @@ -1241,14 +1242,14 @@ void CppExample_MEDCouplingUMesh_buildPartOfMySelfNode() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_buildPartOfMySelfNode_1] //! [CppSnippet_MEDCouplingUMesh_buildPartOfMySelfNode_2] - std::vector nodes; + std::vector nodes; mesh->getNodeIdsOfCell( 0, nodes ); const bool allNodes = true; MCAuto mesh1 = (MEDCouplingUMesh*)mesh->buildPartOfMySelfNode( &nodes[0], &nodes[0]+nodes.size(), allNodes); MCAuto mesh2 = (MEDCouplingUMesh*)mesh->buildPartOfMySelfNode( &nodes[0], &nodes[0]+nodes.size(),!allNodes); - CPPUNIT_ASSERT_EQUAL( (int)mesh1->getNumberOfCells(), 1 ); + CPPUNIT_ASSERT_EQUAL( mesh1->getNumberOfCells(), ToIdType( 1 )); CPPUNIT_ASSERT_EQUAL( mesh2->getNumberOfCells(), mesh->getNumberOfCells() ); //! [CppSnippet_MEDCouplingUMesh_buildPartOfMySelfNode_2] } @@ -1260,7 +1261,7 @@ void CppExample_MEDCouplingUMesh_getCellIdsLyingOnNodes() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2 @@ -1274,13 +1275,13 @@ void CppExample_MEDCouplingUMesh_getCellIdsLyingOnNodes() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_getCellIdsLyingOnNodes_1] //! [CppSnippet_MEDCouplingUMesh_getCellIdsLyingOnNodes_2] - std::vector nodes; + std::vector nodes; mesh->getNodeIdsOfCell( 0, nodes ); const bool allNodes = true; - DataArrayInt* cellIdsArr1 = mesh->getCellIdsLyingOnNodes( &nodes[0], &nodes[0]+nodes.size(), allNodes); - DataArrayInt* cellIdsArr2 = mesh->getCellIdsLyingOnNodes( &nodes[0], &nodes[0]+nodes.size(),!allNodes); - CPPUNIT_ASSERT_EQUAL( (int)cellIdsArr1->getNumberOfTuples(), 1 ); - CPPUNIT_ASSERT_EQUAL( (int)cellIdsArr2->getNumberOfTuples(), (int)mesh->getNumberOfCells() ); + DataArrayIdType* cellIdsArr1 = mesh->getCellIdsLyingOnNodes( &nodes[0], &nodes[0]+nodes.size(), allNodes); + DataArrayIdType* cellIdsArr2 = mesh->getCellIdsLyingOnNodes( &nodes[0], &nodes[0]+nodes.size(),!allNodes); + CPPUNIT_ASSERT_EQUAL( cellIdsArr1->getNumberOfTuples(), ToIdType( 1 )); + CPPUNIT_ASSERT_EQUAL( cellIdsArr2->getNumberOfTuples(), mesh->getNumberOfCells() ); //! [CppSnippet_MEDCouplingUMesh_getCellIdsLyingOnNodes_2] cellIdsArr1->decrRef(); cellIdsArr2->decrRef(); @@ -1293,7 +1294,7 @@ void CppExample_MEDCouplingUMesh_getCellIdsFullyIncludedInNodeIds() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); @@ -1307,11 +1308,11 @@ void CppExample_MEDCouplingUMesh_getCellIdsFullyIncludedInNodeIds() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_getCellIdsFullyIncludedInNodeIds_1] //! [CppSnippet_MEDCouplingUMesh_getCellIdsFullyIncludedInNodeIds_2] - const int cellIds[2]={1,2}; - std::vector nodes; + const mcIdType cellIds[2]={1,2}; + std::vector nodes; mesh->getNodeIdsOfCell( cellIds[0], nodes ); mesh->getNodeIdsOfCell( cellIds[1], nodes ); - DataArrayInt* cellIdsArr = mesh->getCellIdsFullyIncludedInNodeIds( &nodes[0], &nodes[0]+nodes.size()); + DataArrayIdType* cellIdsArr = mesh->getCellIdsFullyIncludedInNodeIds( &nodes[0], &nodes[0]+nodes.size()); CPPUNIT_ASSERT(std::equal( cellIds, cellIds+2, cellIdsArr->getPointer() )); //! [CppSnippet_MEDCouplingUMesh_getCellIdsFullyIncludedInNodeIds_2] cellIdsArr->decrRef(); @@ -1324,7 +1325,7 @@ void CppExample_MEDCouplingUMesh_buildPartOfMySelf() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2 @@ -1338,14 +1339,14 @@ void CppExample_MEDCouplingUMesh_buildPartOfMySelf() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_buildPartOfMySelf_1] //! [CppSnippet_MEDCouplingUMesh_buildPartOfMySelf_2] - const int cellIds[2]={1,2}; + const mcIdType cellIds[2]={1,2}; MEDCouplingUMesh* mesh2=(MEDCouplingUMesh*)mesh->buildPartOfMySelf(cellIds,cellIds+2,true); MEDCouplingUMesh* mesh3=(MEDCouplingUMesh*)mesh->buildPartOfMySelf(cellIds,cellIds+2,false); CPPUNIT_ASSERT( coordsArr->isEqual( *mesh2->getCoords(), 1e-13 )); // same nodes CPPUNIT_ASSERT( !coordsArr->isEqual( *mesh3->getCoords(), 1e-13 )); // different nodes - for ( int i = 0; i < 2; ++i ) + for ( mcIdType i = 0; i < 2; ++i ) { - std::vector nodes1, nodes2; + std::vector nodes1, nodes2; mesh ->getNodeIdsOfCell(cellIds[i], nodes1); mesh2->getNodeIdsOfCell(i, nodes2); CPPUNIT_ASSERT( nodes1 == nodes2 ); // cell #cellIds[i] was copied @@ -1362,7 +1363,7 @@ void CppExample_MEDCouplingUMesh_mergeNodes() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); @@ -1379,13 +1380,13 @@ void CppExample_MEDCouplingUMesh_mergeNodes() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_mergeNodes_1] //! [CppSnippet_MEDCouplingUMesh_mergeNodes_2] - bool areNodesMerged; int newNbOfNodes; - MCAuto arr= + bool areNodesMerged; mcIdType newNbOfNodes; + MCAuto arr= mesh->mergeNodes(0.004,areNodesMerged,newNbOfNodes); - const int idsExpected[6] = {0, 1, 0, 2, 2, 0}; + const mcIdType idsExpected[6] = {0, 1, 0, 2, 2, 0}; CPPUNIT_ASSERT(std::equal(idsExpected,idsExpected+6,arr->getPointer())); CPPUNIT_ASSERT( areNodesMerged ); - CPPUNIT_ASSERT_EQUAL( 3, newNbOfNodes ); + CPPUNIT_ASSERT_EQUAL( ToIdType( 3 ), newNbOfNodes ); //! [CppSnippet_MEDCouplingUMesh_mergeNodes_2] //! [CppSnippet_MEDCouplingUMesh_mergeNodes_3] const double* baryCoords2 = coords + 2*2; // initial coordinates of node #2 @@ -1409,7 +1410,7 @@ void CppExample_MEDCouplingUMesh_zipConnectivityTraducer() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[11]={0,3,4,1, 1,4,2, 4,1,0,3}; + const mcIdType conn[11]={0,3,4,1, 1,4,2, 4,1,0,3}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+0); // 0 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 2 == 1 @@ -1423,10 +1424,10 @@ void CppExample_MEDCouplingUMesh_zipConnectivityTraducer() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_zipConnectivityTraducer_1] //! [CppSnippet_MEDCouplingUMesh_zipConnectivityTraducer_2] - const int oldNbCells = mesh->getNumberOfCells(); - DataArrayInt *arr = mesh->zipConnectivityTraducer(0); - CPPUNIT_ASSERT_EQUAL( oldNbCells-2, (int)mesh->getNumberOfCells() ); - const int idsExpected[5] = {0, 1, 1, 0, 2}; + const mcIdType oldNbCells = mesh->getNumberOfCells(); + DataArrayIdType *arr = mesh->zipConnectivityTraducer(0); + CPPUNIT_ASSERT_EQUAL( oldNbCells-2, mesh->getNumberOfCells() ); + const mcIdType idsExpected[5] = {0, 1, 1, 0, 2}; CPPUNIT_ASSERT(std::equal(idsExpected,idsExpected+5,arr->getPointer())); //! [CppSnippet_MEDCouplingUMesh_zipConnectivityTraducer_2] arr->decrRef(); @@ -1439,7 +1440,7 @@ void CppExample_MEDCouplingUMesh_zipCoordsTraducer() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); @@ -1453,12 +1454,12 @@ void CppExample_MEDCouplingUMesh_zipCoordsTraducer() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_zipCoordsTraducer_1] //! [CppSnippet_MEDCouplingUMesh_zipCoordsTraducer_2] - const int cellIds[2]={1,2}; + const mcIdType cellIds[2]={1,2}; MEDCouplingUMesh* mesh2=(MEDCouplingUMesh*)mesh->buildPartOfMySelf(cellIds,cellIds+2,true); - DataArrayInt *arr=mesh2->zipCoordsTraducer(); - CPPUNIT_ASSERT_EQUAL( 4, mesh2->getNumberOfNodes() ); // nb of nodes decreased - CPPUNIT_ASSERT_EQUAL( (int)mesh->getNumberOfNodes(), (int)arr->getNumberOfTuples() ); - const int idsExpected[9] = {-1,0,1,-1,2,3,-1,-1,-1}; // -1 for unused nodes + DataArrayIdType *arr=mesh2->zipCoordsTraducer(); + CPPUNIT_ASSERT_EQUAL( ToIdType(4), mesh2->getNumberOfNodes() ); // nb of nodes decreased + CPPUNIT_ASSERT_EQUAL( mesh->getNumberOfNodes(), arr->getNumberOfTuples() ); + const mcIdType idsExpected[9] = {-1,0,1,-1,2,3,-1,-1,-1}; // -1 for unused nodes CPPUNIT_ASSERT(std::equal(idsExpected,idsExpected+9,arr->getPointer())); //! [CppSnippet_MEDCouplingUMesh_zipCoordsTraducer_2] mesh2->decrRef(); @@ -1472,7 +1473,7 @@ void CppExample_MEDCouplingUMesh_getNodeIdsInUse() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); @@ -1486,16 +1487,16 @@ void CppExample_MEDCouplingUMesh_getNodeIdsInUse() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_getNodeIdsInUse_1] //! [CppSnippet_MEDCouplingUMesh_getNodeIdsInUse_2] - const int cellIds[2]={1,2}; + const mcIdType cellIds[2]={1,2}; MEDCouplingUMesh* mesh2=(MEDCouplingUMesh*)mesh->buildPartOfMySelf(cellIds,cellIds+2,true); - int newNbOfNodes = 0; - DataArrayInt *arr=mesh2->getNodeIdsInUse( newNbOfNodes ); - const int idsExpected[9] = {-1,0,1,-1,2,3,-1,-1,-1}; + mcIdType newNbOfNodes = 0; + DataArrayIdType *arr=mesh2->getNodeIdsInUse( newNbOfNodes ); + const mcIdType idsExpected[9] = {-1,0,1,-1,2,3,-1,-1,-1}; CPPUNIT_ASSERT(std::equal(idsExpected,idsExpected+9,arr->getPointer())); //! [CppSnippet_MEDCouplingUMesh_getNodeIdsInUse_2] //! [CppSnippet_MEDCouplingUMesh_getNodeIdsInUse_3] - DataArrayInt *arr2=arr->invertArrayO2N2N2O(newNbOfNodes); - const int idsExpected2[4] = {1,2,4,5}; + DataArrayIdType *arr2=arr->invertArrayO2N2N2O(newNbOfNodes); + const mcIdType idsExpected2[4] = {1,2,4,5}; CPPUNIT_ASSERT(std::equal(idsExpected2,idsExpected2+4,arr2->getPointer())); //! [CppSnippet_MEDCouplingUMesh_getNodeIdsInUse_3] mesh2->decrRef(); @@ -1510,7 +1511,7 @@ void CppExample_MEDCouplingUMesh_convertToPolyTypes() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2 @@ -1524,7 +1525,7 @@ void CppExample_MEDCouplingUMesh_convertToPolyTypes() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_convertToPolyTypes_1] //! [CppSnippet_MEDCouplingUMesh_convertToPolyTypes_2] - const int cells[2]={1,3}; + const mcIdType cells[2]={1,3}; mesh->convertToPolyTypes(cells, cells+2); CPPUNIT_ASSERT( mesh->getTypeOfCell(0) == INTERP_KERNEL::NORM_QUAD4 ); CPPUNIT_ASSERT( mesh->getTypeOfCell(1) == INTERP_KERNEL::NORM_POLYGON ); @@ -1540,7 +1541,7 @@ void CppExample_MEDCouplingUMesh_buildDescendingConnectivity2() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2 @@ -1554,23 +1555,23 @@ void CppExample_MEDCouplingUMesh_buildDescendingConnectivity2() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity2_1] //! [CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity2_2] - DataArrayInt *desc =DataArrayInt::New(); - DataArrayInt *descIndx =DataArrayInt::New(); - DataArrayInt *revDesc =DataArrayInt::New(); - DataArrayInt *revDescIndx=DataArrayInt::New(); + DataArrayIdType *desc =DataArrayIdType::New(); + DataArrayIdType *descIndx =DataArrayIdType::New(); + DataArrayIdType *revDesc =DataArrayIdType::New(); + DataArrayIdType *revDescIndx=DataArrayIdType::New(); MEDCouplingUMesh * mesh2 = mesh->buildDescendingConnectivity2(desc,descIndx,revDesc,revDescIndx); - const int descExpected[] = {1,2,3,4,-3,5,6,7,8,-5,9,10,-2,11,12,13,-7,-10}; - const int descIndxExpected[] = {0,4,7,10,14,18}; - const int revDescExpected[] = {0, 0,3, 0,1, 0, 1,2, 1, 2,4, 2, 3, 3,4, 3, 4, 4}; - const int revDescIndxExpected[] = {0,1,3,5,6,8,9,11,12,13,15,16,17,18}; + const mcIdType descExpected[] = {1,2,3,4,-3,5,6,7,8,-5,9,10,-2,11,12,13,-7,-10}; + const mcIdType descIndxExpected[] = {0,4,7,10,14,18}; + const mcIdType revDescExpected[] = {0, 0,3, 0,1, 0, 1,2, 1, 2,4, 2, 3, 3,4, 3, 4, 4}; + const mcIdType revDescIndxExpected[] = {0,1,3,5,6,8,9,11,12,13,15,16,17,18}; CPPUNIT_ASSERT(std::equal(descExpected,descExpected+18,desc->getPointer())); CPPUNIT_ASSERT(std::equal(descIndxExpected,descIndxExpected+6,descIndx->getPointer())); CPPUNIT_ASSERT(std::equal(revDescExpected,revDescExpected+18,revDesc->getPointer())); CPPUNIT_ASSERT(std::equal(revDescIndxExpected,revDescIndxExpected+14,revDescIndx->getPointer())); //! [CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity2_2] //! [CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity2_3] - const int cell2ConnExpect[] = {4,1}; - std::vector cell2Conn; + const mcIdType cell2ConnExpect[] = {4,1}; + std::vector cell2Conn; mesh2->getNodeIdsOfCell( 3-1, cell2Conn ); // cell #3 in FORTRAN mode CPPUNIT_ASSERT(std::equal(cell2ConnExpect,cell2ConnExpect+2,&cell2Conn[0])); //! [CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity2_3] @@ -1588,7 +1589,7 @@ void CppExample_MEDCouplingUMesh_buildDescendingConnectivity() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2 @@ -1602,15 +1603,15 @@ void CppExample_MEDCouplingUMesh_buildDescendingConnectivity() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity_1] //! [CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity_2] - DataArrayInt *desc =DataArrayInt::New(); - DataArrayInt *descIndx =DataArrayInt::New(); - DataArrayInt *revDesc =DataArrayInt::New(); - DataArrayInt *revDescIndx=DataArrayInt::New(); + DataArrayIdType *desc =DataArrayIdType::New(); + DataArrayIdType *descIndx =DataArrayIdType::New(); + DataArrayIdType *revDesc =DataArrayIdType::New(); + DataArrayIdType *revDescIndx=DataArrayIdType::New(); MEDCouplingUMesh * mesh2 = mesh->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx); - const int descExpected[] = {0,1,2,3, 2,4,5, 6,7,4, 8,9,1,10, 11,12,6,9}; - const int descIndxExpected[] = {0,4,7,10,14,18}; - const int revDescExpected[] = {0, 0,3, 0,1, 0, 1,2, 1, 2,4, 2, 3, 3,4, 3, 4, 4}; - const int revDescIndxExpected[] = {0,1,3,5,6,8,9,11,12,13,15,16,17,18}; + const mcIdType descExpected[] = {0,1,2,3, 2,4,5, 6,7,4, 8,9,1,10, 11,12,6,9}; + const mcIdType descIndxExpected[] = {0,4,7,10,14,18}; + const mcIdType revDescExpected[] = {0, 0,3, 0,1, 0, 1,2, 1, 2,4, 2, 3, 3,4, 3, 4, 4}; + const mcIdType revDescIndxExpected[] = {0,1,3,5,6,8,9,11,12,13,15,16,17,18}; CPPUNIT_ASSERT(std::equal(descExpected,descExpected+18,desc->getPointer())); CPPUNIT_ASSERT(std::equal(descIndxExpected,descIndxExpected+6,descIndx->getPointer())); CPPUNIT_ASSERT(std::equal(revDescExpected,revDescExpected+18,revDesc->getPointer())); @@ -1630,7 +1631,7 @@ void CppExample_MEDCouplingUMesh_getReverseNodalConnectivity() MCAuto mesh=MEDCouplingUMesh::New(); mesh->setMeshDimension(2); mesh->allocateCells(5); - const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + const mcIdType conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn); // 0 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+4); // 1 mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+7); // 2 @@ -1644,11 +1645,11 @@ void CppExample_MEDCouplingUMesh_getReverseNodalConnectivity() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingUMesh_getReverseNodalConnectivity_1] //! [CppSnippet_MEDCouplingUMesh_getReverseNodalConnectivity_2] - DataArrayInt *revNodal=DataArrayInt::New(); - DataArrayInt *revNodalIndx=DataArrayInt::New(); + DataArrayIdType *revNodal=DataArrayIdType::New(); + DataArrayIdType *revNodalIndx=DataArrayIdType::New(); mesh->getReverseNodalConnectivity(revNodal,revNodalIndx); - const int revNodalExpected[18]={0,0,1,1,2,0,3,0,1,2,3,4,2,4,3,3,4,4}; - const int revNodalIndexExpected[10]={0,1,3,5,7,12,14,15,17,18}; + const mcIdType revNodalExpected[18]={0,0,1,1,2,0,3,0,1,2,3,4,2,4,3,3,4,4}; + const mcIdType revNodalIndexExpected[10]={0,1,3,5,7,12,14,15,17,18}; CPPUNIT_ASSERT(std::equal(revNodalExpected,revNodalExpected+18,revNodal->getPointer())); CPPUNIT_ASSERT(std::equal(revNodalIndexExpected,revNodalIndexExpected+10,revNodalIndx->getPointer())); //! [CppSnippet_MEDCouplingUMesh_getReverseNodalConnectivity_2] @@ -1672,7 +1673,7 @@ void CppExample_MEDCouplingUMesh_checkDeepEquivalWith() coordsArr->useExternalArrayWithRWAccess( coords, 4, 2 ); mesh1->setCoords(coordsArr); mesh1->allocateCells(2); - const int conn[6]={0,1,2, 1,2,3}; + const mcIdType conn[6]={0,1,2, 1,2,3}; mesh1->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+0); // #0 mesh1->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+3); // #1 mesh1->finishInsertingCells(); @@ -1689,18 +1690,18 @@ void CppExample_MEDCouplingUMesh_checkDeepEquivalWith() coordsArr->useExternalArrayWithRWAccess( coords2, 4, 2 ); mesh2->setCoords(coordsArr); mesh2->allocateCells(2); - const int conn[6]={2,3,0, 3,1,2}; + const mcIdType conn[6]={2,3,0, 3,1,2}; mesh2->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+0); // #0 = #1 mesh2->insertNextCell(INTERP_KERNEL::NORM_TRI3,3, conn+3); // #1 ~ #0 mesh2->finishInsertingCells(); } //! [CppSnippet_MEDCouplingUMesh_checkDeepEquivalWith_1] //! [CppSnippet_MEDCouplingUMesh_checkDeepEquivalWith_2] - int cellCompPol = 1; // "permuted same orientation" - policy of medium severity - DataArrayInt *nOld2New, *cOld2New; + mcIdType cellCompPol = 1; // "permuted same orientation" - policy of medium severity + DataArrayIdType *nOld2New, *cOld2New; mesh1->checkDeepEquivalWith( mesh2, cellCompPol, 0.002, cOld2New, nOld2New ); - const int nOld2NewExpected[4] = { 3, 0, 1, 2 }; - const int cOld2NewExpected[2] = { 1, 0 }; + const mcIdType nOld2NewExpected[4] = { 3, 0, 1, 2 }; + const mcIdType cOld2NewExpected[2] = { 1, 0 }; CPPUNIT_ASSERT(std::equal(nOld2NewExpected,nOld2NewExpected+4,nOld2New->getConstPointer())); CPPUNIT_ASSERT(std::equal(cOld2NewExpected,cOld2NewExpected+2,cOld2New->getConstPointer())); //! [CppSnippet_MEDCouplingUMesh_checkDeepEquivalWith_2] @@ -1709,7 +1710,7 @@ void CppExample_MEDCouplingUMesh_checkDeepEquivalWith() CPPUNIT_ASSERT_THROW ( mesh1->checkDeepEquivalOnSameNodesWith( mesh2, cellCompPol, 0.002, cOld2New ), INTERP_KERNEL::Exception ); mesh2->setCoords( mesh1->getCoords() ); // make meshes share the same coordinates array mesh2->allocateCells(2); - const int conn[6]={1,2,3, 1,0,2}; + const mcIdType conn[6]={1,2,3, 1,0,2}; mesh2->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,conn+0); // #0 = #1 mesh2->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,conn+3); // #1 ~ #0 mesh2->finishInsertingCells(); @@ -1816,8 +1817,8 @@ void CppExample_MEDCouplingPointSet_getBoundingBox() mesh->getBoundingBox( (double*) bbox ); // check the returned coordinates of extremum points of the bounding box - for ( int i = 0; i < 2; ++i ) // point id - for ( int j = 0; j < 3; ++j ) // component + for ( mcIdType i = 0; i < 2; ++i ) // point id + for ( mcIdType j = 0; j < 3; ++j ) // component CPPUNIT_ASSERT_DOUBLES_EQUAL( cc[ i*3 + j ], bbox[j][i], 1e-13); //! [CppSnippet_MEDCouplingPointSet_getBoundingBox_2] } @@ -1839,12 +1840,12 @@ void CppExample_MEDCouplingPointSet_getNodeIdsNearPoint() //! [CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoint_1] //! [CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoint_2] double point [2]={0.3, -0.3}; // point close to nodes #0, #2 and #4 - DataArrayInt *ids = mesh->getNodeIdsNearPoint(point, 1e-2); + DataArrayIdType *ids = mesh->getNodeIdsNearPoint(point, 1e-2); // check found ids - const int expectedIDs[3] = {0,2,4}; - DataArrayInt * okIDs = ids->findIdsEqualList ( expectedIDs, expectedIDs+3 ); - CPPUNIT_ASSERT_EQUAL(3, (int)okIDs->getNumberOfTuples()); + const mcIdType expectedIDs[3] = {0,2,4}; + DataArrayIdType * okIDs = ids->findIdsEqualList ( expectedIDs, expectedIDs+3 ); + CPPUNIT_ASSERT_EQUAL(ToIdType(3), okIDs->getNumberOfTuples()); // release data ids->decrRef(); @@ -1869,17 +1870,17 @@ void CppExample_MEDCouplingPointSet_getNodeIdsNearPoints() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoints_1] //! [CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoints_2] - const int nbOfPoints = 3; + const mcIdType nbOfPoints = 3; double points [nbOfPoints*2]={0.2,-0.30001, // ~ node #1 0.0, 0.0, 1.1, 0.002}; // ~ nodes #3, #4 and #5 - DataArrayInt *ids, *idsIndex; + DataArrayIdType *ids, *idsIndex; mesh->getNodeIdsNearPoints(points, nbOfPoints, 1e-1,ids,idsIndex); // check found ids (i.e. contents of 'ids' array) - const int expectedIDs[4] = {1, 3, 4, 5}; - DataArrayInt * okIDs = ids->findIdsEqualList ( expectedIDs, expectedIDs+4 ); - CPPUNIT_ASSERT_EQUAL(4, (int)okIDs->getNumberOfTuples()); + const mcIdType expectedIDs[4] = {1, 3, 4, 5}; + DataArrayIdType * okIDs = ids->findIdsEqualList ( expectedIDs, expectedIDs+4 ); + CPPUNIT_ASSERT_EQUAL(ToIdType(4), okIDs->getNumberOfTuples()); // release data ids->decrRef(); @@ -1904,12 +1905,12 @@ void CppExample_MEDCouplingPointSet_findCommonNodes() mesh->setCoords(coordsArr); //! [CppSnippet_MEDCouplingPointSet_findCommonNodes_1] //! [CppSnippet_MEDCouplingPointSet_findCommonNodes_2] - DataArrayInt *com, *comI; + DataArrayIdType *com, *comI; mesh->findCommonNodes(1e-13,-1,com,comI); - CPPUNIT_ASSERT_EQUAL(2, (int)com->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(2),com->getNumberOfTuples()); com->decrRef(); comI->decrRef(); mesh->findCommonNodes(0.004,-1,com,comI); - CPPUNIT_ASSERT_EQUAL(5, (int)com->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(ToIdType(5), com->getNumberOfTuples()); //! [CppSnippet_MEDCouplingPointSet_findCommonNodes_2] com->decrRef(); comI->decrRef(); } @@ -1937,17 +1938,17 @@ void CppExample_DataArrayInt_buildPermutationArr() using namespace MEDCoupling; //! [CppSnippet_DataArrayInt_buildPermutationArr_1] DataArrayInt *a=DataArrayInt::New(); - const int vala[5]={4,5,6,7,8}; + const mcIdType vala[5]={4,5,6,7,8}; a->alloc(5,1); std::copy(vala,vala+5,a->getPointer()); DataArrayInt *b=DataArrayInt::New(); - const int valb[5]={5,4,8,6,7}; + const mcIdType valb[5]={5,4,8,6,7}; b->alloc(5,1); std::copy(valb,valb+5,b->getPointer()); - DataArrayInt *c=a->buildPermutationArr(*b); + DataArrayIdType *c=a->buildPermutationArr(*b); //! [CppSnippet_DataArrayInt_buildPermutationArr_1] - const int expect1[5]={1,0,4,2,3}; - CPPUNIT_ASSERT_EQUAL(5,(int)c->getNumberOfTuples()); + const mcIdType expect1[5]={1,0,4,2,3}; + CPPUNIT_ASSERT_EQUAL(ToIdType(5),c->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,(int)c->getNumberOfComponents()); CPPUNIT_ASSERT(std::equal(expect1,expect1+5,c->getConstPointer())); CPPUNIT_ASSERT(a->isEqualWithoutConsideringStrAndOrder(*b)); @@ -1960,13 +1961,13 @@ void CppExample_DataArrayInt_invertArrayO2N2N2O() { using namespace MEDCoupling; //! [CppSnippet_DataArrayInt_invertArrayO2N2N2O_1] - const int arr1[6]={2,0,4,1,5,3}; + const mcIdType arr1[6]={2,0,4,1,5,3}; DataArrayInt *da=DataArrayInt::New(); da->alloc(6,1); std::copy(arr1,arr1+6,da->getPointer()); - DataArrayInt *da2=da->invertArrayO2N2N2O(6); - const int expected1[6]={1,3,0,5,2,4}; - for(int i=0;i<6;i++) + DataArrayIdType *da2=da->invertArrayO2N2N2O(6); + const mcIdType expected1[6]={1,3,0,5,2,4}; + for(mcIdType i=0;i<6;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],da2->getIJ(i,0)); //! [CppSnippet_DataArrayInt_invertArrayO2N2N2O_1] da->decrRef(); @@ -1977,13 +1978,13 @@ void CppExample_DataArrayInt_invertArrayN2O2O2N() { using namespace MEDCoupling; //! [CppSnippet_DataArrayInt_invertArrayN2O2O2N_1] - const int arr1[6]={2,0,4,1,5,3}; + const mcIdType arr1[6]={2,0,4,1,5,3}; DataArrayInt *da=DataArrayInt::New(); da->alloc(6,1); std::copy(arr1,arr1+6,da->getPointer()); - DataArrayInt *da2=da->invertArrayN2O2O2N(6); - const int expected1[6]={1,3,0,5,2,4}; - for(int i=0;i<6;i++) + DataArrayIdType *da2=da->invertArrayN2O2O2N(6); + const mcIdType expected1[6]={1,3,0,5,2,4}; + for(mcIdType i=0;i<6;i++) CPPUNIT_ASSERT_EQUAL(expected1[i],da2->getIJ(i,0)); //! [CppSnippet_DataArrayInt_invertArrayN2O2O2N_1] da->decrRef(); @@ -1998,7 +1999,7 @@ void CppExample_DataArrayDouble_getIdsInRange() da->alloc(10,1); da->iota(); - DataArrayInt* da2 = da->findIdsInRange( 2.5, 6 ); + DataArrayIdType* da2 = da->findIdsInRange( 2.5, 6 ); //! [CppSnippet_DataArrayDouble_getIdsInRange_1] da->decrRef(); da2->decrRef(); @@ -2020,11 +2021,11 @@ void CppExample_DataArrayDouble_findCommonTuples() std::copy(array2,array2+12,da->getPointer()); //! [CppSnippet_DataArrayDouble_findCommonTuples1] //! [CppSnippet_DataArrayDouble_findCommonTuples2] - DataArrayInt *c=0,*cI=0; + DataArrayIdType *c=0,*cI=0; da->findCommonTuples(1.01e-1,-1,c,cI); - const int expected3[5]={0,3,4,1,2}; - const int expected4[3]={0,3,5}; + const mcIdType expected3[5]={0,3,4,1,2}; + const mcIdType expected4[3]={0,3,5}; CPPUNIT_ASSERT(std::equal(expected3,expected3+5,c->getConstPointer())); CPPUNIT_ASSERT(std::equal(expected4,expected4+3,cI->getConstPointer())); c->decrRef(); @@ -2037,7 +2038,7 @@ void CppExample_DataArrayDouble_Meld1() { using namespace MEDCoupling; //! [CppSnippet_DataArrayDouble_Meld1_1] - const int sameNbTuples = 7; + const mcIdType sameNbTuples = 7; DataArrayDouble *da1=DataArrayDouble::New(); da1->alloc(sameNbTuples,2); @@ -2062,7 +2063,7 @@ void CppExample_DataArrayInt_Meld1() { using namespace MEDCoupling; //! [CppSnippet_DataArrayInt_Meld1_1] - const int sameNbTuples = 7; + const mcIdType sameNbTuples = 7; DataArrayInt *da1=DataArrayInt::New(); da1->alloc(sameNbTuples,2); @@ -2098,18 +2099,18 @@ void CppExampleFieldDoubleBuildSubPart1() array->decrRef(); //! [CppSnippetFieldDoubleBuildSubPart1_1] //! [CppSnippetFieldDoubleBuildSubPart1_2] - const int part1[3]={2,1,4}; + const mcIdType part1[3]={2,1,4}; MEDCoupling::MEDCouplingFieldDouble *f2=f1->buildSubPart(part1,part1+3); //! [CppSnippetFieldDoubleBuildSubPart1_2] f2->zipCoords(); - CPPUNIT_ASSERT_EQUAL(3,(int)f2->getMesh()->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(6,f2->getMesh()->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(ToIdType(3),f2->getMesh()->getNumberOfCells()); + CPPUNIT_ASSERT_EQUAL(ToIdType(6),f2->getMesh()->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension()); CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension()); MEDCoupling::MEDCouplingUMesh *m2C=dynamic_cast(const_cast(f2->getMesh())); - CPPUNIT_ASSERT_EQUAL(13,m2C->getNodalConnectivityArrayLen()); + CPPUNIT_ASSERT_EQUAL(ToIdType(13),m2C->getNodalConnectivityArrayLen()); const double expected2[12]={0.2, -0.3, 0.7, -0.3, 0.2, 0.2, 0.7, 0.2, 0.2, 0.7, 0.7, 0.7}; - for(int i=0;i<12;i++) + for(mcIdType i=0;i<12;i++) CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12); const double expected3[13]={3,2,3,1,3,0,2,1,4,4,5,3,2}; CPPUNIT_ASSERT(std::equal(expected3,expected3+13,m2C->getNodalConnectivity()->getConstPointer())); @@ -2129,20 +2130,20 @@ void CppExampleFieldDoubleBuildSubPart1() array->decrRef(); //! [CppSnippetFieldDoubleBuildSubPart1_3] //! [CppSnippetFieldDoubleBuildSubPart1_4] - const int part2[2]={1,2}; + const mcIdType part2[2]={1,2}; f2=f1->buildSubPart(part2,part2+2); //! [CppSnippetFieldDoubleBuildSubPart1_4] f2->decrRef(); //idem previous because nodes of cell#4 are not fully present in part3 - const int part3[2]={1,2}; - MEDCoupling::DataArrayInt *arrr=MEDCoupling::DataArrayInt::New(); + const mcIdType part3[2]={1,2}; + MEDCoupling::DataArrayIdType *arrr=MEDCoupling::DataArrayIdType::New(); arrr->alloc(2,1); std::copy(part3,part3+2,arrr->getPointer()); f2=f1->buildSubPart(arrr); arrr->decrRef(); f2->decrRef(); // - const int part4[3]={1,2,4}; + const mcIdType part4[3]={1,2,4}; f2=f1->buildSubPart(part4,part4+3); f2->decrRef(); // @@ -2156,7 +2157,7 @@ void CppSnippetUMeshStdBuild1() //! [CppSnippetUMeshStdBuild1_1] double coords[27]={-0.3,-0.3,0., 0.2,-0.3,0., 0.7,-0.3,0., -0.3,0.2,0., 0.2,0.2,0., 0.7,0.2,0., -0.3,0.7,0., 0.2,0.7,0., 0.7,0.7,0. }; - int nodalConnPerCell[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + mcIdType nodalConnPerCell[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; //! [CppSnippetUMeshStdBuild1_1] //! [CppSnippetUMeshStdBuild1_2] MEDCoupling::MEDCouplingUMesh *mesh=MEDCoupling::MEDCouplingUMesh::New("My2DMesh",2); @@ -2204,8 +2205,8 @@ void CppSnippetCMeshStdBuild1() arrY->decrRef(); //! [CppSnippetCMeshStdBuild1_2] //! [CppSnippetCMeshStdBuild1_3] - CPPUNIT_ASSERT_EQUAL(8*6,(int)mesh->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(9*7,mesh->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(ToIdType(8*6),mesh->getNumberOfCells()); + CPPUNIT_ASSERT_EQUAL(ToIdType(9*7),mesh->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(2,mesh->getSpaceDimension()); CPPUNIT_ASSERT_EQUAL(2,mesh->getMeshDimension()); //! [CppSnippetCMeshStdBuild1_3] @@ -2219,8 +2220,8 @@ void CppSnippetCMeshStdBuild1() mesh->setCoordsAt(1,arrY); arrY->decrRef(); //! [CppSnippetCMeshStdBuild1_2bis] - CPPUNIT_ASSERT_EQUAL(8*6,(int)mesh->getNumberOfCells()); - CPPUNIT_ASSERT_EQUAL(9*7,mesh->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(ToIdType(8*6),mesh->getNumberOfCells()); + CPPUNIT_ASSERT_EQUAL(ToIdType(9*7),mesh->getNumberOfNodes()); CPPUNIT_ASSERT_EQUAL(2,mesh->getSpaceDimension()); CPPUNIT_ASSERT_EQUAL(2,mesh->getMeshDimension()); //! [CppSnippetCMeshStdBuild1_4] @@ -2233,22 +2234,22 @@ void CppSnippetUMeshAdvBuild1() //! [CppSnippetUMeshAdvBuild1_1] double coords[27]={-0.3,-0.3,0., 0.2,-0.3,0., 0.7,-0.3,0., -0.3,0.2,0., 0.2,0.2,0., 0.7,0.2,0., -0.3,0.7,0., 0.2,0.7,0., 0.7,0.7,0. }; - int nodalConnPerCell[23]={4,0,3,4,1, 3,1,4,2, 3,4,5,2, 4,6,7,4,3, 4,7,8,5,4}; - int nodalConnPerCellIndex[6]={0,5,9,13,18,23}; + mcIdType nodalConnPerCell[23]={4,0,3,4,1, 3,1,4,2, 3,4,5,2, 4,6,7,4,3, 4,7,8,5,4}; + mcIdType nodalConnPerCellIndex[6]={0,5,9,13,18,23}; //! [CppSnippetUMeshAdvBuild1_1] //! [CppSnippetUMeshAdvBuild1_2] MEDCoupling::MEDCouplingUMesh *mesh=MEDCoupling::MEDCouplingUMesh::New("My2DMesh",2); //! [CppSnippetUMeshAdvBuild1_2] //! [CppSnippetUMeshAdvBuild1_3] - MEDCoupling::DataArrayInt *nodalConn=MEDCoupling::DataArrayInt::New(); + MEDCoupling::DataArrayIdType *nodalConn=MEDCoupling::DataArrayIdType::New(); nodalConn->alloc(23,1); std::copy(nodalConnPerCell,nodalConnPerCell+23,nodalConn->getPointer()); - MEDCoupling::DataArrayInt *nodalConnI=MEDCoupling::DataArrayInt::New(); + MEDCoupling::DataArrayIdType *nodalConnI=MEDCoupling::DataArrayIdType::New(); nodalConnI->alloc(6,1); std::copy(nodalConnPerCellIndex,nodalConnPerCellIndex+6,nodalConnI->getPointer()); mesh->setConnectivity(nodalConn,nodalConnI,true); - nodalConn->decrRef();// nodalConn DataArrayInt instance is owned by mesh after call to setConnectivity method. No more need here -> decrRef() - nodalConnI->decrRef();// nodalConnI DataArrayInt instance is owned by mesh after call to setConnectivity method. No more need here -> decrRef() + nodalConn->decrRef();// nodalConn DataArrayIdType instance is owned by mesh after call to setConnectivity method. No more need here -> decrRef() + nodalConnI->decrRef();// nodalConnI DataArrayIdType instance is owned by mesh after call to setConnectivity method. No more need here -> decrRef() //! [CppSnippetUMeshAdvBuild1_3] //! [CppSnippetUMeshAdvBuild1_4] MEDCoupling::DataArrayDouble *coordsArr=MEDCoupling::DataArrayDouble::New(); @@ -2266,7 +2267,7 @@ void CppSnippetUMeshAdvBuild1() void CppSnippetDataArrayBuild1() { //! [CppSnippetDataArrayBuild1_0] - const int nbOfNodes=12; + const mcIdType nbOfNodes=12; double coords[3*nbOfNodes]={2.,3.,4.,3.,4.,5.,4.,5.,6.,5.,6.,7.,6.,7.,8.,7.,8.,9.,8.,9.,10.,9.,10.,11.,10.,11.,12.,11.,12.,13.,12.,13.,14.,13.,14.,15.}; // MEDCoupling::DataArrayDouble *coordsArr=0; diff --git a/src/MEDCoupling/Test/MEDCouplingRemapperTest.cxx b/src/MEDCoupling/Test/MEDCouplingRemapperTest.cxx index 7b6a72e81..7c004b2bd 100644 --- a/src/MEDCoupling/Test/MEDCouplingRemapperTest.cxx +++ b/src/MEDCoupling/Test/MEDCouplingRemapperTest.cxx @@ -628,8 +628,8 @@ void MEDCouplingRemapperTest::testMultiDimCombi() sourceMesh->decrRef(); targetMesh->decrRef(); //------------- 1D -> 2D - const int conn[8]={0,1,1,2,2,3,3,0}; - const int conn2[12]={6,7,5,4,2,7,6,3,0,4,5,1}; + const mcIdType conn[8]={0,1,1,2,2,3,3,0}; + const mcIdType conn2[12]={6,7,5,4,2,7,6,3,0,4,5,1}; const double coords1[]={0.17,0.93,0.56,0.93,0.56,0.25,0.17,0.52}; const double coords2[]={0.,0.,1.,0.,1.,1.,0.,1.,0.,0.5,1.,0.5,0.,0.8,1.,0.8}; sourceMesh=MEDCouplingUMesh::New("src1D",1); @@ -914,15 +914,15 @@ void MEDCouplingRemapperTest::testExtruded2() { MEDCouplingUMesh *meshN,*meshTT,*meshTF; MEDCouplingBasicsTest::build3DExtrudedUMesh_2(meshN,meshTT,meshTF); - std::vector n; + std::vector n; double pt[3]={300.,300.,0.}; double v[3]={0.,0.,2.}; meshN->findNodesOnPlane(pt,v,1e-12,n); MEDCouplingUMesh *meshN2D=(MEDCouplingUMesh *)meshN->buildFacePartOfMySelfNode(&n[0],&n[0]+n.size(),true); n.clear(); bool b=false; - int newNbOfNodes; - DataArrayInt *da=meshTT->mergeNodes(1e-12,b,newNbOfNodes); + mcIdType newNbOfNodes; + DataArrayIdType *da=meshTT->mergeNodes(1e-12,b,newNbOfNodes); CPPUNIT_ASSERT(b); da->decrRef(); meshTT->findNodesOnPlane(pt,v,1e-12,n); @@ -1125,7 +1125,7 @@ MEDCouplingUMesh *MEDCouplingRemapperTest::build1DTargetMesh_2() 0.59,0.09, 0.69,0.19, 0.21,-0.29,0.31,-0.19, 0.45,0.25,0.65,0.45, -0.2,-0.2,0.11,0.11, 0.25,0.25, 0.45,0.45 }; - int targetConn[10]={0,1, 2,3, 4,5, 6,7, 8,9}; + mcIdType targetConn[10]={0,1, 2,3, 4,5, 6,7, 8,9}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New("my name of mesh 1D 2",1); targetMesh->allocateCells(5); @@ -1145,7 +1145,7 @@ MEDCouplingUMesh *MEDCouplingRemapperTest::build2DTargetMesh_3() double targetCoords[20]={-0.6,-0.4, -0.1,-0.4, 1.1,-0.4, 2.1,-0.4, -0.6,0.1, -0.1,0.1, 1.1,0.1, 2.1,0.1, -0.6,1.1, -0.1,1.1}; - int targetConn[16]={0,4,5,1, 1,5,6,2, 2,6,7,3, 4,8,9,5}; + mcIdType targetConn[16]={0,4,5,1, 1,5,6,2, 2,6,7,3, 4,8,9,5}; MEDCouplingUMesh *targetMesh=MEDCouplingUMesh::New(); targetMesh->setMeshDimension(2); targetMesh->allocateCells(4); @@ -1172,7 +1172,7 @@ MEDCouplingUMesh *MEDCouplingRemapperTest::build3DExtrudedUMesh_1(MEDCouplingUMe 0.,0.,3., 1.,1.,3., 1.,1.25,3., 0.,1.,3., 1.,1.5,3., 2.,0.,3., 2.,1.,3., 1.,2.,3., 0.,2.,3., 3.,1.,3., 3.,2.,3., 0.,1.,3., 1.,3.,3., 2.,2.,3., 2.,3.,3.}; - int conn[354]={ + mcIdType conn[354]={ // 0 0,11,1,3,15,26,16,18, 1,2,4,7,13,6,-1,1,16,21,6,-1,6,21,28,13,-1,13,7,22,28,-1,7,4,19,22,-1,4,2,17,19,-1,2,1,16,17,-1,16,21,28,22,19,17, 1,6,5,3,16,21,20,18, 13,10,9,6,28,25,24,21, @@ -1189,7 +1189,7 @@ MEDCouplingUMesh *MEDCouplingRemapperTest::build3DExtrudedUMesh_1(MEDCouplingUMe 41,38,37,34,32,31,-1,41,56,46,31,-1,31,46,47,32,-1,32,47,49,34,-1,34,49,52,37,-1,37,38,53,52,-1,38,41,56,53,-1,56,46,47,49,52,53, 37,42,44,43,52,57,59,58 }; - int conn2[28]={7,12,14,13, 11,8,7,4,2,1, 13,10,9,6, 1,6,5,3, 1,2,4,7,13,6, 0,11,1,3}; + mcIdType conn2[28]={7,12,14,13, 11,8,7,4,2,1, 13,10,9,6, 1,6,5,3, 1,2,4,7,13,6, 0,11,1,3}; // MEDCouplingUMesh *ret=MEDCouplingUMesh::New(); ret->setMeshDimension(3); @@ -1250,7 +1250,7 @@ void MEDCouplingRemapperTest::testPartialTransfer1() array->alloc(sourceMesh->getNumberOfCells(),1); srcField->setArray(array); double *ptr=array->getPointer(); - for(int i=0;igetNumberOfCells();i++) + for(mcIdType i=0;igetNumberOfCells();i++) ptr[i]=(double)(i+7); array->decrRef(); MEDCouplingFieldDouble *trgField=MEDCouplingFieldDouble::New(ON_CELLS); @@ -1279,10 +1279,10 @@ void MEDCouplingRemapperTest::testBugNonRegression1() DataArrayDouble *coordsSrc(DataArrayDouble::New()); const double coordsSrcData[18]={-6.25,3.6084391824351605,264.85199999999998,-6.25,3.6084391824351605,289.05200000000002,-6.2499999999999991,-3.6084391824351618,264.85199999999998,-6.2499999999999991,-3.6084391824351618,289.05200000000002,-1.7763568394002505e-15,4.4408920985006262e-15,264.85199999999998,-1.7763568394002505e-15,4.4408920985006262e-15,289.05200000000002}; coordsSrc->useArray(coordsSrcData,false,DeallocType::CPP_DEALLOC,6,3); - DataArrayInt *connSrc(DataArrayInt::New()),*connISrc(DataArrayInt::New()); - const int connSrcData[7]={16,2,0,4,3,1,5}; + DataArrayIdType *connSrc(DataArrayIdType::New()),*connISrc(DataArrayIdType::New()); + const mcIdType connSrcData[7]={16,2,0,4,3,1,5}; connSrc->useArray(connSrcData,false,DeallocType::CPP_DEALLOC,7,1); - const int connISrcData[2]={0,7}; + const mcIdType connISrcData[2]={0,7}; connISrc->useArray(connISrcData,false,DeallocType::CPP_DEALLOC,2,1); MEDCouplingUMesh *srcMesh(MEDCouplingUMesh::New("source",3)); srcMesh->setCoords(coordsSrc); @@ -1292,11 +1292,11 @@ void MEDCouplingRemapperTest::testBugNonRegression1() DataArrayDouble *coordsTrg(DataArrayDouble::New()); const double coordsTrgData[36]={-2,1.1547005383792521,264.85199999999998,-2,0.57735026918962618,264.85199999999998,-2.5,0.2886751345948132,264.85199999999998,-2.5,1.443375672974065,264.85199999999998,-3.0000000000000004,1.1547005383792526,264.85199999999998,-3.0000000000000004,0.57735026918962662,264.85199999999998,-2,1.1547005383792521,289.05200000000002,-2,0.57735026918962618,289.05200000000002,-2.5,0.2886751345948132,289.05200000000002,-2.5,1.443375672974065,289.05200000000002,-3.0000000000000004,1.1547005383792526,289.05200000000002,-3.0000000000000004,0.57735026918962662,289.05200000000002}; coordsTrg->useArray(coordsTrgData,false,DeallocType::CPP_DEALLOC,12,3); - DataArrayInt *connTrg=DataArrayInt::New(); - const int connTrgData[44]={31,0,1,2,5,4,3,-1,7,6,9,10,11,8,-1,3,9,6,0,-1,4,10,9,3,-1,5,11,10,4,-1,2,8,11,5,-1,1,7,8,2,-1,0,6,7,1}; + DataArrayIdType *connTrg=DataArrayIdType::New(); + const mcIdType connTrgData[44]={31,0,1,2,5,4,3,-1,7,6,9,10,11,8,-1,3,9,6,0,-1,4,10,9,3,-1,5,11,10,4,-1,2,8,11,5,-1,1,7,8,2,-1,0,6,7,1}; connTrg->useArray(connTrgData,false,DeallocType::CPP_DEALLOC,44,1); - DataArrayInt *connITrg=DataArrayInt::New(); - const int connITrgData[2]={0,44}; + DataArrayIdType *connITrg=DataArrayIdType::New(); + const mcIdType connITrgData[2]={0,44}; connITrg->useArray(connITrgData,false,DeallocType::CPP_DEALLOC,2,1); MEDCouplingUMesh *trgMesh=MEDCouplingUMesh::New("target",3); trgMesh->setCoords(coordsTrg); @@ -1308,7 +1308,7 @@ const double coordsTrgData[36]={-2,1.1547005383792521,264.85199999999998,-2,0.57 remapper.setPrecision(1e-12); remapper.setIntersectionType(INTERP_KERNEL::Triangulation); CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(srcMesh,trgMesh,"P0P0")); - std::vector > matrx(remapper.getCrudeMatrix()); + std::vector > matrx(remapper.getCrudeMatrix()); CPPUNIT_ASSERT_EQUAL(1,(int)matrx.size()); CPPUNIT_ASSERT_EQUAL(1,(int)matrx[0].size()); CPPUNIT_ASSERT_DOUBLES_EQUAL(valExpected,matrx[0][0],1e-13); diff --git a/src/PyWrapping/CMakeLists.txt b/src/PyWrapping/CMakeLists.txt index 56c928ff3..11430ce98 100644 --- a/src/PyWrapping/CMakeLists.txt +++ b/src/PyWrapping/CMakeLists.txt @@ -30,6 +30,9 @@ ELSE() SET_SOURCE_FILES_PROPERTIES(medcoupling.i PROPERTIES SWIG_DEFINITIONS "-shadow") ENDIF() SET(SWIG_MODULE_medcoupling_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") +IF(MEDCOUPLING_USE_64BIT_IDS) + STRING(APPEND SWIG_MODULE_medcoupling_EXTRA_FLAGS ";-DMEDCOUPLING_USE_64BIT_IDS") +ENDIF(MEDCOUPLING_USE_64BIT_IDS) SET(medcoupling_SWIG_DPYS_FILES medcoupling.i)