← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2035: 1. Document a few classes.

 

------------------------------------------------------------
revno: 2035
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-02-18 22:08:54 +0100
message:
  1. Document a few classes.
modified:
  pkg/common/Engine/Functor/Bo1_Sphere_Aabb.hpp
  pkg/common/Engine/PartialEngine/MomentEngine.cpp
  pkg/common/Engine/PartialEngine/MomentEngine.hpp
  pkg/dem/DataClass/InteractionGeometry/DemXDofGeom.hpp
  pkg/dem/DataClass/InteractionGeometry/ScGeom.hpp
  pkg/dem/Engine/Functor/Ig2_Facet_Sphere_ScGeom.cpp
  pkg/dem/Engine/Functor/Ig2_Facet_Sphere_ScGeom.hpp
  pkg/dem/Engine/Functor/Ig2_Sphere_Sphere_ScGeom.cpp
  pkg/dem/Engine/Functor/Ig2_Sphere_Sphere_ScGeom.hpp
  pkg/dem/Engine/Functor/Ip2_FrictMat_FrictMat_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 'pkg/common/Engine/Functor/Bo1_Sphere_Aabb.hpp'
--- pkg/common/Engine/Functor/Bo1_Sphere_Aabb.hpp	2010-02-09 16:50:30 +0000
+++ pkg/common/Engine/Functor/Bo1_Sphere_Aabb.hpp	2010-02-18 21:08:54 +0000
@@ -16,7 +16,7 @@
 		void go(const shared_ptr<Shape>& cm, shared_ptr<Bound>& bv, const Se3r&, const Body*);
 	FUNCTOR2D(Sphere,Aabb);
 	YADE_CLASS_BASE_DOC_ATTRS(Bo1_Sphere_Aabb,BoundFunctor,"Functor creating :yref:`Aabb` from :yref:`Sphere`.",
-		((Real,aabbEnlargeFactor,((void)"deactivated",-1),"Relative enlargement of the bounding box (e.g. for distant interaction detection); deactivated if negative."))
+		((Real,aabbEnlargeFactor,((void)"deactivated",-1),"Relative enlargement of the bounding box; deactivated if negative.\n\n.. note::\n\tThis attribute is used to create distant interaction, but is only meaningful with an :yref:`InteractionGeometryFunctor` which will not simply discard such interactions: :yref:`Ig2_Sphere_Sphere_Dem3DofGeom::distFactor` / :yref:`Ig2_Sphere_Sphere_ScGeom::interactionDetectionFactor` should have the same value as :yref:`aabbEnlargeFactor<Bo1_Sphere_Aabb::aabbEnlargeFactor>`."))
 	);
 };
 

=== modified file 'pkg/common/Engine/PartialEngine/MomentEngine.cpp'
--- pkg/common/Engine/PartialEngine/MomentEngine.cpp	2010-01-03 20:30:24 +0000
+++ pkg/common/Engine/PartialEngine/MomentEngine.cpp	2010-02-18 21:08:54 +0000
@@ -1,10 +1,6 @@
 #include"MomentEngine.hpp"
 #include<yade/core/Scene.hpp>
 
-
-MomentEngine::MomentEngine(): moment(Vector3r::ZERO){}
-MomentEngine::~MomentEngine(){}
-
 void MomentEngine::applyCondition(Scene* ncb){
 	FOREACH(const body_id_t id, subscribedBodies){
 		// check that body really exists?

=== modified file 'pkg/common/Engine/PartialEngine/MomentEngine.hpp'
--- pkg/common/Engine/PartialEngine/MomentEngine.hpp	2010-01-03 20:30:24 +0000
+++ pkg/common/Engine/PartialEngine/MomentEngine.hpp	2010-02-18 21:08:54 +0000
@@ -11,13 +11,11 @@
 #include<yade/core/PartialEngine.hpp>
 
 class MomentEngine: public PartialEngine{
-	public :
-		Vector3r moment;
-		MomentEngine();
-		virtual ~MomentEngine();
+	public:
 		virtual void applyCondition(Scene*);
-	REGISTER_ATTRIBUTES(PartialEngine,(moment));
-	REGISTER_CLASS_AND_BASE(MomentEngine,PartialEngine);
+	YADE_CLASS_BASE_DOC_ATTRS(MomentEngine,PartialEngine,"Apply given torque (momentum) value at every subscribed particle, at every step.",
+		((Vector3r,moment,Vector3r::ZERO,"Torque value to be applied."))
+	);
 };
 REGISTER_SERIALIZABLE(MomentEngine);
 

=== modified file 'pkg/dem/DataClass/InteractionGeometry/DemXDofGeom.hpp'
--- pkg/dem/DataClass/InteractionGeometry/DemXDofGeom.hpp	2010-02-09 16:50:30 +0000
+++ pkg/dem/DataClass/InteractionGeometry/DemXDofGeom.hpp	2010-02-18 21:08:54 +0000
@@ -7,7 +7,7 @@
 	It might be removed in the future. */
 class GenericSpheresContact: public InteractionGeometry{
 	YADE_CLASS_BASE_DOC_ATTRS(GenericSpheresContact,InteractionGeometry,
-		"Class uniting ScGeom and Dem3DofGeom, for the purposes of GlobalSittnessTimeStepper. (It might be removed inthe future). Do not use this class directly.",
+		"Class uniting :yref:`ScGeom` and :yref:`Dem3DofGeom`, for the purposes of :yref:`GlobalStiffnessTimeStepper`. (It might be removed inthe future). Do not use this class directly.",
 		((Vector3r,normal,,"Unit vector oriented along the interaction. |yupdate|"))
 		((Real,refR1,,"Reference radius of particle #1. |ycomp|"))
 		((Real,refR2,,"Reference radius of particle #2. |ycomp|"))

=== modified file 'pkg/dem/DataClass/InteractionGeometry/ScGeom.hpp'
--- pkg/dem/DataClass/InteractionGeometry/ScGeom.hpp	2010-02-09 20:22:04 +0000
+++ pkg/dem/DataClass/InteractionGeometry/ScGeom.hpp	2010-02-18 21:08:54 +0000
@@ -29,7 +29,7 @@
 
 		void updateShearForce(Vector3r& shearForce, Real ks, const Vector3r& prevNormal, const State* rbp1, const State* rbp2, Real dt, bool avoidGranularRatcheting=true);
 
-	YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(ScGeom,GenericSpheresContact,"Class representing geometry of two spheres in contact.",
+	YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(ScGeom,GenericSpheresContact,"Class representing :yref:`geometry<InteractionGeometry>` of two :yref:`spheres<Sphere>` in contact. The contact has 3 DOFs (normal and 2×shear) and uses incremental algorithm for updating shear. (For shear formulated in total displacements and rotations, see :yref:`Dem3DofGeom` and related classes).\n\nWe use symbols :math:`\\vec{x}`, :math:`\\vec{v}`, :math:`\\vec{\\omega}` respectively for position, linear and angular velocities (all in global coordinates) and :math:`r` for particles radii; subscripted with 1 or 2 to distinguish 2 spheres in contact. Then we compute unit contact normal\n\n.. math::\n\n\t\\vec{n}=\\frac{\\vec{x}_2-\\vec{x}_1}{||\\vec{x}_2-\\vec{x}_1||}\n\nRelative velocity of spheres is then\n\n.. math::\n\n\t\\vec{v}_{12}=(\\vec{v}_2+\\vec{\\omega}_2\\times(-r_2\\vec{n}))-(\\vec{v}_1+\\vec{\\omega}_1\\times(r_1\\vec{n}))\n\nand its shear component\n\n.. math::\n\n\t\\Delta\\vec{v}_{12}^s=\\vec{v}_{12}-(\\vec{n}\\cdot\\vec{v}_{12})\\vec{n}.\n\nTangential displacement increment over last step then reads\n\n.. math::\n\n\t\\vec{x}_{12}^s=\\Delta t \\vec{v}_{12}^s.",
 		((Vector3r,contactPoint,Vector3r::ZERO,"Reference point of the contact. |ycomp|"))
 		#ifdef SCG_SHEAR
 			((Vector3r,shear,Vector3r::ZERO,"Total value of the current shear. Update the value using ScGeom::updateShear. |ycomp|"))

=== modified file 'pkg/dem/Engine/Functor/Ig2_Facet_Sphere_ScGeom.cpp'
--- pkg/dem/Engine/Functor/Ig2_Facet_Sphere_ScGeom.cpp	2010-02-09 20:22:04 +0000
+++ pkg/dem/Engine/Functor/Ig2_Facet_Sphere_ScGeom.cpp	2010-02-18 21:08:54 +0000
@@ -15,11 +15,6 @@
 
 CREATE_LOGGER(Ig2_Facet_Sphere_ScGeom);
 
-Ig2_Facet_Sphere_ScGeom::Ig2_Facet_Sphere_ScGeom() 
-{
-	shrinkFactor=0;
-}
-
 bool Ig2_Facet_Sphere_ScGeom::go(const shared_ptr<Shape>& cm1,
 							const shared_ptr<Shape>& cm2,
 							const State& state1,

=== modified file 'pkg/dem/Engine/Functor/Ig2_Facet_Sphere_ScGeom.hpp'
--- pkg/dem/Engine/Functor/Ig2_Facet_Sphere_ScGeom.hpp	2009-12-13 20:30:13 +0000
+++ pkg/dem/Engine/Functor/Ig2_Facet_Sphere_ScGeom.hpp	2010-02-18 21:08:54 +0000
@@ -14,7 +14,7 @@
 class Ig2_Facet_Sphere_ScGeom : public InteractionGeometryFunctor
 {
 	public :
-		virtual bool go(	const shared_ptr<Shape>& cm1,
+		virtual bool go(const shared_ptr<Shape>& cm1,
 					const shared_ptr<Shape>& cm2,
 					const State& state1,
 					const State& state2,
@@ -28,26 +28,12 @@
 					const Vector3r& shift2,
 					const bool& force,
 					const shared_ptr<Interaction>& c);
-					
-		Ig2_Facet_Sphere_ScGeom();		
-					
-	REGISTER_CLASS_NAME(Ig2_Facet_Sphere_ScGeom);
-	REGISTER_BASE_CLASS_NAME(InteractionGeometryFunctor);
-	REGISTER_ATTRIBUTES(InteractionGeometryFunctor,(shrinkFactor));
-
+	YADE_CLASS_BASE_DOC_ATTRS(Ig2_Facet_Sphere_ScGeom,InteractionGeometryFunctor,"Create/update a :yref:`ScGeom` instance representing intersection of :yref:`Facet` and :yref:`Sphere`.",
+		((Real,shrinkFactor,((void)"no shrinking",0),"The radius of the inscribed circle of the facet is decreased by the value of the sphere's radius multipled by *shrinkFactor*. From the definition of contact point on the surface made of facets, the given surface is not continuous and becomes in effect surface covered with triangular tiles, with gap between the separate tiles equal to the sphere's radius multiplied by 2×*shrinkFactor*. If zero, no shrinking is done."))
+	);
 	DECLARE_LOGGER;
-
 	FUNCTOR2D(Facet,Sphere);
-
 	DEFINE_FUNCTOR_ORDER_2D(Facet,Sphere);
-
-	// The radius of the inscribed circle of the facet is decreases by the
-	// value of the sphere's radius multipled by shrinkFactor. So, at
-	// definition of a contact point on the surface made of facets, the given
-	// surface is not continuous and is similar to a surface covered with a
-	// tile, with a gap between the separate tiles equal to the sphere's radius
-	// multiplied by 2*shrinkFactor. By default shrinkFactor=0.
-	Real shrinkFactor; 
 };
 
 REGISTER_SERIALIZABLE(Ig2_Facet_Sphere_ScGeom);

=== modified file 'pkg/dem/Engine/Functor/Ig2_Sphere_Sphere_ScGeom.cpp'
--- pkg/dem/Engine/Functor/Ig2_Sphere_Sphere_ScGeom.cpp	2010-02-09 20:22:04 +0000
+++ pkg/dem/Engine/Functor/Ig2_Sphere_Sphere_ScGeom.cpp	2010-02-18 21:08:54 +0000
@@ -10,12 +10,6 @@
 #include<yade/lib-base/Math.hpp>
 #include<yade/core/Omega.hpp>
 
-
-Ig2_Sphere_Sphere_ScGeom::Ig2_Sphere_Sphere_ScGeom()
-{
-	interactionDetectionFactor = 1;
-}
-
 bool Ig2_Sphere_Sphere_ScGeom::go(	const shared_ptr<Shape>& cm1,
 							const shared_ptr<Shape>& cm2,
 							const State& state1, const State& state2, const Vector3r& shift2, const bool& force,
@@ -51,7 +45,6 @@
 	return false;
 }
 
-
 bool Ig2_Sphere_Sphere_ScGeom::goReverse(	const shared_ptr<Shape>& cm1,
 								const shared_ptr<Shape>& cm2,
 								const State& state1,

=== modified file 'pkg/dem/Engine/Functor/Ig2_Sphere_Sphere_ScGeom.hpp'
--- pkg/dem/Engine/Functor/Ig2_Sphere_Sphere_ScGeom.hpp	2009-12-13 20:30:13 +0000
+++ pkg/dem/Engine/Functor/Ig2_Sphere_Sphere_ScGeom.hpp	2010-02-18 21:08:54 +0000
@@ -10,24 +10,13 @@
 
 #include<yade/pkg-common/InteractionGeometryFunctor.hpp>
 
-class Ig2_Sphere_Sphere_ScGeom : public InteractionGeometryFunctor
-{
-	public :
+class Ig2_Sphere_Sphere_ScGeom: public InteractionGeometryFunctor{
+	public:
 		virtual bool go(const shared_ptr<Shape>& cm1, const shared_ptr<Shape>& cm2, const State& state1, const State& se32, const Vector3r& shift2, const bool& force, const shared_ptr<Interaction>& c);
 		virtual bool goReverse(	const shared_ptr<Shape>& cm1, const shared_ptr<Shape>& cm2, const State& state1, const State& se32, const Vector3r& shift2, const bool& force, const shared_ptr<Interaction>& c);
-					
-		Ig2_Sphere_Sphere_ScGeom();		
-		
-		/*! enlarge both radii by this factor (if >1), to permit creation of distant interactions.
-		 *
-		 * InteractionGeometry will be computed when interactionDetectionFactor*(rad1+rad2) > distance.
-		 *
-		 * @note This parameter is functionally coupled with InteractinSphere2AABB::aabbEnlargeFactor,
-		 * which will create larger bounding boxes and should be of the same value. */
-		double interactionDetectionFactor;
-
-	REGISTER_CLASS_AND_BASE(Ig2_Sphere_Sphere_ScGeom,InteractionGeometryFunctor);
-	REGISTER_ATTRIBUTES(InteractionGeometryFunctor,(interactionDetectionFactor));
+	YADE_CLASS_BASE_DOC_ATTRS(Ig2_Sphere_Sphere_ScGeom,InteractionGeometryFunctor,"Create/update a :yref:`ScGeom` instance representing intersection of two :yref:`Spheres<Sphere>`.",
+		((Real,interactionDetectionFactor,1,"Enlarge both radii by this factor (if >1), to permit creation of distant interactions.\n\nInteractionGeometry will be computed when interactionDetectionFactor*(rad1+rad2) > distance.\n\n.. note::\n\t This parameter is functionally coupled with :yref:`Bo1_Sphere_Aabb::aabbEnlargeFactor`, which will create larger bounding boxes and should be of the same value.\n\n.. warning::\n\tFunctionally equal class :yref:`Ig2_Sphere_Sphere_Dem3DofGeom` (which creates :yref:`Dem3DofGeom` rather than :yref:`ScGeom`) calls this parameter :yref:`distFactor<Ig2_Sphere_Sphere_Dem3DofGeom::distFactor>`, but its semantics is *different* in some aspects."))
+	);
 	FUNCTOR2D(Sphere,Sphere);
 	// needed for the dispatcher, even if it is symmetric
 	DEFINE_FUNCTOR_ORDER_2D(Sphere,Sphere);

=== modified file 'pkg/dem/Engine/Functor/Ip2_FrictMat_FrictMat_FrictPhys.hpp'
--- pkg/dem/Engine/Functor/Ip2_FrictMat_FrictMat_FrictPhys.hpp	2010-01-10 09:09:32 +0000
+++ pkg/dem/Engine/Functor/Ip2_FrictMat_FrictMat_FrictPhys.hpp	2010-02-18 21:08:54 +0000
@@ -10,15 +10,13 @@
 
 #include<yade/pkg-common/InteractionPhysicsFunctor.hpp>
 
-class Ip2_FrictMat_FrictMat_FrictPhys : public InteractionPhysicsFunctor
-{
-	public :
-		virtual void go(	const shared_ptr<Material>& b1,
-					const shared_ptr<Material>& b2,
-					const shared_ptr<Interaction>& interaction);
+class Ip2_FrictMat_FrictMat_FrictPhys: public InteractionPhysicsFunctor{
+	public:
+		virtual void go(const shared_ptr<Material>& b1,
+			const shared_ptr<Material>& b2,
+			const shared_ptr<Interaction>& interaction);
 	FUNCTOR2D(FrictMat,FrictMat);
-	REGISTER_CLASS_AND_BASE(Ip2_FrictMat_FrictMat_FrictPhys,InteractionPhysicsFunctor);
-	REGISTER_ATTRIBUTES(InteractionPhysicsFunctor,/*nothing here*/);
+	YADE_CLASS_BASE_DOC(Ip2_FrictMat_FrictMat_FrictPhys,InteractionPhysicsFunctor,"Create a :yref:`FrictPhys` from two :yref:`FrictMats<FrictMat>`. Most parameters are averaged, but the exact algorithm is not documented. Only interactions with :yref:`ScGeom` or :yref:`Dem3DofGeom` geometry are meaningfully accepted; run-time typecheck can make this functor unnecessarily slow in general. Such design is problematic in itself, though -- from http://www.mail-archive.com/yade-dev@xxxxxxxxxxxxxxxxxxx/msg02603.html:\n\n\t\t\tYou have to suppose some exact type of InteractionGeometry in the Ip2 functor, but you don't know anything about it (Ip2 only guarantees you get certain InteractionPhysics types, via the dispatch mechanism).\n\n\t\t\tThat means, unless you use Ig2 functor producing the desired type, the code will break (crash or whatever). The right behavior would be either to accept any type (what we have now, at least in principle), or really enforce InteractionGeometry type of the interation passed to that particular Ip2 functor.\n\nEtc.");
 };
 REGISTER_SERIALIZABLE(Ip2_FrictMat_FrictMat_FrictPhys);