Salome HOME
Copyright update 2022
[tools/medcoupling.git] / src / INTERP_KERNEL / TransformedTriangleMath.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 12ae621..3785f2d
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -79,7 +79,7 @@ namespace INTERP_KERNEL
   void TransformedTriangle::resetNearZeroCoordinates()
   {
     for (int i=0; i<15; i++)
-      if (fabs(_coords[i])<TransformedTriangle::MACH_EPS*20.0) _coords[i]=0.0;
+      if (fabs(_coords[i])<TransformedTriangle::MACH_EPS*40.0) _coords[i]=0.0;
   }
   
   // ----------------------------------------------------------------------------------
@@ -127,7 +127,7 @@ namespace INTERP_KERNEL
           }
       }
   
-    // -- (2) check that each double product statisfies Grandy, [47], else set to 0
+    // -- (2) check that each double product satisfies Grandy, [47], else set to 0
     for(TriSegment seg = PQ ; seg <= RP ; seg = TriSegment(seg + 1))
       {
         for(DoubleProduct dp = C_YZ ; dp <=  C_10 ; dp = DoubleProduct(dp + 1))
@@ -146,7 +146,7 @@ namespace INTERP_KERNEL
 
             const long double delta = MULT_PREC_F * ( std::fabs(term1) + std::fabs(term2) );
          
-            if( epsilonEqual(_doubleProducts[8*seg + dp], 0.0, THRESHOLD_F * delta))
+            if( epsilonEqual(_doubleProducts[8*seg + dp], 0.0, (double)(THRESHOLD_F * delta)))
               {
                 // debug output
 #if LOG_LEVEL >= 5
@@ -182,13 +182,13 @@ namespace INTERP_KERNEL
 
     LOG(2, "for seg " << seg << " consistency " << term1 + term2 + term3 );
     LOG(2, "term1 :" << term1 << " term2 :" << term2 << " term3: " << term3 );
-    
+
     const int num_zero = (term1 == 0.0 ? 1 : 0) + (term2 == 0.0 ? 1 : 0) + (term3 == 0.0 ? 1 : 0);
     const int num_neg = (term1 < 0.0 ? 1 : 0) + (term2 < 0.0 ? 1 : 0) + (term3 < 0.0 ? 1 : 0);
     const int num_pos = (term1 > 0.0 ? 1 : 0) + (term2 > 0.0 ? 1 : 0) + (term3 > 0.0 ? 1 : 0);
-    
+
     assert( num_zero + num_neg + num_pos == 3 );
-    
+
     // calculated geometry is inconsistent if we have one of the following cases
     // * one term zero and the other two of the same sign
     // * two terms zero
@@ -270,7 +270,7 @@ namespace INTERP_KERNEL
           {
             const DoubleProduct dp = DP_FOR_DETERMINANT_EXPANSION[3*corner + (row - 1)];
 
-            // get edge by using correspondance between Double Product and Edge
+            // get edge by using correspondence between Double Product and Edge
             TetraEdge edge = TetraEdge(dp);
            
             // use edge only if it is surrounded by the surface
@@ -485,7 +485,7 @@ namespace INTERP_KERNEL
     const long double delta = MULT_PREC_F * (std::fabs(p_term) + std::fabs(q_term) + std::fabs(r_term));
 #endif
 
-    if( epsilonEqual( p_term + q_term + r_term, 0.0, THRESHOLD_F * delta) )
+    if( epsilonEqual( p_term + q_term + r_term, 0.0, (double)(THRESHOLD_F * delta)) )
       {
         LOG(4, "Reset imprecise triple product for corner " << corner << " to zero" ); 
         return 0.0;