← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2080: 1. Add docs at several places

 

------------------------------------------------------------
revno: 2080
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Mon 2010-03-15 15:35:44 +0100
message:
  1. Add docs at several places
  2. Update debian/rules to run tests
  3. Add funnel.py scripts/test/CundallStrackTest.py
  4. Add more formats to SnapshotEngine (don't seem to work, though)
added:
  examples/funnel.py
modified:
  core/Omega.cpp
  core/main/main.py.in
  debian/rules
  gui/qt3/SnapshotEngine.cpp
  gui/qt3/SnapshotEngine.hpp
  pkg/dem/Engine/GlobalEngine/CohesionlessMomentRotation.cpp
  pkg/dem/Engine/GlobalEngine/CohesionlessMomentRotation.hpp
  pkg/dem/Engine/GlobalEngine/CundallStrack.cpp
  pkg/dem/Engine/GlobalEngine/CundallStrack.hpp
  pkg/dem/meta/ConcretePM.hpp
  pkg/dem/meta/ViscoelasticPM.hpp
  py/system.py
  py/utils.py
  py/ymport.py
  scripts/test/CundallStrackTest.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 'core/Omega.cpp'
--- core/Omega.cpp	2010-02-12 01:28:18 +0000
+++ core/Omega.cpp	2010-03-15 14:35:44 +0000
@@ -175,8 +175,8 @@
 				std::list<string>::iterator prev=I++;
 				pythonables.erase(prev);
 			} catch (...){
-				if(getenv("YADE_DEBUG")) cerr<<"["<<*I<<"]";
-				//boost::python::handle_exception();
+				if(getenv("YADE_DEBUG")){ cerr<<"["<<*I<<"]"; PyErr_Print(); }
+				boost::python::handle_exception();
 				I++;
 			}
 		}

=== modified file 'core/main/main.py.in'
--- core/main/main.py.in	2010-02-16 19:52:56 +0000
+++ core/main/main.py.in	2010-03-15 14:35:44 +0000
@@ -54,15 +54,17 @@
 ==========================================
 
 There was AttributeError while importing yade module.
-If you are running Ubuntu 9.10 (karmic), you just hit a known bug
+If you are running Ubuntu 9.10 (karmic) or 10.04 (lucid),
+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.
+You can work around this bug by updating boost from yade's updated repository
+(as per https://bugs.launchpad.net/ubuntu/+source/boost1.38/+bug/457688/comments/6)
+by issuing the following command:
+
+  sudo add-apt-repository ppa:yade-users/external && sudo apt-get update && sudo apt-get upgrade
+
+You should not need to recompile afterwards.
 """
 	sys.exit(1)
 

=== modified file 'debian/rules'
--- debian/rules	2010-03-10 09:06:28 +0000
+++ debian/rules	2010-03-15 14:35:44 +0000
@@ -68,8 +68,8 @@
 check: install
 	dh_testdir
 	dh_testroot
-	#scripts/yade-exec-wrapper debian/yade${_VERSION}-dbg/usr/bin/yade${_VERSION}-dbg -x scripts/regression-tests.py
-	#scripts/yade-exec-wrapper debian/yade${_VERSION}/usr/bin/yade${_VERSION} -x scripts/regression-tests.py
+	scripts/yade-exec-wrapper debian/yade${_VERSION}-dbg/usr/bin/yade${_VERSION}-dbg -x scripts/regression-tests.py
+	scripts/yade-exec-wrapper debian/yade${_VERSION}/usr/bin/yade${_VERSION} -x scripts/regression-tests.py
 
 # Build architecture-independent files here.
 binary-indep: build install

=== added file 'examples/funnel.py'
--- examples/funnel.py	1970-01-01 00:00:00 +0000
+++ examples/funnel.py	2010-03-15 14:35:44 +0000
@@ -0,0 +1,30 @@
+
+from numpy import linspace
+from yade import pack
+thetas=linspace(0,2*pi,num=16,endpoint=True)
+meridians=pack.revolutionSurfaceMeridians([[(3+rad*sin(th),10*rad+rad*cos(th)) for th in thetas] for rad in linspace(1,2,num=10)],linspace(0,pi,num=10))
+surf=pack.sweptPolylines2gtsSurface(meridians+[[Vector3(5*sin(-th),-10+5*cos(-th),30) for th in thetas]])
+O.bodies.append(pack.gtsSurface2Facets(surf))
+
+sp=pack.SpherePack()
+sp.makeCloud(Vector3(-1,-9,30),Vector3(1,-13,32),.2,rRelFuzz=.3)
+O.bodies.append([utils.sphere(c,r) for c,r in sp])
+
+O.engines=[
+	ForceResetter(), 
+	BoundDispatcher([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
+	InsertionSortCollider(),
+	InteractionDispatchers(
+	[Ig2_Sphere_Sphere_Dem3DofGeom(),
+		Ig2_Facet_Sphere_Dem3DofGeom()],
+		[Ip2_FrictMat_FrictMat_FrictPhys()],
+		[Law2_Dem3DofGeom_FrictPhys_Basic()]
+	),
+	GravityEngine(gravity=(0,0,-9.81)),
+	NewtonIntegrator(),
+	VTKRecorder(recorders=['spheres','facets','colors'],fileName='/tmp/p1',realPeriod=.5)
+]
+O.dt=utils.PWaveTimeStep()
+
+
+

=== modified file 'gui/qt3/SnapshotEngine.cpp'
--- gui/qt3/SnapshotEngine.cpp	2009-12-04 23:07:34 +0000
+++ gui/qt3/SnapshotEngine.cpp	2010-03-15 14:35:44 +0000
@@ -1,6 +1,8 @@
 #include"SnapshotEngine.hpp"
 #include<sstream>
 #include<iomanip>
+#include<boost/algorithm/string/case_conv.hpp>
+
 CREATE_LOGGER(SnapshotEngine);
 YADE_PLUGIN((SnapshotEngine));
 void SnapshotEngine::action(Scene* rb){
@@ -9,9 +11,9 @@
 		if(!ignoreErrors) throw invalid_argument("View #"+lexical_cast<string>(viewNo)+" (SnapshotEngine::viewNo) doesn't exist.");
 		return;
 	}
-	ostringstream fss; fss<<fileBase<<setw(4)<<setfill('0')<<counter++<<".png";
+	ostringstream fss; fss<<fileBase<<setw(4)<<setfill('0')<<counter++<<"."<<boost::algorithm::to_lower_copy(format);
 	LOG_DEBUG("GL view #"<<viewNo<<" → "<<fss.str())
-	glv->setSnapshotFormat("PNG");
+	glv->setSnapshotFormat(format);
 	glv->nextFrameSnapshotFilename=fss.str();
 	// wait for the renderer to save the frame (will happen at next postDraw)
 	timespec t1,t2; t1.tv_sec=0; t1.tv_nsec=10000000; /* 10 ms */

=== modified file 'gui/qt3/SnapshotEngine.hpp'
--- gui/qt3/SnapshotEngine.hpp	2010-02-09 16:50:30 +0000
+++ gui/qt3/SnapshotEngine.hpp	2010-03-15 14:35:44 +0000
@@ -12,6 +12,7 @@
 	public:
 	virtual void action(Scene*);
 	YADE_CLASS_BASE_DOC_ATTRS(SnapshotEngine,PeriodicEngine,"Periodically save snapshots of GLView(s) as .png files. Files are named *fileBase*+*counter*+'.png' (counter is left-padded by 0s, i.e. snap0004.png)",
+		((string,format,"PNG","Format of snapshots (one of JPEG, PNG, EPS, PS, PPM, BMP) `QGLViewer documentation <http://www.libqglviewer.com/refManual/classQGLViewer.html#abbb1add55632dced395e2f1b78ef491c>`_. File extension will be lowercased *format*. Validity of format is not checked."))
 		((string,fileBase,"","Basename for snapshots"))
 		((int,counter,0,"Number appended to fileBase |yupdate|"))
 		((int,viewNo,((void)"primary view",0),"The GLView number that we save."))

=== modified file 'pkg/dem/Engine/GlobalEngine/CohesionlessMomentRotation.cpp'
--- pkg/dem/Engine/GlobalEngine/CohesionlessMomentRotation.cpp	2010-02-02 09:59:57 +0000
+++ pkg/dem/Engine/GlobalEngine/CohesionlessMomentRotation.cpp	2010-03-15 14:35:44 +0000
@@ -227,42 +227,8 @@
 	interaction->interactionPhysics = contactPhysics;
 }
 
-
-
-/* Moment Phys */		
-MomentPhys::MomentPhys()
-{
-	createIndex();
-	frictionAngle = 0;
-	tanFrictionAngle = 0;
-	Eta = 0;
-	prevNormal = Vector3r(0,0,0);
-	
-	moment_twist = Vector3r(0,0,0);
-	moment_bending = Vector3r(0,0,0);
-	
-	shear = Vector3r(0,0,0);
-	cumulativeRotation =0; 
-// assign neutral value	
-	initialOrientation1 = Quaternionr(1.0,0.0,0.0,0.0);
-	initialOrientation2 = Quaternionr(1.0,0.0,0.0,0.0);
-	kr = 0;
-}
-
 MomentPhys::~MomentPhys(){}
 
-/* Ip2_BMP_BMP_MomentPhys */
-Ip2_MomentMat_MomentMat_MomentPhys::Ip2_MomentMat_MomentMat_MomentPhys()
-{
-	userInputStiffness = false;
-	useAlphaBeta = false;
-	Alpha = 0;
-	Beta = 0;	
-	Knormal = 0;
-	Krotate = 0;
-	Kshear= 0;
-
-}
 Ip2_MomentMat_MomentMat_MomentPhys::~Ip2_MomentMat_MomentMat_MomentPhys(){};
 
 

=== modified file 'pkg/dem/Engine/GlobalEngine/CohesionlessMomentRotation.hpp'
--- pkg/dem/Engine/GlobalEngine/CohesionlessMomentRotation.hpp	2010-02-02 09:59:57 +0000
+++ pkg/dem/Engine/GlobalEngine/CohesionlessMomentRotation.hpp	2010-03-15 14:35:44 +0000
@@ -6,80 +6,58 @@
 #include<yade/pkg-common/NormShearPhys.hpp>
 #include<yade/pkg-common/LawFunctor.hpp>
 #include<yade/pkg-dem/ScGeom.hpp>
-#include <set>
-#include <boost/tuple/tuple.hpp>
-
-/* Contact law have been verified with Plassiard et al. (2009) : A spherical discrete element model: calibration procedure and incremental response */
-/* Can be used in Triaxial Test, but significant changes has to be made */
-
-/*    CHANGES THAT HAS TO BE DONE ON TRIAXIAL TEST */
-/*
-Ip2_MomentMat_MomentMat_MomentPhys and Law2_SCG_MomentPhys_CohesionlessMomentRotation have to be added. Since it uses ScGeom, it uses boxes rather than facets.  Spheres and boxes have to be changed to MomentMat rather than FrictMat
-
-  INPUT FOR Ip2_MomentMat_MomentMat_MomentPhys: 
-
-1.  If boolean userInputStiffness=true & useAlphaBeta=false, users can input Knormal, Kshear and Krotate directly.  Then, kn,ks and kr will be equal to these values, rather than calculated E and v.
-
-2.  If boolean userInputStiffness=true & useAlphaBeta=true, users input Knormal, Alpha and Beta.  Then ks and kr are calculated from alpha & beta respectively
-
-3.  If both are false, it calculates kn and ks are calculated from E and v, whilst kr = 0.
-
-  
-  INPUT FOR MomentMat:
-
-1.  Users can input eta (constant for plastic moment) to Spheres and Boxes. For more complicated cases, users can modify TriaxialStressController to use different eta values during isotropic compaction.
-
-  CONTACT LAW:
-  The contribution of stiffnesses are scaled according to the radius of the particle, as implemented in Plassiard et al. (2009)
-*/
-
-
+#include<set>
+#include<boost/tuple/tuple.hpp>
 
 
 class Law2_SCG_MomentPhys_CohesionlessMomentRotation: public LawFunctor{
 	public:
 		virtual void go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, Scene* rootBody);
-		bool preventGranularRatcheting;
-		Law2_SCG_MomentPhys_CohesionlessMomentRotation():preventGranularRatcheting(false){};
-		FUNCTOR2D(ScGeom,MomentPhys);
-		REGISTER_CLASS_AND_BASE(Law2_SCG_MomentPhys_CohesionlessMomentRotation,LawFunctor);
-		REGISTER_ATTRIBUTES(LawFunctor,/*nothing here*/);
-		DECLARE_LOGGER;	
+	FUNCTOR2D(ScGeom,MomentPhys);
+	YADE_CLASS_BASE_DOC_ATTRS(Law2_SCG_MomentPhys_CohesionlessMomentRotation,LawFunctor,"Contact law based on Plassiard et al. (2009) : A spherical discrete element model: calibration procedure and incremental response. The functionality has been verified with results in the paper.\n\nThe contribution of stiffnesses are scaled according to the radius of the particle, as implemented in that paper.\n\nSee also associated classes :yref:`MomentMat`, :yref:`Ip2_MomentMat_MomentMat_MomentPhys`, :yref:`MomentPhys`.\n\n.. note::\n\tThis constitutive law can be used with triaxial test, but the following significant changes in code have to be made: :yref:`Ip2_MomentMat_MomentMat_MomentPhys` and :yref:`Law2_SCG_MomentPhys_CohesionlessMomentRotation` have to be added. Since it uses :yref:`ScGeom`, it uses :yref:`boxes<Box>` rather than :yref:`facets<Facet>`. :yref:`Spheres<Sphere>` and :yref:`boxes<Box>` have to be changed to :yref:`MomentMat` rather than :yref:`FrictMat`.",
+		((bool,preventGranularRatcheting,false,"??"))
+	);
+	DECLARE_LOGGER;	
 };
 REGISTER_SERIALIZABLE(Law2_SCG_MomentPhys_CohesionlessMomentRotation);
 
 
 class Ip2_MomentMat_MomentMat_MomentPhys: public InteractionPhysicsFunctor{
 	public:
-		bool userInputStiffness, useAlphaBeta; //for users to choose whether to input stiffness directly or use ratios to calculate Ks/Kn
-		Real Knormal, Kshear, Krotate; //allows user to input stiffness properties from triaxial test.  These will be passed to MomentPhys or NormShearPhys
-		Real Alpha, Beta; //Alpha is a ratio of Ks/Kn, Beta is a ratio to calculate Kr
-		Ip2_MomentMat_MomentMat_MomentPhys();
 		virtual ~Ip2_MomentMat_MomentMat_MomentPhys();
 		virtual void go(const shared_ptr<Material>& pp1, const shared_ptr<Material>& pp2, const shared_ptr<Interaction>& interaction);
-		REGISTER_ATTRIBUTES(InteractionPhysicsFunctor,(userInputStiffness)(useAlphaBeta)(Knormal)(Kshear)(Krotate)(Alpha)(Beta));
 		FUNCTOR2D(MomentMat,MomentMat);
-		REGISTER_CLASS_AND_BASE(Ip2_MomentMat_MomentMat_MomentPhys,InteractionPhysicsFunctor);
 		DECLARE_LOGGER;
+	YADE_CLASS_BASE_DOC_ATTRS(Ip2_MomentMat_MomentMat_MomentPhys,InteractionPhysicsFunctor,"Create :yref:`MomentPhys` from 2 instances of :yref:`MomentMat`.\n\n1.  If boolean userInputStiffness=true & useAlphaBeta=false, users can input Knormal, Kshear and Krotate directly.  Then, kn,ks and kr will be equal to these values, rather than calculated E and v.\n\n2.  If boolean userInputStiffness=true & useAlphaBeta=true, users input Knormal, Alpha and Beta.  Then ks and kr are calculated from alpha & beta respectively.\n\n3.  If both are false, it calculates kn and ks are calculated from E and v, whilst kr = 0.",
+		((bool,userInputStiffness,false,"for users to choose whether to input stiffness directly or use ratios to calculate Ks/Kn"))
+		((bool,useAlphaBeta,false,"for users to choose whether to input stiffness directly or use ratios to calculate Ks/Kn"))
+		((Real,Knormal,0,"Allows user to input stiffness properties from triaxial test. These will be passed to :yref:`MomentPhys` or :yref:`NormShearPhys`"))
+		((Real,Kshear,0,"Allows user to input stiffness properties from triaxial test. These will be passed to :yref:`MomentPhys` or :yref:`NormShearPhys`"))
+		((Real,Krotate,0,"Allows user to input stiffness properties from triaxial test. These will be passed to :yref:`MomentPhys` or :yref:`NormShearPhys`"))
+		((Real,Alpha,0,"Ratio of Ks/Kn"))
+		((Real,Beta,0,"Ratio to calculate Kr"))
+	);
 };
 REGISTER_SERIALIZABLE(Ip2_MomentMat_MomentMat_MomentPhys);
 
 
 class MomentPhys: public NormShearPhys {
-	private:
 	public:
-		Real frictionAngle, tanFrictionAngle, Eta;  
-		Vector3r prevNormal, shear; 
-		Real cumulativeRotation;
-		Quaternionr	initialOrientation1,initialOrientation2;
-		Real		kr; // rolling stiffness
-		Vector3r	moment_twist,moment_bending;
-		MomentPhys();
-	
-	virtual ~MomentPhys();
-
-	REGISTER_ATTRIBUTES(NormShearPhys,(tanFrictionAngle) (frictionAngle) (prevNormal) (initialOrientation1) (initialOrientation2) (kr) (Eta)(moment_twist) (moment_bending) (cumulativeRotation)(shear));
-	REGISTER_CLASS_AND_BASE(MomentPhys,NormShearPhys);
+		virtual ~MomentPhys();
+	YADE_CLASS_BASE_DOC_ATTRS_CTOR(MomentPhys,NormShearPhys,"Physical interaction properties for use with :yref:`Law2_SCG_MomentPhys_CohesionlessMomentRotation`, created by :yref:`Ip2_MomentMat_MomentMat_MomentPhys`.",
+		((Real,frictionAngle,0,"Friction angle [rad]"))
+		((Real,tanFrictionAngle,0,"Tangent of friction angle"))
+		((Real,Eta,0,"??"))
+		((Quaternionr,initialOrientation1,Quaternionr::IDENTITY,"??"))
+		((Quaternionr,initialOrientation2,Quaternionr::IDENTITY,"??"))
+		((Vector3r,prevNormal,Vector3r::ZERO,"Normal in the previous step."))
+		((Real,kr,0,"rolling stiffness"))
+		((Vector3r,moment_twist,Vector3r::ZERO,"??"))
+		((Vector3r,moment_bending,Vector3r::ZERO,"??"))
+		((Real,cumulativeRotation,0,"??"))
+		((Vector3r,shear,Vector3r::ZERO,"??")),
+		createIndex();
+	);
 	REGISTER_CLASS_INDEX(MomentPhys,NormShearPhys);
 };
 REGISTER_SERIALIZABLE(MomentPhys);
@@ -87,11 +65,11 @@
 /** This class holds information associated with each body */
 class MomentMat: public FrictMat {
 	public:
-		Real eta; //It has to be stored in this class and not by ContactLaw, because users may want to change its values before/after isotropic compaction.
-		MomentMat(): eta(0) {createIndex();};
-		REGISTER_ATTRIBUTES(FrictMat, (eta));
-		REGISTER_CLASS_AND_BASE(MomentMat,FrictMat);
-		REGISTER_CLASS_INDEX(MomentMat,FrictMat);
+	YADE_CLASS_BASE_DOC_ATTRS_CTOR(MomentMat,FrictMat,"Material for constitutive law of (Plassiard & al., 2009); see :yref:`Law2_SCG_MomentPhys_CohesionlessMomentRotation` for details.\n\nUsers can input eta (constant for plastic moment) to Spheres and Boxes. For more complicated cases, users can modify TriaxialStressController to use different eta values during isotropic compaction.",
+		((Real,eta,0,"(has to be stored in this class and not by ContactLaw, because users may want to change its values before/after isotropic compaction.)")),
+		createIndex();
+	);
+	REGISTER_CLASS_INDEX(MomentMat,FrictMat);
 };
 REGISTER_SERIALIZABLE(MomentMat);
 

=== modified file 'pkg/dem/Engine/GlobalEngine/CundallStrack.cpp'
--- pkg/dem/Engine/GlobalEngine/CundallStrack.cpp	2010-02-02 09:59:57 +0000
+++ pkg/dem/Engine/GlobalEngine/CundallStrack.cpp	2010-03-15 14:35:44 +0000
@@ -5,7 +5,7 @@
 #include<yade/pkg-dem/DemXDofGeom.hpp>
 //! tested in scripts/test/CundallStrack.py
 
-YADE_PLUGIN((Law2_Dem3Dof_CSPhys_CundallStrack)(Ip2_BMP_BMP_CSPhys)(CSPhys));
+YADE_PLUGIN((Law2_Dem3Dof_CSPhys_CundallStrack)(Ip2_2xFrictMat_CSPhys)(CSPhys));
 
 
 
@@ -33,9 +33,9 @@
 	
 }
 
-CREATE_LOGGER(Ip2_BMP_BMP_CSPhys);
+CREATE_LOGGER(Ip2_2xFrictMat_CSPhys);
 
-void Ip2_BMP_BMP_CSPhys::go(const shared_ptr<Material>& b1, const shared_ptr<Material>& b2, const shared_ptr<Interaction>& interaction){
+void Ip2_2xFrictMat_CSPhys::go(const shared_ptr<Material>& b1, const shared_ptr<Material>& b2, const shared_ptr<Interaction>& interaction){
 	
 	if(interaction->interactionPhysics) return; 
 

=== modified file 'pkg/dem/Engine/GlobalEngine/CundallStrack.hpp'
--- pkg/dem/Engine/GlobalEngine/CundallStrack.hpp	2010-02-02 09:59:57 +0000
+++ pkg/dem/Engine/GlobalEngine/CundallStrack.hpp	2010-03-15 14:35:44 +0000
@@ -16,33 +16,29 @@
 	public:
 		virtual void go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, Scene* rootBody);
 		FUNCTOR2D(Dem3DofGeom,CSPhys);
-		REGISTER_CLASS_AND_BASE(Law2_Dem3Dof_CSPhys_CundallStrack,LawFunctor);
-		REGISTER_ATTRIBUTES(LawFunctor,/*nothing here*/);
+		YADE_CLASS_BASE_DOC(Law2_Dem3Dof_CSPhys_CundallStrack,LawFunctor,"Basic constitutive law published originally by Cundall&Strack; it has normal and shear stiffnesses (Kn, Kn) and dry Coulomb friction. Operates on associated :yref:`Dem3DofGeom` and :yref:`CSPhys` instances.");
 		DECLARE_LOGGER;	
 };
 REGISTER_SERIALIZABLE(Law2_Dem3Dof_CSPhys_CundallStrack);
 
-class Ip2_BMP_BMP_CSPhys: public InteractionPhysicsFunctor{
+class Ip2_2xFrictMat_CSPhys: public InteractionPhysicsFunctor{
 	public:
-
 		virtual void go(const shared_ptr<Material>& pp1, const shared_ptr<Material>& pp2, const shared_ptr<Interaction>& interaction);
-		REGISTER_ATTRIBUTES(InteractionPhysicsFunctor,);
 		FUNCTOR2D(FrictMat,FrictMat);
-		REGISTER_CLASS_AND_BASE(Ip2_BMP_BMP_CSPhys,InteractionPhysicsFunctor);
+		YADE_CLASS_BASE_DOC(Ip2_2xFrictMat_CSPhys,InteractionPhysicsFunctor,"Functor creating :yref:`CSPhys` from  two :yref:`FrictMat`. See :yref:`Law2_Dem3Dof_CSPhys_CundallStrack` for details.");
 		DECLARE_LOGGER;
 };
-REGISTER_SERIALIZABLE(Ip2_BMP_BMP_CSPhys);
+REGISTER_SERIALIZABLE(Ip2_2xFrictMat_CSPhys);
 
 
 class CSPhys: public NormShearPhys {
-	private:
 	public:
-		Real frictionAngle, tanFrictionAngle; 
-		CSPhys(): NormShearPhys(), frictionAngle(0),tanFrictionAngle(0){ createIndex(); }
 	virtual ~CSPhys();
-
-	REGISTER_ATTRIBUTES(NormShearPhys,(tanFrictionAngle) (frictionAngle));
-	REGISTER_CLASS_AND_BASE(CSPhys,NormShearPhys);
+	YADE_CLASS_BASE_DOC_ATTRS_CTOR(CSPhys,NormShearPhys,"Physical properties for :yref:`Cundall&Strack constitutive law<Law2_Dem3Dof_CSPhys_CundallStrack>`, created by :yref:`Ip2_2xFrictMat_CSPhys`.",
+		((Real,frictionAngle,NaN,"Friction angle of the interaction. |ycomp|"))
+		((Real,tanFrictionAngle,NaN,"Precomputed tangent of :yref:`CSPhys::frictionAngle`. |ycomp|")),
+		createIndex();
+	);
 	REGISTER_CLASS_INDEX(CSPhys,NormShearPhys);
 };
 REGISTER_SERIALIZABLE(CSPhys);

=== modified file 'pkg/dem/meta/ConcretePM.hpp'
--- pkg/dem/meta/ConcretePM.hpp	2010-02-09 16:50:30 +0000
+++ pkg/dem/meta/ConcretePM.hpp	2010-03-15 14:35:44 +0000
@@ -57,7 +57,7 @@
 None of that is used for computation (at least not now), only for post-processing.
 */
 class CpmState: public State {
-	YADE_CLASS_BASE_DOC_ATTRS(CpmState,State,"Cpm state information about each body.\n\nNone of that is used for computation (at least not now), only for post-processing.",
+	YADE_CLASS_BASE_DOC_ATTRS(CpmState,State,"State information about body use by :ref:`cpm-model`.\n\nNone of that is used for computation (at least not now), only for post-processing.",
 		((Real,epsVolumetric,0,"Volumetric strain around this body (unused for now)"))
 		((int,numBrokenCohesive,0,"Number of (cohesive) contacts that damaged completely"))
 		((int,numContacts,0,"Number of contacts with this body"))
@@ -76,7 +76,7 @@
 		virtual shared_ptr<State> newAssocState() const { return shared_ptr<State>(new CpmState); }
 		virtual bool stateTypeOk(State* s) const { return (bool)dynamic_cast<CpmState*>(s); }
 
-	YADE_CLASS_BASE_DOC_ATTRS_CTOR(CpmMat,FrictMat,"Concrete material, for use with other Cpm classes. \n\n.. note::\n\tdensity is initialized to 4800 automatically",
+	YADE_CLASS_BASE_DOC_ATTRS_CTOR(CpmMat,FrictMat,"Concrete material, for use with other Cpm classes. \n\n.. note::\n\t:yref:`Density<Material::density>` is initialized to 4800 kgm⁻³automatically, which gives approximate 2800 kgm⁻³ on 0.5 density packing.\n\n.. _cpm-model::\n\n Concrete Particle Model (CPM)\n-------------------------------------------\n\n :yref:`CpmMat` is particle material, :yref:`Ip2_CpmMat_CpmMat_CpmPhys` averages two particles' materials, creating :yref:`CpmPhys`, which is then used in interaction resultion by :yref:`Law2_Dem3DofGeom_CpmPhys_Cpm`. :yref:`CpmState` is associated to :yref:`CpmMat` and keeps state defined on particles rather than interactions (such as number of completely damaged interactions).\n\nThe model is contained in externally defined macro CPM_MATERIAL_MODEL, which features damage in tension, plasticity in shear and compression and rate-dependence. For commercial reasons, rate-dependence and compression-plasticity is not present in reduced version of the model, used when CPM_MATERIAL_MODEL is not defined. The full model will be described in detail in my (Václav Šmilauer) thesis along with calibration procedures (rigidity, poisson's ratio, compressive/tensile strength ratio, fracture energy, behavior under confinement, rate-dependent behavior).\n\nEven the public model is useful enough to run simulation on concrete samples, such as :ysrc:`uniaxial tension-compression test<examples/concrete/uniax.py>`.",
 		((Real,G_over_E,NaN,"Ratio of normal/shear stiffness at interaction level [-]"))
 		((Real,sigmaT,NaN,"Initial cohesion [Pa]"))
 		((bool,neverDamage,false,"If true, no damage will occur (for testing only)."))
@@ -112,7 +112,7 @@
 		Real computeViscoplScalingFactor(Real sigmaTNorm, Real sigmaTYield,Real dt);
 
 		virtual ~CpmPhys();
-		YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(CpmPhys,NormShearPhys,"Representation of a single interaction of the Cpm type: storage for relevant parameters.\n\n Evolution of the contact is governed by Law2_Dem3DofGeom_CpmPhys_Cpm, that includes damage effects and chages of parameters inside CpmPhys",
+		YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(CpmPhys,NormShearPhys,"Representation of a single interaction of the Cpm type: storage for relevant parameters.\n\n Evolution of the contact is governed by :yref:`Law2_Dem3DofGeom_CpmPhys_Cpm`, that includes damage effects and chages of parameters inside CpmPhys. See :ref:`cpm-model` for details.",
 			((Real,E,NaN,"normal modulus (stiffness / crossSection) [Pa]"))
 			((Real,G,NaN,"shear modulus [Pa]"))
 			((Real,tanFrictionAngle,NaN,"tangens of internal friction angle [-]"))
@@ -161,7 +161,7 @@
 		virtual void go(const shared_ptr<Material>& pp1, const shared_ptr<Material>& pp2, const shared_ptr<Interaction>& interaction);
 		FUNCTOR2D(CpmMat,CpmMat);
 		DECLARE_LOGGER;
-		YADE_CLASS_BASE_DOC_ATTRS(Ip2_CpmMat_CpmMat_CpmPhys,InteractionPhysicsFunctor,"Convert 2 CpmMat instances to CpmPhys with corresponding parameters.",
+		YADE_CLASS_BASE_DOC_ATTRS(Ip2_CpmMat_CpmMat_CpmPhys,InteractionPhysicsFunctor,"Convert 2 :yref:`CpmMat` instances to :yref:`CpmPhys` with corresponding parameters. Uses simple (arithmetic) averages if material are different. Simple copy of parameters is performed if the :yref:`material<CpmMat>` is shared between both particles. See :ref:`cpm-model` for detals.",
 			((long,cohesiveThresholdIter,10,"Should new contacts be cohesive? They will before this iter#, they will not be afterwards. If 0, they will never be. If negative, they will always be created as cohesive (10 by default)."))
 		);
 };
@@ -185,7 +185,7 @@
 	static void updateBodiesState(Scene*);
 
 	FUNCTOR2D(Dem3DofGeom,CpmPhys);
-	YADE_CLASS_BASE_DOC_ATTRS(Law2_Dem3DofGeom_CpmPhys_Cpm,LawFunctor,"Constitutive law for the Cpm model.",
+	YADE_CLASS_BASE_DOC_ATTRS(Law2_Dem3DofGeom_CpmPhys_Cpm,LawFunctor,"Constitutive law for the :ref:`cpm-model`.",
 		((int,yieldSurfType,2,"yield function: 0: mohr-coulomb (original); 1: parabolic; 2: logarithmic, 3: log+lin_tension, 4: elliptic, 5: elliptic+log"))
 		((Real,yieldLogSpeed,.1,"scaling in the logarithmic yield surface (should be <1 for realistic results; >=0 for meaningful results)"))
 		((Real,yieldEllipseShift,NaN,"horizontal scaling of the ellipse (shifts on the +x axis as interactions with +y are given)"))
@@ -223,7 +223,7 @@
 	public:
 		virtual void action(Scene* rb){ update(rb); }
 		void update(Scene* rb=NULL);
-	YADE_CLASS_BASE_DOC_ATTRS_CTOR(CpmStateUpdater,PeriodicEngine,"Changes bodies' colors depending on average damage of their interactions and number of interactions that were already fully broken and have disappeared. This engine contains its own loop (2 loops, more precisely) over all bodies and should be run periodically to update colors during the simulation, if desired.",
+	YADE_CLASS_BASE_DOC_ATTRS_CTOR(CpmStateUpdater,PeriodicEngine,"Update :yref:`CpmState` of bodies based on state variables in :yref:`CpmPhys` of interactions with this bod. In particular, bodies' colors and :yref:`CpmState::normDmg` depending on average :yref:`damage<CpmPhys::omega>` of their interactions and number of interactions that were already fully broken and have disappeared is updated. This engine contains its own loop (2 loops, more precisely) over all bodies and should be run periodically to update colors during the simulation, if desired.",
 		((Real,avgRelResidual,NaN,"Average residual strength at last run."))
 		((Real,maxOmega,NaN,"Globally maximum damage parameter at last run.")),
 		initRun=true;

=== modified file 'pkg/dem/meta/ViscoelasticPM.hpp'
--- pkg/dem/meta/ViscoelasticPM.hpp	2010-01-10 09:09:32 +0000
+++ pkg/dem/meta/ViscoelasticPM.hpp	2010-03-15 14:35:44 +0000
@@ -14,21 +14,16 @@
 /// Material
 /// Note: Shop::getViscoelasticFromSpheresInteraction can get kn,cn,ks,cs from a analytical solution of a pair spheres interaction problem.
 class SimpleViscoelasticMat : public Material {	
-	public :
-	    /// Normal elasticity
-	    Real kn; 
-	    /// Normal viscosity
-	    Real cn; 
-	    /// Shear elasticity
-	    Real ks; 
-	    /// Shear viscosity
-	    Real cs; 
-	    /// Friction angle
-	    Real frictionAngle; 
-		SimpleViscoelasticMat(){ createIndex(); }
+	public:
 		virtual ~SimpleViscoelasticMat();
-	REGISTER_ATTRIBUTES(Material,(kn)(ks)(cn)(cs)(frictionAngle));
-	REGISTER_CLASS_AND_BASE(SimpleViscoelasticMat,Material);
+	YADE_CLASS_BASE_DOC_ATTRS_CTOR(SimpleViscoelasticMat,Material,"Material for simple viscoelastic model of contact.\n\n.. note::\n\t ``Shop::getViscoelasticFromSpheresInteraction`` (and :yref:`yade.utils.getViscoelasticFromSpheresInteraction` in python) compute :yref:`kn<SimpleViscoelasticMat::kn>, :yref:`cn<SimpleViscoelasticMat::cn>`,  :yref:`ks<SimpleViscoelasticMat::ks>`,  :yref:`cs<SimpleViscoelasticMat::cs>` from analytical solution of a pair spheres interaction problem.",
+		((Real,kn,NaN,"Normal elastic stiffness"))
+		((Real,cn,NaN,"Normal viscous constant"))
+		((Real,ks,NaN,"Shear elastic stiffness"))
+		((Real,cs,NaN,"Shear viscous constant"))
+		((Real,frictionAngle,NaN,"Friction angle [rad]")),
+		createIndex();
+	);
 	REGISTER_CLASS_INDEX(SimpleViscoelasticMat,Material);
 };
 REGISTER_SERIALIZABLE(SimpleViscoelasticMat);
@@ -56,9 +51,8 @@
 		virtual void go(const shared_ptr<Material>& b1,
 					const shared_ptr<Material>& b2,
 					const shared_ptr<Interaction>& interaction);
-	REGISTER_ATTRIBUTES(InteractionPhysicsFunctor,/* */)
+	YADE_CLASS_BASE_DOC(Ip2_SimleViscoelasticMat_SimpleViscoelasticMat_SimpleViscoelasticPhys,InteractionPhysicsFunctor,"Convert 2 instances of :yref:`SimpleViscoelasticMat` to :yref:`SimpleViscoelasticPhys` using the rule of consecutive connection.");
 	FUNCTOR2D(SimpleViscoelasticMat,SimpleViscoelasticMat);
-	REGISTER_CLASS_AND_BASE(Ip2_SimleViscoelasticMat_SimpleViscoelasticMat_SimpleViscoelasticPhys, InteractionPhysicsFunctor);
 
 };
 REGISTER_SERIALIZABLE(Ip2_SimleViscoelasticMat_SimpleViscoelasticMat_SimpleViscoelasticPhys);
@@ -68,9 +62,8 @@
 class Law2_Spheres_Viscoelastic_SimpleViscoelastic: public LawFunctor {
 	public :
 		virtual void go(shared_ptr<InteractionGeometry>&, shared_ptr<InteractionPhysics>&, Interaction*, Scene*);
-		FUNCTOR2D(ScGeom,SimpleViscoelasticPhys);
-		REGISTER_CLASS_AND_BASE(Law2_Spheres_Viscoelastic_SimpleViscoelastic,LawFunctor);
-		REGISTER_ATTRIBUTES(LawFunctor,/* */);
+	FUNCTOR2D(ScGeom,SimpleViscoelasticPhys);
+	YADE_CLASS_BASE_DOC(Law2_Spheres_Viscoelastic_SimpleViscoelastic,LawFunctor,"Linear viscoelastic model operating on :yref:`ScGeom` and :yref:`SimpleViscoelasticPhys`.");
 };
 REGISTER_SERIALIZABLE(Law2_Spheres_Viscoelastic_SimpleViscoelastic);
 

=== modified file 'py/system.py'
--- py/system.py	2010-03-10 11:37:28 +0000
+++ py/system.py	2010-03-15 14:35:44 +0000
@@ -124,6 +124,7 @@
 	'CinemKNCEngine':'KinemCNSEngine', # Wed Mar 10 12:34:01 2010, jduriez@c1solimara-l
 	'CinemDNCEngine':'KinemCNDEngine', # Wed Mar 10 12:34:27 2010, jduriez@c1solimara-l
 	'CinemDTCEngine':'KinemCTDEngine', # Wed Mar 10 12:34:37 2010, jduriez@c1solimara-l
+	'Ip2_BMP_BMP_CSPhys':'Ip2_2xFrictMat_CSPhys', # Wed Mar 10 15:08:56 2010, eudoxos@frigo
 	### END_RENAMED_CLASSES_LIST ### (do not delete this line; scripts/rename-class.py uses it
 }
 

=== modified file 'py/utils.py'
--- py/utils.py	2010-03-09 14:20:36 +0000
+++ py/utils.py	2010-03-15 14:35:44 +0000
@@ -70,7 +70,14 @@
 
 def randomColor(): return Vector3(random.random(),random.random(),random.random())
 
-def typedEngine(name): return [e for e in Omega().engines if e.name==name][0]
+def typedEngine(name):
+	"""Return first engine from current O.engines, identified by its type (as string). For example:
+
+	>>> O.engines=[InsertionSortCollider(),NewtonIntegrator(),GravityEngine()]
+	>>> utils.typedEngine("NewtonIntegrator") == O.engines[1]
+	True
+	"""
+	return [e for e in Omega().engines if e.name==name][0]
 
 def downCast(obj,newClassName):
 	"""Cast given object to class deriving from the same yade root class and copy all parameters from given object.

=== modified file 'py/ymport.py'
--- py/ymport.py	2010-03-07 19:53:42 +0000
+++ py/ymport.py	2010-03-15 14:35:44 +0000
@@ -42,10 +42,10 @@
 	scale factor scales the given data.
 	
 	Remaining **kw arguments are passed to utils.facet; 
-	mesh files can be easily created with GMSH http://www.geuz.org/gmsh/
-	Example added to scripts/test/regular-sphere-pack.py
+	mesh files can be easily created with `GMSH <http://www.geuz.org/gmsh/>`_.
+	Example added to :ysrc:`scripts/test/regular-sphere-pack.py`
 	
-	Additional examples of mesh-files can be downloaded here
+	Additional examples of mesh-files can be downloaded from 
 	http://www-roc.inria.fr/gamma/download/download.php
 	"""
 	infile = open(meshfile,"r")
@@ -99,18 +99,17 @@
 	""" Imports geometry from LSMGenGeo .geo file and creates spheres.
 	shift[X,Y,Z] parameter moves the specimen.
 	scale factor scales the given data.
-	Remaining **kw arguments are passed to utils.sphere; 
+	Remaining **kw arguments are passed to :yref:`yade.utils.sphere`; 
 	
 	LSMGenGeo library allows to create pack of spheres
 	with given [Rmin:Rmax] with null stress inside the specimen.
-	Can be usefull for Mining Rock simulation.
-	
-	Example added to scripts/test/regular-sphere-pack.py
-	Example of LSMGenGeo library using is added to genCylLSM.py
-	
-	https://answers.launchpad.net/esys-particle/+faq/877
-	http://www.access.edu.au/lsmgengeo_python_doc/current/pythonapi/html/GenGeo-module.html
-	https://svn.esscc.uq.edu.au/svn/esys3/lsm/contrib/LSMGenGeo/""";
+	Can be useful for Mining Rock simulation.
+	
+	Example: :ysrc:`scripts/test/regular-sphere-pack.py`, usage of LSMGenGeo library in :ysrc:`scripts/test/genCylLSM.py`.
+	
+	* https://answers.launchpad.net/esys-particle/+faq/877
+	* http://www.access.edu.au/lsmgengeo_python_doc/current/pythonapi/html/GenGeo-module.html
+	* https://svn.esscc.uq.edu.au/svn/esys3/lsm/contrib/LSMGenGeo/""";
 	from yade.utils import sphere
 
 	infile = open(fileName,"r")
@@ -127,18 +126,17 @@
 def gengeo(mntable,shift=[0.0,0.0,0.0],scale=1.0,**kw):
 	""" Imports geometry from LSMGenGeo library and creates spheres.
 	shift[X,Y,Z] parameter moves the specimen.
-	Remaining **kw arguments are passed to utils.sphere; 
+	Remaining **kw arguments are passed to :yref:`yade.utils.sphere`; 
 	
 	LSMGenGeo library allows to create pack of spheres
 	with given [Rmin:Rmax] with null stress inside the specimen.
-	Can be usefull for Mining Rock simulation.
-	
-	Example added to scripts/test/regular-sphere-pack.py
-	Example of LSMGenGeo library using is added to genCylLSM.py
-	
-	https://answers.launchpad.net/esys-particle/+faq/877
-	http://www.access.edu.au/lsmgengeo_python_doc/current/pythonapi/html/GenGeo-module.html
-	https://svn.esscc.uq.edu.au/svn/esys3/lsm/contrib/LSMGenGeo/""";
+	Can be useful for Mining Rock simulation.
+	
+	Example: :ysrc:`scripts/test/regular-sphere-pack.py`, usage of LSMGenGeo library in :ysrc:`scripts/test/genCylLSM.py`.
+	
+	* https://answers.launchpad.net/esys-particle/+faq/877
+	* http://www.access.edu.au/lsmgengeo_python_doc/current/pythonapi/html/GenGeo-module.html
+	* https://svn.esscc.uq.edu.au/svn/esys3/lsm/contrib/LSMGenGeo/""";
 	from GenGeo import MNTable3D,Sphere
 	
 	ret=[]

=== modified file 'scripts/test/CundallStrackTest.py'
--- scripts/test/CundallStrackTest.py	2009-12-25 14:46:48 +0000
+++ scripts/test/CundallStrackTest.py	2010-03-15 14:35:44 +0000
@@ -26,7 +26,7 @@
 		Ig2_Sphere_Sphere_Dem3DofGeom()
 	]),
 	InteractionPhysicsDispatcher(
-		[Ip2_BMP_BMP_CSPhys()]
+		[Ip2_2xFrictMat_CSPhys()]
 	),
 
 	LawDispatcher([Law2_Dem3Dof_CSPhys_CundallStrack()]),