1 // Copyright (C) 2007-2014 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, or (at your option) any later version.
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
20 #ifndef __MEDPARTITIONERTEST_HXX__
21 #define __MEDPARTITIONERTEST_HXX__
24 # if defined MEDPARTITIONERTEST_EXPORTS || defined MEDPARTITIONERTest_EXPORTS
25 # define MEDPARTITIONERTEST_EXPORT __declspec( dllexport )
27 # define MEDPARTITIONERTEST_EXPORT __declspec( dllimport )
30 # define MEDPARTITIONERTEST_EXPORT
34 #include <cppunit/extensions/HelperMacros.h>
40 #include "MEDCouplingUMesh.hxx"
41 #include "MEDCouplingExtrudedMesh.hxx"
42 #include "MEDCouplingFieldDouble.hxx"
44 class MEDPARTITIONERTEST_EXPORT MEDPARTITIONERTest : public CppUnit::TestFixture
46 CPPUNIT_TEST_SUITE( MEDPARTITIONERTest );
47 CPPUNIT_TEST( testMeshCollectionSingle );
48 CPPUNIT_TEST( testMeshCollectionXml );
49 #if defined(MED_ENABLE_METIS)
50 CPPUNIT_TEST( testMeshCollectionSinglePartitionMetis );
51 CPPUNIT_TEST( testMeshCollectionComplexPartitionMetis );
52 CPPUNIT_TEST( testMetisSmallSize );
54 #if defined(MED_ENABLE_SCOTCH)
55 CPPUNIT_TEST( testMeshCollectionSinglePartitionScotch );
56 CPPUNIT_TEST( testMeshCollectionComplexPartitionScotch );
57 CPPUNIT_TEST( testScotchSmallSize );
60 #if defined(HAVE_MPI2)
61 #if defined(MED_ENABLE_PARMETIS)
62 //test with mpi on system
63 CPPUNIT_TEST( testMpirunSmallSize );
64 CPPUNIT_TEST( testMpirunMedianSize );
65 CPPUNIT_TEST( testMpirunHugeSize );
69 CPPUNIT_TEST( testCreateBoundaryFaces2D ); // imp 0021756
71 //CPPUNIT_TEST( deleteTestMeshes );
72 CPPUNIT_TEST_SUITE_END();
77 int _ni; //nb of hexa9
81 std::string _file_name; //initial test mesh file med CUBE3D
82 std::string _file_name_with_faces; //initial test mesh file med CUBE3D plus a set of faces
83 std::string _file_name2; //initial test mesh file med CARRE3D
84 std::string _file_name_huge_xml;
86 std::string _mesh_name; //initial test mesh file med
90 void setSize(int ni, int nj, int nk);
94 std::string getPartitionerExe() const;
95 ParaMEDMEM::MEDCouplingUMesh * buildCUBE3DMesh();
96 ParaMEDMEM::MEDCouplingUMesh * buildFACE3DMesh();
97 ParaMEDMEM::MEDCouplingUMesh * buildCARRE3DMesh();
98 ParaMEDMEM::MEDCouplingFieldDouble * buildVecFieldOnCells(std::string myfileName);
99 ParaMEDMEM::MEDCouplingFieldDouble * buildVecFieldOnNodes();
100 void createTestMeshWithoutField();
101 void createTestMeshWithVecFieldOnCells();
102 void createTestMeshWithVecFieldOnNodes();
103 void verifyTestMeshWithVecFieldOnNodes();
104 void verifyMetisOrScotchMedpartitionerOnSmallSizeForMesh(std::string MetisOrScotch);
105 void verifyMetisOrScotchMedpartitionerOnSmallSizeForFieldOnCells(std::string MetisOrScotch);
106 void verifyMetisOrScotchMedpartitionerOnSmallSizeForFieldOnGaussNe(std::string MetisOrScotch);
107 void verifyMedpartitionerOnSmallSizeForMesh();
108 void verifyMedpartitionerOnSmallSizeForFieldOnCells();
109 void verifyMedpartitionerOnSmallSizeForFieldOnGaussNe();
110 void createTestMeshes();
111 void createHugeTestMesh(int ni, int nj, int nk, int nbx, int nby, int nbz, int nbTarget);
112 void launchMetisOrScotchMedpartitionerOnTestMeshes(std::string MetisOrScotch);
113 void launchMedpartitionerOnTestMeshes();
114 void launchMedpartitionerOnHugeTestMeshes();
115 void deleteTestMeshes();
120 void testMeshCollectionSingle();
121 void testMeshCollectionXml();
122 #if defined(MED_ENABLE_METIS)
123 void testMeshCollectionSinglePartitionMetis();
124 void testMeshCollectionComplexPartitionMetis();
125 void testMetisSmallSize();
127 #if defined(MED_ENABLE_SCOTCH)
128 void testMeshCollectionSinglePartitionScotch();
129 void testMeshCollectionComplexPartitionScotch();
130 void testScotchSmallSize();
133 #if defined(HAVE_MPI2)
134 void testMpirunSmallSize();
135 void testMpirunMedianSize();
136 void testMpirunHugeSize();
139 void testCreateBoundaryFaces2D();