← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3734: Clean some unused macroses (old wm3-stuff)

 

------------------------------------------------------------
revno: 3734
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Fri 2015-11-06 21:00:30 +0100
message:
  Clean some unused macroses (old wm3-stuff)
modified:
  lib/base/Logging.hpp
  pkg/dem/Shop_01.cpp
  pkg/dem/Shop_02.cpp
  pkg/dem/Tetra.cpp
  pkg/dem/Tetra.hpp


--
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/base/Logging.hpp'
--- lib/base/Logging.hpp	2014-07-03 19:08:46 +0000
+++ lib/base/Logging.hpp	2015-11-06 20:00:30 +0000
@@ -24,37 +24,25 @@
 	# define LOG_INFO(msg)  _POOR_MANS_LOG("INFO ",msg)
 	# define LOG_DEBUG(msg) _POOR_MANS_LOG("DEBUG",msg)
 #else
-	# define LOG_TRACE(msg) // _POOR_MANS_LOG("TRACE",msg)
-	# define LOG_INFO(msg)  // _POOR_MANS_LOG("INFO ",msg)
-	# define LOG_DEBUG(msg) // _POOR_MANS_LOG("DEBUG",msg)
+	# define LOG_TRACE(msg)
+	# define LOG_INFO(msg)
+	# define LOG_DEBUG(msg)
 #endif
 
 
-#	define LOG_WARN(msg)  _POOR_MANS_LOG("WARN ",msg)
-#	define LOG_ERROR(msg) _POOR_MANS_LOG("ERROR",msg)
-#	define LOG_FATAL(msg) _POOR_MANS_LOG("FATAL",msg)
+#define LOG_WARN(msg)  _POOR_MANS_LOG("WARN ",msg)
+#define LOG_ERROR(msg) _POOR_MANS_LOG("ERROR",msg)
+#define LOG_FATAL(msg) _POOR_MANS_LOG("FATAL",msg)
 
-#	define DECLARE_LOGGER
-#	define CREATE_LOGGER(classname)
+#define DECLARE_LOGGER
+#define CREATE_LOGGER(classname)
 
 
 // these macros are temporary
 #define TRACE LOG_TRACE("Been here")
 #define _TRVHEAD cerr<<__FILE__<<":"<<__LINE__<<":"<<__FUNCTION__<<": "
 #define _TRV(x) #x"="<<x<<"; "
-#define _TRVTAIL "\n"
 #define TRVAR1(a) LOG_TRACE( _TRV(a) );
 #define TRVAR2(a,b) LOG_TRACE( _TRV(a) << _TRV(b) );
 #define TRVAR3(a,b,c) LOG_TRACE( _TRV(a) << _TRV(b) << _TRV(c) );
 #define TRVAR4(a,b,c,d) LOG_TRACE( _TRV(a) << _TRV(b) << _TRV(c) << _TRV(d) );
-#define TRVAR5(a,b,c,d,e) LOG_TRACE( _TRV(a) << _TRV(b) << _TRV(c) << _TRV(d) << _TRV(e) );
-#define TRVAR6(a,b,c,d,e,f) LOG_TRACE( _TRV(a) << _TRV(b) << _TRV(c) << _TRV(d) << _TRV(e) << _TRV(f));
-// prints boost matrix
-#define TRMAT(MAT) _TRVHEAD<< #MAT "=(";for(unsigned i=0; i<MAT.size1(); i++){cerr<<"(";for(unsigned j=0; j<MAT.size2(); j++){ cerr<<MAT(i,j)<<" "; } cerr<<")"; } cerr<<")"; cerr<<_TRVTAIL
-// dtto, but for matrix of vectors; maybe the previos macro could handle that also.
-#define TRMATVEC(MAT) _TRVHEAD<< #MAT "=(";for(unsigned i=0; i<MAT.size1(); i++){cerr<<"(";for(unsigned j=0; j<MAT.size2(); j++){ cerr<<"["<<static_cast<Vector3r>(MAT(i,j))<<"]"; } cerr<<")"; } cerr<<")"; cerr<<_TRVTAIL
-// show Matrix3 from the wm3 library 
-#define TRWM3MAT(_M)	LOG_TRACE(#_M "=(("<<_M(0,0)<<" "<<_M(0,1)<<" "<<_M(0,2)<<")("<<_M(1,0)<<" "<<_M(1,1)<<" "<<_M(1,2)<<")("<<_M(2,0)<<" "<<_M(2,1)<<" "<<_M(2,2)<<"))");
-#define TRWM3VEC(_V) LOG_TRACE(#_V "=("<<_V[0]<<" "<<_V[1]<<" "<<_V[2]<<")")
-#define TRWM3QUAT(_Q) LOG_TRACE(#_Q "=("<<_Q[0]<<" "<<_Q[1]<<" "<<_Q[2]<<" "<<_Q[3]<<")")
-

=== modified file 'pkg/dem/Shop_01.cpp'
--- pkg/dem/Shop_01.cpp	2015-07-20 12:45:42 +0000
+++ pkg/dem/Shop_01.cpp	2015-11-06 20:00:30 +0000
@@ -83,8 +83,6 @@
 		if(flip(i,j)!=double(int(flip(i,j)))) LOG_WARN("Flip matrix entry "<<flip(i,j)<<" at ["<<i<<","<<j<<"] not integer?! (will be rounded)");
 		trsfInc(i,j)=int(flip(i,j))*size[j]/size[i];
 	}
-	TRWM3MAT(cell->trsf);
-	TRWM3MAT(trsfInc);
 	cell->trsf+=trsfInc;
 	cell->postLoad(*cell);
 

=== modified file 'pkg/dem/Shop_02.cpp'
--- pkg/dem/Shop_02.cpp	2015-07-20 17:52:39 +0000
+++ pkg/dem/Shop_02.cpp	2015-11-06 20:00:30 +0000
@@ -93,12 +93,9 @@
 	}
 	else{
 		// Real hPeriodStart=(periodStart-theta0)*dH_dTheta;
-		//TRVAR4(hPeriodStart,periodStart,theta0,theta);
 		//Real h=Shop::periodicWrap(pt[axis]-hRef,hPeriodStart,hPeriodStart+2*Mathr::PI*dH_dTheta,&period);
 		theta=Shop::periodicWrap(theta,periodStart,periodStart+2*Mathr::PI,&period);
 		Real h=pt[axis]-hRef+period*2*Mathr::PI*dH_dTheta;
-		//TRVAR3(pt[axis],pt[axis]-hRef,period);
-		//TRVAR2(h,theta);
 		return boost::make_tuple(r,h,theta);
 	}
 }

=== modified file 'pkg/dem/Tetra.cpp'
--- pkg/dem/Tetra.cpp	2014-10-15 06:44:01 +0000
+++ pkg/dem/Tetra.cpp	2015-11-06 20:00:30 +0000
@@ -688,12 +688,10 @@
 	Vector3r Sg(0,0,0); // static moment of intersection
 
 	Vector3r tt[4]; for(int i=0; i<4; i++) tt[i]=tA.v[i];
-	//DEBUG TRWM3VEC(tt[0]); TRWM3VEC(tt[1]); TRWM3VEC(tt[2]); TRWM3VEC(tt[3]); TRVAR1(TetrahedronVolume(tA.v)); TRVAR1(TetrahedronVolume(tt)); TRWM3MAT(TetrahedronInertiaTensor(tA.v));
 
 	for(list<Tetra>::iterator II=tAB.begin(); II!=tAB.end(); II++){
 		Real dV=TetrahedronVolume(II->v);
 		V+=dV;
-		//DEBUG TRVAR1(dV); TRWM3VEC(II->v[0]); TRWM3VEC(II->v[1]); TRWM3VEC(II->v[2]); TRWM3VEC(II->v[3]); LOG_TRACE("====")
 		Sg+=dV*(II->v[0]+II->v[1]+II->v[2]+II->v[3])*.25;
 	}
 	Vector3r centroid=Sg/V;
@@ -742,8 +740,7 @@
 	 *
 	 * In our case, the greatest inertia is along ixxx, the other coordinates are ixx and ix. equivalentPenetrationDepth means what was z.
 	 */
-	//DEBUG
-	TRWM3MAT(Ip); TRWM3MAT(I);
+
 	Real equivalentPenetrationDepth=sqrt(6.*(Ip(ix,ix)+Ip(ixx,ixx)-Ip(ixxx,ixxx))/V);
 	Real equivalentCrossSection=V/equivalentPenetrationDepth;
 	TRVAR3(V,equivalentPenetrationDepth,equivalentCrossSection);
@@ -804,7 +801,6 @@
 		const Vector3r& P(B.v[i]); // reference point on the plane
 		normal=(B.v[i1]-P).cross(B.v[i2]-P); normal.normalize(); // normal
 		if((B.v[i3]-P).dot(normal)>0) normal*=-1; // outer normal
-		/* TRWM3VEC(P); TRWM3VEC(normal); LOG_TRACE("DUMP initial tetrahedron list:"); for(list<Tetra>::iterator I=ret.begin(); I!=ret.end(); I++) (*I).dump(); */
 		for(list<Tetra>::iterator I=ret.begin(); I!=ret.end(); /* I++ */ ){
 			list<Tetra> splitDecomposition=TetraClipByPlane(*I,P,normal);
 			// replace current list element by the result of decomposition;
@@ -852,8 +848,6 @@
 	// scaling factor for Mathr::EPSILON: average edge length
 	Real scaledEPSILON=Mathr::EPSILON*(1/6.)*((T.v[1]-T.v[0])+(T.v[2]-T.v[0])+(T.v[3]-T.v[0])+(T.v[2]-T.v[1])+(T.v[3]-T.v[1])+(T.v[3]-T.v[2])).norm();
 
-	/* TRWM3VEC(P); TRWM3VEC(normal); T.dump(); */
-
 	vector<size_t> pos, neg, zer; Real dist[4];
 	for(size_t i=0; i<4; i++){
 		dist[i]=(T.v[i]-P).dot(normal);
@@ -879,7 +873,7 @@
 		for(size_t i=0; i<NEG; i++) v[i+  0+  0]=T.v[neg[i]];
 		for(size_t i=0; i<POS; i++) v[i+  0+NEG]=T.v[pos[i]];
 		for(size_t i=0; i<ZER; i++) v[i+POS+NEG]=T.v[zer[i]];
-		/* LOG_TRACE("NEG(in)="<<NEG<<", POS(out)="<<POS<<", ZER(boundary)="<<ZER); TRWM3VEC(v[0]); TRWM3VEC(v[1]); TRWM3VEC(v[2]); TRWM3VEC(v[3]); */
+
 		#define _A v[0]
 		#define _B v[1]
 		#define _C v[2]
@@ -978,9 +972,6 @@
 		// F=σA=εEA
 		// this is unused; should it?: contactPhys->kn
 		Vector3r F=contactGeom->normal*averageStrain*young*contactGeom->equivalentCrossSection;
-		TRWM3VEC(contactGeom->normal);
-		TRWM3VEC(F);
-		TRWM3VEC((A->state->pos-contactGeom->contactPoint).cross(F));
 
 		scene->forces.addForce (idA,-F);
 		scene->forces.addForce (idB, F);

=== modified file 'pkg/dem/Tetra.hpp'
--- pkg/dem/Tetra.hpp	2014-10-15 06:44:01 +0000
+++ pkg/dem/Tetra.hpp	2015-11-06 20:00:30 +0000
@@ -125,7 +125,7 @@
 		std::list<Tetra> Tetra2TetraIntersection(const Tetra& A, const Tetra& B);
 		std::list<Tetra> TetraClipByPlane(const Tetra& T, const Vector3r& P, const Vector3r& n);
 		//! Intersection of line given by points A, B and plane given by P and its normal.
-		Vector3r PtPtPlaneIntr(const Vector3r& A, const Vector3r& B, const Vector3r& P, const Vector3r& normal){const double t=(P-A).dot(normal) / (B-A).dot(normal); /* TRWM3VEC(A); TRWM3VEC(B); TRWM3VEC(P); TRWM3VEC(normal); LOG_TRACE("t="<<t); TRWM3VEC((A+t*(B-A))); */ return A+t*(B-A); }
+		Vector3r PtPtPlaneIntr(const Vector3r& A, const Vector3r& B, const Vector3r& P, const Vector3r& normal){const double t=(P-A).dot(normal) / (B-A).dot(normal); return A+t*(B-A); }
 };
 
 REGISTER_SERIALIZABLE(Ig2_Tetra_Tetra_TTetraGeom);