← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1993: 1. Convert a RockPM class to YADE_CLASS_BASE_DOC_ATTRS

 

------------------------------------------------------------
revno: 1993
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-01-27 15:17:05 +0100
message:
  1. Convert a RockPM class to YADE_CLASS_BASE_DOC_ATTRS
modified:
  pkg/dem/meta/RockPM.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/dem/meta/RockPM.hpp'
--- pkg/dem/meta/RockPM.hpp	2010-01-10 09:09:32 +0000
+++ pkg/dem/meta/RockPM.hpp	2010-01-27 14:17:05 +0000
@@ -20,56 +20,42 @@
 	public:
 		virtual void go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, Scene* rootBody);
 		FUNCTOR2D(Dem3DofGeom,RpmPhys);
-		REGISTER_CLASS_AND_BASE(Law2_Dem3DofGeom_RockPMPhys_Rpm,LawFunctor);
-		REGISTER_ATTRIBUTES(LawFunctor,/*nothing here*/);
-		DECLARE_LOGGER;	
+		
+	YADE_CLASS_BASE_DOC_ATTRDECL_CTOR_PY(Law2_Dem3DofGeom_RockPMPhys_Rpm,LawFunctor,"Constitutive law for the Rpm model",
+		((int,thisIsJustCap,0,"This is just a cap.")),,);
+	DECLARE_LOGGER;	
 };
 REGISTER_SERIALIZABLE(Law2_Dem3DofGeom_RockPMPhys_Rpm);
 
 /** This class holds information associated with each body */
 class RpmMat: public FrictMat {
-	public:
-		int exampleNumber; ///<Number of "stone"
-		bool initCohesive, isDamaged;
-		Real stressCompressMax, Brittleness, G_over_E; ///<Parameters for damaging
+		YADE_CLASS_BASE_DOC_ATTRDECL_CTOR_PY(RpmMat,FrictMat,"Rock material, for use with other Rpm classes.",
+			((int,exampleNumber,0,"Number of the specimen. This value is equal for all particles of one specimen. [-]"))
+			((bool,initCohesive,false,"The flag shows, whether particles of this material can be cohesive. [-]"))
+			((Real,stressCompressMax,0,"Maximal strength for compression. The main destruction parameter. [Pa] //(Needs to be reworked)"))
+			((Real,Brittleness,0,"One of destruction parameters. [-] //(Needs to be reworked)"))
+			((Real,G_over_E,1,"Ratio of normal/shear stiffness at interaction level. [-]")),
+			createIndex();,
+			/*py*/
+			);
 		
-		RpmMat(): 
-			exampleNumber(0.), 
-			initCohesive(false), 
-			isDamaged(false), 
-			stressCompressMax(0), 
-			Brittleness(0), 
-			G_over_E(1) {createIndex();};
-		REGISTER_ATTRIBUTES(FrictMat, 
-			(exampleNumber)
-			(initCohesive)
-			(isDamaged)
-			(stressCompressMax)
-			(Brittleness)
-			(G_over_E));
-		REGISTER_CLASS_AND_BASE(RpmMat,FrictMat);
 		REGISTER_CLASS_INDEX(RpmMat,FrictMat);
 };
 REGISTER_SERIALIZABLE(RpmMat);
 
 
 class Ip2_RpmMat_RpmMat_RpmPhys: public InteractionPhysicsFunctor{
-	private:
 	public:
 		Real initDistance;
-
 		Ip2_RpmMat_RpmMat_RpmPhys(){
 			initDistance = 0;
 		}
-
 		virtual void go(const shared_ptr<Material>& pp1, const shared_ptr<Material>& pp2, const shared_ptr<Interaction>& interaction);
-		REGISTER_ATTRIBUTES(InteractionPhysicsFunctor,
-			(initDistance)
-		);
-
 		FUNCTOR2D(RpmMat,RpmMat);
-		REGISTER_CLASS_AND_BASE(Ip2_RpmMat_RpmMat_RpmPhys,InteractionPhysicsFunctor);
 		DECLARE_LOGGER;
+		YADE_CLASS_BASE_DOC_ATTRS(Ip2_RpmMat_RpmMat_RpmPhys,InteractionPhysicsFunctor,"Convert 2 RpmMat instances to RpmPhys with corresponding parameters.",
+			((initDistance,"Initial distance between spheres at the first step."))
+		);
 };
 REGISTER_SERIALIZABLE(Ip2_RpmMat_RpmMat_RpmPhys);
 
@@ -77,32 +63,21 @@
 class RpmPhys: public NormShearPhys {
 	private:
 	public:
-		Real crossSection,E,G,tanFrictionAngle,lengthMaxCompression,lengthMaxTension;
 		Real omega, Fn, sigmaN, epsN;
 		Vector3r epsT, sigmaT, Fs;
 		 
-
-		bool isCohesive;
-
-		RpmPhys(): NormShearPhys(),
-			crossSection(0),
-			E(0),
-			G(0), 
-			tanFrictionAngle(0), 
-			lengthMaxCompression(0), 
-			lengthMaxTension(0), 
-			isCohesive(false) { createIndex(); epsT=Vector3r::ZERO; omega=0; Fn=0; Fs=Vector3r::ZERO;}
 		virtual ~RpmPhys();
 
-		REGISTER_ATTRIBUTES(NormShearPhys,
-			(E)
-			(G)
-			(tanFrictionAngle)
-			(isCohesive)
-			(lengthMaxCompression)
-			(lengthMaxTension)
+		YADE_CLASS_BASE_DOC_ATTRDECL_CTOR_PY(RpmPhys,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",
+			((Real,E,NaN,"normal modulus (stiffness / crossSection) [Pa]"))
+			((Real,crossSection,0,"equivalent cross-section associated with this contact [m²]"))
+			((Real,G,NaN,"shear modulus [Pa]"))
+			((Real,tanFrictionAngle,NaN,"tangens of internal friction angle [-]"))
+			((bool,isCohesive,false,"if not cohesive, interaction is deleted when distance is greater than lengthMaxTension or less than lengthMaxCompression."))
+			((Real,lengthMaxCompression,0,"Maximal penetration of particles during compression. If it is more, the interaction is deleted [m]"))
+			((Real,lengthMaxTension,0,"Maximal distance between particles during tension. If it is more, the interaction is deleted [m]"))
+			,createIndex(); epsT=Vector3r::ZERO; omega=0; Fn=0; Fs=Vector3r::ZERO;,
 		);
-	REGISTER_CLASS_AND_BASE(RpmPhys,NormShearPhys);
 	REGISTER_CLASS_INDEX(RpmPhys,NormShearPhys);
 };
 REGISTER_SERIALIZABLE(RpmPhys);


Follow ups