From: vbd Date: Tue, 7 Aug 2007 14:45:30 +0000 (+0000) Subject: Staffan : X-Git-Tag: trio_trio_coupling~79 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c85ecd3d2638313d5a439fea48117eac3abe426a;p=tools%2Fmedcoupling.git Staffan : added more tests --- diff --git a/src/INTERP_KERNEL/Test/Interpolation3DTest.cxx b/src/INTERP_KERNEL/Test/Interpolation3DTest.cxx index a1ec7bfc4..5b4ea5c25 100644 --- a/src/INTERP_KERNEL/Test/Interpolation3DTest.cxx +++ b/src/INTERP_KERNEL/Test/Interpolation3DTest.cxx @@ -46,8 +46,11 @@ bool Interpolation3DTest::isReflexive(IntersectionMatrix m1, IntersectionMatrix } else { - std::cout << "V2( " << iter2->first - 1 << ", " << i + 1 << ") " << " does not exist" << std::endl; - isReflexive = false; + if(!epsilonEqual(v1, 0.0)) + { + std::cout << "V2( " << iter2->first - 1 << ", " << i + 1 << ") " << " does not exist" << std::endl; + isReflexive = false; + } } } ++i; diff --git a/src/INTERP_KERNEL/Test/Interpolation3DTest.hxx b/src/INTERP_KERNEL/Test/Interpolation3DTest.hxx index 6500f12c7..0c9d60455 100644 --- a/src/INTERP_KERNEL/Test/Interpolation3DTest.hxx +++ b/src/INTERP_KERNEL/Test/Interpolation3DTest.hxx @@ -12,29 +12,32 @@ class Interpolation3DTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE( Interpolation3DTest ); - +#if 0 CPPUNIT_TEST( tetraReflexiveUnit ); CPPUNIT_TEST( tetraReflexiveGeneral ); CPPUNIT_TEST( tetraNudgedSimpler ); CPPUNIT_TEST( tetraNudged ); CPPUNIT_TEST( tetraCorner ); - +#endif + CPPUNIT_TEST( tetraSimpleIncluded ); + CPPUNIT_TEST( tetraComplexIncluded ); +#if 0 CPPUNIT_TEST( tetraHalfstripOnly ); CPPUNIT_TEST( tetraHalfstripOnly2 ); CPPUNIT_TEST( tetraSimpleHalfstripOnly ); CPPUNIT_TEST( generalTetra ); + CPPUNIT_TEST( dividedUnitTetraSimplerReflexive ); CPPUNIT_TEST( dividedUnitTetraReflexive ); + CPPUNIT_TEST( nudgedDividedUnitTetra ); + CPPUNIT_TEST( nudgedDividedUnitTetraSimpler ); + CPPUNIT_TEST( dividedGenTetra ); +#endif #if 0 CPPUNIT_TEST( boxReflexive ); CPPUNIT_TEST( tetraBoxes ); #endif - //CPPUNIT_TEST( tetraTetraScale ); - // CPPUNIT_TEST( box1 ); - // CPPUNIT_TEST( cyl1 ); - //CPPUNIT_TEST( tetra1 ); - // CPPUNIT_TEST( tetra3 ); - + CPPUNIT_TEST_SUITE_END(); @@ -70,6 +73,16 @@ public: intersectMeshes("meshes/UnitTetra.med", "UnitTetra", "meshes/CornerTetra.med", "CornerTetra", 0.0135435); } + void tetraSimpleIncluded() + { + intersectMeshes("meshes/SimpleIncludedTetra.med", "SimpleIncludedTetra", "meshes/SimpleIncludingTetra.med", "SimpleIncludingTetra", 17.0156, 1.0e-4); + } + + void tetraComplexIncluded() + { + intersectMeshes("meshes/ComplexIncludedTetra.med", "ComplexIncludedTetra", "meshes/ComplexIncludingTetra.med", "ComplexIncludingTetra", 17.0156, 1.0e-4); + } + void tetraHalfstripOnly() { // NB this test is not completely significant : we should also verify that @@ -101,6 +114,26 @@ public: intersectMeshes("meshes/DividedUnitTetra.med", "DividedUnitTetra", "meshes/DividedUnitTetra.med", "DividedUnitTetra", 0.1666667); } + void dividedUnitTetraSimplerReflexive() + { + intersectMeshes("meshes/DividedUnitTetraSimpler.med", "DividedUnitTetraSimpler", "meshes/DividedUnitTetraSimpler.med", "DividedUnitTetraSimpler", 0.1666667); + } + + void nudgedDividedUnitTetra() + { + intersectMeshes("meshes/NudgedDividedUnitTetra.med", "NudgedDividedUnitTetra", "meshes/DividedUnitTetra.med", "DividedUnitTetra", 0.150191); + } + + void nudgedDividedUnitTetraSimpler() + { + intersectMeshes("meshes/NudgedDividedUnitTetraSimpler.med", "NudgedDividedUnitTetraSimpler", "meshes/DividedUnitTetraSimpler.med", "DividedUnitTetraSimpler", 0.150191); + } + + void dividedGenTetra() + { + intersectMeshes("meshes/DividedGenTetra1.med", "DividedGenTetra1", "meshes/DividedGenTetra2.med", "DividedGenTetra2", 4.91393, 1.0e-5); + } + void boxReflexive() { intersectMeshes("meshes/Box3.med", "Box3", "meshes/Box3.med", "Box3", 13.9954, 1.0e-4); diff --git a/src/INTERP_KERNEL/Test/TestInterpKernel.cxx b/src/INTERP_KERNEL/Test/TestInterpKernel.cxx index b3242825c..65042c34b 100644 --- a/src/INTERP_KERNEL/Test/TestInterpKernel.cxx +++ b/src/INTERP_KERNEL/Test/TestInterpKernel.cxx @@ -25,8 +25,8 @@ // --- Registers the fixture into the 'registry' -//CPPUNIT_TEST_SUITE_REGISTRATION( Interpolation3DTest ); -CPPUNIT_TEST_SUITE_REGISTRATION( TransformedTriangleIntersectTest ); +CPPUNIT_TEST_SUITE_REGISTRATION( Interpolation3DTest ); +//CPPUNIT_TEST_SUITE_REGISTRATION( TransformedTriangleIntersectTest ); //CPPUNIT_TEST_SUITE_REGISTRATION( TransformedTriangleTest ); //CPPUNIT_TEST_SUITE_REGISTRATION( TestBogusClass ); diff --git a/src/INTERP_KERNEL/Test/TransformedTriangleIntersectTest.cxx b/src/INTERP_KERNEL/Test/TransformedTriangleIntersectTest.cxx index 3b8de2139..7420456b0 100644 --- a/src/INTERP_KERNEL/Test/TransformedTriangleIntersectTest.cxx +++ b/src/INTERP_KERNEL/Test/TransformedTriangleIntersectTest.cxx @@ -41,9 +41,9 @@ // -> (QR, X) : - (QR, Y) : - (QR, Z) : 6 // -> (RP, X) : - (RP, Y) : - (RP, Z) : - // ----------------------------------------------------------------------------------------------------- -// TE -> OX : 4 OY : 7 OZ : 8 XY : 1 ZX : 4 YZ : 3,7 +// TE -> OX : 4 OY : 7 OZ : 8 XY : 1 ZX : 4 YZ : 3 // ----------------------------------------------------------------------------------------------------- -// TR -> X : 7 Y : 6 Z : 5 +// TR -> X : 7 Y : 6 Z : 5 // ----------------------------------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -644,7 +644,7 @@ void TransformedTriangleIntersectTest::testTriangle4() void TransformedTriangleIntersectTest::testTriangle5() { - +std::cout << std::endl << "+++++++ Testing triangle 5" << std::endl; typedef TransformedTriangle TT; double coords[9] = @@ -779,12 +779,13 @@ void TransformedTriangleIntersectTest::testTriangle5() // SE - // SC - // SHS - -// SR (PQ, X), (QR, XY) +// SR (PQ, X), (QR, Z) // TE - // TR Y void TransformedTriangleIntersectTest::testTriangle6() { + std::cout << std::endl << "+++++++ Testing triangle 6" << std::endl; typedef TransformedTriangle TT; @@ -890,11 +891,11 @@ void TransformedTriangleIntersectTest::testTriangle6() CPPUNIT_ASSERT_EQUAL(false, tri->testSegmentRayIntersection(TT::QR, TT::X)); CPPUNIT_ASSERT_EQUAL(false, tri->testSegmentRayIntersection(TT::QR, TT::Y)); - CPPUNIT_ASSERT_EQUAL(false, tri->testSegmentRayIntersection(TT::QR, TT::Z)); + CPPUNIT_ASSERT_EQUAL(true , tri->testSegmentRayIntersection(TT::QR, TT::Z)); CPPUNIT_ASSERT_EQUAL(false, tri->testSegmentRayIntersection(TT::RP, TT::X)); CPPUNIT_ASSERT_EQUAL(false, tri->testSegmentRayIntersection(TT::RP, TT::Y)); - CPPUNIT_ASSERT_EQUAL(true , tri->testSegmentRayIntersection(TT::RP, TT::Z)); + CPPUNIT_ASSERT_EQUAL(false, tri->testSegmentRayIntersection(TT::RP, TT::Z)); // surface-edge (6 possibilities) CPPUNIT_ASSERT_EQUAL(false, tri->testSurfaceEdgeIntersection(TT::OX)); @@ -1485,7 +1486,7 @@ void TransformedTriangleIntersectTest::testTriangle10() // SC (RP, O) // SHS - // SR - -// TE [OY] +// TE [OY, OZ] // TR - void TransformedTriangleIntersectTest::testTriangle11() @@ -1604,7 +1605,7 @@ void TransformedTriangleIntersectTest::testTriangle11() // surface-edge (6 possibilities) CPPUNIT_ASSERT_EQUAL(false, tri->testSurfaceEdgeIntersection(TT::OX)); CPPUNIT_ASSERT_EQUAL(true , tri->testSurfaceEdgeIntersection(TT::OY)); - CPPUNIT_ASSERT_EQUAL(false, tri->testSurfaceEdgeIntersection(TT::OZ)); + CPPUNIT_ASSERT_EQUAL(true, tri->testSurfaceEdgeIntersection(TT::OZ)); CPPUNIT_ASSERT_EQUAL(false, tri->testSurfaceEdgeIntersection(TT::YZ)); CPPUNIT_ASSERT_EQUAL(false, tri->testSurfaceEdgeIntersection(TT::ZX)); CPPUNIT_ASSERT_EQUAL(false, tri->testSurfaceEdgeIntersection(TT::XY)); diff --git a/src/INTERP_KERNEL/Test/TransformedTriangleIntersectTest.hxx b/src/INTERP_KERNEL/Test/TransformedTriangleIntersectTest.hxx index 5ade43944..99189b998 100644 --- a/src/INTERP_KERNEL/Test/TransformedTriangleIntersectTest.hxx +++ b/src/INTERP_KERNEL/Test/TransformedTriangleIntersectTest.hxx @@ -12,6 +12,7 @@ class TransformedTriangleIntersectTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE( TransformedTriangleIntersectTest ); + CPPUNIT_TEST( testTriangle1 ); CPPUNIT_TEST( testTriangle2 ); CPPUNIT_TEST( testTriangle3 ); @@ -25,6 +26,7 @@ class TransformedTriangleIntersectTest : public CppUnit::TestFixture CPPUNIT_TEST( testTriangle11 ); CPPUNIT_TEST( testTriangle12 ); CPPUNIT_TEST( testTriangle13 ); + CPPUNIT_TEST_SUITE_END(); typedef INTERP_UTILS::TransformedTriangle::TriSegment TriSegment;