Back to index

salome-med  6.5.0
MEDCouplingBasicsTest.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef __MEDCOUPLINGBASICSTEST_HXX__
00021 #define __MEDCOUPLINGBASICSTEST_HXX__
00022 
00023 #include <cppunit/extensions/HelperMacros.h>
00024 
00025 #include <map>
00026 #include <vector>
00027 
00028 namespace ParaMEDMEM
00029 {
00030   class DataArrayDouble;
00031   class MEDCouplingUMesh;
00032   class MEDCouplingFieldDouble;
00033   class MEDCouplingMultiFields;
00034 
00035   class MEDCouplingBasicsTest : public CppUnit::TestFixture
00036   {
00037   public:
00038     static MEDCouplingUMesh *build3DSourceMesh_2();
00039     static MEDCouplingUMesh *build3DTargetMesh_2();
00040     static MEDCouplingUMesh *build1DTargetMesh_1();
00041     static MEDCouplingUMesh *build2DSourceMesh_1();
00042     static MEDCouplingUMesh *build2DTargetMesh_1();
00043     static MEDCouplingUMesh *build2DTargetMeshPerm_1();
00044     static MEDCouplingUMesh *build2DTargetMesh_2();
00045     static MEDCouplingUMesh *buildCU1DMesh_U();
00046     static MEDCouplingUMesh *buildCU2DMesh_U();
00047     static MEDCouplingUMesh *buildCU3DMesh_U();
00048     static MEDCouplingUMesh *build3DSurfSourceMesh_1();
00049     static MEDCouplingUMesh *build3DSurfSourceMesh_2();
00050     static MEDCouplingUMesh *build3DSurfTargetMesh_1();
00051     static MEDCouplingUMesh *build3DSurfTargetMeshPerm_1();
00052     static MEDCouplingUMesh *build3DSurfTargetMesh_2();
00053     static MEDCouplingUMesh *build3DSourceMesh_1();
00054     static MEDCouplingUMesh *build3DTargetMesh_1();
00055     static MEDCouplingUMesh *build2DTargetMeshMergeNode_1();
00056     static MEDCouplingUMesh *build3DTargetMeshMergeNode_1();
00057     static MEDCouplingUMesh *build3DExtrudedUMesh_1(MEDCouplingUMesh *&mesh2D);
00058     static void build3DExtrudedUMesh_2(MEDCouplingUMesh *&meshN, MEDCouplingUMesh *&meshTT, MEDCouplingUMesh *&meshTF);
00059     static MEDCouplingUMesh *build2DTargetMeshMerged_1();
00060     static MEDCouplingUMesh *build2DCurveMesh(double dx, double dy);
00061     static MEDCouplingUMesh *build1DMesh(double dx);
00062     static MEDCouplingUMesh *build1DSourceMesh_2();
00063     static MEDCouplingUMesh *build1DTargetMesh_2();
00064     static MEDCouplingUMesh *build2DCurveSourceMesh_2();
00065     static MEDCouplingUMesh *build2DCurveTargetMesh_2();
00066     static MEDCouplingUMesh *build1DTargetMesh_3();
00067     static MEDCouplingUMesh *build2DCurveTargetMesh_3();
00068     static MEDCouplingUMesh *build2DTargetMesh_3();
00069     static MEDCouplingUMesh *build3DTargetMesh_3();
00070     static MEDCouplingUMesh *build2DTargetMesh_4();
00071     static MEDCouplingUMesh *build1DMultiTypes_1();
00072     static MEDCouplingUMesh *build2DMultiTypes_1();
00073     static MEDCouplingUMesh *build3DMultiTypes_1();
00074     static MEDCouplingUMesh *buildHexa8Mesh_1();
00075     static MEDCouplingUMesh *buildPointe_1(MEDCouplingUMesh *&m1);
00076 
00077     static MEDCouplingUMesh *build2D1DSourceMesh();
00078     static MEDCouplingUMesh *build2D1DTargetMesh();
00079     static MEDCouplingUMesh *build2D1DSegSourceMesh(const double shiftX = 0.,
00080                                                     const double inclinationX = 0.);
00081     static MEDCouplingUMesh *build2D1DQuadTargetMesh(const double inclinaisonX = 0.);
00082     static MEDCouplingUMesh *build2D1DTriTargetMesh(const double inclinaisonX = 0.);
00083     static MEDCouplingUMesh *build3D2DSourceMesh();
00084     static MEDCouplingUMesh *build3D2DTargetMesh();
00085     static MEDCouplingUMesh* build3D2DQuadSourceMesh(const double shiftX = 0.,
00086                                                      const double inclinationX = 0.);
00087     static MEDCouplingUMesh* build3D2DTriSourceMesh(const double shiftX = 0.,
00088                                                     const double inclinationX = 0.);
00089     static MEDCouplingUMesh* build3D2DTetraTargetMesh(const double inclinaisonX = 0.);
00090     static MEDCouplingUMesh* build3D2DHexaTargetMesh(const double inclinaisonX = 0.);
00091 
00092     static DataArrayDouble *buildCoordsForMultiTypes_1();
00093     static MEDCouplingMultiFields *buildMultiFields_1();
00094     static std::vector<MEDCouplingFieldDouble *> buildMultiFields_2();
00095     static double sumAll(const std::vector< std::map<int,double> >& matrix);
00096   protected:
00097     static int countNonZero(const std::vector< std::map<int,double> >& matrix);
00098 
00099     static void test2D1DMeshesIntersection(MEDCouplingUMesh *sourceMesh,
00100                                            MEDCouplingUMesh *targetMesh,
00101                                            const double correctSurf,
00102                                            const int correctDuplicateFacesNbr,
00103                                            const int correctTotalIntersectFacesNbr = -1);
00104     static void test3D2DMeshesIntersection(MEDCouplingUMesh *sourceMesh,
00105                                            MEDCouplingUMesh *targetMesh,
00106                                            const double correctSurf,
00107                                            const int correctDuplicateFacesNbr,
00108                                            const int correctTotalIntersectFacesNbr = -1);
00109   };
00110 }
00111 
00112 #endif