← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2156: - Register, rename, clean code, doccument some attributes.

 

------------------------------------------------------------
revno: 2156
committer: Bruno Chareyre <bchareyre@r1arduina>
branch nick: trunk
timestamp: Mon 2010-04-19 15:08:27 +0200
message:
  - Register, rename, clean code, doccument some attributes.
renamed:
  pkg/dem/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.cpp => pkg/dem/DataClass/InteractionPhysics/CohFrictPhys.cpp
  pkg/dem/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.hpp => pkg/dem/DataClass/InteractionPhysics/CohFrictPhys.hpp
  pkg/dem/DataClass/Material/CohesiveFrictionalMat.cpp => pkg/dem/DataClass/Material/CohFrictMat.cpp
  pkg/dem/DataClass/Material/CohesiveFrictionalMat.hpp => pkg/dem/DataClass/Material/CohFrictMat.hpp
  pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.cpp => pkg/dem/Engine/Functor/Ip2_2xCohFrictMat_CohFrictPhys.cpp
  pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.hpp => pkg/dem/Engine/Functor/Ip2_2xCohFrictMat_CohFrictPhys.hpp
modified:
  pkg/dem/DataClass/InteractionPhysics/CohFrictPhys.cpp
  pkg/dem/DataClass/InteractionPhysics/CohFrictPhys.hpp
  pkg/dem/DataClass/Material/CohFrictMat.cpp
  pkg/dem/DataClass/Material/CohFrictMat.hpp
  pkg/dem/Engine/Functor/Ip2_2xCohFrictMat_CohFrictPhys.cpp
  pkg/dem/Engine/Functor/Ip2_2xCohFrictMat_CohFrictPhys.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
=== renamed file 'pkg/dem/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.cpp' => 'pkg/dem/DataClass/InteractionPhysics/CohFrictPhys.cpp'
--- pkg/dem/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.cpp	2009-12-02 12:26:23 +0000
+++ pkg/dem/DataClass/InteractionPhysics/CohFrictPhys.cpp	2010-04-19 13:08:27 +0000
@@ -6,53 +6,19 @@
 *  GNU General Public License v2 or later. See file LICENSE for details. *
 *************************************************************************/
 
-#include "CohesiveFrictionalContactInteraction.hpp"
-
-
-CohesiveFrictionalContactInteraction::CohesiveFrictionalContactInteraction()
-{
-	createIndex();
-	cohesionDisablesFriction = false;
-	cohesionBroken = true;
-	fragile = true;
-	normalAdhesion = 0;
-	shearAdhesion = 0;
-	moment_twist = Vector3r(0,0,0);
-	moment_bending = Vector3r(0,0,0);
-
-// assign neutral value	
-	orientationToContact1 = Quaternionr(1.0,0.0,0.0,0.0);
-	orientationToContact2 = Quaternionr(1.0,0.0,0.0,0.0);
-	initialOrientation1 = Quaternionr(1.0,0.0,0.0,0.0);
-	initialOrientation2 = Quaternionr(1.0,0.0,0.0,0.0);
-	twistCreep          = Quaternionr(1.0,0.0,0.0,0.0);
-	kr = 0;
-	currentContactOrientation = Quaternionr(1.0,0.0,0.0,0.0);
-	initialContactOrientation = Quaternionr(1.0,0.0,0.0,0.0);
-	initialPosition1=initialPosition2=Vector3r(1,0,0);
-}
-
-void CohesiveFrictionalContactInteraction::SetBreakingState()
-{
-	
-	//if (fragile) {
+#include "CohFrictPhys.hpp"
+
+void CohFrictPhys::SetBreakingState()
+{	
+	if (fragile) {
 		cohesionBroken = true;
 		normalAdhesion = 0;
-		shearAdhesion = 0;//}
-	
+		shearAdhesion = 0;}	
 }
 
-CohesiveFrictionalContactInteraction::~CohesiveFrictionalContactInteraction()
+CohFrictPhys::~CohFrictPhys()
 {
 }
-
-// void CohesiveFrictionalContactInteraction::postProcessAttributes(bool)
-// {
-// 
-// }
-
-
-YADE_PLUGIN((CohesiveFrictionalContactInteraction));
-
-//YADE_REQUIRE_FEATURE(PHYSPAR);
+YADE_PLUGIN((CohFrictPhys));
+
 

=== renamed file 'pkg/dem/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.hpp' => 'pkg/dem/DataClass/InteractionPhysics/CohFrictPhys.hpp'
--- pkg/dem/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.hpp	2010-01-10 09:09:32 +0000
+++ pkg/dem/DataClass/InteractionPhysics/CohFrictPhys.hpp	2010-04-19 13:08:27 +0000
@@ -11,39 +11,38 @@
 #include<yade/pkg-common/NormShearPhys.hpp>
 #include<yade/pkg-dem/FrictPhys.hpp>
 
-class CohesiveFrictionalContactInteraction : public FrictPhys
+class CohFrictPhys : public FrictPhys
 {
 	public :
-		bool		cohesionDisablesFriction,	//is shear strength the sum of friction and adhesion or only adhesion?
-				cohesionBroken,	//is cohesion active? should be set to false when a fragile contact is broken
-				fragile;	//do cohesion disapear when contact strength is exceeded?
-
-		Real		normalAdhesion			// max tensile force
-				,shearAdhesion;			// max shear force (actual max force can include friction too depending on cohesionDisablesFriction)
-
-		Quaternionr	initialOrientation1,initialOrientation2,
-				orientationToContact1,orientationToContact2,
-				currentContactOrientation,initialContactOrientation,
-				twistCreep;
-		Vector3r	initialPosition1,initialPosition2;
-		Real		kr; // rolling stiffness
-		Vector3r	moment_twist,moment_bending;
+		virtual ~CohFrictPhys();
+		void SetBreakingState ();
 	
-		CohesiveFrictionalContactInteraction();
-		virtual ~CohesiveFrictionalContactInteraction();
-		void SetBreakingState ();
-
-	REGISTER_ATTRIBUTES(NormPhys,
-		(prevNormal)(shearForce)(ks)(initialKn)(initialKs)(tangensOfFrictionAngle)(cohesionDisablesFriction)(fragile)(cohesionBroken)(normalAdhesion)(shearAdhesion)
-		// FIXME where this?
-		(orientationToContact1)(orientationToContact2)(initialOrientation1)(initialOrientation2)(kr)(currentContactOrientation)(initialContactOrientation)(initialPosition1)(initialPosition2)(twistCreep)
-		(moment_twist)(moment_bending)
+	YADE_CLASS_BASE_DOC_ATTRS_CTOR(CohFrictPhys,FrictPhys,"",
+		((bool,cohesionDisablesFriction,false,"is shear strength the sum of friction and adhesion or only adhesion?"))
+		((bool,cohesionBroken,true,"is cohesion active? will be set false when a fragile contact is broken"))
+		((bool,fragile,true,"do cohesion disapear when contact strength is exceeded?"))
+		((Real,kr,0,"rotational stiffness [N.m/rad]"))
+		((Real,normalAdhesion,0,"tensile strength"))
+		((Real,shearAdhesion,0,"cohesive part of the shear strength (a frictional term might be added depending on :yref:`Law2_ScGeom_CohFrictPhys_ElasticPlastic::cohesionDisablesFriction`)"))
+		// internal attributes
+		((Vector3r,moment_twist,Vector3r(0,0,0),""))
+		((Vector3r,moment_bending,Vector3r(0,0,0),""))
+		((Vector3r,initialPosition1,Vector3r(0,0,0),""))
+		((Vector3r,initialPosition2,Vector3r(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,initialOrientation1,Quaternionr(1.0,0.0,0.0,0.0),""))
+		((Quaternionr,initialOrientation2,Quaternionr(1.0,0.0,0.0,0.0),""))
+		((Quaternionr,twistCreep,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),""))
+		,
+		createIndex();
 	);
-	REGISTER_CLASS_NAME(CohesiveFrictionalContactInteraction);
-	REGISTER_BASE_CLASS_NAME(FrictPhys);
-	REGISTER_CLASS_INDEX(CohesiveFrictionalContactInteraction,FrictPhys);
+/// Indexable	
+	REGISTER_CLASS_INDEX(CohFrictPhys,FrictPhys);
 
 };
 
-REGISTER_SERIALIZABLE(CohesiveFrictionalContactInteraction);
+REGISTER_SERIALIZABLE(CohFrictPhys);
 

=== renamed file 'pkg/dem/DataClass/Material/CohesiveFrictionalMat.cpp' => 'pkg/dem/DataClass/Material/CohFrictMat.cpp'
--- pkg/dem/DataClass/Material/CohesiveFrictionalMat.cpp	2010-04-08 14:54:58 +0000
+++ pkg/dem/DataClass/Material/CohFrictMat.cpp	2010-04-19 13:08:27 +0000
@@ -6,14 +6,14 @@
 *  GNU General Public License v2 or later. See file LICENSE for details. *
 *************************************************************************/
 
-#include "CohesiveFrictionalMat.hpp"
-
-
-CohesiveFrictionalMat::~CohesiveFrictionalMat()
+#include "CohFrictMat.hpp"
+
+
+CohFrictMat::~CohFrictMat()
 {
 }
 
-YADE_PLUGIN((CohesiveFrictionalMat));
+YADE_PLUGIN((CohFrictMat));
 
 
 

=== renamed file 'pkg/dem/DataClass/Material/CohesiveFrictionalMat.hpp' => 'pkg/dem/DataClass/Material/CohFrictMat.hpp'
--- pkg/dem/DataClass/Material/CohesiveFrictionalMat.hpp	2010-04-08 14:54:58 +0000
+++ pkg/dem/DataClass/Material/CohFrictMat.hpp	2010-04-19 13:08:27 +0000
@@ -13,21 +13,21 @@
 #include<yade/pkg-common/ElastMat.hpp>
 
 
-class CohesiveFrictionalMat : public FrictMat
+class CohFrictMat : public FrictMat
 {
 	public :
-		virtual ~CohesiveFrictionalMat ();
+		virtual ~CohFrictMat ();
 
 /// Serialization
-	YADE_CLASS_BASE_DOC_ATTRS_CTOR(CohesiveFrictionalMat,FrictMat,"",
+	YADE_CLASS_BASE_DOC_ATTRS_CTOR(CohFrictMat,FrictMat,"",
 		((bool,isBroken,true,""))
 		((bool,isCohesive,true,"")),
 		createIndex();
 					);
 /// Indexable
-	REGISTER_CLASS_INDEX(CohesiveFrictionalMat,FrictMat);
+	REGISTER_CLASS_INDEX(CohFrictMat,FrictMat);
 };
 
-REGISTER_SERIALIZABLE(CohesiveFrictionalMat);
+REGISTER_SERIALIZABLE(CohFrictMat);
 
 

=== renamed file 'pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.cpp' => 'pkg/dem/Engine/Functor/Ip2_2xCohFrictMat_CohFrictPhys.cpp'
--- pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.cpp	2009-12-13 20:11:31 +0000
+++ pkg/dem/Engine/Functor/Ip2_2xCohFrictMat_CohFrictPhys.cpp	2010-04-19 13:08:27 +0000
@@ -6,32 +6,19 @@
 *  GNU General Public License v2 or later. See file LICENSE for details. *
 *************************************************************************/
 
-#include"CohesiveFrictionalRelationships.hpp"
+#include"Ip2_2xCohFrictMat_CohFrictPhys.hpp"
 #include<yade/pkg-dem/ScGeom.hpp>
-#include<yade/pkg-dem/CohesiveFrictionalContactInteraction.hpp>
-#include<yade/pkg-dem/CohesiveFrictionalMat.hpp>
+#include<yade/pkg-dem/CohFrictPhys.hpp>
+#include<yade/pkg-dem/CohFrictMat.hpp>
 #include<yade/core/Omega.hpp>
 #include<yade/core/Scene.hpp>
 
-
-CohesiveFrictionalRelationships::CohesiveFrictionalRelationships()
-{
-		normalCohesion = 10000000;
-		shearCohesion = 10000000;
-		setCohesionNow = false;
-		setCohesionOnNewContacts = false;
-		cohesionDefinitionIteration = -1; 
-
-//		elasticRollingLimit = ;
-}
-
-
-void CohesiveFrictionalRelationships::go(	  const shared_ptr<Material>& b1 // CohesiveFrictionalMat
-		, const shared_ptr<Material>& b2 // CohesiveFrictionalMat
+void Ip2_2xCohFrictMat_CohFrictPhys::go(	  const shared_ptr<Material>& b1 // CohFrictMat
+		, const shared_ptr<Material>& b2 // CohFrictMat
 					, const shared_ptr<Interaction>& interaction)
 {
-	CohesiveFrictionalMat* sdec1 = static_cast<CohesiveFrictionalMat*>(b1.get());
-	CohesiveFrictionalMat* sdec2 = static_cast<CohesiveFrictionalMat*>(b2.get());
+	CohFrictMat* sdec1 = static_cast<CohFrictMat*>(b1.get());
+	CohFrictMat* sdec2 = static_cast<CohFrictMat*>(b2.get());
 	ScGeom* interactionGeometry = YADE_CAST<ScGeom*>(interaction->interactionGeometry.get());
 	
 	//Create cohesive interractions only once
@@ -47,8 +34,8 @@
 		if(!interaction->interactionPhysics)
 		{
 //std::cerr << " isNew, id1: " << interaction->getId1() << " id2: " << interaction->getId2()  << "\n";
-			interaction->interactionPhysics = shared_ptr<CohesiveFrictionalContactInteraction>(new CohesiveFrictionalContactInteraction());
-			CohesiveFrictionalContactInteraction* contactPhysics = YADE_CAST<CohesiveFrictionalContactInteraction*>(interaction->interactionPhysics.get());
+			interaction->interactionPhysics = shared_ptr<CohFrictPhys>(new CohFrictPhys());
+			CohFrictPhys* contactPhysics = YADE_CAST<CohFrictPhys*>(interaction->interactionPhysics.get());
 
 			Real Ea 	= sdec1->young;
 			Real Eb 	= sdec2->young;
@@ -94,17 +81,6 @@
 				contactPhysics->currentContactOrientation = contactPhysics->initialContactOrientation;
 				contactPhysics->orientationToContact1   = contactPhysics->initialOrientation1.Conjugate() * contactPhysics->initialContactOrientation;
 				contactPhysics->orientationToContact2	= contactPhysics->initialOrientation2.Conjugate() * contactPhysics->initialContactOrientation;
-
-
-//if((interaction->getId1()==7 && interaction->getId2()==12)||(interaction->getId1()==12 && interaction->getId2()==7)){
-//Vector3r axis0;
-//Real angle0;
-//contactPhysics->initialRelativeOrientation.ToAxisAngle(axis0,angle0);
-//std::cout << "-----------------------\n"
-//                                               << " ax0: " <<  axis0[0] << " " << axis0[1] << " " << axis0[2] << " an0: " << angle0 << "\n";
-//}
-
-				//contactPhysics->elasticRollingLimit = elasticRollingLimit;
 			}
 
 			contactPhysics->prevNormal 			= interactionGeometry->normal;
@@ -130,7 +106,7 @@
 		{	
 			// FIXME - are those lines necessary ???? what they are doing in fact ???
 			// ANSWER - they are used when you setCohesionNow (contact isNew not)
-			CohesiveFrictionalContactInteraction* contactPhysics = YADE_CAST<CohesiveFrictionalContactInteraction*>(interaction->interactionPhysics.get());
+			CohFrictPhys* contactPhysics = YADE_CAST<CohFrictPhys*>(interaction->interactionPhysics.get());
 
 			contactPhysics->kn = contactPhysics->initialKn;
 			contactPhysics->ks = contactPhysics->initialKs;
@@ -155,18 +131,12 @@
 			contactPhysics->currentContactOrientation = contactPhysics->initialContactOrientation;
 			contactPhysics->orientationToContact1   = contactPhysics->initialOrientation1.Conjugate() * contactPhysics->initialContactOrientation;
 			contactPhysics->orientationToContact2	= contactPhysics->initialOrientation2.Conjugate() * contactPhysics->initialContactOrientation;
-//Vector3r axis0;
-//Real angle0;
-//contactPhysics->initialRelativeOrientation.ToAxisAngle(axis0,angle0);
-//std::cout << "id1: " << interaction->getId1() << " id2: " << interaction->getId2() << " | "
-//                                               << " ax0: " <<  axis0[0] << " " << axis0[1] << " " << axis0[2] << ", an0: " << angle0 << "\n";
-				//contactPhysics->elasticRollingLimit = elasticRollingLimit;
 			}
 		}	
 		
 	}
 };
-YADE_PLUGIN((CohesiveFrictionalRelationships));
+YADE_PLUGIN((Ip2_2xCohFrictMat_CohFrictPhys));
 
 
 

=== renamed file 'pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.hpp' => 'pkg/dem/Engine/Functor/Ip2_2xCohFrictMat_CohFrictPhys.hpp'
--- pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.hpp	2009-12-07 19:41:08 +0000
+++ pkg/dem/Engine/Functor/Ip2_2xCohFrictMat_CohFrictPhys.hpp	2010-04-19 13:08:27 +0000
@@ -10,30 +10,26 @@
 
 #include<yade/pkg-common/InteractionPhysicsFunctor.hpp>
 
-class CohesiveFrictionalRelationships : public InteractionPhysicsFunctor
+class Ip2_2xCohFrictMat_CohFrictPhys : public InteractionPhysicsFunctor
 {
 	public :
-		CohesiveFrictionalRelationships();
-
 		virtual void go(	const shared_ptr<Material>& b1,
 					const shared_ptr<Material>& b2,
 					const shared_ptr<Interaction>& interaction);
-
-		Real 		normalCohesion,
-				shearCohesion;
-
-		bool		setCohesionNow,
-				setCohesionOnNewContacts;
-				
 		int cohesionDefinitionIteration;
-		long iter;//REMOVE THIS
-
-		REGISTER_ATTRIBUTES(InteractionPhysicsFunctor,(normalCohesion)(shearCohesion)(setCohesionNow)(setCohesionOnNewContacts));
-	FUNCTOR2D(CohesiveFrictionalMat,CohesiveFrictionalMat);
-	REGISTER_CLASS_NAME(CohesiveFrictionalRelationships);
-	REGISTER_BASE_CLASS_NAME(InteractionPhysicsFunctor);
+		
+		YADE_CLASS_BASE_DOC_ATTRS_CTOR(Ip2_2xCohFrictMat_CohFrictPhys,InteractionPhysicsFunctor,
+		"Generates cohesive-frictional interactions with moments. Used in the contact law :yref:`Law2_ScGeom_CohFrictPhys_ElasticPlastic`.",
+		((bool,setCohesionNow,false,""))
+		((bool,setCohesionOnNewContacts,false,""))
+		((Real,normalCohesion,10000000,""))
+		((Real,shearCohesion,10000000,""))
+		,
+		cohesionDefinitionIteration = -1; 
+		);
+	FUNCTOR2D(CohFrictMat,CohFrictMat);
 };
 
-REGISTER_SERIALIZABLE(CohesiveFrictionalRelationships);
+REGISTER_SERIALIZABLE(Ip2_2xCohFrictMat_CohFrictPhys);