← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2054: 1. Fix quaternion/vector initializers in NormalInelasticityPhys

 

------------------------------------------------------------
revno: 2054
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Sun 2010-02-28 22:21:28 +0100
message:
  1. Fix quaternion/vector initializers in NormalInelasticityPhys
  2. Fix some eigen related macros
modified:
  SConstruct
  pkg/dem/DataClass/InteractionPhysics/NormalInelasticityPhys.hpp
  py/miniWm3Wrap/manualWrap.cpp
  scripts/test/regular-sphere-pack.py


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

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'SConstruct'
--- SConstruct	2010-02-25 10:20:07 +0000
+++ SConstruct	2010-02-28 21:21:28 +0000
@@ -390,8 +390,9 @@
 		if not ok: featureNotOK('eigen',note="You might have to add eigen header directory (e.g. /usr/include/eigen2) to CPPPATH.")
 	if 'nowm3' in env['features'] and 'eigen' not in env['features']:
 		featureNotOK("You selected the 'nowm3' feature; you MUST also select the 'eigen' feature in such case.")
-	# this should fix eigen crashes at runtime
-	if 'nowm3' in env['features']: env.Append(CPPDEFINES=['EIGEN_DONT_ALIGN','EIGEN_DONT_VECTORIZE'])
+	# different macros for different versions of eigen:
+	#  http://bitbucket.org/eigen/eigen/issue/96/eigen_dont_align-doesnt-exist-in-205-but-appears-in-web
+	if 'nowm3' in env['features']: env.Append(CPPDEFINES=['EIGEN_DONT_VECTORIZE','EIGEN_DONT_ALIGN','EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT'])
 
 	if env['useMiniWm3'] and not 'nowm3' in env['features']: env.Append(LIBS='miniWm3',CPPDEFINES=['MINIWM3'])
 

=== modified file 'pkg/dem/DataClass/InteractionPhysics/NormalInelasticityPhys.hpp'
--- pkg/dem/DataClass/InteractionPhysics/NormalInelasticityPhys.hpp	2010-02-26 17:01:36 +0000
+++ pkg/dem/DataClass/InteractionPhysics/NormalInelasticityPhys.hpp	2010-02-28 21:21:28 +0000
@@ -27,14 +27,14 @@
 				 ((Real,unMax,0.0,"the maximum value of penetration depth of the history of this interaction"))
 				 ((Real,previousun,0.0,"the value of this un at the last time step"))
 				 ((Real,previousFn,0.0,"the value of the normal force at the last time step"))
-				 ((Quaternionr,initialOrientation1,Quaternionr(1.0,0.0,0.0,0.0),""))
-				 ((Quaternionr,initialOrientation2,Quaternionr(1.0,0.0,0.0,0.0),""))
-				 ((Quaternionr,orientationToContact1,Quaternionr(1.0,0.0,0.0,0.0),""))
-				 ((Quaternionr,orientationToContact2,Quaternionr(1.0,0.0,0.0,0.0),""))
-				 ((Quaternionr,currentContactOrientation,Quaternionr(1.0,0.0,0.0,0.0),""))
-				 ((Quaternionr,initialContactOrientation,Quaternionr(1.0,0.0,0.0,0.0),""))
-				 ((Vector3r,initialPosition1,Quaternionr(1.0,0.0,0.0,0.0),""))
-				 ((Vector3r,initialPosition2,Quaternionr(1.0,0.0,0.0,0.0),""))
+				 ((Quaternionr,initialOrientation1,Quaternionr::IDENTITY,""))
+				 ((Quaternionr,initialOrientation2,Quaternionr::IDENTITY,""))
+				 ((Quaternionr,orientationToContact1,Quaternionr::IDENTITY,""))
+				 ((Quaternionr,orientationToContact2,Quaternionr::IDENTITY,""))
+				 ((Quaternionr,currentContactOrientation,Quaternionr::IDENTITY,""))
+				 ((Quaternionr,initialContactOrientation,Quaternionr::IDENTITY,""))
+				 ((Vector3r,initialPosition1,Vector3r::ZERO,""))
+				 ((Vector3r,initialPosition2,Vector3r::ZERO,""))
 				 ((Real,forMaxMoment,1.0,"parameter stored for each interaction, and allowing to compute the maximum value of the exchanged torque : TorqueMax= forMaxMoment * NormalForce"))
 				 ((Real,kr,0.0,"the rolling stiffness of the rigidity")),
 				 createIndex();

=== modified file 'py/miniWm3Wrap/manualWrap.cpp'
--- py/miniWm3Wrap/manualWrap.cpp	2010-02-27 22:26:29 +0000
+++ py/miniWm3Wrap/manualWrap.cpp	2010-02-28 21:21:28 +0000
@@ -35,7 +35,7 @@
 int Matrix3_len(){return 9;}
 #undef IDX_CHECK
 
-#if 1
+#if 0
 	// workarounds for static methods; disabled for now, see comment in miniWm3Wrap-generate.py
 	#define _WORKAROUND(clss,member) clss clss##_##member(const clss& self){return clss::member;}
 	_WORKAROUND(Vector2r,ONE); _WORKAROUND(Vector2r,UNIT_X); _WORKAROUND(Vector2r,UNIT_Y); _WORKAROUND(Vector2r,ZERO);

=== modified file 'scripts/test/regular-sphere-pack.py'
--- scripts/test/regular-sphere-pack.py	2010-02-21 09:29:06 +0000
+++ scripts/test/regular-sphere-pack.py	2010-02-28 21:21:28 +0000
@@ -66,10 +66,10 @@
 # Import regular-sphere-pack-LSMGenGeo.geo into the YADE simulation
 O.bodies.append(ymport.gengeoFile('regular-sphere-pack-LSMGenGeo.geo',shift=[-7.0,-7.0,-5.9],scale=1.0,color=(1,0,1),**kw))
 
-# spheresToFile saves coordinates and radiuses of all spheres of the simulation into the text file
-print "Saved into the OutFile " + str (export.text("OutFile")) + " spheres";
+# spheresToFile saves coordinates and radii of all spheres of the simulation into the text file
+#print "Saved into the OutFile " + str (export.text("OutFile")) + " spheres";
 
-# spheresFromFile function imports coordinates and radiuses of all spheres of the simulation into the text file"""
+# spheresFromFile function imports coordinates and radiuses of all spheres of the simulation into the text file
 O.bodies.append(ymport.text('regular-sphere-pack-FromFile',shift=[6.0,6.0,-2.9],scale=0.7,color=(1,1,1),**kw))
 
 try:
@@ -100,7 +100,7 @@
 O.dt=utils.PWaveTimeStep()
 O.saveTmp()
 O.timingEnabled=True
-O.run(10000,True)
-from yade import timing
-timing.stats()
-quit()
+#O.run(10000,True)
+#from yade import timing
+#timing.stats()
+#quit()