yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #02457
[Branch ~yade-dev/yade/trunk] Rev 1841: Please, never make me do that again!!
------------------------------------------------------------
revno: 1841
committer: Bruno Chareyre <bchareyre@r1arduina>
branch nick: trunk
timestamp: Wed 2009-12-02 13:26:23 +0100
message:
Please, never make me do that again!!
modified:
pkg/dem/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.cpp
pkg/dem/DataClass/PhysicalParameters/CohesiveFrictionalBodyParameters.cpp
pkg/dem/DataClass/PhysicalParameters/CohesiveFrictionalBodyParameters.hpp
pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.cpp
pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.cpp
pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.hpp
pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.cpp
pkg/dem/PreProcessor/CohesiveTriaxialTest.cpp
pkg/dem/PreProcessor/CohesiveTriaxialTest.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/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.cpp'
--- pkg/dem/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.cpp 2009-11-21 10:36:08 +0000
+++ pkg/dem/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.cpp 2009-12-02 12:26:23 +0000
@@ -54,5 +54,5 @@
YADE_PLUGIN((CohesiveFrictionalContactInteraction));
-YADE_REQUIRE_FEATURE(PHYSPAR);
+//YADE_REQUIRE_FEATURE(PHYSPAR);
=== modified file 'pkg/dem/DataClass/PhysicalParameters/CohesiveFrictionalBodyParameters.cpp'
--- pkg/dem/DataClass/PhysicalParameters/CohesiveFrictionalBodyParameters.cpp 2009-11-21 10:36:08 +0000
+++ pkg/dem/DataClass/PhysicalParameters/CohesiveFrictionalBodyParameters.cpp 2009-12-02 12:26:23 +0000
@@ -8,7 +8,7 @@
#include "CohesiveFrictionalBodyParameters.hpp"
-CohesiveFrictionalBodyParameters::CohesiveFrictionalBodyParameters () : BodyMacroParameters()
+CohesiveFrictionalBodyParameters::CohesiveFrictionalBodyParameters () : GranularMat()
{
createIndex();
isBroken=true;
@@ -21,5 +21,5 @@
YADE_PLUGIN((CohesiveFrictionalBodyParameters));
-YADE_REQUIRE_FEATURE(PHYSPAR);
+//YADE_REQUIRE_FEATURE(PHYSPAR);
=== modified file 'pkg/dem/DataClass/PhysicalParameters/CohesiveFrictionalBodyParameters.hpp'
--- pkg/dem/DataClass/PhysicalParameters/CohesiveFrictionalBodyParameters.hpp 2009-07-17 20:50:55 +0000
+++ pkg/dem/DataClass/PhysicalParameters/CohesiveFrictionalBodyParameters.hpp 2009-12-02 12:26:23 +0000
@@ -12,10 +12,10 @@
#pragma once
-#include<yade/pkg-dem/BodyMacroParameters.hpp>
-
-
-class CohesiveFrictionalBodyParameters : public BodyMacroParameters
+#include<yade/pkg-common/ElasticMat.hpp>
+
+
+class CohesiveFrictionalBodyParameters : public GranularMat
{
public :
bool isBroken;
@@ -26,10 +26,10 @@
/// Serialization
REGISTER_CLASS_NAME(CohesiveFrictionalBodyParameters);
- REGISTER_BASE_CLASS_NAME(BodyMacroParameters);
- REGISTER_ATTRIBUTES(BodyMacroParameters,(isBroken)(isCohesive));
+ REGISTER_BASE_CLASS_NAME(GranularMat);
+ REGISTER_ATTRIBUTES(GranularMat,(isBroken)(isCohesive));
/// Indexable
- REGISTER_CLASS_INDEX(CohesiveFrictionalBodyParameters,BodyMacroParameters);
+ REGISTER_CLASS_INDEX(CohesiveFrictionalBodyParameters,GranularMat);
};
REGISTER_SERIALIZABLE(CohesiveFrictionalBodyParameters);
=== modified file 'pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.cpp'
--- pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.cpp 2009-12-01 14:56:39 +0000
+++ pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.cpp 2009-12-02 12:26:23 +0000
@@ -7,16 +7,11 @@
*************************************************************************/
#include "HydraulicForceEngine.hpp"
-#include <yade/pkg-common/ParticleParameters.hpp>
#include <yade/core/World.hpp>
#include <yade/core/Body.hpp>
#include <yade/pkg-dem/CohesiveFrictionalBodyParameters.hpp>
#include <vector>
#include "HydraulicForceEngine.hpp"
-#include <yade/pkg-common/ParticleParameters.hpp>
-#include <yade/core/World.hpp>
-#include <yade/pkg-dem/CohesiveFrictionalBodyParameters.hpp>
-#include <vector>
#include <yade/pkg-dem/Shop.hpp>
#include<yade/pkg-common/InteractingSphere.hpp>
@@ -78,7 +73,7 @@
if (b->interactingGeometry && b->interactingGeometry->getClassName()=="InteractingSphere")
{
//cerr << "translate it" << endl;
- if ((static_cast<CohesiveFrictionalBodyParameters*> (b->physicalParameters.get()))->isBroken == true)
+ if ((static_cast<CohesiveFrictionalBodyParameters*> (b->material.get()))->isBroken == true)
{
ncb->bex.addForce(b->getId(),Vector3r(0,5,0));
}
@@ -140,7 +135,7 @@
if (!b->isDynamic) continue;
shared_ptr<InteractingSphere> intSph=dynamic_pointer_cast<InteractingSphere>(b->interactingGeometry);
if(!intSph) continue;
- const Vector3r& pos=b->physicalParameters->se3.position;
+ const Vector3r& pos=b->state->pos;
f<< b->getId()<<" "<<pos[0]<<" "<<pos[1]<<" "<<pos[2]<<" "<<intSph->radius<<endl; // <<" "<<1<<" "<<1<<endl;
}
f.close();
@@ -178,5 +173,5 @@
YADE_PLUGIN((HydraulicForceEngine));
-YADE_REQUIRE_FEATURE(PHYSPAR);
+//YADE_REQUIRE_FEATURE(PHYSPAR);
=== modified file 'pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.cpp'
--- pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.cpp 2009-12-01 14:56:39 +0000
+++ pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.cpp 2009-12-02 12:26:23 +0000
@@ -28,18 +28,8 @@
}
-
-//
-//
-//
-/// Big WHAT THE FUCK? this code below is duplicated THREE times due to some weird IFs !
-/// need to FIXME that.
-/// but from all my testing it works currently. / janek
-//
-//
-
-void CohesiveFrictionalRelationships::go( const shared_ptr<PhysicalParameters>& b1 // CohesiveFrictionalBodyParameters
- , const shared_ptr<PhysicalParameters>& b2 // CohesiveFrictionalBodyParameters
+void CohesiveFrictionalRelationships::go( const shared_ptr<Material>& b1 // CohesiveFrictionalBodyParameters
+ , const shared_ptr<Material>& b2 // CohesiveFrictionalBodyParameters
, const shared_ptr<Interaction>& interaction)
{
CohesiveFrictionalBodyParameters* sdec1 = static_cast<CohesiveFrictionalBodyParameters*>(b1.get());
@@ -54,7 +44,7 @@
setCohesionNow = 0;}
- if(interactionGeometry) // so it is SpheresContactGeometry - NON PERMANENT LINK
+ if(interactionGeometry)
{
if(!interaction->interactionPhysics)
{
@@ -66,8 +56,8 @@
Real Eb = sdec2->young;
Real Va = sdec1->poisson;
Real Vb = sdec2->poisson;
- Real Da = interactionGeometry->radius1; // FIXME - multiply by factor of sphere interaction distance (so sphere interacts at bigger range that its geometrical size)
- Real Db = interactionGeometry->radius2; // FIXME - as above
+ Real Da = interactionGeometry->radius1;
+ Real Db = interactionGeometry->radius2;
Real fa = sdec1->frictionAngle;
Real fb = sdec2->frictionAngle;
@@ -96,12 +86,11 @@
contactPhysics->cohesionBroken = false;
contactPhysics->normalAdhesion = normalCohesion*pow(std::min(Db, Da),2);
contactPhysics->shearAdhesion = shearCohesion*pow(std::min(Db, Da),2);;
-
- // FIXME - not sure: do I need to repeat it here [1] ?
- contactPhysics->initialOrientation1 = sdec1->se3.orientation;
- contactPhysics->initialOrientation2 = sdec2->se3.orientation;
- contactPhysics->initialPosition1 = sdec1->se3.position;
- contactPhysics->initialPosition2 = sdec2->se3.position;
+
+ contactPhysics->initialOrientation1 = Body::byId(interaction->getId1())->state->ori;
+ contactPhysics->initialOrientation2 = Body::byId(interaction->getId2())->state->ori;
+ contactPhysics->initialPosition1 = Body::byId(interaction->getId1())->state->pos;
+ contactPhysics->initialPosition2 = Body::byId(interaction->getId2())->state->pos;
contactPhysics->kr = Kr;
contactPhysics->initialContactOrientation.Align(Vector3r(1.0,0.0,0.0),interactionGeometry->normal);
contactPhysics->currentContactOrientation = contactPhysics->initialContactOrientation;
@@ -127,11 +116,10 @@
contactPhysics->ks = contactPhysics->initialKs;
contactPhysics->equilibriumDistance = contactPhysics->initialEquilibriumDistance;
- // FIXME - or here [1] ?
- contactPhysics->initialOrientation1 = sdec1->se3.orientation;
- contactPhysics->initialOrientation2 = sdec2->se3.orientation;
- contactPhysics->initialPosition1 = sdec1->se3.position;
- contactPhysics->initialPosition2 = sdec2->se3.position;
+ contactPhysics->initialOrientation1 = Body::byId(interaction->getId1())->state->ori;
+ contactPhysics->initialOrientation2 = Body::byId(interaction->getId2())->state->ori;
+ contactPhysics->initialPosition1 = Body::byId(interaction->getId1())->state->pos;
+ contactPhysics->initialPosition2 = Body::byId(interaction->getId2())->state->pos;
contactPhysics->kr = Kr;
contactPhysics->initialContactOrientation.Align(Vector3r(1.0,0.0,0.0),interactionGeometry->normal);
contactPhysics->currentContactOrientation = contactPhysics->initialContactOrientation;
@@ -157,12 +145,12 @@
contactPhysics->shearAdhesion = shearCohesion*pow(std::min(interactionGeometry->radius2, interactionGeometry->radius1),2);
//setCohesionNow = false;
- contactPhysics->initialOrientation1 = sdec1->se3.orientation;
- contactPhysics->initialOrientation2 = sdec2->se3.orientation;
- contactPhysics->initialPosition1 = sdec1->se3.position;
- contactPhysics->initialPosition2 = sdec2->se3.position;
- Real Da = interactionGeometry->radius1; // FIXME - multiply by factor of sphere interaction distance (so sphere interacts at bigger range that its geometrical size)
- Real Db = interactionGeometry->radius2; // FIXME - as above
+ contactPhysics->initialOrientation1 = Body::byId(interaction->getId1())->state->ori;
+ contactPhysics->initialOrientation2 = Body::byId(interaction->getId2())->state->ori;
+ contactPhysics->initialPosition1 = Body::byId(interaction->getId1())->state->pos;
+ contactPhysics->initialPosition2 = Body::byId(interaction->getId2())->state->pos;
+ Real Da = interactionGeometry->radius1;
+ Real Db = interactionGeometry->radius2;
Real Kr = Da*Db*contactPhysics->ks*2.0; // just like "2.0" above - it's an arbitrary parameter
contactPhysics->kr = Kr;
contactPhysics->initialContactOrientation.Align(Vector3r(1.0,0.0,0.0),interactionGeometry->normal);
@@ -179,22 +167,8 @@
}
}
-#if 0
- else // this is PERMANENT LINK because previous dynamic_cast failed, dispatcher should do this job
- {
- SDECLinkGeometry* sdecLinkGeometry = dynamic_cast<SDECLinkGeometry*>(interaction->interactionGeometry.get());
- if (sdecLinkGeometry)
- {
- SDECLinkPhysics* linkPhysics = static_cast<SDECLinkPhysics*>(interaction->interactionPhysics.get());
- // linkPhysics->frictionAngle = ?? //FIXME - uninitialized
- linkPhysics->kn = linkPhysics->initialKn;
- linkPhysics->ks = linkPhysics->initialKs;
- linkPhysics->equilibriumDistance = linkPhysics->initialEquilibriumDistance;
- }
- }
-#endif
};
YADE_PLUGIN((CohesiveFrictionalRelationships));
-YADE_REQUIRE_FEATURE(PHYSPAR);
+//YADE_REQUIRE_FEATURE(PHYSPAR);
=== modified file 'pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.hpp'
--- pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.hpp 2009-12-01 14:22:18 +0000
+++ pkg/dem/Engine/Functor/CohesiveFrictionalRelationships.hpp 2009-12-02 12:26:23 +0000
@@ -15,8 +15,8 @@
public :
CohesiveFrictionalRelationships();
- virtual void go( const shared_ptr<PhysicalParameters>& b1,
- const shared_ptr<PhysicalParameters>& b2,
+ virtual void go( const shared_ptr<Material>& b1,
+ const shared_ptr<Material>& b2,
const shared_ptr<Interaction>& interaction);
Real normalCohesion,
@@ -28,7 +28,7 @@
int cohesionDefinitionIteration;
long iter;//REMOVE THIS
- REGISTER_ATTRIBUTES(InteractionPhysicsFunctor,(normalCohesion)(shearCohesion)(setCohesionNow)(setCohesionOnNewContacts));
+ REGISTER_ATTRIBUTES(InteractionPhysicsFunctor,(normalCohesion)(shearCohesion)(setCohesionNow)(setCohesionOnNewContacts));
FUNCTOR2D(CohesiveFrictionalBodyParameters,CohesiveFrictionalBodyParameters);
REGISTER_CLASS_NAME(CohesiveFrictionalRelationships);
REGISTER_BASE_CLASS_NAME(InteractionPhysicsFunctor);
=== modified file 'pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.cpp'
--- pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.cpp 2009-12-01 14:56:39 +0000
+++ pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.cpp 2009-12-02 12:26:23 +0000
@@ -10,11 +10,9 @@
#include<yade/pkg-dem/CohesiveFrictionalBodyParameters.hpp>
#include<yade/pkg-dem/SpheresContactGeometry.hpp>
#include<yade/pkg-dem/CohesiveFrictionalContactInteraction.hpp>
-#include<yade/pkg-dem/SDECLinkPhysics.hpp>
#include<yade/core/Omega.hpp>
#include<yade/core/World.hpp>
-
Vector3r translation_vect_ (0.10,0,0);
@@ -65,7 +63,7 @@
{
shared_ptr<Body> b = *bi;
if (b->interactingGeometry && b->interactingGeometry->getClassName()=="InteractingSphere")
- (static_cast<CohesiveFrictionalBodyParameters*> (b->physicalParameters.get()))->isBroken = true;
+ (static_cast<CohesiveFrictionalBodyParameters*> (b->material.get()))->isBroken = true;
// b->geometricalModel->diffuseColor= Vector3r(0.5,0.3,0.9);
}
}
@@ -87,8 +85,8 @@
* && (*bodies)[(*ii)->getId2()]->interactingGeometry->getClassName() != "box" */
)
{
- YADE_CAST<CohesiveFrictionalBodyParameters*>((*bodies)[(*ii)->getId1()]->physicalParameters.get())->isBroken = false;
- YADE_CAST<CohesiveFrictionalBodyParameters*>((*bodies)[(*ii)->getId2()]->physicalParameters.get())->isBroken = false;
+ YADE_CAST<CohesiveFrictionalBodyParameters*>((*bodies)[(*ii)->getId1()]->material.get())->isBroken = false;
+ YADE_CAST<CohesiveFrictionalBodyParameters*>((*bodies)[(*ii)->getId2()]->material.get())->isBroken = false;
}
const shared_ptr<Interaction>& contact = *ii;
@@ -98,8 +96,12 @@
if ( !( (*bodies)[id1]->getGroupMask() & (*bodies)[id2]->getGroupMask() & sdecGroupMask) )
continue; // skip other groups,
- CohesiveFrictionalBodyParameters* de1 = YADE_CAST<CohesiveFrictionalBodyParameters*>((*bodies)[id1]->physicalParameters.get());
- CohesiveFrictionalBodyParameters* de2 = YADE_CAST<CohesiveFrictionalBodyParameters*>((*bodies)[id2]->physicalParameters.get());
+ CohesiveFrictionalBodyParameters* de1 = YADE_CAST<CohesiveFrictionalBodyParameters*>((*bodies)[id1]->material.get());
+ CohesiveFrictionalBodyParameters* de2 = YADE_CAST<CohesiveFrictionalBodyParameters*>((*bodies)[id2]->material.get());
+
+ Body* b1 = (*bodies)[id1].get();
+ Body* b2 = (*bodies)[id2].get();
+
SpheresContactGeometry* currentContactGeometry = YADE_CAST<SpheresContactGeometry*>(contact->interactionGeometry.get());
CohesiveFrictionalContactInteraction* currentContactPhysics = YADE_CAST<CohesiveFrictionalContactInteraction*> (contact->interactionPhysics.get());
@@ -123,7 +125,7 @@
ncb->interactions->requestErase(contact->getId1(),contact->getId2());
// contact->interactionPhysics was reset now; currentContactPhysics still hold the object, but is not associated with the interaction anymore
- currentContactPhysics->cohesionBroken = true;
+ currentContactPhysics->cohesionBroken = true;
currentContactPhysics->normalForce = Vector3r::ZERO;
currentContactPhysics->shearForce = Vector3r::ZERO;
@@ -141,7 +143,7 @@
axis = currentContactPhysics->prevNormal.Cross(currentContactGeometry->normal);
shearForce -= shearForce.Cross(axis);
- angle = dt*0.5*currentContactGeometry->normal.Dot(de1->angularVelocity+de2->angularVelocity);
+ angle = dt*0.5*currentContactGeometry->normal.Dot(Body::byId(id1)->state->angVel+Body::byId(id2)->state->angVel);
axis = angle*currentContactGeometry->normal;
shearForce -= shearForce.Cross(axis);
@@ -162,16 +164,18 @@
/// ///
+
+
Vector3r x = currentContactGeometry->contactPoint;
- Vector3r c1x = (x - de1->se3.position);
- Vector3r c2x = (x - de2->se3.position);
+ Vector3r c1x = (x - b1->state->pos);
+ Vector3r c2x = (x - b2->state->pos);
/// The following definition of c1x and c2x is to avoid "granular ratcheting"
/// (see F. ALONSO-MARROQUIN, R. GARCIA-ROJO, H.J. HERRMANN,
/// "Micro-mechanical investigation of granular ratcheting, in Cyclic Behaviour of Soils and Liquefaction Phenomena",
/// ed. T. Triantafyllidis (Balklema, London, 2004), p. 3-10 - and a lot more papers from the same authors)
Vector3r _c1x_ = currentContactGeometry->radius1*currentContactGeometry->normal;
Vector3r _c2x_ = -currentContactGeometry->radius2*currentContactGeometry->normal;
- Vector3r relativeVelocity = (de2->velocity+de2->angularVelocity.Cross(_c2x_)) - (de1->velocity+de1->angularVelocity.Cross(_c1x_));
+ Vector3r relativeVelocity = ( b2->state->vel+b2->state->angVel.Cross(_c2x_)) - (b1->state->vel+b1->state->angVel.Cross(_c1x_));
Vector3r shearVelocity = relativeVelocity-currentContactGeometry->normal.Dot(relativeVelocity)*currentContactGeometry->normal;
Vector3r shearDisplacement = shearVelocity*dt;
@@ -298,8 +302,8 @@
// currentContactPhysics->currentContactOrientation = align * currentContactPhysics->currentContactOrientation;
//}
- Quaternionr delta( de1->se3.orientation * currentContactPhysics->initialOrientation1.Conjugate() *
- currentContactPhysics->initialOrientation2 * de2->se3.orientation.Conjugate());
+ Quaternionr delta( b1->state->ori * currentContactPhysics->initialOrientation1.Conjugate() *
+ currentContactPhysics->initialOrientation2 * b2->state->ori.Conjugate());
if(twist_creep){
delta = delta * currentContactPhysics->twistCreep;
}
@@ -359,10 +363,10 @@
if (b->interactingGeometry && b->interactingGeometry->getClassName()=="InteractingSphere" && erosionActivated)
{
//cerr << "translate it" << endl;
- if ((static_cast<CohesiveFrictionalBodyParameters*> (b->physicalParameters.get()))->isBroken == true)
+ if ((static_cast<CohesiveFrictionalBodyParameters*> (b->material.get()))->isBroken == true)
{
if (b->isDynamic)
- (static_cast<CohesiveFrictionalBodyParameters*> (b->physicalParameters.get()))->se3.position += translation_vect_;
+ b->state->pos += translation_vect_;
b->isDynamic = false;
b->interactingGeometry->diffuseColor= Vector3r(0.5,0.3,0.9);
@@ -379,5 +383,5 @@
YADE_PLUGIN((CohesiveFrictionalContactLaw));
-YADE_REQUIRE_FEATURE(PHYSPAR);
+//YADE_REQUIRE_FEATURE(PHYSPAR);
=== modified file 'pkg/dem/PreProcessor/CohesiveTriaxialTest.cpp'
--- pkg/dem/PreProcessor/CohesiveTriaxialTest.cpp 2009-12-01 14:56:39 +0000
+++ pkg/dem/PreProcessor/CohesiveTriaxialTest.cpp 2009-12-02 12:26:23 +0000
@@ -15,13 +15,13 @@
#include<yade/pkg-dem/CohesiveFrictionalContactLaw.hpp>
#include<yade/pkg-dem/CohesiveFrictionalRelationships.hpp>
#include<yade/pkg-dem/CohesiveFrictionalBodyParameters.hpp>
-#include<yade/pkg-dem/SDECLinkPhysics.hpp>
+//#include<yade/pkg-dem/SDECLinkPhysics.hpp>
#include<yade/pkg-dem/GlobalStiffnessTimeStepper.hpp>
#include<yade/pkg-dem/PositionOrientationRecorder.hpp>
-#include<yade/pkg-dem/AveragePositionRecorder.hpp>
-#include<yade/pkg-dem/ForceRecorder.hpp>
-#include<yade/pkg-dem/VelocityRecorder.hpp>
+//#include<yade/pkg-dem/AveragePositionRecorder.hpp>
+//#include<yade/pkg-dem/ForceRecorder.hpp>
+//#include<yade/pkg-dem/VelocityRecorder.hpp>
#include<yade/pkg-dem/TriaxialStressController.hpp>
#include<yade/pkg-dem/TriaxialCompressionEngine.hpp>
#include <yade/pkg-dem/TriaxialStateRecorder.hpp>
@@ -41,12 +41,13 @@
#include<yade/pkg-common/GravityEngines.hpp>
#include<yade/pkg-dem/HydraulicForceEngine.hpp>
+#include<yade/pkg-dem/NewtonsDampedLaw.hpp>
#include<yade/pkg-dem/InteractingSphere2InteractingSphere4SpheresContactGeometry.hpp>
#include<yade/pkg-dem/InteractingBox2InteractingSphere4SpheresContactGeometry.hpp>
-#include<yade/pkg-common/PhysicalActionApplier.hpp>
-#include<yade/pkg-common/PhysicalActionDamper.hpp>
-#include<yade/pkg-common/CundallNonViscousDamping.hpp>
-#include<yade/pkg-common/CundallNonViscousDamping.hpp>
+//#include<yade/pkg-common/PhysicalActionApplier.hpp>
+//#include<yade/pkg-common/PhysicalActionDamper.hpp>
+//#include<yade/pkg-common/CundallNonViscousDamping.hpp>
+//#include<yade/pkg-common/CundallNonViscousDamping.hpp>
#include<yade/pkg-common/InteractionGeometryDispatcher.hpp>
#include<yade/pkg-common/InteractionPhysicsDispatcher.hpp>
@@ -56,7 +57,7 @@
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/StateMetaEngine.hpp>
+//#include<yade/pkg-common/StateDispatcher.hpp>
#include<yade/pkg-dem/Shop.hpp>
@@ -194,8 +195,8 @@
rootBody->bodies->insert(body);
triaxialcompressionEngine->wall_bottom_id = body->getId();
//triaxialStateRecorder->wall_bottom_id = body->getId();
- forcerec->startId = body->getId();
- forcerec->endId = body->getId();
+// forcerec->startId = body->getId();
+// forcerec->endId = body->getId();
}
//forcerec->id = body->getId();
@@ -375,9 +376,9 @@
body = shared_ptr<Body>(new Body(body_id_t(0),2));
shared_ptr<CohesiveFrictionalBodyParameters> physics(new CohesiveFrictionalBodyParameters);
shared_ptr<AABB> aabb(new AABB);
- #ifdef YADE_SHAPE
- shared_ptr<Sphere> gSphere(new Sphere);
- #endif
+// #ifdef YADE_SHAPE
+// shared_ptr<Sphere> gSphere(new Sphere);
+// #endif
shared_ptr<InteractingSphere> iSphere(new InteractingSphere);
Quaternionr q(Mathr::SymmetricRandom(),Mathr::SymmetricRandom(),Mathr::SymmetricRandom(),Mathr::SymmetricRandom());
@@ -386,14 +387,14 @@
body->isDynamic = dynamic;
- physics->angularVelocity = Vector3r(0,0,0);
- physics->velocity = Vector3r(0,0,0);
- physics->mass = 4.0/3.0*Mathr::PI*radius*radius*radius*density;
+ body->state->angVel = Vector3r(0,0,0);
+ body->state->vel = Vector3r(0,0,0);
+ body->state->mass = 4.0/3.0*Mathr::PI*radius*radius*radius*density;
- physics->inertia = Vector3r( 2.0/5.0*physics->mass*radius*radius,
- 2.0/5.0*physics->mass*radius*radius,
- 2.0/5.0*physics->mass*radius*radius);
- physics->se3 = Se3r(position,q);
+ body->state->inertia = Vector3r( 2.0/5.0*body->state->mass*radius*radius,
+ 2.0/5.0*body->state->mass*radius*radius,
+ 2.0/5.0*body->state->mass*radius*radius);
+ body->state->se3 = Se3r(position,q);
physics->young = sphereYoungModulus;
physics->poisson = spherePoissonRatio;
physics->frictionAngle = sphereFrictionDeg * Mathr::PI/180.0;
@@ -411,18 +412,19 @@
iSphere->radius = radius;
iSphere->diffuseColor = Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom());
-
+ iSphere->wire = false;
+
body->interactingGeometry = iSphere;
- #ifdef YADE_SHAPE
- gSphere->radius = radius;
- // gSphere->diffuseColor = ((int)(position[0]*400.0))%2?Vector3r(0.7,0.7,0.7):Vector3r(0.45,0.45,0.45);
- gSphere->diffuseColor = spheresColor;
- gSphere->wire = false;
- gSphere->shadowCaster = true;
- body->geometricalModel = gSphere;
- #endif
+// #ifdef YADE_SHAPE
+// gSphere->radius = radius;
+// // gSphere->diffuseColor = ((int)(position[0]*400.0))%2?Vector3r(0.7,0.7,0.7):Vector3r(0.45,0.45,0.45);
+// gSphere->diffuseColor = spheresColor;
+// gSphere->wire = false;
+// gSphere->shadowCaster = true;
+// body->geometricalModel = gSphere;
+// #endif
body->boundingVolume = aabb;
- body->physicalParameters = physics;
+ body->material = physics;
}
@@ -431,9 +433,9 @@
body = shared_ptr<Body>(new Body(body_id_t(0),2));
shared_ptr<CohesiveFrictionalBodyParameters> physics(new CohesiveFrictionalBodyParameters);
shared_ptr<AABB> aabb(new AABB);
- #ifdef YADE_SHAPE
- shared_ptr<Box> gBox(new Box);
- #endif
+// #ifdef YADE_SHAPE
+// shared_ptr<Box> gBox(new Box);
+// #endif
shared_ptr<InteractingBox> iBox(new InteractingBox);
Quaternionr q;
@@ -441,18 +443,18 @@
body->isDynamic = false;
- physics->angularVelocity = Vector3r(0,0,0);
- physics->velocity = Vector3r(0,0,0);
- physics->mass = 0;
+ body->state->angVel = Vector3r(0,0,0);
+ body->state->vel = Vector3r(0,0,0);
+ body->state->mass = 0;
//physics->mass = extents[0]*extents[1]*extents[2]*density*2;
- physics->inertia = Vector3r(
- physics->mass*(extents[1]*extents[1]+extents[2]*extents[2])/3
- , physics->mass*(extents[0]*extents[0]+extents[2]*extents[2])/3
- , physics->mass*(extents[1]*extents[1]+extents[0]*extents[0])/3
+ body->state->inertia = Vector3r(
+ body->state->mass*(extents[1]*extents[1]+extents[2]*extents[2])/3
+ , body->state->mass*(extents[0]*extents[0]+extents[2]*extents[2])/3
+ , body->state->mass*(extents[1]*extents[1]+extents[0]*extents[0])/3
);
// physics->mass = 0;
// physics->inertia = Vector3r(0,0,0);
- physics->se3 = Se3r(position,q);
+ body->state->se3 = Se3r(position,q);
physics->young = boxYoungModulus;
physics->poisson = boxPoissonRatio;
@@ -460,39 +462,19 @@
physics->isCohesive = false;
aabb->diffuseColor = Vector3r(1,0,0);
-
- #ifdef YADE_SHAPE
- gBox->extents = extents;
- gBox->diffuseColor = Vector3r(1,1,1);
- gBox->wire = wire;
- gBox->shadowCaster = false;
- body->geometricalModel = gBox;
- #endif
iBox->extents = extents;
iBox->diffuseColor = Vector3r(1,1,1);
+ iBox->wire = wire;
body->boundingVolume = aabb;
body->interactingGeometry = iBox;
- body->physicalParameters = physics;
+ body->material = physics;
}
void CohesiveTriaxialTest::createActors(shared_ptr<World>& rootBody)
{
-// recording average positions
- averagePositionRecorder = shared_ptr<AveragePositionRecorder>(new AveragePositionRecorder);
- averagePositionRecorder -> outputFile = positionRecordFile;
- averagePositionRecorder -> interval = recordIntervalIter;
-// recording forces
- forcerec = shared_ptr<ForceRecorder>(new ForceRecorder);
- forcerec -> outputFile = forceRecordFile;
- forcerec -> interval = recordIntervalIter;
-// recording velocities
- velocityRecorder = shared_ptr<VelocityRecorder>(new VelocityRecorder);
- velocityRecorder-> outputFile = velocityRecordFile;
- velocityRecorder-> interval = recordIntervalIter;
-
shared_ptr<InteractionGeometryDispatcher> interactionGeometryDispatcher(new InteractionGeometryDispatcher);
shared_ptr<InteractionGeometryFunctor> s1(new InteractingSphere2InteractingSphere4SpheresContactGeometry);
@@ -515,25 +497,29 @@
- shared_ptr<GravityEngine> gravityCondition(new GravityEngine);
- gravityCondition->gravity = gravity;
-
- shared_ptr<CundallNonViscousForceDamping> actionForceDamping(new CundallNonViscousForceDamping);
- actionForceDamping->damping = dampingForce;
- shared_ptr<CundallNonViscousMomentumDamping> actionMomentumDamping(new CundallNonViscousMomentumDamping);
- actionMomentumDamping->damping = dampingMomentum;
- shared_ptr<PhysicalActionDamper> actionDampingDispatcher(new PhysicalActionDamper);
- actionDampingDispatcher->add(actionForceDamping);
- actionDampingDispatcher->add(actionMomentumDamping);
-
- shared_ptr<PhysicalActionApplier> applyActionDispatcher(new PhysicalActionApplier);
- applyActionDispatcher->add("NewtonsForceLaw");
- applyActionDispatcher->add("NewtonsMomentumLaw");
-
- shared_ptr<StateMetaEngine> positionIntegrator(new StateMetaEngine);
- positionIntegrator->add("LeapFrogPositionIntegrator");
- shared_ptr<StateMetaEngine> orientationIntegrator(new StateMetaEngine);
- orientationIntegrator->add("LeapFrogOrientationIntegrator");
+// shared_ptr<GravityEngine> gravityCondition(new GravityEngine);
+// gravityCondition->gravity = gravity;
+
+// shared_ptr<CundallNonViscousForceDamping> actionForceDamping(new CundallNonViscousForceDamping);
+// actionForceDamping->damping = dampingForce;
+// shared_ptr<CundallNonViscousMomentumDamping> actionMomentumDamping(new CundallNonViscousMomentumDamping);
+// actionMomentumDamping->damping = dampingMomentum;
+// shared_ptr<PhysicalActionDamper> actionDampingDispatcher(new PhysicalActionDamper);
+// actionDampingDispatcher->add(actionForceDamping);
+// actionDampingDispatcher->add(actionMomentumDamping);
+//
+// shared_ptr<PhysicalActionApplier> applyActionDispatcher(new PhysicalActionApplier);
+// applyActionDispatcher->add("NewtonsForceLaw");
+// applyActionDispatcher->add("NewtonsMomentumLaw");
+//
+// shared_ptr<StateDispatcher> positionIntegrator(new StateDispatcher);
+// positionIntegrator->add("LeapFrogPositionIntegrator");
+// shared_ptr<StateDispatcher> orientationIntegrator(new StateDispatcher);
+// orientationIntegrator->add("LeapFrogOrientationIntegrator");
+
+ shared_ptr<NewtonsDampedLaw> newton(new NewtonsDampedLaw);
+ newton->damping=dampingMomentum;
+
//shared_ptr<ElasticCriterionTimeStepper> sdecTimeStepper(new ElasticCriterionTimeStepper);
//sdecTimeStepper->sdecGroupMask = 2;
@@ -580,8 +566,8 @@
// recording global stress
triaxialStateRecorder = shared_ptr<TriaxialStateRecorder>(new
TriaxialStateRecorder);
- triaxialStateRecorder-> outputFile = WallStressRecordFile;
- triaxialStateRecorder-> interval = recordIntervalIter;
+ triaxialStateRecorder-> file = WallStressRecordFile;
+ triaxialStateRecorder-> iterPeriod = recordIntervalIter;
//triaxialStateRecorder-> thickness = thickness;
@@ -610,18 +596,8 @@
rootBody->engines.push_back(globalStiffnessTimeStepper);
rootBody->engines.push_back(triaxialStateRecorder);
rootBody->engines.push_back(hydraulicForceEngine);//<-------------HYDRAULIC ENGINE HERE
- rootBody->engines.push_back(actionDampingDispatcher);
- rootBody->engines.push_back(applyActionDispatcher);
- rootBody->engines.push_back(positionIntegrator);
- if(!rotationBlocked)
- rootBody->engines.push_back(orientationIntegrator);
- //rootBody->engines.push_back(triaxialstressController);
-
-
- //rootBody->engines.push_back(averagePositionRecorder);
- //rootBody->engines.push_back(velocityRecorder);
- //rootBody->engines.push_back(forcerec);
-
+ rootBody->engines.push_back(newton);
+
if (saveAnimationSnapshots) {
shared_ptr<PositionOrientationRecorder> positionOrientationRecorder(new PositionOrientationRecorder);
positionOrientationRecorder->outputFile = AnimationSnapshotsBaseName;
@@ -634,16 +610,11 @@
void CohesiveTriaxialTest::positionRootBody(shared_ptr<World>& rootBody)
-{
+{
rootBody->isDynamic = false;
Quaternionr q;
q.FromAxisAngle( Vector3r(0,0,1),0);
- shared_ptr<ParticleParameters> physics(new ParticleParameters); // FIXME : fix indexable class PhysicalParameters
- physics->se3 = Se3r(Vector3r(0,0,0),q);
- physics->mass = 0;
- physics->velocity = Vector3r::ZERO;
- physics->acceleration = Vector3r::ZERO;
shared_ptr<MetaInteractingGeometry> set(new MetaInteractingGeometry());
@@ -653,9 +624,7 @@
aabb->diffuseColor = Vector3r(0,0,1);
rootBody->interactingGeometry = YADE_PTR_CAST<InteractingGeometry>(set);
- rootBody->boundingVolume = YADE_PTR_CAST<BoundingVolume>(aabb);
- rootBody->physicalParameters = physics;
-
+ rootBody->boundingVolume = YADE_PTR_CAST<BoundingVolume>(aabb);
}
@@ -709,5 +678,5 @@
YADE_PLUGIN((CohesiveTriaxialTest));
-YADE_REQUIRE_FEATURE(PHYSPAR);
+//YADE_REQUIRE_FEATURE(PHYSPAR);
=== modified file 'pkg/dem/PreProcessor/CohesiveTriaxialTest.hpp'
--- pkg/dem/PreProcessor/CohesiveTriaxialTest.hpp 2009-12-01 14:56:39 +0000
+++ pkg/dem/PreProcessor/CohesiveTriaxialTest.hpp 2009-12-02 12:26:23 +0000
@@ -16,9 +16,9 @@
#include <Wm3Vector3.h>
#include<yade/lib-base/yadeWm3.hpp>
-class ForceRecorder;
-class AveragePositionRecorder;
-class VelocityRecorder;
+//class ForceRecorder;
+//class AveragePositionRecorder;
+//class VelocityRecorder;
class TriaxialStressController;
class TriaxialCompressionEngine;
class TriaxialStateRecorder;
@@ -109,9 +109,9 @@
,AnimationSnapshotsBaseName
,WallStressRecordFile;
- shared_ptr<ForceRecorder> forcerec;
- shared_ptr<VelocityRecorder> velocityRecorder;
- shared_ptr<AveragePositionRecorder> averagePositionRecorder;
+ //shared_ptr<ForceRecorder> forcerec;
+ //shared_ptr<VelocityRecorder> velocityRecorder;
+ //shared_ptr<AveragePositionRecorder> averagePositionRecorder;
shared_ptr<TriaxialCompressionEngine> triaxialcompressionEngine;
shared_ptr<TriaxialStressController> triaxialstressController;
shared_ptr<TriaxialStateRecorder> triaxialStateRecorder;