Salome HOME
Merge from BR_V5_DEV 16Feb09
[tools/medcoupling.git] / src / INTERP_KERNELTest / MultiElementTetraTests.hxx
1 //  Copyright (C) 2007-2008  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.
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 #ifndef __MULTI_ELEMENT_TETRA_TESTS_HXX_
20 #define __MULTI_ELEMENT_TETRA_TESTS_HXX_
21
22 #include "InterpolationTestSuite.hxx"
23
24 namespace INTERP_TEST
25 {
26   /**
27    * \brief Class testing algorithm by intersecting meshes of several 
28    * elements (all tetrahedra) - up to a few thousand. This serves to check the 
29    * filtering methods and the matrix assemblage, as well as verifying
30    * that computation errors do not become unmanageable. It uses mehes of 
31    * different geometries : tetrahedra, boxes and cylinders.
32    *
33    */
34   class MultiElementTetraTests : public InterpolationTestSuite<3,3>
35   {
36     CPPUNIT_TEST_SUITE( MultiElementTetraTests );
37
38     CPPUNIT_TEST( tetraComplexIncluded );
39     CPPUNIT_TEST( dividedUnitTetraSimplerReflexive );
40     CPPUNIT_TEST( dividedUnitTetraReflexive );
41     CPPUNIT_TEST( nudgedDividedUnitTetraSimpler );
42     CPPUNIT_TEST( nudgedDividedUnitTetra );
43     CPPUNIT_TEST( dividedGenTetra );
44     CPPUNIT_TEST( tinyBoxReflexive );
45     CPPUNIT_TEST( moderateBoxEvenSmallerReflexive );
46     CPPUNIT_TEST( moderateBoxSmallReflexive );
47     CPPUNIT_TEST( boxReflexive );
48     CPPUNIT_TEST( boxReflexiveModerate );
49     CPPUNIT_TEST( tetraBoxes );
50     CPPUNIT_TEST( moderateBoxesSmaller );
51     CPPUNIT_TEST( moderateBoxes );
52
53     CPPUNIT_TEST_SUITE_END();
54
55   public:
56
57     /// Tetrahedron situated totally inside another
58     /// \brief Status : pass
59     void tetraComplexIncluded()
60     {
61       _testTools->intersectMeshes("ComplexIncludedTetra", "ComplexIncludingTetra", 17.0156);
62     }
63
64     /// Unit tetrahedron divided in 4 elements intersecting itself.
65     /// \brief Status : pass
66     void dividedUnitTetraSimplerReflexive()
67     {
68       _testTools->intersectMeshes("DividedUnitTetraSimpler", "DividedUnitTetraSimpler", 0.1666667);
69     }
70
71     /// Unit tetrahedron divided in 14 elements intersecting itself.
72     /// \brief Status : pass
73     void dividedUnitTetraReflexive()
74     {
75       _testTools->intersectMeshes("DividedUnitTetra", "DividedUnitTetra", 0.1666667);
76     }
77
78     /// Unit tetrahedron divided in 4 elements intersecting slightly displaced version of itself.
79     /// \brief Status : pass
80     void nudgedDividedUnitTetraSimpler()
81     {
82       _testTools->intersectMeshes("NudgedDividedUnitTetraSimpler", "DividedUnitTetraSimpler", 0.150191);
83     }
84
85     /// Unit tetrahedron divided in 14 elements intersecting slightly displaced version of itself.
86     /// \brief Status : pass
87     void nudgedDividedUnitTetra()
88     {
89       _testTools->intersectMeshes("NudgedDividedUnitTetra", "DividedUnitTetra", 0.150191);
90     }
91
92     /// Two intersecting tetrahedra in general position, one with 23 elements, the other with 643 elements
93     /// \brief Status : pass
94     void dividedGenTetra()
95     {
96       _testTools->intersectMeshes("DividedGenTetra1",  "DividedGenTetra2", 0.546329);
97     }
98
99     /// Large box in general position with 12 elements intersecting itself
100     /// \brief Status : pass
101     void tinyBoxReflexive()
102     {
103       _testTools->intersectMeshes("TinyBox", "TinyBox", 979200);
104     }
105
106     /// Small box in general position with 33 elements intersecting itself
107     /// \brief Status : pass
108     void boxReflexive()
109     {
110       _testTools->intersectMeshes("Box3",  "Box3", 13.9954);
111     }
112
113     /// Box in general position with 67 elements intersecting itself
114     /// \brief Status : pass
115     void moderateBoxEvenSmallerReflexive()
116     {
117       _testTools->intersectMeshes("BoxEvenSmaller1", "BoxEvenSmaller1", 1.44018e6);
118     }
119
120     /// Box in general position with 544 elements intersecting itself
121     /// \brief Status : pass
122     void moderateBoxSmallReflexive()
123     {
124       _testTools->intersectMeshes("BoxModSmall1", "BoxModSmall1", 1.44018e6);
125     }
126
127     /// Large box in general position with 2943 elements intersecting itself
128     /// \brief Status : pass
129     void boxReflexiveModerate()
130     {
131       _testTools->intersectMeshes("Box1Moderate",  "Box1Moderate", 1.0e6);
132     }
133
134     /// Two intersecting boxes in general position with 12 and 18 elements
135     /// \brief Status : pass
136     void tetraBoxes()
137     {
138       _testTools->intersectMeshes("Box1", "Box2", 124.197);
139     }
140     
141     /// Two intersecting boxes in general position with 430 and 544 elements
142     /// \brief Status : pass
143     void moderateBoxesSmaller()
144     {
145       _testTools->intersectMeshes("BoxModSmall1", "BoxModSmall2", 321853);
146     }
147
148     /// Two intersecting boxes in general position with 2943 and 3068 elements
149     /// \brief Status : pass
150     void moderateBoxes()
151     {
152       _testTools->intersectMeshes("Box1Moderate",  "Box2Moderate", 376856);
153     }
154
155   };
156 }
157
158 #endif