1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef _ParaMEDMEMTEST_HXX_
20 #define _ParaMEDMEMTEST_HXX_
22 #include <cppunit/extensions/HelperMacros.h>
30 class ParaMEDMEMTest : public CppUnit::TestFixture
32 CPPUNIT_TEST_SUITE( ParaMEDMEMTest );
33 CPPUNIT_TEST(testMPIProcessorGroup_constructor);
34 CPPUNIT_TEST(testMPIProcessorGroup_boolean);
35 CPPUNIT_TEST(testMPIProcessorGroup_rank);
36 CPPUNIT_TEST(testBlockTopology_constructor);
37 CPPUNIT_TEST(testBlockTopology_serialize);
38 CPPUNIT_TEST(testIntersectionDEC_2D);
39 CPPUNIT_TEST(testIntersectionDEC_2DP0P1);
41 CPPUNIT_TEST(testSynchronousEqualIntersectionWithoutInterpNativeDEC_2D);
42 CPPUNIT_TEST(testSynchronousEqualIntersectionWithoutInterpDEC_2D);
43 CPPUNIT_TEST(testSynchronousEqualIntersectionDEC_2D);
44 CPPUNIT_TEST(testSynchronousFasterSourceIntersectionDEC_2D);
45 CPPUNIT_TEST(testSynchronousSlowerSourceIntersectionDEC_2D);
46 CPPUNIT_TEST(testSynchronousSlowSourceIntersectionDEC_2D);
47 CPPUNIT_TEST(testSynchronousFastSourceIntersectionDEC_2D);
48 CPPUNIT_TEST(testAsynchronousEqualIntersectionDEC_2D);
49 CPPUNIT_TEST(testAsynchronousFasterSourceIntersectionDEC_2D);
50 CPPUNIT_TEST(testAsynchronousSlowerSourceIntersectionDEC_2D);
51 CPPUNIT_TEST(testAsynchronousSlowSourceIntersectionDEC_2D);
52 CPPUNIT_TEST(testAsynchronousFastSourceIntersectionDEC_2D);
54 //can be added again after FVM correction for 2D
55 // CPPUNIT_TEST(testNonCoincidentDEC_2D);
56 CPPUNIT_TEST(testNonCoincidentDEC_3D);
58 CPPUNIT_TEST(testStructuredCoincidentDEC);
59 CPPUNIT_TEST_SUITE_END();
64 ParaMEDMEMTest():CppUnit::TestFixture(){}
68 void testMPIProcessorGroup_constructor();
69 void testMPIProcessorGroup_boolean();
70 void testMPIProcessorGroup_rank();
71 void testBlockTopology_constructor();
72 void testBlockTopology_serialize();
73 void testIntersectionDEC_2D();
74 void testIntersectionDEC_2DP0P1();
76 void testNonCoincidentDEC_2D();
77 void testNonCoincidentDEC_3D();
79 void testStructuredCoincidentDEC();
80 void testSynchronousEqualIntersectionWithoutInterpNativeDEC_2D();
81 void testSynchronousEqualIntersectionWithoutInterpDEC_2D();
82 void testSynchronousEqualIntersectionDEC_2D();
83 void testSynchronousFasterSourceIntersectionDEC_2D();
84 void testSynchronousSlowerSourceIntersectionDEC_2D();
85 void testSynchronousSlowSourceIntersectionDEC_2D();
86 void testSynchronousFastSourceIntersectionDEC_2D();
88 void testAsynchronousEqualIntersectionDEC_2D();
89 void testAsynchronousFasterSourceIntersectionDEC_2D();
90 void testAsynchronousSlowerSourceIntersectionDEC_2D();
91 void testAsynchronousSlowSourceIntersectionDEC_2D();
92 void testAsynchronousFastSourceIntersectionDEC_2D();
96 void testNonCoincidentDEC(const std::string& filename1,
97 const std::string& meshname1,
98 const std::string& filename2,
99 const std::string& meshname2,
100 int nbprocsource, double epsilon);
101 void testAsynchronousIntersectionDEC_2D(double dtA, double tmaxA,
102 double dtB, double tmaxB,
103 bool WithPointToPoint, bool Asynchronous, bool WithInterp, const char *srcMeth, const char *targetMeth);
104 void testIntersectionDEC_2D_(const char *srcMeth, const char *targetMeth);
108 // to automatically remove temporary files from disk
109 class ParaMEDMEMTest_TmpFilesRemover
112 ParaMEDMEMTest_TmpFilesRemover() {}
113 ~ParaMEDMEMTest_TmpFilesRemover();
114 bool Register(const std::string theTmpFile);
117 std::set<std::string> myTmpFiles;
121 * Tool to print array to stream.
124 void ParaMEDMEMTest_DumpArray (std::ostream & stream, const T* array, const int length, const std::string text)
126 stream << text << ": {";
129 for (int i = 1; i < length; i++) {
130 stream << ", " << array[i];
133 stream << "}" << std::endl;