Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __TU_MESH_TEST_TOOLKIT_HXX__
00021 #define __TU_MESH_TEST_TOOLKIT_HXX__
00022
00023 #include "Interpolation3D.hxx"
00024 #include "Interpolation3D.txx"
00025 #include "InterpolationPlanar.hxx"
00026
00027 #include <vector>
00028 #include <map>
00029
00030 #define ERR_TOL 1.0e-8
00031
00032 typedef std::vector<std::map<int,double> > IntersectionMatrix;
00033
00034 namespace INTERP_KERNEL
00035 {
00036 class Interpolation3D;
00037 }
00038
00039
00040 namespace MEDMEM {
00041 class MESH;
00042 };
00043
00044 namespace INTERP_TEST
00045 {
00050 template<int SPACEDIM, int MESHDIM>
00051 class MeshTestToolkit
00052 {
00053
00054 public:
00055 double _precision;
00056 INTERP_KERNEL::IntersectionType _intersectionType;
00057
00058 MeshTestToolkit():_precision(1.e-6),_intersectionType(INTERP_KERNEL::Triangulation) {}
00059
00060 ~MeshTestToolkit() {}
00061
00062 void intersectMeshes(const char* mesh1, const char* mesh2, const double correctVol, const double prec = 1.0e-5, bool doubleTest = true) const;
00063
00064
00065 void intersectMeshes(const char* mesh1path, const char* mesh1, const char* mesh2path, const char* mesh2, const double correctVol, const double prec = 1.0e-5, bool doubleTest = true) const;
00066
00067 void dumpIntersectionMatrix(const IntersectionMatrix& m) const;
00068
00069 double sumRow(const IntersectionMatrix& m, int i) const;
00070
00071 double sumCol(const IntersectionMatrix& m, int i) const;
00072
00073 void getVolumes( MEDMEM::MESH& mesh, double* tab) const;
00074
00075 bool testVolumes(const IntersectionMatrix& m, MEDMEM::MESH& sMesh, MEDMEM::MESH& tMesh) const;
00076
00077 double sumVolume(const IntersectionMatrix& m) const;
00078
00079 bool areCompatitable( const IntersectionMatrix& m1, const IntersectionMatrix& m2) const;
00080
00081 bool testTranspose(const IntersectionMatrix& m1, const IntersectionMatrix& m2) const;
00082
00083 bool testDiagonal(const IntersectionMatrix& m) const;
00084
00085 void calcIntersectionMatrix(const char* mesh1path, const char* mesh1, const char* mesh2path, const char* mesh2, IntersectionMatrix& m) const;
00086
00087 };
00088 }
00089 #endif