← Back to team overview

yade-dev team mailing list archive

[svn] r1907 - in trunk: core/containers pkg/dem/Engine/DeusExMachina

 

Author: eudoxos
Date: 2009-07-31 12:07:59 +0200 (Fri, 31 Jul 2009)
New Revision: 1907

Modified:
   trunk/core/containers/InteractionHashMap.hpp
   trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp
Log:
Fix has_map warning and one more in FlowEngine.


Modified: trunk/core/containers/InteractionHashMap.hpp
===================================================================
--- trunk/core/containers/InteractionHashMap.hpp	2009-07-31 09:45:22 UTC (rev 1906)
+++ trunk/core/containers/InteractionHashMap.hpp	2009-07-31 10:07:59 UTC (rev 1907)
@@ -10,7 +10,16 @@
 
 #include<yade/core/InteractionContainer.hpp>
 #include<yade/core/Interaction.hpp>
-#include<ext/hash_map>
+
+
+#if __GNUC__<4 || (__GNUC__==4 && __GNUC_MINOR__<=2)
+	// use this in gcc<=4.2
+	// see also the corresponding IHashMap typedef below
+	#include<ext/hash_map>
+#else
+	#include<tr1/unordered_map>
+#endif
+
 #include<vector>
 
 using namespace std;
@@ -35,7 +44,11 @@
 	}
 };
 
-typedef hash_map<pair<body_id_t,body_id_t>, shared_ptr<Interaction>, hashPair, eqPair > IHashMap;
+#if __GNUC__<4 || (__GNUC__==4 && __GNUC_MINOR__<=2)
+	typedef hash_map<pair<body_id_t,body_id_t>, shared_ptr<Interaction>, hashPair, eqPair > IHashMap;
+#else
+	typedef tr1::unordered_map<pair<body_id_t,body_id_t>, shared_ptr<Interaction>, hashPair, eqPair > IHashMap;
+#endif
 
 class InteractionHashMap : public InteractionContainer
 {

Modified: trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp	2009-07-31 09:45:22 UTC (rev 1906)
+++ trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp	2009-07-31 10:07:59 UTC (rev 1907)
@@ -30,6 +30,9 @@
 	if (!isActivated) return;
 	shared_ptr<BodyContainer>& bodies = ncb->bodies;
 	FOREACH(const shared_ptr<Body>& b, *bodies){
+		// to avoid warning:
+		b->physicalParameters; 
+
 		// clump members are non-dynamic; they skip the rest of loop once their forces are properly taken into account, however
 		//if (!b->isDynamic && !b->isClumpMember()) continue;