-// 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
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;
}
// ----------------------------------------------------------------------------------
}
}
- // -- (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))
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
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
{
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
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;