← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1811: Adaptation RockPM and PressTestEngine for material and state classes

 

------------------------------------------------------------
revno: 1811
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
branch nick: trunk
timestamp: Mon 2009-11-23 10:09:04 +0100
message:
  Adaptation RockPM and PressTestEngine for material and state classes
modified:
  pkg/common/Engine/DeusExMachina/PressTestEngine.cpp
  pkg/dem/meta/RockPM.cpp
  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/common/Engine/DeusExMachina/PressTestEngine.cpp'
--- pkg/common/Engine/DeusExMachina/PressTestEngine.cpp	2009-11-21 10:36:08 +0000
+++ pkg/common/Engine/DeusExMachina/PressTestEngine.cpp	2009-11-23 09:09:04 +0000
@@ -1,6 +1,5 @@
 
 #include"PressTestEngine.hpp"
-#include<yade/pkg-common/ParticleParameters.hpp>
 #include<yade/core/MetaBody.hpp>
 
 
@@ -51,6 +50,3 @@
 
 CREATE_LOGGER(PressTestEngine);
 YADE_PLUGIN((PressTestEngine));
-
-YADE_REQUIRE_FEATURE(PHYSPAR);
-

=== modified file 'pkg/dem/meta/RockPM.cpp'
--- pkg/dem/meta/RockPM.cpp	2009-11-21 10:36:08 +0000
+++ pkg/dem/meta/RockPM.cpp	2009-11-23 09:09:04 +0000
@@ -1,6 +1,5 @@
 #include"RockPM.hpp"
 #include<yade/core/MetaBody.hpp>
-#include<yade/pkg-dem/BodyMacroParameters.hpp>
 #include<yade/pkg-dem/DemXDofGeom.hpp>
 #include<yade/pkg-dem/Shop.hpp>
 
@@ -92,7 +91,7 @@
 
 CREATE_LOGGER(Ip2_RpmMat_RpmMat_RpmPhys);
 
-void Ip2_RpmMat_RpmMat_RpmPhys::go(const shared_ptr<PhysicalParameters>& pp1, const shared_ptr<PhysicalParameters>& pp2, const shared_ptr<Interaction>& interaction){
+void Ip2_RpmMat_RpmMat_RpmPhys::go(const shared_ptr<Material>& pp1, const shared_ptr<Material>& pp2, const shared_ptr<Interaction>& interaction){
 	if(interaction->interactionPhysics) return; 
 
 	Dem3DofGeom* contGeom=YADE_CAST<Dem3DofGeom*>(interaction->interactionGeometry.get());
@@ -102,20 +101,21 @@
 	const shared_ptr<RpmMat>& rpm1=YADE_PTR_CAST<RpmMat>(pp1);
 	const shared_ptr<RpmMat>& rpm2=YADE_PTR_CAST<RpmMat>(pp2);
 	
-	const shared_ptr<BodyMacroParameters>& elast1=static_pointer_cast<BodyMacroParameters>(pp1);
-	const shared_ptr<BodyMacroParameters>& elast2=static_pointer_cast<BodyMacroParameters>(pp2);
+	//const shared_ptr<BodyMacroParameters>& elast1=static_pointer_cast<BodyMacroParameters>(pp1);
+	//const shared_ptr<BodyMacroParameters>& elast2=static_pointer_cast<BodyMacroParameters>(pp2);
+
 	long cohesiveThresholdIter=10;
 	
 	bool initCohesive = rpm1->initCohesive*rpm2->initCohesive;
 	
-	Real E12=2*elast1->young*elast2->young/(elast1->young+elast2->young);
+	Real E12=2*rpm1->young*rpm2->young/(rpm1->young+rpm2->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*G_over_E;
-	contPhys->tanFrictionAngle=tan(.5*(elast1->frictionAngle+elast2->frictionAngle));
+	contPhys->tanFrictionAngle=tan(.5*(rpm1->frictionAngle+rpm2->frictionAngle));
 	contPhys->crossSection=S12;
 	contPhys->kn=contPhys->E*contPhys->crossSection;
 	contPhys->ks=contPhys->G*contPhys->crossSection;
@@ -134,7 +134,3 @@
 }
 
 RpmPhys::~RpmPhys(){};
-
-
-YADE_REQUIRE_FEATURE(PHYSPAR);
-

=== modified file 'pkg/dem/meta/RockPM.hpp'
--- pkg/dem/meta/RockPM.hpp	2009-08-28 07:22:29 +0000
+++ pkg/dem/meta/RockPM.hpp	2009-11-23 09:09:04 +0000
@@ -8,13 +8,12 @@
 
 #pragma once
 
-#include<yade/pkg-common/RigidBodyParameters.hpp>
-#include<yade/pkg-dem/BodyMacroParameters.hpp>
 #include<yade/pkg-common/InteractionPhysicsEngineUnit.hpp>
 #include<yade/pkg-dem/SpheresContactGeometry.hpp>
 #include<yade/pkg-common/PeriodicEngines.hpp>
 #include<yade/pkg-common/NormalShearInteractions.hpp>
 #include<yade/pkg-common/ConstitutiveLaw.hpp>
+#include<yade/pkg-common/ElasticMat.hpp>
 
 
 class Law2_Dem3DofGeom_RockPMPhys_Rpm: public ConstitutiveLaw{
@@ -28,7 +27,7 @@
 REGISTER_SERIALIZABLE(Law2_Dem3DofGeom_RockPMPhys_Rpm);
 
 /** This class holds information associated with each body */
-class RpmMat: public BodyMacroParameters {
+class RpmMat: public GranularMat {
 	public:
 		int exampleNumber; ///<Number of "stone"
 		bool initCohesive, isDamaged;
@@ -41,15 +40,15 @@
 			stressCompressMax(0), 
 			Brittleness(0), 
 			G_over_E(1) {createIndex();};
-		REGISTER_ATTRIBUTES(BodyMacroParameters, 
+		REGISTER_ATTRIBUTES(GranularMat, 
 			(exampleNumber)
 			(initCohesive)
 			(isDamaged)
 			(stressCompressMax)
 			(Brittleness)
 			(G_over_E));
-		REGISTER_CLASS_AND_BASE(RpmMat,BodyMacroParameters);
-		REGISTER_CLASS_INDEX(RpmMat,BodyMacroParameters);
+		REGISTER_CLASS_AND_BASE(RpmMat,GranularMat);
+		REGISTER_CLASS_INDEX(RpmMat,GranularMat);
 };
 REGISTER_SERIALIZABLE(RpmMat);
 
@@ -63,7 +62,7 @@
 			initDistance = 0;
 		}
 
-		virtual void go(const shared_ptr<PhysicalParameters>& pp1, const shared_ptr<PhysicalParameters>& pp2, const shared_ptr<Interaction>& interaction);
+		virtual void go(const shared_ptr<Material>& pp1, const shared_ptr<Material>& pp2, const shared_ptr<Interaction>& interaction);
 		REGISTER_ATTRIBUTES(InteractionPhysicsEngineUnit,
 			(initDistance)
 		);