← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1991: 1. Add detection & mention workaround for https://bugs.launchpad.net/ubuntu/+source/boost1.38/+bu...

 

------------------------------------------------------------
revno: 1991
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Tue 2010-01-26 10:54:16 +0100
message:
  1. Add detection & mention workaround for https://bugs.launchpad.net/ubuntu/+source/boost1.38/+bug/457688
  1. Convert a few more classes to YADE_CLASS_BASE_DOC_ATTRS
modified:
  core/Collider.hpp
  core/main/main.py.in
  pkg/common/DataClass/InteractionPhysics/NormShearPhys.hpp
  pkg/dem/DataClass/InteractionPhysics/FrictPhys.hpp


--
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 'core/Collider.hpp'
--- core/Collider.hpp	2010-01-23 15:40:06 +0000
+++ core/Collider.hpp	2010-01-26 09:54:16 +0000
@@ -40,12 +40,7 @@
 		Currently used from Shop::flipCell, which changes cell information for bodies.
 		*/
 		virtual void invalidatePersistentData(){}
-
-	protected:
-
-	REGISTER_CLASS_NAME(Collider);	
-	REGISTER_BASE_CLASS_NAME(GlobalEngine);
+	YADE_CLASS_BASE_DOC_ATTRS(Collider,GlobalEngine,"Abstract class for finding spatial collisions between bodies.",);
 };
-
 REGISTER_SERIALIZABLE(Collider);
 

=== modified file 'core/main/main.py.in'
--- core/main/main.py.in	2010-01-23 10:53:12 +0000
+++ core/main/main.py.in	2010-01-26 09:54:16 +0000
@@ -32,14 +32,34 @@
 
 sys.stderr.write('Welcome to Yade '+version+'\n')
 
-# initialization and c++ plugins import
-import yade
-# other parts we will need soon
-import yade.config
-import yade.wrapper
-import yade.log
-import yade.system
+try:
+	# initialization and c++ plugins import
+	import yade
+	# other parts we will need soon
+	import yade.config
+	import yade.wrapper
+	import yade.log
+	import yade.system
 #import yade.plot
+except AttributeError:
+	print """
+==========================================
+======== ERROR: read carefully! ==========
+==========================================
+
+There was AttributeError while importing yade module.
+If you are running Ubuntu 9.10 (karmic), you just hit a known bug
+https://bugs.launchpad.net/ubuntu/+source/boost1.38/+bug/457688
+
+You can work around this bug by using the following command
+(as per https://bugs.launchpad.net/ubuntu/+source/boost1.38/+bug/457688/comments/6):
+
+sudo add-apt-repository ppa:ajmitch/ppa && sudo apt-get update && sudo apt-get upgrade
+
+No need to recompile afterwards.
+"""
+	sys.exit(1)
+
 
 # continue option processing
 

=== modified file 'pkg/common/DataClass/InteractionPhysics/NormShearPhys.hpp'
--- pkg/common/DataClass/InteractionPhysics/NormShearPhys.hpp	2010-01-24 16:27:40 +0000
+++ pkg/common/DataClass/InteractionPhysics/NormShearPhys.hpp	2010-01-26 09:54:16 +0000
@@ -6,13 +6,11 @@
 
 class NormPhys:public InteractionPhysics {
 	public:
-		Real kn;
-		Vector3r normalForce;
-		NormPhys(): normalForce(Vector3r::ZERO) {createIndex(); }
 		virtual ~NormPhys();
-	YADE_CLASS_BASE_DOC_ATTRS(NormPhys,InteractionPhysics,"Abstract class for interactions that have normal stiffness.",
-		((kn,"Normal stiffness"))
-		((normalForce,"Normal force after previous step."))
+	YADE_CLASS_BASE_DOC_ATTRDECL_CTOR_PY(NormPhys,InteractionPhysics,"Abstract class for interactions that have normal stiffness.",
+		((Real,kn,NaN,"Normal stiffness"))
+		((Vector3r,normalForce,Vector3r::ZERO,"Normal force after previous step.")),
+		createIndex(),
 	);
 	REGISTER_CLASS_INDEX(NormPhys,InteractionPhysics);
 };
@@ -20,13 +18,12 @@
 
 class NormShearPhys: public NormPhys{
 	public:
-		Real ks;
-		Vector3r shearForce;
-		NormShearPhys(): shearForce(Vector3r::ZERO){ createIndex(); }
 		virtual ~NormShearPhys();
-	YADE_CLASS_BASE_DOC_ATTRS(NormShearPhys,NormPhys,"Abstract class for interactions that have shear stiffnesses, in addition to normal stiffness. This class is used in the PFC3d-style stiffness timestepper.",
-		((ks,"Shear stiffness"))
-		((shearForce,"Shear force after previous step"))
+	YADE_CLASS_BASE_DOC_ATTRDECL_CTOR_PY(NormShearPhys,NormPhys,
+		"Abstract class for interactions that have shear stiffnesses, in addition to normal stiffness. This class is used in the PFC3d-style stiffness timestepper.",
+		((Real,ks,NaN,"Shear stiffness"))
+		((Vector3r,shearForce,Vector3r::ZERO,"Shear force after previous step")),
+		createIndex(),
 	);
 	REGISTER_CLASS_INDEX(NormShearPhys,NormPhys);
 };

=== modified file 'pkg/dem/DataClass/InteractionPhysics/FrictPhys.hpp'
--- pkg/dem/DataClass/InteractionPhysics/FrictPhys.hpp	2010-01-10 09:09:32 +0000
+++ pkg/dem/DataClass/InteractionPhysics/FrictPhys.hpp	2010-01-26 09:54:16 +0000
@@ -12,15 +12,13 @@
 				,equilibriumDistance		// equilibrium distance
 				,initialEquilibriumDistance	// initial equilibrium distance
 				,frictionAngle 			// angle of friction, according to Coulumb criterion
-				,tangensOfFrictionAngle
 				;	
-		Vector3r	prevNormal;			// unit normal of the contact plane.
-
-		FrictPhys(){ createIndex(); }
 		virtual ~FrictPhys();
-	REGISTER_ATTRIBUTES(NormShearPhys,(prevNormal)/*(initialKn)(initialKs)*/(tangensOfFrictionAngle));
-	REGISTER_CLASS_NAME(FrictPhys);
-	REGISTER_BASE_CLASS_NAME(NormShearPhys);
+	YADE_CLASS_BASE_DOC_ATTRDECL_CTOR_PY(FrictPhys,NormShearPhys,"Interaction with friction",
+		((Vector3r,prevNormal,Vector3r::ZERO,"unit normal of the contact plane in previous step"))
+		((Real,tangensOfFrictionAngle,NaN,"tan of angle of friction")),
+		createIndex(),
+	);
 	REGISTER_CLASS_INDEX(FrictPhys,NormShearPhys);
 };
 REGISTER_SERIALIZABLE(FrictPhys);