From: ageay Date: Wed, 11 Mar 2009 17:54:35 +0000 (+0000) Subject: Some new functionalities. X-Git-Tag: V5_1_main_FINAL~420 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=69f3ddc87834fec4a28b3e7332407e9a73b7f47c;p=tools%2Fmedcoupling.git Some new functionalities. --- diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest.cxx index 440506a4e..32d72cfc1 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest.cxx @@ -95,6 +95,37 @@ void MEDCouplingBasicsTest::testMesh() myCoords->decrRef(); CPPUNIT_ASSERT_EQUAL(nbOfNodes,mesh->getNumberOfNodes()); mesh->checkCoherency(); + CPPUNIT_ASSERT_EQUAL(3,mesh->getSpaceDimension()); + // test clone not recursively + MEDCouplingUMesh *mesh2=mesh->clone(false); + CPPUNIT_ASSERT(mesh2!=mesh); + mesh2->checkCoherency(); + 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(mesh->getNodalConnectivityIndex()==mesh2->getNodalConnectivityIndex()); + CPPUNIT_ASSERT_EQUAL(15,mesh2->getNodalConnectivityIndex()->getIJ(3,0)); + mesh2->decrRef(); + // test clone not recursively + MEDCouplingUMesh *mesh3=mesh->clone(true); + CPPUNIT_ASSERT(mesh3!=mesh); + mesh3->checkCoherency(); + 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(mesh->getNodalConnectivityIndex()!=mesh3->getNodalConnectivityIndex()); + CPPUNIT_ASSERT_EQUAL(15,mesh3->getNodalConnectivityIndex()->getIJ(3,0)); + mesh3->decrRef(); //test 4 - Field on cells MEDCouplingFieldDouble *fieldOnCells=MEDCouplingFieldDouble::New(ON_CELLS); fieldOnCells->setMesh(mesh); @@ -104,13 +135,190 @@ void MEDCouplingBasicsTest::testMesh() tmp=array->getPointer(); array->decrRef(); fill(tmp,tmp+9*nbOfCells,7.); + //content of field changed -> declare it. fieldOnCells->declareAsNew(); fieldOnCells->checkCoherency(); + // testing clone of fields - no recursive + MEDCouplingFieldDouble *fieldOnCells2=fieldOnCells->clone(false); + CPPUNIT_ASSERT(fieldOnCells2!=fieldOnCells); + fieldOnCells2->checkCoherency(); + CPPUNIT_ASSERT_EQUAL(nbOfCells,fieldOnCells2->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(9,fieldOnCells2->getNumberOfComponents()); + CPPUNIT_ASSERT(fieldOnCells2->getArray()==fieldOnCells->getArray()); + CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,fieldOnCells2->getArray()->getIJ(3,7),1e-14); + CPPUNIT_ASSERT(fieldOnCells2->getMesh()==fieldOnCells->getMesh()); + // testing clone of fields - recursive + MEDCouplingFieldDouble *fieldOnCells3=fieldOnCells->clone(true); + CPPUNIT_ASSERT(fieldOnCells3!=fieldOnCells); + fieldOnCells3->checkCoherency(); + CPPUNIT_ASSERT_EQUAL(nbOfCells,fieldOnCells3->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(9,fieldOnCells3->getNumberOfComponents()); + CPPUNIT_ASSERT(fieldOnCells3->getArray()!=fieldOnCells->getArray()); + CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,fieldOnCells3->getArray()->getIJ(3,7),1e-14); + CPPUNIT_ASSERT(fieldOnCells3->getMesh()==fieldOnCells->getMesh()); + fieldOnCells2->decrRef(); + fieldOnCells3->decrRef(); + // fieldOnCells->decrRef(); //clean-up mesh->decrRef(); } +void MEDCouplingBasicsTest::testDeepCopy() +{ + DataArrayDouble *array=DataArrayDouble::New(); + array->alloc(5,3); + fill(array->getPointer(),array->getPointer()+5*3,7.); + CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,array->getIJ(3,2),1e-14); + double *tmp1=array->getPointer(); + DataArrayDouble *array2=array->deepCopy(); + double *tmp2=array2->getPointer(); + CPPUNIT_ASSERT(tmp1!=tmp2); + array->decrRef(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,array2->getIJ(3,2),1e-14); + array2->decrRef(); + // + DataArrayInt *array3=DataArrayInt::New(); + array3->alloc(5,3); + fill(array3->getPointer(),array3->getPointer()+5*3,17); + CPPUNIT_ASSERT_EQUAL(17,array3->getIJ(3,2)); + int *tmp3=array3->getPointer(); + DataArrayInt *array4=array3->deepCopy(); + int *tmp4=array4->getPointer(); + CPPUNIT_ASSERT(tmp3!=tmp4); + array3->decrRef(); + CPPUNIT_ASSERT_EQUAL(17,array4->getIJ(3,2)); + array4->decrRef(); +} + +void MEDCouplingBasicsTest::testRevNodal() +{ + MEDCouplingUMesh *mesh=build2DTargetMesh_1(); + DataArrayInt *revNodal=DataArrayInt::New(); + DataArrayInt *revNodalIndx=DataArrayInt::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(18,revNodal->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(10,revNodalIndx->getNbOfElems()); + CPPUNIT_ASSERT(std::equal(revNodalExpected,revNodalExpected+18,revNodal->getPointer())); + CPPUNIT_ASSERT(std::equal(revNodalIndexExpected,revNodalIndexExpected+10,revNodalIndx->getPointer())); + // + revNodal->decrRef(); + revNodalIndx->decrRef(); + mesh->decrRef(); +} + +void MEDCouplingBasicsTest::testBuildPartOfMySelf() +{ + MEDCouplingUMesh *mesh=build2DTargetMesh_1(); + mesh->setName("Toto"); + const int tab1[2]={0,4}; + const int tab2[3]={0,2,3}; + // + MEDCouplingUMesh *subMesh=mesh->buildPartOfMySelf(tab1,tab1+2,true); + std::string name(subMesh->getName()); + CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllTypes().size()); + CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*mesh->getAllTypes().begin()); + CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++(mesh->getAllTypes().begin()))); + CPPUNIT_ASSERT_EQUAL(1,(int)subMesh->getAllTypes().size()); + CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllTypes().begin()); + CPPUNIT_ASSERT(name=="PartOf_Toto"); + CPPUNIT_ASSERT(mesh->getCoords()==subMesh->getCoords()); + CPPUNIT_ASSERT_EQUAL(2,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(10,subMesh->getNodalConnectivity()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(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(); + // + subMesh=mesh->buildPartOfMySelf(tab2,tab2+3,true); + name=subMesh->getName(); + CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getAllTypes().size()); + CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*subMesh->getAllTypes().begin()); + CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++(subMesh->getAllTypes().begin()))); + CPPUNIT_ASSERT(name=="PartOf_Toto"); + CPPUNIT_ASSERT(mesh->getCoords()==subMesh->getCoords()); + CPPUNIT_ASSERT_EQUAL(3,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(14,subMesh->getNodalConnectivity()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(4,subMesh->getNodalConnectivityIndex()->getNbOfElems()); + CPPUNIT_ASSERT(std::equal(subConn2,subConn2+14,subMesh->getNodalConnectivity()->getPointer())); + CPPUNIT_ASSERT(std::equal(subConnIndex2,subConnIndex2+4,subMesh->getNodalConnectivityIndex()->getPointer())); + subMesh->decrRef(); + // + mesh->decrRef(); +} + +void MEDCouplingBasicsTest::testZipCoords() +{ + MEDCouplingUMesh *mesh=build2DTargetMesh_1(); + CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllTypes().size()); + CPPUNIT_ASSERT_EQUAL(2,mesh->getSpaceDimension()); + CPPUNIT_ASSERT_EQUAL(9,mesh->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(5,mesh->getNumberOfCells()); + 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(); + oldCoords->incrRef(); + mesh->zipCoords(); + CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllTypes().size()); + CPPUNIT_ASSERT_EQUAL(2,mesh->getSpaceDimension()); + CPPUNIT_ASSERT_EQUAL(9,mesh->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(5,mesh->getNumberOfCells()); + CPPUNIT_ASSERT(mesh->getCoords()!=oldCoords); + CPPUNIT_ASSERT(std::equal(mesh->getCoords()->getPointer(),mesh->getCoords()->getPointer()+2*9,oldCoords->getPointer())); + CPPUNIT_ASSERT(std::equal(oldConn.begin(),oldConn.end(),mesh->getNodalConnectivity()->getPointer())); + CPPUNIT_ASSERT(std::equal(oldConnIndex.begin(),oldConnIndex.end(),mesh->getNodalConnectivityIndex()->getPointer())); + oldCoords->decrRef(); + // + const int tab1[2]={0,4}; + MEDCouplingUMesh *subMesh=mesh->buildPartOfMySelf(tab1,tab1+2,true); + DataArrayInt *traducer=subMesh->zipCoordsTraducer(); + const int 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->getAllTypes().begin()); + CPPUNIT_ASSERT_EQUAL(2,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(10,subMesh->getNodalConnectivity()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(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(); + // + subMesh=mesh->buildPartOfMySelf(tab1,tab1+2,false); + CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllTypes().begin()); + CPPUNIT_ASSERT_EQUAL(2,subMesh->getNumberOfCells()); + CPPUNIT_ASSERT_EQUAL(7,subMesh->getNumberOfNodes()); + CPPUNIT_ASSERT_EQUAL(10,subMesh->getNodalConnectivity()->getNbOfElems()); + CPPUNIT_ASSERT_EQUAL(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(); + // + mesh->decrRef(); +} + +void MEDCouplingBasicsTest::testEqualMesh() +{ + MEDCouplingUMesh *mesh1=build2DTargetMesh_1(); + MEDCouplingUMesh *mesh2=build2DTargetMesh_1(); + // + + // + mesh1->decrRef(); + mesh2->decrRef(); +} + void MEDCouplingBasicsTest::test2DInterpP0P0_1() { MEDCouplingUMesh *sourceMesh=build2DSourceMesh_1(); @@ -227,14 +435,14 @@ void MEDCouplingBasicsTest::test3DSurfInterpP0P0_1() myInterpolator.setIntersectionType(types[i]); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0"); CPPUNIT_ASSERT_EQUAL(5,(int)res.size()); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2.),res[0][0],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2.),res[0][1],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2.),res[1][0],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2.),res[2][0],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25*sqrt(2.),res[3][1],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2.),res[4][0],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2.),res[4][1],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(1.*sqrt(2.),sumAll(res),1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2),res[0][0],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2),res[0][1],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2),res[1][0],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2),res[2][0],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25*sqrt(2),res[3][1],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2),res[4][0],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2),res[4][1],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1.*sqrt(2),sumAll(res),1e-12); res.clear(); } //clean up @@ -258,19 +466,19 @@ void MEDCouplingBasicsTest::test3DSurfInterpP0P1_1() myInterpolator.setIntersectionType(types[i]); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P1"); CPPUNIT_ASSERT_EQUAL(9,(int)res.size()); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2.),res[0][0],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2.),res[0][1],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2.),res[1][0],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.083333333333333329*sqrt(2.),res[2][0],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.16666666666666666*sqrt(2.),res[3][1],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.16666666666666666*sqrt(2.),res[4][0],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.16666666666666666*sqrt(2.),res[4][1],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2.),res[5][0],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.083333333333333329*sqrt(2.),res[6][1],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.16666666666666666*sqrt(2.),res[7][1],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2.),res[8][0],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2.),res[8][1],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(1.25*sqrt(2.),sumAll(res),1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2),res[0][0],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2),res[0][1],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2),res[1][0],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.083333333333333329*sqrt(2),res[2][0],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.16666666666666666*sqrt(2),res[3][1],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.16666666666666666*sqrt(2),res[4][0],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.16666666666666666*sqrt(2),res[4][1],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.125*sqrt(2),res[5][0],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.083333333333333329*sqrt(2),res[6][1],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.16666666666666666*sqrt(2),res[7][1],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2),res[8][0],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2),res[8][1],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1.25*sqrt(2),sumAll(res),1e-12); res.clear(); } //clean up @@ -294,16 +502,16 @@ void MEDCouplingBasicsTest::test3DSurfInterpP1P0_1() myInterpolator.setIntersectionType(types[i]); myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P0"); 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.041666666666666664*sqrt(2.),res[1][0],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2.),res[3][0],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.083333333333333333*sqrt(2.),res[1][1],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.083333333333333333*sqrt(2.),res[2][1],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.166666666666666667*sqrt(2.),res[3][2],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2.),res[2][3],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2.),res[3][3],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25*sqrt(2.),res[4][3],1e-12); - CPPUNIT_ASSERT_DOUBLES_EQUAL(1.*sqrt(2.),sumAll(res),1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25*sqrt(2),res[0][0],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2),res[1][0],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2),res[3][0],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.083333333333333333*sqrt(2),res[1][1],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.083333333333333333*sqrt(2),res[2][1],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.166666666666666667*sqrt(2),res[3][2],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2),res[2][3],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.041666666666666664*sqrt(2),res[3][3],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25*sqrt(2),res[4][3],1e-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1.*sqrt(2),sumAll(res),1e-12); res.clear(); } //clean up diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest.hxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest.hxx index 0f0ab1210..eccf4d090 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest.hxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest.hxx @@ -32,6 +32,11 @@ namespace ParaMEDMEM { CPPUNIT_TEST_SUITE(MEDCouplingBasicsTest); CPPUNIT_TEST( testMesh ); + CPPUNIT_TEST( testDeepCopy ); + CPPUNIT_TEST( testRevNodal ); + CPPUNIT_TEST( testBuildPartOfMySelf ); + CPPUNIT_TEST( testZipCoords ); + CPPUNIT_TEST( testEqualMesh ); CPPUNIT_TEST( test2DInterpP0P0_1 ); CPPUNIT_TEST( test2DInterpP0P1_1 ); CPPUNIT_TEST( test2DInterpP1P0_1 ); @@ -42,6 +47,11 @@ namespace ParaMEDMEM CPPUNIT_TEST_SUITE_END(); public: void testMesh(); + void testDeepCopy(); + void testRevNodal(); + void testBuildPartOfMySelf(); + void testZipCoords(); + void testEqualMesh(); void test2DInterpP0P0_1(); void test2DInterpP0P1_1(); void test2DInterpP1P0_1();