Cleanup: Replace deprecated finite with isfinite
authorSimon <intrigus>
Fri, 5 Apr 2019 11:41:28 +0000 (13:41 +0200)
committerJacques Lucke <mail@jlucke.com>
Fri, 5 Apr 2019 11:41:28 +0000 (13:41 +0200)
Differential Revision: https://developer.blender.org/D4649

intern/elbeem/intern/mvmcoords.cpp
intern/elbeem/intern/solver_adap.cpp
intern/elbeem/intern/solver_main.cpp

index 3a465da..407a1b4 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "mvmcoords.h"
 #include <algorithm>
+#include <cmath>
 
 #if defined(_MSC_VER) && _MSC_VER > 1600
 // std::greater
@@ -24,6 +25,7 @@
 
 
 using std::vector;
+using std::isfinite;
 
 void MeanValueMeshCoords::clear() 
 {
@@ -170,8 +172,8 @@ void MeanValueMeshCoords::computeWeights(vector<ntlVec3Gfx> &reference_vertices,
        for (vector<mvmIndexWeight>::iterator viter = tds.weights.begin();
                        viter != tds.weights.end(); ++viter) {
                viter->weight *= invTotalWeight;  
-               //assert(finite(viter->weight) != 0);
-               if(!finite(viter->weight)) viter->weight=0.;
+               //assert(isfinite(viter->weight) != 0);
+               if(!isfinite(viter->weight)) viter->weight=0.;
        }
 }
 
index dc3a93b..9e5619c 100644 (file)
@@ -14,7 +14,9 @@
 #include "solver_relax.h"
 #include "particletracer.h"
 
+#include <cmath>
 
+using std::isfinite;
 
 /*****************************************************************************/
 //! coarse step functions
@@ -1244,7 +1246,7 @@ void LbmFsgrSolver::adaptTimestep() {
                                uz  += (dfDvecZ[l]*m); 
                        } 
 #ifndef WIN32
-                       if (!finite(rho)) {
+                       if (!isfinite(rho)) {
                                errMsg("adaptTimestep","Brute force non-finite rho at"<<PRINT_IJK);  // DEBUG!
                                rho = 1.0;
                                ux = uy = uz = 0.0;
index 9fdefc7..994839f 100644 (file)
@@ -17,6 +17,9 @@
 #include "globals.h"
 
 #include <stdlib.h>
+#include <cmath>
+
+using std::isfinite;
 
 /*****************************************************************************/
 /*! perform a single LBM step */
@@ -216,8 +219,8 @@ void LbmFsgrSolver::stepMain() {
 
 #ifndef WIN32
        // good indicator for instabilities
-       if( (!finite(mMxvx)) || (!finite(mMxvy)) || (!finite(mMxvz)) ) { CAUSE_PANIC; }
-       if( (!finite(mCurrentMass)) || (!finite(mCurrentVolume)) ) { CAUSE_PANIC; }
+       if( (!isfinite(mMxvx)) || (!isfinite(mMxvy)) || (!isfinite(mMxvz)) ) { CAUSE_PANIC; }
+       if( (!isfinite(mCurrentMass)) || (!isfinite(mCurrentVolume)) ) { CAUSE_PANIC; }
 #endif // WIN32
 
        // output total step time
@@ -250,7 +253,7 @@ void LbmFsgrSolver::stepMain() {
        if(!this->mPanic){ FSGR_FORIJK_BOUNDS(mMaxRefine) { \
                if(RFLAG(mMaxRefine,i,j,k,mLevel[mMaxRefine].setCurr)&(CFFluid|CFInter)) { \
                for(int l=0;l<dTotalNum;l++) { \
-                       if(!finite(QCELL(mMaxRefine,i,j,k,mLevel[mMaxRefine].setCurr,l))) { errMsg("NNOFIN"," "<<str<<" at "<<PRINT_IJK<<" l"<<l<<" "); }\
+                       if(!isfinite(QCELL(mMaxRefine,i,j,k,mLevel[mMaxRefine].setCurr,l))) { errMsg("NNOFIN"," "<<str<<" at "<<PRINT_IJK<<" l"<<l<<" "); }\
                }/*for*/ \
                }/*if*/ \
        } }