← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3446: -replace abs, max, min by std::abs, std::max, std::min

 

------------------------------------------------------------
revno: 3446
committer: cyuan <chaoyuan2012@xxxxxxxxx>
timestamp: Fri 2014-07-18 23:39:35 +0800
message:
  -replace abs, max, min by std::abs, std::max, std::min
modified:
  pkg/pfv/UnsaturatedEngine.cpp


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'pkg/pfv/UnsaturatedEngine.cpp'
--- pkg/pfv/UnsaturatedEngine.cpp	2014-07-04 14:08:45 +0000
+++ pkg/pfv/UnsaturatedEngine.cpp	2014-07-18 15:39:35 +0000
@@ -20,7 +20,7 @@
   	public:
   	bool isWaterReservoir;
 	bool isAirReservoir;
-	double capillaryCellVolume;//abs(cell.volume) - abs(cell.solid.volume)
+	double capillaryCellVolume;//std::abs(cell.volume) - std::abs(cell.solid.volume)
 	std::vector<double> poreRadius;//pore throat radius for drainage
 	double solidLine [4][4];//the length of intersecting line between sphere and facet. [i][j] is for sphere facet "i" and sphere facetVertices[i][j]. Last component for 1/sumLines in the facet.
 	double trapCapP;//for calculating the pressure of trapped phase, cell.pressureTrapped = pressureAir - trapCapP.
@@ -244,13 +244,13 @@
         for (FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++) {
             if (tri.is_infinite(cell)) continue;
             if (cell->info().Pcondition) continue;//NOTE:reservoirs cells should not be included in totalCellVolume
-            totalCellVolume = totalCellVolume + abs( cell->info().volume() );}}
+            totalCellVolume = totalCellVolume + std::abs( cell->info().volume() );}}
     else {
         for (FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++) {
             if (tri.is_infinite(cell)) continue;
             if (cell->info().Pcondition) continue;//NOTE:reservoirs cells should not be included in totalCellVolume
             if (cell->info().isFictious) continue;
-            totalCellVolume = totalCellVolume + abs( cell->info().volume() );}}
+            totalCellVolume = totalCellVolume + std::abs( cell->info().volume() );}}
 }
 
 void UnsaturatedEngine::updateVolumeCapillaryCell()
@@ -260,7 +260,7 @@
     FiniteCellsIterator cellEnd = tri.finite_cells_end();
     CellHandle neighbourCell;
     for (FiniteCellsIterator cell = tri.finite_cells_begin(); cell != cellEnd; cell++) {
-        cell->info().capillaryCellVolume = abs( cell->info().volume() ) - solver->volumeSolidPore(cell);
+        cell->info().capillaryCellVolume = std::abs( cell->info().volume() ) - solver->volumeSolidPore(cell);
     }
 }
 
@@ -462,7 +462,7 @@
                 if ( (cell->neighbor(facet)->info().isFictious) && (!isInvadeBoundary) ) continue;
                 if ( cell->neighbor(facet)->info().isWaterReservoir == true ) {
                     double nCellP = surfaceTension/cell->info().poreRadius[facet];
-                    nextEntry = min(nextEntry,nCellP);}}}}
+                    nextEntry = std::min(nextEntry,nCellP);}}}}
                     
     if (nextEntry==1e50) {
         cout << "End drainage !" << endl;
@@ -513,7 +513,7 @@
 
 double UnsaturatedEngine::computeCellInterfacialArea(CellHandle cell, int j, double rC)
 {
-    double rInscribe = abs(solver->computeEffectiveRadius(cell, j));  
+    double rInscribe = std::abs(solver->computeEffectiveRadius(cell, j));  
     CellHandle cellh = CellHandle(cell);
     int facetNFictious = solver->detectFacetFictiousVertices (cellh,j);
     
@@ -568,7 +568,7 @@
 
 double UnsaturatedEngine::computeEffPoreRadius(CellHandle cell, int j)
 {
-    double rInscribe = abs(solver->computeEffectiveRadius(cell, j));
+    double rInscribe = std::abs(solver->computeEffectiveRadius(cell, j));
     CellHandle cellh = CellHandle(cell);
     int facetNFictious = solver->detectFacetFictiousVertices (cellh,j);
     double r;
@@ -599,8 +599,8 @@
     g[1] = ((e[1]-r[2]-r[0])>0) ? 0.5*(e[1]-r[2]-r[0]):0 ;
     g[2] = ((e[2]-r[0]-r[1])>0) ? 0.5*(e[2]-r[0]-r[1]):0 ;
     
-    double rmin= (max(g[0],max(g[1],g[2]))==0) ? 1.0e-10:max(g[0],max(g[1],g[2])) ;
-    double rmax = abs(solver->computeEffectiveRadius(cell, j));
+    double rmin= (std::max(g[0],std::max(g[1],g[2]))==0) ? 1.0e-10:std::max(g[0],std::max(g[1],g[2])) ;
+    double rmax = std::abs(solver->computeEffectiveRadius(cell, j));
 //     if(rmin>rmax) { cerr<<"WARNING! rmin>rmax. rmin="<<rmin<<" ,rmax="<<rmax<<endl; }
     
     double deltaForceRMin = computeDeltaForce(cell,j,rmin);
@@ -628,7 +628,7 @@
 double UnsaturatedEngine::bisection(CellHandle cell, int j, double a, double b)
 {
     double m = 0.5*(a+b);
-    if (abs(b-a)>abs((solver->computeEffectiveRadius(cell, j)*1.0e-6))) {
+    if (std::abs(b-a)>std::abs((solver->computeEffectiveRadius(cell, j)*1.0e-6))) {
         if ( computeDeltaForce(cell,j,m) * computeDeltaForce(cell,j,a) < 0 ) {
             b = m;
             return bisection(cell,j,a,b);}
@@ -772,14 +772,14 @@
     g[1] = ((e[1]-r[2]-r[0])>0) ? 0.5*(e[1]-r[2]-r[0]):0 ;
     g[2] = ((e[2]-r[0]-r[1])>0) ? 0.5*(e[2]-r[0]-r[1]):0 ;
     
-    double rmin= (max(g[0],max(g[1],g[2]))==0) ? 1.0e-10:max(g[0],max(g[1],g[2])) ;
+    double rmin= (std::max(g[0],std::max(g[1],g[2]))==0) ? 1.0e-10:std::max(g[0],std::max(g[1],g[2])) ;
     return rmin;
 }
 double UnsaturatedEngine::getRMax(CellHandle cell, int j)
 {
     RTriangulation& tri = solver->T[solver->currentTes].Triangulation();
     if (tri.is_infinite(cell->neighbor(j))) {return 0;cerr<<"tri.is_infinite(cell->neighbor(j)"<<endl;}
-    double rmax = abs(solver->computeEffectiveRadius(cell, j));//rmin>rmax ?
+    double rmax = std::abs(solver->computeEffectiveRadius(cell, j));//rmin>rmax ?
     return rmax;
 }
 void UnsaturatedEngine::checkRCompare()
@@ -1037,7 +1037,7 @@
                     CVector fluidSurfk = cell->info().facetSurfaces[j]*cell->info().facetFluidSurfacesRatio[j];
                     /// handle fictious vertex since we can get the projected surface easily here
                     if (cell->vertex(j)->info().isFictious) {
-                        Real projSurf=abs(Surfk[solver->boundary(cell->vertex(j)->info().id()).coordinate]);
+                        Real projSurf=std::abs(Surfk[solver->boundary(cell->vertex(j)->info().id()).coordinate]);
                         tempVect=-projSurf*solver->boundary(cell->vertex(j)->info().id()).normal;
                         cell->vertex(j)->info().forces = cell->vertex(j)->info().forces+tempVect*cell->info().p();
                         //define the cached value for later use with cache*p