← Back to team overview

yade-dev team mailing list archive

[svn] r1885 - in trunk: pkg/dem scripts

 

Author: gladky_anton
Date: 2009-07-24 17:30:47 +0200 (Fri, 24 Jul 2009)
New Revision: 1885

Added:
   trunk/scripts/installOnUbuntu.sh
Modified:
   trunk/pkg/dem/RockPM.cpp
   trunk/pkg/dem/RockPM.hpp
Log:
1. RockPM update. Added simple "destruction mechanism"
2. Added scripts/installOnUbuntu.sh to make "oneButton-checkout+compile+install+doxygen+epydoc" script. Not tested yet. Requires corrections.



Modified: trunk/pkg/dem/RockPM.cpp
===================================================================
--- trunk/pkg/dem/RockPM.cpp	2009-07-24 03:18:08 UTC (rev 1884)
+++ trunk/pkg/dem/RockPM.cpp	2009-07-24 15:30:47 UTC (rev 1885)
@@ -34,35 +34,64 @@
 	Dem3DofGeom* geom=static_cast<Dem3DofGeom*>(ig.get());
 	RpmPhys* phys=static_cast<RpmPhys*>(ip.get());
 
-	Real displN=geom->displacementN();	
+	Real displN=geom->displacementN();
+	const Real& crossSection=phys->crossSection;
+	
+	Real& epsN=phys->epsN;
+	Vector3r& epsT=phys->epsT;
+	
+	Real& sigmaN=phys->sigmaN;
+	Vector3r& sigmaT=phys->sigmaT;
+	
+	const Real& E = phys->E;
+	const Real& G = phys->G;
+	
+	Real& Fn=phys->Fn;
+	Vector3r& Fs=phys->Fs;
+	
+	
 	const shared_ptr<Body>& body1=Body::byId(contact->getId1(),rootBody);
 	const shared_ptr<Body>& body2=Body::byId(contact->getId2(),rootBody);
 	assert(body1);
 	assert(body2);
 	const shared_ptr<RpmMat>& rbp1=YADE_PTR_CAST<RpmMat>(body1->physicalParameters);
 	const shared_ptr<RpmMat>& rbp2=YADE_PTR_CAST<RpmMat>(body2->physicalParameters);
-
+	
 	//check, whether one of bodies is damaged
 	if ((rbp1->isDamaged) || (rbp2->isDamaged)) {
 		phys->isCohesive = false;
 	}
-				
-				
+
 	if(displN<=0){
 		/*Normal Interaction*/
-		phys->normalForce=phys->kn*displN*geom->normal;
-		Real maxFsSq=phys->normalForce.SquaredLength()*pow(phys->tanFrictionAngle,2);
-		Vector3r trialFs=phys->ks*geom->displacementT();
-		if(trialFs.SquaredLength()>maxFsSq){ geom->slipToDisplacementTMax(sqrt(maxFsSq)); trialFs*=sqrt(maxFsSq/(trialFs.SquaredLength()));} 
-		applyForceAtContactPoint(phys->normalForce+trialFs,geom->contactPoint,contact->getId1(),geom->se31.position,contact->getId2(),geom->se32.position,rootBody);
+		epsN=geom->strainN();
+		epsT=geom->strainT();
+		
+		
+		sigmaN=E*epsN;
+		Fn=sigmaN*crossSection; phys->normalForce=Fn*geom->normal;
+		
+		sigmaT=G*epsT;
+
+		/*Check, whether the shear stress more, than normal force multiplicated to tanFrictionAngle*/
+		
+		Real maxFsSq = phys->normalForce.SquaredLength()*phys->tanFrictionAngle*phys->tanFrictionAngle;
+		if(sigmaT.SquaredLength()>maxFsSq) {
+			sigmaT*=sqrt(maxFsSq/(sigmaT.SquaredLength()));
+		}
+		
+		Fs=sigmaT*crossSection;
+		phys->shearForce = Fs;
+
+		applyForceAtContactPoint(phys->normalForce + phys->shearForce, geom->contactPoint, contact->getId1(), geom->se31.position, contact->getId2(), geom->se32.position, rootBody);
 		/*Normal Interaction_____*/
-		
 		if ((phys->isCohesive)&&(displN<(-phys->lengthMaxCompression))) {
 			//LOG_WARN(displN<<"__COMRESS!!!__");
 			phys->isCohesive = false;
 			rbp1->isDamaged=true;
 			rbp2->isDamaged=true;
 		}
+		return;
 	} else {
 		if (phys->isCohesive) {
 			if (displN>(phys->lengthMaxTension)) {
@@ -70,20 +99,17 @@
 				phys->isCohesive = false;
 				rbp1->isDamaged=true;
 				rbp2->isDamaged=true;
-				return;
+				return; 
 			} else {
 				phys->normalForce=phys->kn*displN*geom->normal;
-				Real maxFsSq=phys->normalForce.SquaredLength()*pow(phys->tanFrictionAngle,2);
-				Vector3r trialFs=phys->ks*geom->displacementT();
-				if(trialFs.SquaredLength()>maxFsSq){ geom->slipToDisplacementTMax(sqrt(maxFsSq)); trialFs*=sqrt(maxFsSq/(trialFs.SquaredLength()));} 
-				applyForceAtContactPoint(phys->normalForce+trialFs,geom->contactPoint,contact->getId1(),geom->se31.position,contact->getId2(),geom->se32.position,rootBody);
+				applyForceAtContactPoint(phys->normalForce, geom->contactPoint, contact->getId1(), geom->se31.position, contact->getId2(), geom->se32.position, rootBody);
+				return;
 			}
 		} else {
 			rootBody->interactions->requestErase(contact->getId1(),contact->getId2());
 			return;
 		}
 	}
-	
 }
 
 
@@ -101,26 +127,28 @@
 	
 	const shared_ptr<BodyMacroParameters>& elast1=static_pointer_cast<BodyMacroParameters>(pp1);
 	const shared_ptr<BodyMacroParameters>& elast2=static_pointer_cast<BodyMacroParameters>(pp2);
-
+	long cohesiveThresholdIter=1000;
+	
 	bool initCohesive = rpm1->initCohesive*rpm2->initCohesive;
 	
 	Real E12=2*elast1->young*elast2->young/(elast1->young+elast2->young);
 	Real minRad=(contGeom->refR1<=0?contGeom->refR2:(contGeom->refR2<=0?contGeom->refR1:min(contGeom->refR1,contGeom->refR2)));
 	Real S12=Mathr::PI*pow(minRad,2);
+	Real G_over_E = (rpm1->G_over_E + rpm2->G_over_E)/2;
 	shared_ptr<RpmPhys> contPhys(new RpmPhys());
 	contPhys->E=E12;
-	contPhys->G=E12;
+	contPhys->G=E12*G_over_E;
 	contPhys->tanFrictionAngle=tan(.5*(elast1->frictionAngle+elast2->frictionAngle));
 	contPhys->crossSection=S12;
 	contPhys->kn=contPhys->E*contPhys->crossSection;
 	contPhys->ks=contPhys->G*contPhys->crossSection;
 	
 	contPhys->lengthMaxCompression=S12*(0.5*(rpm1->stressCompressMax+rpm2->stressCompressMax))/(contPhys->kn);
-	contPhys->lengthMaxTension=S12*(0.5*(rpm1->stressTensionMax+rpm2->stressTensionMax))/(contPhys->kn);
+	contPhys->lengthMaxTension=S12*(0.5*(rpm1->stressCompressMax*rpm1->Brittleness+rpm2->stressCompressMax*rpm2->Brittleness))/(contPhys->kn);
 	
 	initDistance = contGeom->displacementN();
 
-	if ((rpm1->exampleNumber==rpm2->exampleNumber)&&(initDistance<(contPhys->lengthMaxTension))&&(initCohesive)&&(OO.getCurrentIteration()==0)) {
+	if ((rpm1->exampleNumber==rpm2->exampleNumber)&&(initDistance<(contPhys->lengthMaxTension))&&(initCohesive)&&(OO.getCurrentIteration()<=cohesiveThresholdIter)) {
 		contPhys->isCohesive=true;
 		//LOG_WARN("InitDistance="<<initDistance<<"  "<<rpm1->exampleNumber<<"  "<<rpm2->exampleNumber<<" "<<OO.getCurrentIteration());
 		//LOG_WARN("lengthMaxCompression="<<contPhys->lengthMaxCompression);

Modified: trunk/pkg/dem/RockPM.hpp
===================================================================
--- trunk/pkg/dem/RockPM.hpp	2009-07-24 03:18:08 UTC (rev 1884)
+++ trunk/pkg/dem/RockPM.hpp	2009-07-24 15:30:47 UTC (rev 1885)
@@ -48,15 +48,16 @@
 	public:
 		int exampleNumber; //Number of "stone"
 		bool initCohesive, isDamaged;
-		Real stressCompressMax, stressTensionMax; //Parameters for damaging
-
-		RpmMat(): exampleNumber(0.), initCohesive(false), isDamaged(false), stressCompressMax(0), stressTensionMax(0) {createIndex();};
+		Real stressCompressMax, Brittleness, G_over_E; //Parameters for damaging
+		
+		RpmMat(): exampleNumber(0.), initCohesive(false), isDamaged(false), stressCompressMax(0), Brittleness(0), G_over_E(1) {createIndex();};
 		REGISTER_ATTRIBUTES(BodyMacroParameters, 
 			(exampleNumber)
 			(initCohesive)
 			(isDamaged)
 			(stressCompressMax)
-			(stressTensionMax));
+			(Brittleness)
+			(G_over_E));
 		REGISTER_CLASS_AND_BASE(RpmMat,BodyMacroParameters);
 };
 REGISTER_SERIALIZABLE(RpmMat);
@@ -65,7 +66,7 @@
 class Ip2_RpmMat_RpmMat_RpmPhys: public InteractionPhysicsEngineUnit{
 	private:
 	public:
-		Real sigmaT, initDistance;
+		Real initDistance;
 
 		Ip2_RpmMat_RpmMat_RpmPhys(){
 			initDistance = 0;
@@ -73,7 +74,6 @@
 
 		virtual void go(const shared_ptr<PhysicalParameters>& pp1, const shared_ptr<PhysicalParameters>& pp2, const shared_ptr<Interaction>& interaction);
 		REGISTER_ATTRIBUTES(InteractionPhysicsEngineUnit,
-			(sigmaT)
 			(initDistance)
 		);
 
@@ -88,9 +88,13 @@
 	private:
 	public:
 		Real crossSection,E,G,tanFrictionAngle,lengthMaxCompression,lengthMaxTension;
+		Real omega, Fn, sigmaN, epsN;
+		Vector3r epsT, sigmaT, Fs;
+		 
+
 		bool isCohesive;
 
-		RpmPhys(): NormalShearInteraction(),crossSection(0),E(0),G(0), tanFrictionAngle(0), lengthMaxCompression(0), lengthMaxTension(0), isCohesive(false) { createIndex();}
+		RpmPhys(): NormalShearInteraction(),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(NormalShearInteraction,

Added: trunk/scripts/installOnUbuntu.sh
===================================================================
--- trunk/scripts/installOnUbuntu.sh	2009-07-24 03:18:08 UTC (rev 1884)
+++ trunk/scripts/installOnUbuntu.sh	2009-07-24 15:30:47 UTC (rev 1885)
@@ -0,0 +1,22 @@
+#!/bin/bash
+# This script works on Ubuntu 9.04, and possibly on new Debians.
+# It "compiles and installs" the latest YADE SVN-version.
+# The install is maximal: you will get almost all YADE functionality, even if you dont need it
+# Please, copy this script to the empty directory and start it.
+# 
+
+
+BASEDIR='./'
+VERSION='trunk'
+sudo aptitude install scons libqt3-mt-dev qt3-dev-tools freeglut3-dev libboost-date-time-dev libboost-filesystem-dev libboost-thread-dev libboost-regex-dev fakeroot dpkg-dev build-essential g++ libboost-iostreams-dev liblog4cxx10-dev python-dev libboost-python-dev ipython python-matplotlib libsqlite3-dev python-numeric python-tk gnuplot doxygen python-pygraphviz python-epydoc
+
+svn checkout https://svn.berlios.de/svnroot/repos/yade/trunk
+mkdir $BASEDIR/build
+mkdir $BASEDIR/data
+cd $BASEDIR/trunk
+scons PREFIX=$BASEDIR/../build optimize=1 -j2 openmp=True features=log4cxx,python,openGL,GTS version=$VERSION
+scons doc
+cd ..
+$BASEDIR/build/bin/yade-$VERSION yade-epydoc.py
+
+


Property changes on: trunk/scripts/installOnUbuntu.sh
___________________________________________________________________
Name: svn:executable
   + *