From d922ac3fa21b5790eca23b92a2143627ff8af001 Mon Sep 17 00:00:00 2001 From: abn Date: Mon, 2 May 2016 15:58:15 +0200 Subject: [PATCH] Minor portability: Cygwin compiler seems to have _X as a standard symbol ... --- src/INTERP_KERNEL/InterpolationUtils.hxx | 14 +++++++------- src/INTERP_KERNEL/UnitTetraIntersectionBary.cxx | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/INTERP_KERNEL/InterpolationUtils.hxx b/src/INTERP_KERNEL/InterpolationUtils.hxx index 0c5a5a949..8f7eaffa6 100644 --- a/src/INTERP_KERNEL/InterpolationUtils.hxx +++ b/src/INTERP_KERNEL/InterpolationUtils.hxx @@ -421,7 +421,7 @@ namespace INTERP_KERNEL */ inline void barycentric_coords(const std::vector& n, const double *p, double *bc) { - enum { _X, _Y, _Z }; + enum { _XX=0, _YY, _ZZ }; switch(n.size()) { case 2: @@ -435,8 +435,8 @@ namespace INTERP_KERNEL { // TRIA3 // matrix 2x2 double - T11 = n[0][_X]-n[2][_X], T12 = n[1][_X]-n[2][_X], - T21 = n[0][_Y]-n[2][_Y], T22 = n[1][_Y]-n[2][_Y]; + T11 = n[0][_XX]-n[2][_XX], T12 = n[1][_XX]-n[2][_XX], + T21 = n[0][_YY]-n[2][_YY], T22 = n[1][_YY]-n[2][_YY]; // matrix determinant double Tdet = T11*T22 - T12*T21; if ( (std::fabs( Tdet) ) < (std::numeric_limits::min()) ) @@ -447,7 +447,7 @@ namespace INTERP_KERNEL // matrix inverse double t11 = T22, t12 = -T12, t21 = -T21, t22 = T11; // vector - double r11 = p[_X]-n[2][_X], r12 = p[_Y]-n[2][_Y]; + double r11 = p[_XX]-n[2][_XX], r12 = p[_YY]-n[2][_YY]; // barycentric coordinates: mutiply matrix by vector bc[0] = (t11 * r11 + t12 * r12)/Tdet; bc[1] = (t21 * r11 + t22 * r12)/Tdet; @@ -462,9 +462,9 @@ namespace INTERP_KERNEL // bc1*( z1 - z4 ) + bc2*( z2 - z4 ) + bc3*( z3 - z4 ) = px - z4 double T[3][4]= - {{ n[0][_X]-n[3][_X], n[1][_X]-n[3][_X], n[2][_X]-n[3][_X], p[_X]-n[3][_X] }, - { n[0][_Y]-n[3][_Y], n[1][_Y]-n[3][_Y], n[2][_Y]-n[3][_Y], p[_Y]-n[3][_Y] }, - { n[0][_Z]-n[3][_Z], n[1][_Z]-n[3][_Z], n[2][_Z]-n[3][_Z], p[_Z]-n[3][_Z] }}; + {{ n[0][_XX]-n[3][_XX], n[1][_XX]-n[3][_XX], n[2][_XX]-n[3][_XX], p[_XX]-n[3][_XX] }, + { n[0][_YY]-n[3][_YY], n[1][_YY]-n[3][_YY], n[2][_YY]-n[3][_YY], p[_YY]-n[3][_YY] }, + { n[0][_ZZ]-n[3][_ZZ], n[1][_ZZ]-n[3][_ZZ], n[2][_ZZ]-n[3][_ZZ], p[_ZZ]-n[3][_ZZ] }}; if ( !solveSystemOfEquations<3>( T, bc ) ) bc[0]=1., bc[1] = bc[2] = bc[3] = 0; diff --git a/src/INTERP_KERNEL/UnitTetraIntersectionBary.cxx b/src/INTERP_KERNEL/UnitTetraIntersectionBary.cxx index e84d1b878..9b4c727cb 100644 --- a/src/INTERP_KERNEL/UnitTetraIntersectionBary.cxx +++ b/src/INTERP_KERNEL/UnitTetraIntersectionBary.cxx @@ -35,7 +35,7 @@ namespace INTERP_KERNEL { - enum { _X=0, _Y, _Z }; + enum { _XX=0, _YY, _ZZ }; inline bool samePoint( const double* p1, const double* p2 ) { @@ -86,7 +86,7 @@ namespace INTERP_KERNEL const std::vector * pPolygonA = &triangle.getPolygonA(); if ( pPolygonA->size() < 3 ) { - if ( !epsilonEqual( triNormal[_Z], 0 )) + if ( !epsilonEqual( triNormal[_ZZ], 0 )) return; // not vertical triangle does not intersect the unit tetra // Vertical triangle. Use inherited methods of TransformedTriangle to @@ -378,8 +378,8 @@ namespace INTERP_KERNEL } // check if the segment p1-p2 is on the inclined side if ( sideFaces[3] && - epsilonEqual( p1[_X] + p1[_Y] + p1[_Z], 1.0 ) && - epsilonEqual( p2[_X] + p2[_Y] + p2[_Z], 1.0 )) + epsilonEqual( p1[_XX] + p1[_YY] + p1[_ZZ], 1.0 ) && + epsilonEqual( p2[_XX] + p2[_YY] + p2[_ZZ], 1.0 )) { sideFaces[3]->push_back( new double[3] ); copyVector3( p1, sideFaces[3]->back() ); -- 2.39.2