Salome HOME
Adding test of self intersecting quadratic mesh.
[tools/medcoupling.git] / src / INTERP_KERNELTest / MeshTestToolkit.txx
index 28ce7bde9511e07b6af5200b85121fd385ed2dd0..0c551bbfa83ef952cb09d86bdc6bed2f931219f0 100644 (file)
@@ -160,7 +160,7 @@ namespace INTERP_TEST
 
     for(int i = 0; i < sMesh.getNumberOfCells(); ++i)
       {
-        const double sum_row = sumRow(m, i+1);
+        const double sum_row = sumRow(m, i);
         if(!epsilonEqualRelative(sum_row, fabs(sVol[i]), _precision))
           {
             LOG(1, "Source volume inconsistent : vol of cell " << i << " = " << sVol[i] << " but the row sum is " << sum_row );
@@ -206,11 +206,11 @@ namespace INTERP_TEST
         for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
           {
             int j = iter2->first;
-            if(m2.at(j-1).count(i+1) == 0)
+            if(m2.at(j).count(i) == 0)
               {
                 if(!epsilonEqual(iter2->second, 0.0, _precision))
                   {
-                    LOG(2, "V1( " << i << ", " << j << ") exists, but V2( " << j - 1 << ", " << i + 1 << ") " << " does not " );
+                    LOG(2, "V1( " << i << ", " << j << ") exists, but V2( " << j << ", " << i << ") " << " does not " );
                     LOG(2, "(" << i << ", " << j << ") fails");
                     compatitable = false;
                   }
@@ -251,11 +251,11 @@ namespace INTERP_TEST
             const double v1 = fabs(iter2->second);
             //if(m2[j - 1].count(i+1) > 0)
             //  {
-            std::map<int, double> theMap =  m2.at(j-1);
-            const double v2 = fabs(theMap[i + 1]); 
+            std::map<int, double> theMap =  m2.at(j);
+            const double v2 = fabs(theMap[i]); 
             if(v1 != v2)
               {
-                LOG(2, "V1( " << i << ", " << j << ") = " << v1 << " which is different from V2( " << j - 1 << ", " << i + 1 << ") = " << v2 << " | diff = " << v1 - v2 );
+                LOG(2, "V1( " << i << ", " << j << ") = " << v1 << " which is different from V2( " << j << ", " << i << ") = " << v2 << " | diff = " << v1 - v2 );
                 if(!epsilonEqualRelative(v1, v2, _precision))
                   {
                     LOG(2, "(" << i << ", " << j << ") fails");
@@ -283,7 +283,7 @@ namespace INTERP_TEST
   bool MeshTestToolkit<SPACEDIM,MESHDIM>::testDiagonal(const IntersectionMatrix& m) const
   {
     LOG(1, "Checking if matrix is diagonal" );
-    int i = 1;
+    int i = 0;
     bool isDiagonal = true;
     for(IntersectionMatrix::const_iterator iter = m.begin() ; iter != m.end() ; ++iter)
       {
@@ -293,7 +293,7 @@ namespace INTERP_TEST
             const double vol = iter2->second;
             if(vol != 0.0 && (i != j))
               {
-                LOG(2, "V( " << i - 1 << ", " << j << ") = " << vol << " which is not zero" );
+                LOG(2, "V( " << i << ", " << j << ") = " << vol << " which is not zero" );
                 if(!epsilonEqual(vol, 0.0, _precision))
                   {
                     LOG(2, "(" << i << ", " << j << ") fails");