Salome HOME
Copyright update 2020
[tools/medcoupling.git] / src / INTERP_KERNELTest / HexaTests.hxx
1 // Copyright (C) 2007-2020  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef __HEXA_TESTS_HXX_
21 #define __HEXA_TESTS_HXX_
22
23 #include "InterpolationTestSuite.hxx"
24
25 namespace INTERP_TEST
26 {
27   /**
28    * \brief Class performing intersection tests on meshes with hexahedral elements.
29    *
30    */
31   class HexaTests : public InterpolationTestSuite<3,3>
32   {
33     CPPUNIT_TEST_SUITE( HexaTests );
34
35     CPPUNIT_TEST( simpleHexaBox );
36     //VB : slightly inaccurate so that it triggers a failure of the test
37     // should be investigated in the future
38     //    CPPUNIT_TEST( reflexiveHexaBox );
39     CPPUNIT_TEST( hexaBoxes );
40     CPPUNIT_TEST( hexaBoxesMoved );
41
42     CPPUNIT_TEST_SUITE_END();
43
44   public:
45
46     /// Intersection between two boxes, aligned with the axes.One has 60 hexahedral elements and the other has 39 tetrahedral elements
47     /// \brief Status : pass
48     void simpleHexaBox()
49     {
50       _testTools->intersectMeshes("BoxHexa1", "BoxTetra2", 65250, 1.0e-5);
51     }
52
53     /// Intersection of a box with 60 hexahedral elements with itself
54     /// \brief Status : pass
55     void reflexiveHexaBox()
56     {
57       _testTools->intersectMeshes("BoxHexa1", "BoxHexa1", 204000);
58     }
59
60     /// Intersection between two boxes, aligned with the axes.Both have hexahedral elements : one 36, the other 60
61     /// \brief Status : pass
62     void hexaBoxes()
63     {
64       _testTools->intersectMeshes("BoxHexa1", "BoxHexa2", 65250);
65     }
66
67     /// Intersection between two boxes in general position with hexahedral elements. One has 200 elements and the other 420.
68     /// \brief Status : fails - reason unknown. The matrix does not fulfill the transpose requirement : that W_AB = W_BA^T 
69     void hexaBoxesMoved()
70     {
71       _testTools->intersectMeshes("MovedHexaBox1", "MovedHexaBox2", 65250);
72     }
73
74   };
75 }
76 #endif