← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 4085: replace abs by std::abs (complement of https://github.com/yade/trunk/commit/1997c194c0aa759cae101...

 

------------------------------------------------------------
revno: 4085
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
timestamp: Wed 2014-07-16 18:49:41 +0200
message:
  replace abs by std::abs (complement of https://github.com/yade/trunk/commit/1997c194c0aa759cae101a3dd0a559fcf049b29f)
modified:
  lib/triangulation/FlowBoundingSphere.ipp
  lib/triangulation/Network.ipp


--
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 'lib/triangulation/FlowBoundingSphere.ipp'
--- lib/triangulation/FlowBoundingSphere.ipp	2014-07-02 16:18:24 +0000
+++ lib/triangulation/FlowBoundingSphere.ipp	2014-07-16 16:49:41 +0000
@@ -116,7 +116,7 @@
 		//This is the influx term
 		if (cell->info().Pcondition) cell->info().averageVelocity() = cell->info().averageVelocity() - (totFlowRate)*((Point) cell->info()-CGAL::ORIGIN );
 		//now divide by volume
-		cell->info().averageVelocity() = cell->info().averageVelocity() /abs(cell->info().volume());
+		cell->info().averageVelocity() = cell->info().averageVelocity() /std::abs(cell->info().volume());
 	}
 }
 
@@ -239,7 +239,7 @@
 	double pressure = 0.f;
 	int cell=0;
 	for (int i=0; i<captures; i++){
-        for (double Z=min(zMin,zMax); Z<=max(zMin,zMax); Z+=abs(Rz)) {
+        for (double Z=min(zMin,zMax); Z<=max(zMin,zMax); Z+=std::abs(Rz)) {
 		permeameter = Tri.locate(Point(X, Y, Z));
 		pressure+=permeameter->info().p();
 		cell++;
@@ -318,7 +318,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[boundary(cell->vertex(j)->info().id()).coordinate]);
+						Real projSurf=std::abs(Surfk[boundary(cell->vertex(j)->info().id()).coordinate]);
 						tempVect=-projSurf*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
@@ -526,7 +526,7 @@
 					if (S0==0) S0=checkSphereFacetOverlap(v1,v2,v0);
 					if (S0==0) S0=checkSphereFacetOverlap(v2,v0,v1);
 					//take absolute value, since in rare cases the surface can be negative (overlaping spheres)
-					fluidArea=abs(area-crossSections[0]-crossSections[1]-crossSections[2]+S0);
+					fluidArea=std::abs(area-crossSections[0]-crossSections[1]-crossSections[2]+S0);
 					cell->info().facetFluidSurfacesRatio[j]=fluidArea/area;
 					k=(fluidArea * pow(radius,2)) / (8*viscosity*distance);
 					 meanDistance += distance;
@@ -988,7 +988,7 @@
         double viscosity = viscosity;
         double gravity = 1;
         double Vdarcy = Q1/Section;
-	double DeltaP = abs(PInf-PSup);
+	double DeltaP = std::abs(PInf-PSup);
 	double DeltaH = DeltaP/ (density*gravity);
 	double k = viscosity*Vdarcy*DeltaY / DeltaP; /**m²**/
 	double Ks = k*(density*gravity)/viscosity; /**m/s**/
@@ -1185,7 +1185,7 @@
         boundary(yMaxId).flowCondition=0;
         boundary(yMinId).value=0;
         boundary(yMaxId).value=1;
-	double pZero = abs((boundary(yMinId).value-boundary(yMaxId).value)/2);
+	double pZero = std::abs((boundary(yMinId).value-boundary(yMaxId).value)/2);
 	initializePressure( pZero );
 	gaussSeidel();
 	const char *kk = "Permeability";
@@ -1214,8 +1214,8 @@
         double Ry = (yMax-yMin) /intervals;
         double Rz = (zMax-zMin) /intervals;
 	double X=0.5;
-                for (double Y=min(yMax,yMin); Y<=max(yMax,yMin); Y=Y+abs(Ry)) {
-                        for (double Z=min(zMin,zMax); Z<=max(zMin,zMax); Z=Z+abs(Rz)) {
+                for (double Y=min(yMax,yMin); Y<=max(yMax,yMin); Y=Y+std::abs(Ry)) {
+                        for (double Z=min(zMin,zMax); Z<=max(zMin,zMax); Z=Z+std::abs(Rz)) {
 			  permeameter = Tri.locate(Point(X, Y, Z));
 			  consFile << permeameter->info().p() <<" ";
                         }

=== modified file 'lib/triangulation/Network.ipp'
--- lib/triangulation/Network.ipp	2014-07-02 16:18:24 +0000
+++ lib/triangulation/Network.ipp	2014-07-16 16:49:41 +0000
@@ -15,6 +15,8 @@
 #define FAST
 
 namespace CGT {
+	
+using std::abs;
 
 // 	template<class Tesselation> const double Network<Tesselation>::FAR = 50000;
 	template<class Tesselation> const double Network<Tesselation>::ONE_THIRD = 1.0/3.0;