yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #01178
[svn] r1738 - in trunk: core core/containers examples examples/SpheresFactory examples/dynamic_simulation_tests examples/rod_penetration extra extra/clump extra/spherical-dem-simulator extra/tetra extra/usct gui/py pkg/common pkg/common/Container pkg/common/DataClass pkg/common/Engine pkg/common/Engine/DeusExMachina pkg/common/Engine/EngineUnit pkg/common/Engine/MetaEngine pkg/common/Engine/StandAloneEngine pkg/dem pkg/dem/DataClass pkg/dem/Engine/DeusExMachina pkg/dem/Engine/EngineUnit pkg/dem/Engine/StandAloneEngine pkg/dem/PreProcessor pkg/fem pkg/fem/Engine/StandAloneEngine pkg/fem/PreProcessor pkg/lattice pkg/lattice/DataClass/PhysicalParameters pkg/lattice/Engine/StandAloneEngine pkg/lattice/PreProcessor pkg/mass-spring pkg/mass-spring/Engine/StandAloneEngine pkg/mass-spring/PreProcessor pkg/realtime-rigidbody pkg/realtime-rigidbody/Engine/StandAloneEngine pkg/realtime-rigidbody/PreProcessor pkg/snow pkg/snow/Engine pkg/snow/PreProcessor scripts
Author: eudoxos
Date: 2009-03-30 19:10:27 +0200 (Mon, 30 Mar 2009)
New Revision: 1738
Removed:
trunk/core/PhysicalAction.hpp
trunk/core/PhysicalActionContainer.cpp
trunk/core/PhysicalActionContainer.hpp
trunk/core/containers/PhysicalActionVectorVector.cpp
trunk/core/containers/PhysicalActionVectorVector.hpp
trunk/pkg/common/Container/PhysicalActionVectorVector.hpp
trunk/pkg/common/DataClass/PhysicalAction/
trunk/pkg/common/Engine/StandAloneEngine/PhysicalActionContainerInitializer.cpp
trunk/pkg/common/Engine/StandAloneEngine/PhysicalActionContainerInitializer.hpp
trunk/pkg/dem/DataClass/PhysicalAction/
trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.cpp
trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.hpp
trunk/pkg/dem/Engine/DeusExMachina/ResultantForceEngine.cpp
trunk/pkg/dem/Engine/DeusExMachina/ResultantForceEngine.hpp
trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessCounter.cpp
trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessCounter.hpp
Modified:
trunk/core/BexContainer.hpp
trunk/core/Body.hpp
trunk/core/MetaBody.cpp
trunk/core/MetaBody.hpp
trunk/core/SConscript
trunk/core/yade.cpp
trunk/examples/STLImporterTest.py
trunk/examples/SpheresFactory/model.py
trunk/examples/dynamic_simulation_tests/ringCundallDamping.py
trunk/examples/dynamic_simulation_tests/ringSimpleViscoelastic.py
trunk/examples/rod_penetration/model.py
trunk/extra/Brefcom.cpp
trunk/extra/Brefcom.hpp
trunk/extra/BrefcomTestGen.cpp
trunk/extra/SConscript
trunk/extra/SimpleScene.cpp
trunk/extra/SimpleScene.hpp
trunk/extra/clump/Shop.cpp
trunk/extra/clump/Shop.hpp
trunk/extra/spherical-dem-simulator/SphericalDEMSimulator.cpp
trunk/extra/tetra/Tetra.cpp
trunk/extra/tetra/Tetra.hpp
trunk/extra/usct/UniaxialStrainControlledTest.cpp
trunk/extra/usct/UniaxialStrainControlledTest.hpp
trunk/gui/py/_utils.cpp
trunk/gui/py/utils.py
trunk/gui/py/yadeControl.cpp
trunk/pkg/common/Engine/DeusExMachina/CinemCNCEngine.cpp
trunk/pkg/common/Engine/DeusExMachina/CinemCNCEngine.hpp
trunk/pkg/common/Engine/DeusExMachina/CinemKNCEngine.cpp
trunk/pkg/common/Engine/DeusExMachina/CinemKNCEngine.hpp
trunk/pkg/common/Engine/DeusExMachina/DisplacementToForceEngine.cpp
trunk/pkg/common/Engine/DeusExMachina/DisplacementToForceEngine.hpp
trunk/pkg/common/Engine/DeusExMachina/ForceEngine.cpp
trunk/pkg/common/Engine/DeusExMachina/ForceEngine.hpp
trunk/pkg/common/Engine/DeusExMachina/GravityEngines.cpp
trunk/pkg/common/Engine/DeusExMachina/GravityEngines.hpp
trunk/pkg/common/Engine/DeusExMachina/MomentEngine.cpp
trunk/pkg/common/Engine/DeusExMachina/MomentEngine.hpp
trunk/pkg/common/Engine/EngineUnit/CundallNonViscousDamping.cpp
trunk/pkg/common/Engine/EngineUnit/CundallNonViscousDamping.hpp
trunk/pkg/common/Engine/EngineUnit/NewtonsForceLaw.cpp
trunk/pkg/common/Engine/EngineUnit/NewtonsForceLaw.hpp
trunk/pkg/common/Engine/EngineUnit/NewtonsMomentumLaw.cpp
trunk/pkg/common/Engine/EngineUnit/NewtonsMomentumLaw.hpp
trunk/pkg/common/Engine/MetaEngine/ConstitutiveLaw.hpp
trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplier.cpp
trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplier.hpp
trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplierUnit.hpp
trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamper.cpp
trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamper.hpp
trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamperUnit.hpp
trunk/pkg/common/Engine/ParallelEngine.cpp
trunk/pkg/common/Engine/StandAloneEngine/PhysicalActionContainerReseter.cpp
trunk/pkg/common/SConscript
trunk/pkg/dem/Engine/DeusExMachina/CapillaryRecorder.cpp
trunk/pkg/dem/Engine/DeusExMachina/CapillaryRecorder.hpp
trunk/pkg/dem/Engine/DeusExMachina/ContactStressRecorder.cpp
trunk/pkg/dem/Engine/DeusExMachina/ContactStressRecorder.hpp
trunk/pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.cpp
trunk/pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.hpp
trunk/pkg/dem/Engine/DeusExMachina/NewtonsDampedLaw.cpp
trunk/pkg/dem/Engine/DeusExMachina/NewtonsDampedLaw.hpp
trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp
trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp
trunk/pkg/dem/Engine/DeusExMachina/TriaxialStateRecorder.cpp
trunk/pkg/dem/Engine/DeusExMachina/TriaxialStateRecorder.hpp
trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp
trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.hpp
trunk/pkg/dem/Engine/DeusExMachina/WallStressRecorder.cpp
trunk/pkg/dem/Engine/DeusExMachina/WallStressRecorder.hpp
trunk/pkg/dem/Engine/EngineUnit/ef2_Spheres_NormalShear_ElasticFrictionalLaw.hpp
trunk/pkg/dem/Engine/EngineUnit/ef2_Spheres_Viscoelastic_SimpleViscoelasticContactLaw.hpp
trunk/pkg/dem/Engine/StandAloneEngine/CapillaryCohesiveLaw.cpp
trunk/pkg/dem/Engine/StandAloneEngine/CapillaryCohesiveLaw.hpp
trunk/pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.cpp
trunk/pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.hpp
trunk/pkg/dem/Engine/StandAloneEngine/ContactLaw1.cpp
trunk/pkg/dem/Engine/StandAloneEngine/ContactLaw1.hpp
trunk/pkg/dem/Engine/StandAloneEngine/ElasticCohesiveLaw.cpp
trunk/pkg/dem/Engine/StandAloneEngine/ElasticCohesiveLaw.hpp
trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.cpp
trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.hpp
trunk/pkg/dem/Engine/StandAloneEngine/ForceRecorder.cpp
trunk/pkg/dem/Engine/StandAloneEngine/ForceRecorder.hpp
trunk/pkg/dem/Engine/StandAloneEngine/GeometricalModelForceColorizer.cpp
trunk/pkg/dem/Engine/StandAloneEngine/GeometricalModelForceColorizer.hpp
trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessTimeStepper.cpp
trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessTimeStepper.hpp
trunk/pkg/dem/Engine/StandAloneEngine/MicroMacroAnalyser.cpp
trunk/pkg/dem/Engine/StandAloneEngine/MicroMacroAnalyser.hpp
trunk/pkg/dem/Engine/StandAloneEngine/MyTetrahedronLaw.cpp
trunk/pkg/dem/Engine/StandAloneEngine/MyTetrahedronLaw.hpp
trunk/pkg/dem/Engine/StandAloneEngine/ViscousForceDamping.cpp
trunk/pkg/dem/Engine/StandAloneEngine/ViscousForceDamping.hpp
trunk/pkg/dem/Engine/StandAloneEngine/VolumicContactLaw.cpp
trunk/pkg/dem/Engine/StandAloneEngine/VolumicContactLaw.hpp
trunk/pkg/dem/PreProcessor/CohesiveTriaxialTest.cpp
trunk/pkg/dem/PreProcessor/DirectShearCis.cpp
trunk/pkg/dem/PreProcessor/Funnel.cpp
trunk/pkg/dem/PreProcessor/HydraulicTest.cpp
trunk/pkg/dem/PreProcessor/MembraneTest.cpp
trunk/pkg/dem/PreProcessor/ModifiedTriaxialTest.cpp
trunk/pkg/dem/PreProcessor/SDECImpactTest.cpp
trunk/pkg/dem/PreProcessor/SDECLinkedSpheres.cpp
trunk/pkg/dem/PreProcessor/SDECMovingWall.cpp
trunk/pkg/dem/PreProcessor/SDECSpheresPlane.cpp
trunk/pkg/dem/PreProcessor/STLImporterTest.cpp
trunk/pkg/dem/PreProcessor/SimpleShear.cpp
trunk/pkg/dem/PreProcessor/TestSimpleViscoelastic.cpp
trunk/pkg/dem/PreProcessor/TetrahedronsTest.cpp
trunk/pkg/dem/PreProcessor/ThreePointBending.cpp
trunk/pkg/dem/PreProcessor/TriaxialTest.cpp
trunk/pkg/dem/PreProcessor/TriaxialTest.hpp
trunk/pkg/dem/PreProcessor/TriaxialTestWater.cpp
trunk/pkg/dem/PreProcessor/TriaxialTestWater.hpp
trunk/pkg/dem/SConscript
trunk/pkg/fem/Engine/StandAloneEngine/FEMLaw.cpp
trunk/pkg/fem/Engine/StandAloneEngine/FEMLaw.hpp
trunk/pkg/fem/PreProcessor/FEMBeam.cpp
trunk/pkg/fem/SConscript
trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeBeamParameters.hpp
trunk/pkg/lattice/Engine/StandAloneEngine/BeamRecorder.hpp
trunk/pkg/lattice/Engine/StandAloneEngine/LatticeLaw.hpp
trunk/pkg/lattice/Engine/StandAloneEngine/MovingSupport.hpp
trunk/pkg/lattice/Engine/StandAloneEngine/NodeRecorder.hpp
trunk/pkg/lattice/Engine/StandAloneEngine/StrainRecorder.hpp
trunk/pkg/lattice/PreProcessor/LatticeExample.cpp
trunk/pkg/lattice/SConscript
trunk/pkg/mass-spring/Engine/StandAloneEngine/MassSpringLaw.cpp
trunk/pkg/mass-spring/Engine/StandAloneEngine/MassSpringLaw.hpp
trunk/pkg/mass-spring/PreProcessor/HangingCloth.cpp
trunk/pkg/mass-spring/SConscript
trunk/pkg/realtime-rigidbody/Engine/StandAloneEngine/FrictionLessElasticContactLaw.cpp
trunk/pkg/realtime-rigidbody/Engine/StandAloneEngine/FrictionLessElasticContactLaw.hpp
trunk/pkg/realtime-rigidbody/PreProcessor/BoxStack.cpp
trunk/pkg/realtime-rigidbody/PreProcessor/RotatingBox.cpp
trunk/pkg/realtime-rigidbody/SConscript
trunk/pkg/snow/Engine/ElawSnowLayersDeformation.cpp
trunk/pkg/snow/Engine/ElawSnowLayersDeformation.hpp
trunk/pkg/snow/PreProcessor/SnowCreepTest.cpp
trunk/pkg/snow/PreProcessor/SnowVoxelsLoader.cpp
trunk/pkg/snow/SConscript
trunk/scripts/chain-distant-interactions.py
trunk/scripts/constitutive-law.py
trunk/scripts/cylindrical-layer-packing.py
trunk/scripts/exact-rot-facet.py
trunk/scripts/exact-rot.py
trunk/scripts/multi.py
trunk/scripts/simple-scene-graph.py
trunk/scripts/simple-scene-parallel.py
trunk/scripts/simple-scene-player.py
trunk/scripts/simple-scene-video.py
trunk/scripts/simple-scene.py
trunk/scripts/test-sphere-facet-corner.py
trunk/scripts/test-sphere-facet.py
Log:
1. Remove all traces of physical actions:
PhysicalAction, GlobalStiffness, Force, Momentum, MakeItFlat,
ResultantForceEngine, GlobalStiffnessCounter,
PhysicalActionVectorVector, PhysicalActionContainer.
2. All code now uses BexContainer.
Please check that your code works correctly (I tried to do my best and double-checked, though).
Make sure you remove (rm -rf ...) all plugins before recompiling as old plugins will _not_ be deleted automatically.
Modified: trunk/core/BexContainer.hpp
===================================================================
--- trunk/core/BexContainer.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/core/BexContainer.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,7 +10,35 @@
#ifdef YADE_OPENMP
#include<omp.h>
+/*! Container for Body External Variables (bex), typically forces and torques from interactions.
+ * Values should be reset at every iteration by calling BexContainer::reset();
+ * If you want to add your own bex, you need to:
+ *
+ * 1. Create storage vector
+ * 2. Create accessor function
+ * 3. Update the resize function
+ * 4. Update the reset function
+ * 5. update the sync function (for the multithreaded implementation)
+ *
+ * This class exists in two flavors: non-parallel and parallel. The parallel one stores
+ * bex increments separately for every thread and sums those when sync() is called.
+ * The reason of this design is that the container is not truly random-access, but rather
+ * is written to everywhere in one phase and read in the next one. Adding to force/torque
+ * marks the container as dirty and sync() must be performed before reading the stored data.
+ * Calling getForce/getTorque when the container is not synchronized throws an exception.
+ *
+ * It is intentional that sync() needs to be called exlicitly, since syncs are expensive and
+ * the programmer should be aware of that. Sync is however performed only if the container
+ * is dirty. Every full sync increments the syncCount variable, that should ideally equal
+ * the number of steps (one per step).
+ *
+ * The number of threads (omp_get_max_threads) may not change once BexContainer is constructed.
+ *
+ * The non-parallel flavor has the same interface, but sync() is no-op and synchronization
+ * is not enforced at all.
+ */
+//! This is the parallel flavor of BexContainer
class BexContainer{
private:
typedef std::vector<Vector3r> vvector;
@@ -30,7 +58,8 @@
inline void ensureSynced(){ if(!synced) throw runtime_error("BexContainer not thread-synchronized; call sync() first!"); }
/*! Function to allow friend classes to get force even if not synced.
- * Dangerous! The caller must know what it is doing! */
+ * Dangerous! The caller must know what it is doing! (i.e. don't read after write
+ * for a particular body id. */
const Vector3r& getForceUnsynced (body_id_t id){ensureSize(id); return _force[id];}
const Vector3r& getTorqueUnsynced(body_id_t id){ensureSize(id); return _force[id];}
friend class PhysicalActionDamperUnit;
@@ -48,10 +77,9 @@
const Vector3r& getTorque(body_id_t id) { ensureSize(id); ensureSynced(); return _torque[id]; }
void addTorque(body_id_t id, const Vector3r& f){ ensureSize(id); synced=false; _torqueData[omp_get_thread_num()][id]+=f;}
- /* Sum contributions from all threads, save to the 0th thread storage.
- * Locks globalMutex, since one thread modifies other threads' data.
- * Must be called before get* methods are used. Exception is thrown otherwise, since data are not consistent.
- */
+ /* Sum contributions from all threads, save to _force&_torque.
+ * Locks globalMutex, since one thread modifies common data (_force&_torque).
+ * Must be called before get* methods are used. Exception is thrown otherwise, since data are not consistent. */
inline void sync(){
if(synced) return;
boost::mutex::scoped_lock lock(globalMutex);
@@ -68,8 +96,7 @@
/* Change size of containers (number of bodies).
* Locks globalMutex, since on threads modifies other threads' data.
- * Called very rarely (a few times at the beginning of the simulation)
- */
+ * Called very rarely (a few times at the beginning of the simulation). */
void resize(size_t newSize){
boost::mutex::scoped_lock lock(globalMutex);
if(size>=newSize) return; // in case on thread was waiting for resize, but it was already satisfied by another one
@@ -80,7 +107,8 @@
_force.resize(newSize); _torque.resize(newSize);
size=newSize;
}
-
+ /*! Reset all data, also reset summay forces/torques and mark the container clean. */
+ // perhaps should be private and friend MetaBody or whatever the only caller should be
void reset(){
for(int thread=0; thread<nThreads; thread++){
memset(_forceData [thread][0], 0,sizeof(Vector3r)*size);
@@ -92,16 +120,7 @@
};
#else
-/* Container for Body External Variables (bex), typically forces and torques from interactions.
- * Values should be reset at every iteration by BexResetter.
- * If you want to add your own bex, there are 4 steps:
- *
- * 1. Create storage vector
- * 2. Create accessor function
- * 3. Update the resize function
- * 4. Update the reset function
- *
- */
+//! This is the non-parallel flavor of BexContainer
class BexContainer {
private:
std::vector<Vector3r> _force;
@@ -131,7 +150,6 @@
_force.resize(newSize);
_torque.resize(newSize);
size=newSize;
- // std::cerr<<"[DEBUG] BexContainer: Resized to "<<size<<std::endl;
}
};
Modified: trunk/core/Body.hpp
===================================================================
--- trunk/core/Body.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/core/Body.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -16,7 +16,6 @@
#include"PhysicalParameters.hpp"
#include"InteractionContainer.hpp"
#include"Interaction.hpp"
-#include"PhysicalActionContainer.hpp"
#include<yade/lib-base/yadeWm3Extra.hpp>
#include<yade/lib-serialization/Serializable.hpp>
Modified: trunk/core/MetaBody.cpp
===================================================================
--- trunk/core/MetaBody.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/core/MetaBody.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -24,7 +24,6 @@
* and different type of containers can still be used instead by explicit assignment */
#include<yade/core/BodyRedirectionVector.hpp>
#include<yade/core/InteractionVecMap.hpp>
-#include<yade/core/PhysicalActionVectorVector.hpp>
// POSIX-only
#include<pwd.h>
@@ -36,9 +35,6 @@
MetaBody::MetaBody() :
Body(),bodies(new BodyRedirectionVector), interactions(new InteractionVecMap), persistentInteractions(interactions),transientInteractions(interactions)
- #ifndef BEX_CONTAINER
- ,physicalActions(new PhysicalActionVectorVector)
- #endif
{
engines.clear();
initializers.clear();
@@ -83,8 +79,10 @@
{
if(needsInitializers){
FOREACH(shared_ptr<Engine> e, initializers){ if(e->isActivated()) e->action(this); }
+ bex.resize(bodies->size());
needsInitializers=false;
}
+ //bex.reset(); // uncomment if PhysicalActionContainerReseter is removed
TimingInfo::delta last=TimingInfo::getNow();
FOREACH(const shared_ptr<Engine>& e, engines){
if(e->isActivated()){
Modified: trunk/core/MetaBody.hpp
===================================================================
--- trunk/core/MetaBody.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/core/MetaBody.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -14,7 +14,7 @@
#include"BodyContainer.hpp"
#include"Engine.hpp"
#include"DisplayParameters.hpp"
-#include"PhysicalActionContainer.hpp"
+#include"BexContainer.hpp"
//#include"groupRelationData.hpp"
class MetaBody : public Body
@@ -29,11 +29,8 @@
__attribute__((__deprecated__)) shared_ptr<InteractionContainer>& persistentInteractions; // disappear, reappear according to physical (or any other non-spatial) criterion
shared_ptr<InteractionContainer>& transientInteractions; // disappear, reappear according to spatial criterion
- #ifdef BEX_CONTAINER
- BexContainer bex;
- #else
- shared_ptr<PhysicalActionContainer> physicalActions;
- #endif
+ BexContainer bex;
+
vector<shared_ptr<Serializable> > miscParams; // will set static parameters during deserialization (primarily for GLDraw functors which otherwise have no attribute access)
//! tags like mp3 tags: author, date, version, description etc.
list<string> tags;
@@ -66,9 +63,6 @@
(initializers)
(bodies)
(transientInteractions)
- #ifndef BEX_CONTAINER
- (physicalActions)
- #endif
(miscParams)
(dispParams)
(dt)
Deleted: trunk/core/PhysicalAction.hpp
===================================================================
--- trunk/core/PhysicalAction.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/core/PhysicalAction.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,33 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2004 by Olivier Galizzi *
-* olivier.galizzi@xxxxxxx *
-* Copyright (C) 2004 by Janek Kozicki *
-* cosurgi@xxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#pragma once
-
-
-#include<yade/lib-serialization/Serializable.hpp>
-#include<yade/lib-multimethods/Indexable.hpp>
-
-/* Helper macro for Engines and Engine units to declare what PhysicalParameters (Bex, BodyExternalVariables) they want to use */
-#define NEEDS_BEX(...) public: virtual std::list<std::string> getNeededBex(){ const char* bex[]={ __VA_ARGS__ "", NULL}; std::list<std::string> ret; for(int i=0; bex[i]!=NULL;i++){ret.push_back(std::string(bex[i]));} return ret; }
-
-class PhysicalAction : public Serializable, public Indexable
-{
- public :
-
- virtual void reset() {throw;};
- virtual shared_ptr<PhysicalAction> clone() {throw;};
-
- REGISTER_INDEX_COUNTER(PhysicalAction);
- REGISTER_CLASS_AND_BASE(PhysicalAction,Serializable Indexable);
-};
-
-REGISTER_SERIALIZABLE(PhysicalAction);
-
-
Deleted: trunk/core/PhysicalActionContainer.cpp
===================================================================
--- trunk/core/PhysicalActionContainer.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/core/PhysicalActionContainer.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,25 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2004 by Olivier Galizzi *
-* olivier.galizzi@xxxxxxx *
-* Copyright (C) 2004 by Janek Kozicki *
-* cosurgi@xxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#include "PhysicalActionContainer.hpp"
-#include "PhysicalAction.hpp"
-
-
-PhysicalActionContainer::PhysicalActionContainer() : Serializable()
-{
- action.clear();
-}
-
-
-PhysicalActionContainer::~PhysicalActionContainer()
-{
-
-}
-
Deleted: trunk/core/PhysicalActionContainer.hpp
===================================================================
--- trunk/core/PhysicalActionContainer.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/core/PhysicalActionContainer.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,125 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2004 by Olivier Galizzi *
-* olivier.galizzi@xxxxxxx *
-* Copyright (C) 2004 by Janek Kozicki *
-* cosurgi@xxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#pragma once
-
-#include<yade/lib-serialization/Serializable.hpp>
-#include<yade/core/PhysicalAction.hpp>
-#include<iostream>
-
-// experimental
-#ifndef NO_BEX
-# define BEX_CONTAINER
-#endif
-
-#ifdef BEX_CONTAINER
- #include<yade/core/BexContainer.hpp>
-#endif
-
-using namespace boost;
-using namespace std;
-
-class PhysicalActionContainerIterator
-{
- public :
- int currentIndex;
-
- PhysicalActionContainerIterator() {};
- virtual ~PhysicalActionContainerIterator() {};
-
- virtual bool isDifferent(const PhysicalActionContainerIterator&) { throw;};
- virtual void affect(const PhysicalActionContainerIterator&) { throw;};
- virtual void increment() { throw;};
- virtual shared_ptr<PhysicalAction> getValue() { throw;};
- virtual shared_ptr<PhysicalActionContainerIterator> createPtr() { throw;};
- virtual int getCurrentIndex() { throw;};
-};
-
-class PhysicalActionContainerIteratorPointer
-{
- private :
- shared_ptr<PhysicalActionContainerIterator> ptr;
- void allocate(const PhysicalActionContainerIteratorPointer& bi)
- {
- if (ptr==0) ptr = bi.get()->createPtr();
- }
-
- public :
- PhysicalActionContainerIterator& getRef() {return *ptr;};
- PhysicalActionContainerIterator& getRef() const {return *ptr;};
- shared_ptr<PhysicalActionContainerIterator> get() {return ptr;};
- shared_ptr<PhysicalActionContainerIterator> get() const {return ptr;};
-
- PhysicalActionContainerIteratorPointer(const PhysicalActionContainerIteratorPointer& bi)
- {
- allocate(bi);
- ptr->affect(bi.getRef());
- };
-
- PhysicalActionContainerIteratorPointer(const shared_ptr<PhysicalActionContainerIterator>& i) { ptr = i; };
- PhysicalActionContainerIteratorPointer() { ptr = shared_ptr<PhysicalActionContainerIterator>(); };
- bool operator!=(const PhysicalActionContainerIteratorPointer& bi) { return ptr->isDifferent(bi.getRef()); };
-
- PhysicalActionContainerIteratorPointer& operator=(const PhysicalActionContainerIteratorPointer& bi)
- {
- allocate(bi);
- ptr->affect(bi.getRef());
- return *this;
- };
-
- PhysicalActionContainerIteratorPointer& operator++() { ptr->increment(); return *this; };
- PhysicalActionContainerIteratorPointer& operator++(int); // disabled
- shared_ptr<PhysicalAction> operator*() { return ptr->getValue(); };
- int getCurrentIndex() { return ptr->getCurrentIndex(); };
-
-};
-
-
-
-// this container is different: it has ALWAYS data inside, not empty pointers at all. Every field has
-// inside the right pointer type so it can be safely (and quickly) static_casted, so that the user himself
-// is doing addition, substraction, and whatever he wants.
-//
-// you should never have to create new PhysicalAction ! (that takes too much time), except for calling prepare, which is done only once
-
-class PhysicalActionContainer : public Serializable
-{
- public :
- PhysicalActionContainer();
- virtual ~PhysicalActionContainer();
-
- virtual void clear() {throw;};
-
- // doesn't delete all, just resets data
- virtual void reset() {throw;};
- virtual unsigned int size() {throw;};
- // fills container with resetted fields. argument here, should be all PhysicalAction types that are planned to use
- virtual void prepare(std::vector<shared_ptr<PhysicalAction> >& ) {throw;};
-
- // finds and returns action of given polymorphic type, for body of given Id,
- // should be always succesfull. if it is not - you forgot to call prepare()
- virtual shared_ptr<PhysicalAction>& find(
- unsigned int /*Body->getId() */
- , int /*Force::getClassIndexStatic()*/) {throw;};
-
- typedef PhysicalActionContainerIteratorPointer iterator;
- virtual PhysicalActionContainer::iterator begin() {throw;};
- virtual PhysicalActionContainer::iterator end() {throw;};
-
- REGISTER_ATTRIBUTES(/*no base*/,(action));
- REGISTER_CLASS_AND_BASE(PhysicalActionContainer,Serializable);
-
- // local storage for uniform serialization of all possible container concrete implementations.
- private :
- vector<shared_ptr<PhysicalAction> > action;
-};
-
-REGISTER_SERIALIZABLE(PhysicalActionContainer);
-
Modified: trunk/core/SConscript
===================================================================
--- trunk/core/SConscript 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/core/SConscript 2009-03-30 17:10:27 UTC (rev 1738)
@@ -17,7 +17,6 @@
'MetaEngine.cpp',
'NullGUI.cpp',
'Omega.cpp',
- 'PhysicalActionContainer.cpp',
'PhysicalParameters.cpp',
'Preferences.cpp',
'SimulationFlow.cpp',
@@ -32,7 +31,6 @@
'containers/InteractionVecSet.cpp',
'containers/InteractionHashMap.cpp',
'containers/InteractionVecMap.cpp',
- 'containers/PhysicalActionVectorVector.cpp',
],
LIBS=env['LIBS']+['yade-base',
'yade-serialization',
Deleted: trunk/core/containers/PhysicalActionVectorVector.cpp
===================================================================
--- trunk/core/containers/PhysicalActionVectorVector.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/core/containers/PhysicalActionVectorVector.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,227 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2004 by Olivier Galizzi *
-* olivier.galizzi@xxxxxxx *
-* Copyright (C) 2004 by Janek Kozicki *
-* cosurgi@xxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#include"PhysicalActionVectorVector.hpp"
-#include<yade/core/Body.hpp>
-#include<yade/core/PhysicalAction.hpp>
-
-PhysicalActionVectorVectorIterator::PhysicalActionVectorVectorIterator() : PhysicalActionContainerIterator()
-{
- currentIndex = -1;
-}
-
-
-PhysicalActionVectorVectorIterator::~PhysicalActionVectorVectorIterator()
-{
-
-}
-
-
-bool PhysicalActionVectorVectorIterator::isDifferent(const PhysicalActionContainerIterator& i)
-{
- const PhysicalActionVectorVectorIterator& it = static_cast<const PhysicalActionVectorVectorIterator&>(i);
- if (it.vvi==it.vviEnd)
- return !(vvi==vviEnd);
- else
- return (vi != it.vi );
-}
-
-
-void PhysicalActionVectorVectorIterator::increment()
-{
- ++vi;
- if(vi == viEnd)
- {
- ++vvi;
- ++currentIndex;
- while(!(*usedIds)[currentIndex] && vvi != vviEnd)
- {
- ++currentIndex;
- ++vvi;
- }
- if(vvi != vviEnd)
- {
- vi = (*vvi).begin();
- viEnd = (*vvi).end();
- }
- }
-}
-
-
-void PhysicalActionVectorVectorIterator::affect(const PhysicalActionContainerIterator& i)
-{
- const PhysicalActionVectorVectorIterator& tmpi = static_cast<const PhysicalActionVectorVectorIterator&>(i);
- vi = tmpi.vi;
- viEnd = tmpi.viEnd;
- vvi = tmpi.vvi;
- vviEnd = tmpi.vviEnd;
- currentIndex = tmpi.currentIndex;
- usedIds = tmpi.usedIds;
-}
-
-
-shared_ptr<PhysicalAction> PhysicalActionVectorVectorIterator::getValue()
-{
- return *vi;
-}
-
-
-int PhysicalActionVectorVectorIterator::getCurrentIndex()
-{
- return currentIndex;
-}
-
-
-shared_ptr<PhysicalActionContainerIterator> PhysicalActionVectorVectorIterator::createPtr()
-{
- return shared_ptr<PhysicalActionContainerIterator>(new PhysicalActionVectorVectorIterator());
-}
-
-
-/**************************************************************************/
-/**************************************************************************/
-/**************************************************************************/
-/**************************************************************************/
-
-PhysicalActionVectorVector::PhysicalActionVectorVector()
-{
- clear();
-// currentIndex = -1;
- current_size = 0;
-}
-
-
-PhysicalActionVectorVector::~PhysicalActionVectorVector()
-{
-}
-
-
-void PhysicalActionVectorVector::clear()
-{
- physicalActions.clear();
- usedIds.clear();
- current_size = physicalActions.size();
-}
-
-
-// doesn't not delete all, just resets data
-void PhysicalActionVectorVector::reset()
-{
- #if 1
- vector< vector< shared_ptr<PhysicalAction> > >::iterator vvi = physicalActions.begin();
- vector< vector< shared_ptr<PhysicalAction> > >::iterator vviEnd = physicalActions.end();
- for( ; vvi != vviEnd ; ++vvi )
- {
- vector< shared_ptr<PhysicalAction> >::iterator vi = (*vvi).begin();
- vector< shared_ptr<PhysicalAction> >::iterator viEnd = (*vvi).end();
- for( ; vi != viEnd ; ++vi)
- //if(*vi) // FIXME ?? do not check - all fields are NOT empty.
- (*vi)->reset();
- }
- #else
- FOREACH(int idx, usedBexIndices){
- // reset everything
- FOREACH(shared_ptr<PhysicalAction>& pa,physicalActions[idx]){ pa->reset();}
- }
- #endif
-}
-
-
-unsigned int PhysicalActionVectorVector::size()
-{
- return current_size;
-}
-
-
-// fills container with resetted fields. argument here, should be all PhysicalAction types that are planned to use
-void PhysicalActionVectorVector::prepare(std::vector<shared_ptr<PhysicalAction> >& actionTypes)
-{
- unsigned int size = actionTypes.size();
- int maxSize = 0;
- for(unsigned int i = 0 ; i < size ; ++i)
- maxSize = max(maxSize , actionTypes[i]->getClassIndex() );
- ++maxSize;
- actionTypesResetted.resize(maxSize);
- usedBexIndices.clear();
- for(unsigned int i = 0 ; i < size ; ++i )
- {
- int idx=actionTypes[i]->getClassIndex();
- actionTypesResetted[idx] = actionTypes[i]->clone();
- actionTypesResetted[idx] -> reset();
- usedBexIndices.push_back(idx);
- }
-}
-
-
-// finds and returns action of given polymorphic type, for body of given Id,
-// should be always succesfull. if it is not - you forgot to call prepare()
-shared_ptr<PhysicalAction>& PhysicalActionVectorVector::find(unsigned int id , int actionIndex )
-{
- #ifdef BEX_CONTAINER
- cerr<<"FATAL: This build of yade uses nex BexContainer instead of PhysicalActionContainer.\nFATAL: However, your simulation still uses PhysicalActionContainer.\nFATAL: Update your code, see backtrace (if in debug build) to find where the old container is used."<<endl;
- throw std::runtime_error("Deprecated PhysicalActionContainer is not supported in this build!");
- #endif
- if( current_size <= id ) // this is very rarely executed, only at beginning.
- // somebody is accesing out of bounds, make sure he will find, what he needs - a resetted PhysicalAction of his type
- {
- unsigned int oldSize = physicalActions.size();
- unsigned int newSize = id+1;
- current_size = newSize;
- usedIds.resize(newSize,false);
- physicalActions.resize(newSize);
- for(unsigned int i = oldSize ; i < newSize ; ++i )
- {
- unsigned int actionTypesSize = actionTypesResetted.size();
- physicalActions[i].resize(actionTypesSize);
- for( unsigned int j = 0 ; j < actionTypesSize ; ++j )
- physicalActions[i][j] = actionTypesResetted[j]->clone();
- }
- }
- usedIds[id] = true;
- return physicalActions[id][actionIndex];
-}
-
-
-PhysicalActionContainer::iterator PhysicalActionVectorVector::begin()
-{
- shared_ptr<PhysicalActionVectorVectorIterator> it(new PhysicalActionVectorVectorIterator());
- it->currentIndex = 0;
- it->usedIds = &usedIds;
- it->vvi = physicalActions.begin();
- it->vviEnd = physicalActions.end();
- while(it->vvi!=it->vviEnd && !usedIds[it->currentIndex])
- {
- ++(it->currentIndex);
- ++(it->vvi);
- }
- if(it->vvi != it->vviEnd)
- {
- it->vi = (*it->vvi).begin();
- it->viEnd = (*it->vvi).end();
- }
-
- return PhysicalActionContainer::iterator(it);
-}
-
-
-PhysicalActionContainer::iterator PhysicalActionVectorVector::end()
-{
- shared_ptr<PhysicalActionVectorVectorIterator> it(new PhysicalActionVectorVectorIterator());
- it->currentIndex = physicalActions.size();
- it->vvi = physicalActions.end();
- it->vviEnd = physicalActions.end();
- /* Using nested iterator when the first one is end() already would be error, therefore we leave it->vi and it->viEnd alone.
- * (see PhysicalActionVectorVectorIterator::isDifferent for exact implementation of !=end()) */
- return PhysicalActionContainer::iterator(it);
-
-}
-
-
-// YADE_PLUGIN();
Deleted: trunk/core/containers/PhysicalActionVectorVector.hpp
===================================================================
--- trunk/core/containers/PhysicalActionVectorVector.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/core/containers/PhysicalActionVectorVector.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,90 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2004 by Olivier Galizzi *
-* olivier.galizzi@xxxxxxx *
-* Copyright (C) 2004 by Janek Kozicki *
-* cosurgi@xxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#pragma once
-
-#include<yade/core/PhysicalActionContainer.hpp>
-#include<list>
-#include<vector>
-
-class PhysicalAction;
-
-using namespace boost;
-using namespace std;
-
-class PhysicalActionVectorVectorIterator : public PhysicalActionContainerIterator
-{
- public :
- vector< vector< shared_ptr<PhysicalAction> > >::iterator vvi;
- vector< vector< shared_ptr<PhysicalAction> > >::iterator vviEnd;
- vector< shared_ptr<PhysicalAction> > ::iterator vi;
- vector< shared_ptr<PhysicalAction> > ::iterator viEnd;
- vector< bool > * usedIds;
-
- public :
- PhysicalActionVectorVectorIterator();
- ~PhysicalActionVectorVectorIterator();
-
- virtual bool isDifferent(const PhysicalActionContainerIterator& i);
- virtual void affect(const PhysicalActionContainerIterator& i);
- virtual void increment();
- virtual shared_ptr<PhysicalAction> getValue();
- virtual shared_ptr<PhysicalActionContainerIterator> createPtr();
- virtual int getCurrentIndex();
-};
-
-
-
-class PhysicalActionVectorVector : public PhysicalActionContainer
-{
- private :
- // this in fact should be also a RedirectionVector in respect to the Body.id
- // this container is memory-consuming, because size of this vector is depending on highest id
- // from all bodies, not on the number of bodies
-
- // in this two-dimensional table:
- // - first dimension is Body->getId() number
- // - second dimension is PhysicalAction->getClassIndex() number
- vector< vector< shared_ptr<PhysicalAction> > > physicalActions;
- vector< shared_ptr<PhysicalAction> > actionTypesResetted;
- vector< bool > usedIds;
- unsigned int current_size;
- vector<int> usedBexIndices;
-
- public :
- PhysicalActionVectorVector();
- virtual ~PhysicalActionVectorVector();
-
- virtual void clear();
-
- // doesn't delete all, just resets data
- virtual void reset();
- virtual unsigned int size();
- // fills container with resetted fields. argument here, should be all PhysicalAction types that are planned to use
- virtual void prepare(std::vector<shared_ptr<PhysicalAction> >& );
-
- // finds and returns action of given polymorphic type, for body of given Id,
- // should be always succesfull. if it is not - you forgot to call prepare()
- virtual shared_ptr<PhysicalAction>& find(
- unsigned int /*Body->getId() */
- , int /*ActionForce::getClassIndexStatic()*/);
-
- virtual PhysicalActionContainer::iterator begin();
- virtual PhysicalActionContainer::iterator end();
-
-/// Serialization
- REGISTER_CLASS_NAME(PhysicalActionVectorVector);
- REGISTER_BASE_CLASS_NAME(PhysicalActionContainer);
-
-};
-
-REGISTER_SERIALIZABLE(PhysicalActionVectorVector);
-
-
Modified: trunk/core/yade.cpp
===================================================================
--- trunk/core/yade.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/core/yade.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -160,9 +160,6 @@
#ifdef LOG4CXX
" LOG4CXX configurable logging framework enabled (~/.yade-suffix/logging.conf)"
#endif
- #ifdef BEX_CONTAINER
- " BEX_CONTAINER (uses BexContainer instead of PhysicalActionContainer)\n"
- #endif
"\n";
}
Modified: trunk/examples/STLImporterTest.py
===================================================================
--- trunk/examples/STLImporterTest.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/examples/STLImporterTest.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -38,8 +38,6 @@
## Initializers
o.initializers=[
- ## Create and reset to zero container of all PhysicalActions that will be used
- StandAloneEngine('PhysicalActionContainerInitializer'),
## Create bounding boxes. They are needed to zoom the 3d view properly before we start the simulation.
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingFacet2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
Modified: trunk/examples/SpheresFactory/model.py
===================================================================
--- trunk/examples/SpheresFactory/model.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/examples/SpheresFactory/model.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -21,11 +21,10 @@
## Initializers
o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',
[EngineUnit('InteractingSphere2AABB'),
EngineUnit('InteractingFacet2AABB'),
- EngineUnit('MetaInteractingGeometry2AABB')])
+ EngineUnit('MetaInteractingGeometry2AABB')]),
]
## Engines
Modified: trunk/examples/dynamic_simulation_tests/ringCundallDamping.py
===================================================================
--- trunk/examples/dynamic_simulation_tests/ringCundallDamping.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/examples/dynamic_simulation_tests/ringCundallDamping.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -35,11 +35,10 @@
## Initializers
o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',
[EngineUnit('InteractingSphere2AABB'),
EngineUnit('InteractingFacet2AABB'),
- EngineUnit('MetaInteractingGeometry2AABB')])
+ EngineUnit('MetaInteractingGeometry2AABB')]),
]
## Engines
Modified: trunk/examples/dynamic_simulation_tests/ringSimpleViscoelastic.py
===================================================================
--- trunk/examples/dynamic_simulation_tests/ringSimpleViscoelastic.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/examples/dynamic_simulation_tests/ringSimpleViscoelastic.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -40,11 +40,10 @@
## Initializers
o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',
[EngineUnit('InteractingSphere2AABB'),
EngineUnit('InteractingFacet2AABB'),
- EngineUnit('MetaInteractingGeometry2AABB')])
+ EngineUnit('MetaInteractingGeometry2AABB')]),
]
## Engines
Modified: trunk/examples/rod_penetration/model.py
===================================================================
--- trunk/examples/rod_penetration/model.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/examples/rod_penetration/model.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -45,11 +45,10 @@
## Initializers
o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[
EngineUnit('InteractingSphere2AABB'),
EngineUnit('InteractingFacet2AABB'),
- EngineUnit('MetaInteractingGeometry2AABB')])
+ EngineUnit('MetaInteractingGeometry2AABB')]),
]
## Engines
Modified: trunk/extra/Brefcom.cpp
===================================================================
--- trunk/extra/Brefcom.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/extra/Brefcom.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -12,12 +12,7 @@
CREATE_LOGGER(BrefcomGlobalCharacteristics);
void BrefcomGlobalCharacteristics::compute(MetaBody* rb, bool useMaxForce){
- //Shop::Bex::initCache();
- #ifdef BEX_CONTAINER
- rb->bex.sync();
- #else
- throw runtime_error("Brefcom can run only with BexContainer");
- #endif
+ rb->bex.sync();
// 1. reset volumetric strain (cummulative in the next loop)
// 2. get maximum force on a body and sum of all forces (for averaging)
@@ -26,9 +21,7 @@
BrefcomPhysParams* bpp(YADE_CAST<BrefcomPhysParams*>(b->physicalParameters.get()));
bpp->epsVolumetric=0;
bpp->numContacts=0;
- #ifdef BEX_CONTAINER
- currF=rb->bex.getForce(b->id).Length(); maxF=max(currF,maxF); sumF+=currF;
- #endif
+ currF=rb->bex.getForce(b->id).Length(); maxF=max(currF,maxF); sumF+=currF;
}
Real meanF=sumF/rb->bodies->size();
@@ -133,14 +126,10 @@
CREATE_LOGGER(BrefcomLaw);
void BrefcomLaw::applyForce(const Vector3r& force, const body_id_t& id1, const body_id_t& id2){
-#ifdef BEX_CONTAINER
rootBody->bex.addForce(id1,force);
rootBody->bex.addForce(id2,-force);
rootBody->bex.addTorque(id1,(contGeom->contactPoint-contGeom->pos1).Cross(force));
rootBody->bex.addTorque(id2,(contGeom->contactPoint-contGeom->pos2).Cross(-force));
-#else
- throw runtime_error("Brefcom can run only with BexContainer");
-#endif
}
CREATE_LOGGER(ef2_Spheres_Brefcom_BrefcomLaw);
@@ -222,7 +211,6 @@
LOG_DEBUG("Contact #"<<I->getId1()<<"=#"<<I->getId2()<<" is damaged over thershold ("<<omega<<">"<<omegaThreshold<<") and has been deleted (isReal="<<I->isReal<<")");
return;
}
- // store Fn (and Fs?), for use with GlobalStiffnessCounter?
NNAN(sigmaN); NNANV(sigmaT); NNAN(crossSection);
Fn=sigmaN*crossSection; BC->normalForce=Fn*contGeom->normal;
Modified: trunk/extra/Brefcom.hpp
===================================================================
--- trunk/extra/Brefcom.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/extra/Brefcom.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -6,14 +6,11 @@
#include<yade/core/FileGenerator.hpp>
#include<yade/pkg-common/RigidBodyParameters.hpp>
#include<yade/pkg-dem/BodyMacroParameters.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
#include<yade/pkg-common/InteractionPhysicsEngineUnit.hpp>
#include<yade/pkg-dem/SpheresContactGeometry.hpp>
#include<yade/pkg-common/GLDrawFunctors.hpp>
#include<yade/pkg-common/PeriodicEngines.hpp>
#include<yade/pkg-common/NormalShearInteractions.hpp>
-#include<yade/pkg-dem/GlobalStiffness.hpp>
#include<yade/pkg-common/ConstitutiveLaw.hpp>
/* Engine encompassing several computations looping over all bodies/interactions
@@ -206,7 +203,6 @@
BrefcomLaw(): logStrain(false) { Shop::Bex::initCache(); };
void action(MetaBody*);
protected:
- NEEDS_BEX("Force","Momentum");
REGISTER_CLASS_AND_BASE(BrefcomLaw,InteractionSolver);
REGISTER_ATTRIBUTES(InteractionSolver,(logStrain));
DECLARE_LOGGER;
Modified: trunk/extra/BrefcomTestGen.cpp
===================================================================
--- trunk/extra/BrefcomTestGen.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/extra/BrefcomTestGen.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -9,7 +9,6 @@
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/InteractingSphere.hpp>
#include<yade/pkg-common/BoundingVolumeMetaEngine.hpp>
#include<yade/pkg-common/AABB.hpp>
@@ -36,12 +35,6 @@
void BrefcomTestGen::createEngines(){
rootBody->initializers.clear();
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
- physicalActionInitializer->physicalActionNames.push_back("GlobalStiffness");
- rootBody->initializers.push_back(physicalActionInitializer);
-
shared_ptr<BoundingVolumeMetaEngine> boundingVolumeDispatcher = shared_ptr<BoundingVolumeMetaEngine>(new BoundingVolumeMetaEngine);
boundingVolumeDispatcher->add(new InteractingSphere2AABB);
boundingVolumeDispatcher->add(new MetaInteractingGeometry2AABB);
Modified: trunk/extra/SConscript
===================================================================
--- trunk/extra/SConscript 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/extra/SConscript 2009-03-30 17:10:27 UTC (rev 1738)
@@ -36,13 +36,11 @@
'RigidBodyParameters',
'ElasticBodyParameters',
'BodyMacroParameters',
- 'Momentum',
- 'Force',
'AABB']),
env.SharedLibrary('TetraTestGen',['tetra/TetraTestGen.cpp'],LIBS=env['LIBS']+['Shop','Tetra']),
- env.SharedLibrary('UniaxialStrainControlledTest',['usct/UniaxialStrainControlledTest.cpp'],LIBS=env['LIBS']+['Shop','GlobalStiffnessTimeStepper','GlobalStiffnessCounter','Brefcom','PositionOrientationRecorder']),
+ env.SharedLibrary('UniaxialStrainControlledTest',['usct/UniaxialStrainControlledTest.cpp'],LIBS=env['LIBS']+['Shop','GlobalStiffnessTimeStepper','Brefcom','PositionOrientationRecorder']),
env.SharedLibrary('Brefcom',['Brefcom.cpp'],CXXFLAGS=env['CXXFLAGS']+brefcomInclude,LIBS=env['LIBS']+['Shop','InteractingSphere2InteractingSphere4SpheresContactGeometry']),
@@ -65,7 +63,6 @@
'GravityEngines',
'yade-serialization',
'yade-base',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -80,7 +77,6 @@
'ParticleParameters',
'MetaInteractingGeometry',
'MetaInteractingGeometry2AABB',
- 'GlobalStiffness',
'InteractingSphere2AABB',\
'InteractingBox2AABB',
'NewtonsMomentumLaw',
@@ -88,8 +84,6 @@
'LeapFrogPositionIntegrator',
'LeapFrogOrientationIntegrator',
'InteractingBox2InteractingSphere4SpheresContactGeometry',
- 'Momentum',
- 'Force',
'InteractingSphere2InteractingSphere4SpheresContactGeometry',
#'Clump',
'yade-multimethods',
Modified: trunk/extra/SimpleScene.cpp
===================================================================
--- trunk/extra/SimpleScene.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/extra/SimpleScene.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -6,21 +6,17 @@
#include<yade/pkg-common/MetaInteractingGeometry.hpp>
#include<yade/pkg-common/MetaInteractingGeometry2AABB.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/AABB.hpp>
#include<yade/pkg-common/Box.hpp>
#include<yade/pkg-common/Sphere.hpp>
#include<yade/pkg-common/InteractingBox.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-#include<yade/pkg-common/Force.hpp>
#include<yade/pkg-common/NewtonsForceLaw.hpp>
#include<yade/pkg-common/NewtonsMomentumLaw.hpp>
#include<yade/pkg-common/LeapFrogPositionIntegrator.hpp>
#include<yade/pkg-common/LeapFrogOrientationIntegrator.hpp>
#include<yade/pkg-dem/InteractingSphere2InteractingSphere4SpheresContactGeometry.hpp>
#include<yade/pkg-dem/InteractingBox2InteractingSphere4SpheresContactGeometry.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/InteractionGeometryMetaEngine.hpp>
#include<yade/pkg-common/InteractionPhysicsMetaEngine.hpp>
@@ -47,8 +43,6 @@
/* initializers */
rootBody->initializers.clear();
//@
- rootBody->initializers.push_back(shared_ptr<PhysicalActionContainerInitializer>(new PhysicalActionContainerInitializer));
- //@
shared_ptr<BoundingVolumeMetaEngine> boundingVolumeDispatcher = shared_ptr<BoundingVolumeMetaEngine>(new BoundingVolumeMetaEngine);
boundingVolumeDispatcher->add(new InteractingSphere2AABB);
boundingVolumeDispatcher->add(new InteractingBox2AABB);
Modified: trunk/extra/SimpleScene.hpp
===================================================================
--- trunk/extra/SimpleScene.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/extra/SimpleScene.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,6 +1,5 @@
#pragma once
#include<yade/core/FileGenerator.hpp>
-#include<yade/core/PhysicalAction.hpp>
#include<yade/extra/Shop.hpp>
Modified: trunk/extra/clump/Shop.cpp
===================================================================
--- trunk/extra/clump/Shop.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/extra/clump/Shop.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -18,7 +18,6 @@
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/pkg-common/InteractingBox.hpp>
#include<yade/pkg-common/InteractingSphere.hpp>
@@ -27,8 +26,6 @@
#include<yade/pkg-common/InteractingBox2AABB.hpp>
#include<yade/pkg-common/MetaInteractingGeometry.hpp>
#include<yade/pkg-common/MetaInteractingGeometry2AABB.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-#include<yade/pkg-common/Force.hpp>
#include<yade/pkg-common/NewtonsForceLaw.hpp>
#include<yade/pkg-common/NewtonsMomentumLaw.hpp>
#include<yade/pkg-common/LeapFrogPositionIntegrator.hpp>
@@ -38,8 +35,6 @@
#include<yade/pkg-dem/MacroMicroElasticRelationships.hpp>
#include<yade/pkg-dem/SimpleViscoelasticBodyParameters.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
/*class InteractingSphere2AABB;
class InteractingBox2AABB;
class MetaInteractingGeometry;
@@ -47,7 +42,6 @@
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/InteractionGeometryMetaEngine.hpp>
@@ -85,57 +79,30 @@
map<string,boost::any> Shop::defaults;
-int Shop::Bex::forceIdx=-1;
-int Shop::Bex::momentumIdx=-1;
+void Shop::Bex::initCache(){}
-void Shop::Bex::initCache(){
- if(Shop::Bex::forceIdx<0){
- Shop::Bex::forceIdx=shared_ptr<PhysicalAction>(new Force())->getClassIndex();
- Shop::Bex::momentumIdx=shared_ptr<PhysicalAction>(new Momentum())->getClassIndex();
- }
-}
-#ifdef BEX_CONTAINER
- const Vector3r& Shop::Bex::force(body_id_t id,MetaBody* rb){ rb->bex.sync(); return rb->bex.getForce(id);}
- const Vector3r& Shop::Bex::momentum(body_id_t id,MetaBody* rb){ rb->bex.sync(); return rb->bex.getTorque(id);}
-#else
- #define __BEX_ACCESS(retType,shopBexMember,bexClass,bexIdx,bexAttribute) retType& Shop::Bex::shopBexMember(body_id_t id,MetaBody* mb){ assert(bexIdx>=0); shared_ptr<PhysicalActionContainer> pac=(mb?mb:Omega::instance().getRootBody().get())->physicalActions; /*if((long)pac->size()<=id) throw invalid_argument("No " #shopBexMember " for #"+lexical_cast<string>(id)+" (max="+lexical_cast<string>(((long)pac->size()-1))+")");*/ return static_pointer_cast<bexClass>(pac->find(id,bexIdx))->bexAttribute; }
- __BEX_ACCESS(Vector3r,force,Force,forceIdx,force);
- __BEX_ACCESS(Vector3r,momentum,Momentum,momentumIdx,momentum);
- #undef __BEX_ACCESS
-#endif
+const Vector3r& Shop::Bex::force(body_id_t id,MetaBody* rb){ rb->bex.sync(); return rb->bex.getForce(id);}
+const Vector3r& Shop::Bex::momentum(body_id_t id,MetaBody* rb){ rb->bex.sync(); return rb->bex.getTorque(id);}
/* Apply force on contact point to 2 bodies; the force is oriented as it applies on the first body and is reversed on the second.
*
* Shop::Bex::initCache must have been called at some point. */
void Shop::applyForceAtContactPoint(const Vector3r& force, const Vector3r& contPt, body_id_t id1, const Vector3r& pos1, body_id_t id2, const Vector3r& pos2, MetaBody* rootBody){
-#ifdef BEX_CONTAINER
rootBody->bex.addForce(id1,force);
rootBody->bex.addForce(id2,-force);
rootBody->bex.addTorque(id1,(contPt-pos1).Cross(force));
rootBody->bex.addTorque(id2,-(contPt-pos2).Cross(force));
-#else
- Shop::Bex::force(id1,rootBody)+=force;
- Shop::Bex::force(id2,rootBody)-=force;
- Shop::Bex::momentum(id1,rootBody)+=(contPt-pos1).Cross(force);
- Shop::Bex::momentum(id2,rootBody)-=(contPt-pos2).Cross(force);
-#endif
}
Real Shop::unbalancedForce(bool useMaxForce, MetaBody* _rb){
MetaBody* rb=_rb ? _rb : Omega::instance().getRootBody().get();
- #ifdef BEX_CONTAINER
- rb->bex.sync();
- #endif
+ rb->bex.sync();
// get maximum force on a body and sum of all forces (for averaging)
Real sumF=0,maxF=0,currF;
FOREACH(const shared_ptr<Body>& b, *rb->bodies){
if(!b->isDynamic) continue;
- #ifdef BEX_CONTAINER
- currF=rb->bex.getForce(b->id).Length(); maxF=max(currF,maxF); sumF+=currF;
- #else
- currF=Shop::Bex::force(b->id,rb).Length(); maxF=max(currF,maxF); sumF+=currF;
- #endif
+ currF=rb->bex.getForce(b->id).Length(); maxF=max(currF,maxF); sumF+=currF;
}
Real meanF=sumF/rb->bodies->size();
// get max force on contacts
@@ -243,11 +210,6 @@
// initializers
rootBody->initializers.clear();
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
- rootBody->initializers.push_back(physicalActionInitializer);
-
shared_ptr<BoundingVolumeMetaEngine> boundingVolumeDispatcher = shared_ptr<BoundingVolumeMetaEngine>(new BoundingVolumeMetaEngine);
boundingVolumeDispatcher->add(new InteractingSphere2AABB);
boundingVolumeDispatcher->add(new InteractingBox2AABB);
Modified: trunk/extra/clump/Shop.hpp
===================================================================
--- trunk/extra/clump/Shop.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/extra/clump/Shop.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -86,15 +86,9 @@
*/
class Bex{
public:
- static int forceIdx,momentumIdx;
static void initCache();
- #ifdef BEX_CONTAINER
- static const Vector3r& force(body_id_t, MetaBody* mb=NULL);
- static const Vector3r& momentum(body_id_t, MetaBody* mb=NULL);
- #else
- static Vector3r& force(body_id_t, MetaBody* mb=NULL);
- static Vector3r& momentum(body_id_t, MetaBody* mb=NULL);
- #endif
+ static const Vector3r& force(body_id_t, MetaBody* mb=NULL);
+ static const Vector3r& momentum(body_id_t, MetaBody* mb=NULL);
};
//! Estimate timestep based on P-wave propagation speed
Modified: trunk/extra/spherical-dem-simulator/SphericalDEMSimulator.cpp
===================================================================
--- trunk/extra/spherical-dem-simulator/SphericalDEMSimulator.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/extra/spherical-dem-simulator/SphericalDEMSimulator.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -206,19 +206,10 @@
shared_ptr<PhysicalActionDamper> pade = dynamic_pointer_cast<PhysicalActionDamper>(e);
if (pade)
{
- #ifdef BEX_CONTAINER
shared_ptr<CundallNonViscousForceDamping> cnvfd = YADE_PTR_CAST<CundallNonViscousForceDamping>(pade->getExecutor("RigidBodyParameters"));
assert(cnvfd);
forceDamping=cnvfd->damping;
momentumDamping=forceDamping;
- #else
- shared_ptr<CundallNonViscousForceDamping> cnvfd = YADE_PTR_CAST<CundallNonViscousForceDamping>(pade->getExecutor("Force","RigidBodyParameters"));
- shared_ptr<CundallNonViscousMomentumDamping> cnvmd = YADE_PTR_CAST<CundallNonViscousMomentumDamping>(pade->getExecutor("Momentum","RigidBodyParameters"));
- assert(cnvfd);
- assert(cnvmd);
- forceDamping = cnvfd->damping;
- momentumDamping = cnvmd->damping;
- #endif
}
}
}
Modified: trunk/extra/tetra/Tetra.cpp
===================================================================
--- trunk/extra/tetra/Tetra.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/extra/tetra/Tetra.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -7,7 +7,6 @@
#include<yade/core/Interaction.hpp>
-#include<yade/core/PhysicalAction.hpp>
#include<yade/core/Omega.hpp>
#include<yade/core/MetaBody.hpp>
@@ -405,17 +404,10 @@
TRWM3VEC(F);
TRWM3VEC((physB->se3.position-contactGeom->contactPoint).Cross(F));
- #ifdef BEX_CONTAINER
- rootBody->bex.addForce (idA,-F);
- rootBody->bex.addForce (idB, F);
- rootBody->bex.addTorque(idA,-(physA->se3.position-contactGeom->contactPoint).Cross(F));
- rootBody->bex.addTorque(idB, (physA->se3.position-contactGeom->contactPoint).Cross(F));
- #else
- static_pointer_cast<Force>(rootBody->physicalActions->find(idA,actionForce->getClassIndex()))->force-=F;
- static_pointer_cast<Force>(rootBody->physicalActions->find(idB,actionForce->getClassIndex()))->force+=F;
- static_pointer_cast<Momentum>(rootBody->physicalActions->find(idA,actionMomentum->getClassIndex()))->momentum-=(physA->se3.position-contactGeom->contactPoint).Cross(F);
- static_pointer_cast<Momentum>(rootBody->physicalActions->find(idB,actionMomentum->getClassIndex()))->momentum+=(physB->se3.position-contactGeom->contactPoint).Cross(F);
- #endif
+ rootBody->bex.addForce (idA,-F);
+ rootBody->bex.addForce (idB, F);
+ rootBody->bex.addTorque(idA,-(physA->se3.position-contactGeom->contactPoint).Cross(F));
+ rootBody->bex.addTorque(idB, (physA->se3.position-contactGeom->contactPoint).Cross(F));
}
}
Modified: trunk/extra/tetra/Tetra.hpp
===================================================================
--- trunk/extra/tetra/Tetra.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/extra/tetra/Tetra.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -7,7 +7,6 @@
#include<yade/core/InteractingGeometry.hpp>
#include<yade/core/InteractionGeometry.hpp>
#include<yade/core/InteractionSolver.hpp>
-#include<yade/core/PhysicalAction.hpp>
#include<yade/pkg-common/Tetrahedron.hpp>
#include<yade/pkg-common/AABB.hpp>
@@ -16,9 +15,6 @@
#include<yade/pkg-common/GLDrawFunctors.hpp>
#include<yade/pkg-common/InteractionGeometryEngineUnit.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-
#include<Wm3Math.h>
#include<Wm3Vector3.h>
@@ -135,15 +131,8 @@
class TetraLaw: public InteractionSolver {
public:
- //! @fixme: those two are here only because this class needs to access
- /// the ID number of Force and Momentum. Those variables are actually not used to store a value of
- /// Force and Momentum, just to get ID, although normally they are
- /// used to store this value. I already have a better solution for that.
- shared_ptr<PhysicalAction> actionForce;
- shared_ptr<PhysicalAction> actionMomentum;
+ TetraLaw():InteractionSolver(){};
- TetraLaw():InteractionSolver(),actionForce(new Force),actionMomentum(new Momentum){};
-
int sdecGroupMask; // probably unused?!
void action(MetaBody*);
@@ -151,7 +140,6 @@
DECLARE_LOGGER;
protected:
void registerAttributes(){InteractionSolver::registerAttributes(); /* … */ }
- NEEDS_BEX("Force","Momentum");
REGISTER_CLASS_NAME(TetraLaw);
REGISTER_BASE_CLASS_NAME(InteractionSolver);
};
Modified: trunk/extra/usct/UniaxialStrainControlledTest.cpp
===================================================================
--- trunk/extra/usct/UniaxialStrainControlledTest.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/extra/usct/UniaxialStrainControlledTest.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,6 +1,5 @@
// 2008 © Václav Šmilauer <eudoxos@xxxxxxxx>
#include"UniaxialStrainControlledTest.hpp"
-#include<yade/pkg-common/Force.hpp>
#include<yade/pkg-common/InteractingSphere.hpp>
#include<yade/pkg-common/Box.hpp>
#include<yade/pkg-common/InteractingBox.hpp>
@@ -128,14 +127,9 @@
void UniaxialStrainer::computeAxialForce(MetaBody* rootBody){
sumPosForces=sumNegForces=0;
- #ifdef BEX_CONTAINER
- rootBody->bex.sync();
- FOREACH(body_id_t id, negIds) sumNegForces+=rootBody->bex.getForce(id)[axis];
- FOREACH(body_id_t id, posIds) sumNegForces-=rootBody->bex.getForce(id)[axis];
- #else
- FOREACH(body_id_t id, negIds) sumNegForces+=Shop::Bex::force(id)[axis];
- FOREACH(body_id_t id, posIds) sumPosForces-=Shop::Bex::force(id)[axis];
- #endif
+ rootBody->bex.sync();
+ FOREACH(body_id_t id, negIds) sumNegForces+=rootBody->bex.getForce(id)[axis];
+ FOREACH(body_id_t id, posIds) sumPosForces-=rootBody->bex.getForce(id)[axis];
}
/***************************************** USCTGen **************************/
@@ -201,14 +195,11 @@
#include<yade/extra/Brefcom.hpp>
#include<yade/pkg-common/RigidBodyParameters.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
#include<yade/pkg-common/InteractionPhysicsEngineUnit.hpp>
#include<yade/pkg-dem/SpheresContactGeometry.hpp>
#include<yade/core/MetaBody.hpp>
#include<yade/pkg-dem/BodyMacroParameters.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/InteractingSphere.hpp>
#include<yade/pkg-common/BoundingVolumeMetaEngine.hpp>
#include<yade/pkg-common/AABB.hpp>
@@ -225,7 +216,6 @@
#include<yade/pkg-common/LeapFrogPositionIntegrator.hpp>
#include<yade/pkg-common/LeapFrogOrientationIntegrator.hpp>
#include<yade/pkg-common/PersistentSAPCollider.hpp>
-#include<yade/pkg-dem/GlobalStiffnessCounter.hpp>
#include<yade/pkg-dem/PositionOrientationRecorder.hpp>
#include<yade/pkg-dem/GlobalStiffnessTimeStepper.hpp>
#include<yade/pkg-common/PhysicalActionDamper.hpp>
@@ -237,12 +227,6 @@
void USCTGen::createEngines(){
rootBody->initializers.clear();
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
- physicalActionInitializer->physicalActionNames.push_back("GlobalStiffness");
- rootBody->initializers.push_back(physicalActionInitializer);
-
shared_ptr<BoundingVolumeMetaEngine> boundingVolumeDispatcher = shared_ptr<BoundingVolumeMetaEngine>(new BoundingVolumeMetaEngine);
boundingVolumeDispatcher->add(new InteractingSphere2AABB);
boundingVolumeDispatcher->add(new MetaInteractingGeometry2AABB);
@@ -294,21 +278,7 @@
shared_ptr<PhysicalParametersMetaEngine> orientationIntegrator(new PhysicalParametersMetaEngine);
orientationIntegrator->add(new LeapFrogOrientationIntegrator);
rootBody->engines.push_back(orientationIntegrator);
-#if 0
- shared_ptr<GlobalStiffnessCounter> globalStiffnessCounter(new GlobalStiffnessCounter);
- globalStiffnessCounter->sdecGroupMask=1023;
- globalStiffnessCounter->interval=100;
- globalStiffnessCounter->assumeElasticSpheres=false;
- shared_ptr<GlobalStiffnessTimeStepper> globalStiffnessTimeStepper(new GlobalStiffnessTimeStepper);
- globalStiffnessTimeStepper->sdecGroupMask=1023; // BIN 111111111, should always match
- globalStiffnessTimeStepper->timeStepUpdateInterval=100;
- globalStiffnessTimeStepper->defaultDt=1e-6;
- rootBody->engines.push_back(globalStiffnessTimeStepper);
-
- rootBody->engines.push_back(globalStiffnessCounter);
-#endif
-
rootBody->engines.push_back(shared_ptr<BrefcomDamageColorizer>(new BrefcomDamageColorizer));
}
Modified: trunk/extra/usct/UniaxialStrainControlledTest.hpp
===================================================================
--- trunk/extra/usct/UniaxialStrainControlledTest.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/extra/usct/UniaxialStrainControlledTest.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -5,7 +5,6 @@
#include<yade/extra/Shop.hpp>
#include<yade/core/FileGenerator.hpp>
#include<yade/core/DeusExMachina.hpp>
-#include<yade/core/PhysicalAction.hpp>
#ifndef FOREACH
#define FOREACH BOOST_FOREACH
@@ -54,7 +53,6 @@
DeusExMachina::registerAttributes();
REGISTER_ATTRIBUTE(forces);
}
- NEEDS_BEX("Force");
REGISTER_CLASS_NAME(UniaxialStrainSensorPusher);
REGISTER_BASE_CLASS_NAME(DeusExMachina);
//DECLARE_LOGGER;
@@ -156,7 +154,6 @@
);
void prepareRecStream(void){ if(!recordFile.empty()) recStream.open(recordFile.c_str()); }
void postProcessAttributes(bool deserializing){ if(deserializing) prepareRecStream(); }
- NEEDS_BEX("Force","Momentum","GlobalStiffness");
REGISTER_CLASS_AND_BASE(UniaxialStrainer,DeusExMachina);
DECLARE_LOGGER;
};
Modified: trunk/gui/py/_utils.cpp
===================================================================
--- trunk/gui/py/_utils.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/gui/py/_utils.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -194,13 +194,8 @@
Vector3r axis=tuple2vec(_axis), axisPt=tuple2vec(_axisPt);
FOREACH(const shared_ptr<Body> b, *rb->bodies){
if(!b->maskOk(mask)) continue;
- #ifdef BEX_CONTAINER
- const Vector3r& m=rb->bex.getTorque(b->getId());
- const Vector3r& f=rb->bex.getForce(b->getId());
- #else
- const Vector3r& m=Shop::Bex::momentum(b->getId(),rb.get());
- const Vector3r& f=Shop::Bex::force(b->getId(),rb.get());
- #endif
+ const Vector3r& m=rb->bex.getTorque(b->getId());
+ const Vector3r& f=rb->bex.getForce(b->getId());
Vector3r r=b->physicalParameters->se3.position-axisPt;
ret+=axis.Dot(m+r.Cross(f));
}
@@ -219,11 +214,7 @@
Vector3r direction=tuple2vec(_direction);
FOREACH(const shared_ptr<Body> b, *rb->bodies){
if(!b->maskOk(mask)) continue;
- #ifdef BEX_CONTAINER
- const Vector3r& f=rb->bex.getForce(b->getId());
- #else
- const Vector3r& f=Shop::Bex::force(b->getId(),rb.get());
- #endif
+ const Vector3r& f=rb->bex.getForce(b->getId());
ret+=direction.Dot(f);
}
return ret;
Modified: trunk/gui/py/utils.py
===================================================================
--- trunk/gui/py/utils.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/gui/py/utils.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -378,7 +378,6 @@
engines, however. By default, no gravity is applied.
"""
O.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingBox2AABB'),EngineUnit('InteractingFacet2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
O.engines=[
Modified: trunk/gui/py/yadeControl.cpp
===================================================================
--- trunk/gui/py/yadeControl.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/gui/py/yadeControl.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -405,37 +405,6 @@
Vector3r tuple2vec(const python::tuple& t){return Vector3r(python::extract<double>(t[0])(),python::extract<double>(t[1])(),python::extract<double>(t[2])());}
-BASIC_PY_PROXY(pyPhysicalAction,PhysicalAction);
-
-class pyPhysicalActionContainer{
- public:
- const shared_ptr<PhysicalActionContainer> proxee;
- pyPhysicalActionContainer(const shared_ptr<PhysicalActionContainer>& _proxee): proxee(_proxee){}
- pyPhysicalAction pyGetitem(python::object action_and_id){
- if(!PySequence_Check(action_and_id.ptr())) throw invalid_argument("Key must be a tuple");
- if(python::len(action_and_id)!=2) throw invalid_argument("Key must be a 2-tuple: [action-name , body id].");
- python::extract<string> actionName_(PySequence_GetItem(action_and_id.ptr(),0));
- python::extract<body_id_t> id_(PySequence_GetItem(action_and_id.ptr(),1));
- if(!actionName_.check()) throw invalid_argument("Could not extract action-name.");
- if(!id_.check()) throw invalid_argument("Could not extract body id.");
- // FIXME: this may be rather slow (at every lookup!)
- int actionClassIndex=dynamic_pointer_cast<Indexable>(ClassFactory::instance().createShared(actionName_()))->getClassIndex();
- LOG_DEBUG("Got class index "<<actionClassIndex<<" for "<<actionName_());
- return pyPhysicalAction(proxee->find(id_(),actionClassIndex));
- }
- python::tuple force_get(long id){ Shop::Bex::initCache(); Vector3r f=Shop::Bex::force(id); return python::make_tuple(f[0],f[1],f[2]);}
- python::tuple momentum_get(long id){ Shop::Bex::initCache(); Vector3r m=Shop::Bex::momentum(id); return python::make_tuple(m[0],m[1],m[2]);}
- #ifndef BEX_CONTAINER
- void force_add(long id, python::tuple f){ Shop::Bex::initCache(); Shop::Bex::force(id)+=tuple2vec(f);}
- void torque_add(long id, python::tuple m){ Shop::Bex::initCache(); Shop::Bex::momentum(id)+=tuple2vec(m);}
- #else
- void force_add(long id, python::tuple f){ throw runtime_error("ActionContainer not supported with BexContainer");}
- void torque_add(long id, python::tuple m){ throw runtime_error("ActionContainer not supported with BexContainer");}
- #endif
-};
-
-
-#ifdef BEX_CONTAINER
class pyBexContainer{
public:
pyBexContainer(){}
@@ -444,9 +413,7 @@
void force_add(long id, python::tuple f){ MetaBody* rb=Omega::instance().getRootBody().get(); rb->bex.addForce (id,tuple2vec(f)); }
void torque_add(long id, python::tuple t){ MetaBody* rb=Omega::instance().getRootBody().get(); rb->bex.addTorque(id,tuple2vec(t));}
};
-#endif
-
class pyOmega{
private:
// can be safely removed now, since pyOmega makes an empty rootBody in the constructor, if there is none
@@ -502,10 +469,8 @@
bool timingEnabled_get(){return TimingInfo::enabled;}
void timingEnabled_set(bool enabled){TimingInfo::enabled=enabled;}
- #ifdef BEX_CONTAINER
- unsigned long bexSyncCount_get(){ return OMEGA.getRootBody()->bex.syncCount;}
- void bexSyncCount_set(unsigned long count){ OMEGA.getRootBody()->bex.syncCount=count;}
- #endif
+ unsigned long bexSyncCount_get(){ return OMEGA.getRootBody()->bex.syncCount;}
+ void bexSyncCount_set(unsigned long count){ OMEGA.getRootBody()->bex.syncCount=count;}
void run(long int numIter=-1,bool doWait=false){
if(numIter>0) OMEGA.getRootBody()->stopAtIteration=OMEGA.getCurrentIteration()+numIter;
@@ -599,11 +564,7 @@
pyBodyContainer bodies_get(void){assertRootBody(); return pyBodyContainer(OMEGA.getRootBody()->bodies); }
pyInteractionContainer interactions_get(void){assertRootBody(); return pyInteractionContainer(OMEGA.getRootBody()->interactions); }
- #ifdef BEX_CONTAINER
- pyBexContainer actions_get(void){return pyBexContainer();}
- #else
- pyPhysicalActionContainer actions_get(void){return pyPhysicalActionContainer(OMEGA.getRootBody()->physicalActions); }
- #endif
+ pyBexContainer actions_get(void){return pyBexContainer();}
boost::python::list listChildClasses(const string& base){
@@ -633,14 +594,6 @@
rb->bodies=bc;
}
string bodyContainer_get(string clss){ return OMEGA.getRootBody()->bodies->getClassName(); }
- #ifndef BEX_CONTAINER
- void physicalActionContainer_set(string clss){
- MetaBody* rb=OMEGA.getRootBody().get();
- shared_ptr<PhysicalActionContainer> pac=dynamic_pointer_cast<PhysicalActionContainer>(ClassFactory::instance().createShared(clss));
- rb->physicalActions=pac;
- }
- string physicalActionContainer_get(string clss){ return OMEGA.getRootBody()->physicalActions->getClassName(); }
- #endif
};
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(omega_run_overloads,run,0,2);
@@ -700,9 +653,7 @@
.add_property("bodyContainer",&pyOmega::bodyContainer_get,&pyOmega::bodyContainer_set)
.add_property("interactionContainer",&pyOmega::interactionContainer_get,&pyOmega::interactionContainer_set)
.add_property("timingEnabled",&pyOmega::timingEnabled_get,&pyOmega::timingEnabled_set)
- #ifdef BEX_CONTAINER
- .add_property("bexSyncCount",&pyOmega::bexSyncCount_get,&pyOmega::bexSyncCount_set)
- #endif
+ .add_property("bexSyncCount",&pyOmega::bexSyncCount_get,&pyOmega::bexSyncCount_set)
;
boost::python::class_<pyTags>("TagsWrapper",python::init<pyTags&>())
.def("__getitem__",&pyTags::getItem)
@@ -725,21 +676,12 @@
.def("__iter__",&pyInteractionIterator::pyIter)
.def("next",&pyInteractionIterator::pyNext);
- boost::python::class_<pyPhysicalActionContainer>("ActionContainer",python::init<pyPhysicalActionContainer&>())
- .def("__getitem__",&pyPhysicalActionContainer::pyGetitem)
- .def("f",&pyPhysicalActionContainer::force_get)
- .def("m",&pyPhysicalActionContainer::momentum_get)
- .def("addF",&pyPhysicalActionContainer::force_add)
- .def("addT",&pyPhysicalActionContainer::torque_add);
-
- #ifdef BEX_CONTAINER
boost::python::class_<pyBexContainer>("BexContainer",python::init<pyBexContainer&>())
.def("f",&pyBexContainer::force_get)
.def("t",&pyBexContainer::torque_get)
.def("m",&pyBexContainer::torque_get) // for compatibility with ActionContainer
.def("addF",&pyBexContainer::force_add)
.def("addT",&pyBexContainer::torque_add);
- #endif
boost::python::class_<pyTimingDeltas>("TimingDeltas",python::init<pyTimingDeltas&>())
.def("reset",&pyTimingDeltas::reset)
@@ -803,8 +745,6 @@
.add_property("id1",&pyInteraction::id1_get)
.add_property("id2",&pyInteraction::id2_get);
- BASIC_PY_PROXY_WRAPPER(pyPhysicalAction,"Action");
-
BASIC_PY_PROXY_WRAPPER(pyFileGenerator,"Preprocessor")
.def("generate",&pyFileGenerator::generate)
.def("load",&pyFileGenerator::load);
Deleted: trunk/pkg/common/Container/PhysicalActionVectorVector.hpp
===================================================================
--- trunk/pkg/common/Container/PhysicalActionVectorVector.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Container/PhysicalActionVectorVector.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1 +0,0 @@
-#include<yade/core/PhysicalActionVectorVector.hpp>
Modified: trunk/pkg/common/Engine/DeusExMachina/CinemCNCEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/CinemCNCEngine.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/DeusExMachina/CinemCNCEngine.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,14 +10,13 @@
#include "CinemCNCEngine.hpp"
#include<yade/pkg-common/RigidBodyParameters.hpp>
#include<yade/pkg-common/InteractingBox.hpp>
-#include<yade/pkg-common/Force.hpp>
#include<yade/pkg-dem/ElasticContactInteraction.hpp>
#include<yade/core/MetaBody.hpp>
#include<yade/lib-base/yadeWm3Extra.hpp>
#include <yade/lib-miniWm3/Wm3Math.h>
-CinemCNCEngine::CinemCNCEngine() : actionForce(new Force), leftbox(new Body), rightbox(new Body), frontbox(new Body), backbox(new Body), topbox(new Body), boxbas(new Body)
+CinemCNCEngine::CinemCNCEngine() : leftbox(new Body), rightbox(new Body), frontbox(new Body), backbox(new Body), topbox(new Body), boxbas(new Body)
{
prevF_sup=Vector3r(0,0,0);
firstRun=true;
@@ -187,11 +186,7 @@
void CinemCNCEngine::computeDu(MetaBody* ncb)
{
- #ifdef BEX_CONTAINER
- ncb->bex.sync(); Vector3r F_sup=ncb->bex.getForce(id_boxhaut);
- #else
- Vector3r& F_sup = dynamic_cast<Force*>(ncb->physicalActions->find(id_boxhaut,actionForce->getClassIndex()) . get() )->force;
- #endif
+ ncb->bex.sync(); Vector3r F_sup=ncb->bex.getForce(id_boxhaut);
if(firstRun)
{
Modified: trunk/pkg/common/Engine/DeusExMachina/CinemCNCEngine.hpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/CinemCNCEngine.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/DeusExMachina/CinemCNCEngine.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -33,7 +33,6 @@
class CinemCNCEngine : public DeusExMachina
{
private :
- shared_ptr<PhysicalAction> actionForce;
shared_ptr<ContactLaw1> myLdc;
Real coeff_dech; // in the case of the use of "ContactLaw1" for ex where kn(unload)#kn(load). The engine cares to find the value at the first run
Real alpha // angle from the lower plate to the left box (trigo wise), the Engine finds itself its value
Modified: trunk/pkg/common/Engine/DeusExMachina/CinemKNCEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/CinemKNCEngine.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/DeusExMachina/CinemKNCEngine.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,14 +10,13 @@
#include "CinemKNCEngine.hpp"
#include<yade/pkg-common/RigidBodyParameters.hpp>
#include<yade/pkg-common/InteractingBox.hpp>
-#include<yade/pkg-common/Force.hpp>
#include<yade/pkg-dem/ElasticContactInteraction.hpp>
#include<yade/core/MetaBody.hpp>
#include<yade/lib-base/yadeWm3Extra.hpp>
#include <yade/lib-miniWm3/Wm3Math.h>
-CinemKNCEngine::CinemKNCEngine() : actionForce(new Force), leftbox(new Body), rightbox(new Body), frontbox(new Body), backbox(new Body), topbox(new Body), boxbas(new Body)
+CinemKNCEngine::CinemKNCEngine() : leftbox(new Body), rightbox(new Body), frontbox(new Body), backbox(new Body), topbox(new Body), boxbas(new Body)
{
prevF_sup=Vector3r(0,0,0);
firstRun=true;
@@ -180,11 +179,7 @@
void CinemKNCEngine::computeDu(MetaBody* ncb)
{
- #ifdef BEX_CONTAINER
- ncb->bex.sync(); Vector3r F_sup=ncb->bex.getForce(id_boxhaut);
- #else
- Vector3r& F_sup = dynamic_cast<Force*>(ncb->physicalActions->find(id_boxhaut,actionForce->getClassIndex()) . get() )->force;
- #endif
+ ncb->bex.sync(); Vector3r F_sup=ncb->bex.getForce(id_boxhaut);
if(firstRun)
{
Modified: trunk/pkg/common/Engine/DeusExMachina/CinemKNCEngine.hpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/CinemKNCEngine.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/DeusExMachina/CinemKNCEngine.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -31,7 +31,6 @@
class CinemKNCEngine : public DeusExMachina
{
private :
- shared_ptr<PhysicalAction> actionForce;
shared_ptr<ContactLaw1> myLdc;
Real coeff_dech; // the engine cares about it
Real alpha // angle from the lower plate to the left box (trigo wise), the Engine finds itself its value
Modified: trunk/pkg/common/Engine/DeusExMachina/DisplacementToForceEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/DisplacementToForceEngine.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/DeusExMachina/DisplacementToForceEngine.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -9,9 +9,8 @@
#include"DisplacementToForceEngine.hpp"
#include<yade/core/MetaBody.hpp>
#include<yade/pkg-common/ParticleParameters.hpp>
-#include<yade/pkg-common/Force.hpp>
-DisplacementToForceEngine::DisplacementToForceEngine() : actionParameterForce(new Force), targetForce(Vector3r::ZERO), targetForceMask(Vector3r::ZERO)
+DisplacementToForceEngine::DisplacementToForceEngine() : targetForce(Vector3r::ZERO), targetForceMask(Vector3r::ZERO)
{
direction=1.0;
old_direction=1.0;
@@ -56,18 +55,12 @@
std::vector<int>::const_iterator ii = subscribedBodies.begin();
std::vector<int>::const_iterator iiEnd = subscribedBodies.end();
- #ifdef BEX_CONTAINER
- ncb->bex.sync();
- #endif
+ ncb->bex.sync();
for(;ii!=iiEnd;++ii)
if( bodies->exists(*ii) )
{
- #ifdef BEX_CONTAINER
- Vector3r current_force=ncb->bex.getForce(*ii);
- #else
- Vector3r current_force=static_cast<Force*>( ncb->physicalActions->find(*ii,actionParameterForce->getClassIndex() ).get() )->force;
- #endif
+ Vector3r current_force=ncb->bex.getForce(*ii);
Real current_length_sq =
(targetForceMask[0] != 0) ? current_force[0]*current_force[0]:0.0
Modified: trunk/pkg/common/Engine/DeusExMachina/DisplacementToForceEngine.hpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/DisplacementToForceEngine.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/DeusExMachina/DisplacementToForceEngine.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -12,12 +12,9 @@
#include<Wm3Vector3.h>
#include<yade/lib-base/yadeWm3.hpp>
-class Force;
-
class DisplacementToForceEngine : public DeusExMachina
{
private :
- shared_ptr<Force> actionParameterForce;
Real target_length_sq,direction,old_direction,oscillations;
public :
Vector3r targetForce,targetForceMask;
Modified: trunk/pkg/common/Engine/DeusExMachina/ForceEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/ForceEngine.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/DeusExMachina/ForceEngine.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -8,13 +8,12 @@
#include"ForceEngine.hpp"
#include<yade/pkg-common/ParticleParameters.hpp>
-#include<yade/pkg-common/Force.hpp>
#include<yade/core/MetaBody.hpp>
#include<boost/foreach.hpp>
-ForceEngine::ForceEngine() : actionParameterForce(new Force), force(Vector3r::ZERO)
+ForceEngine::ForceEngine() : force(Vector3r::ZERO)
{
}
@@ -33,11 +32,7 @@
void ForceEngine::applyCondition(MetaBody* ncb){
FOREACH(body_id_t id, subscribedBodies){
assert(ncb->bodies->exists(id));
- #ifdef BEX_CONTAINER
- ncb->bex.addForce(id,force);
- #else
- static_pointer_cast<Force>(ncb->physicalActions->find(id,actionParameterForce->getClassIndex()))->force+=force;
- #endif
+ ncb->bex.addForce(id,force);
}
}
Modified: trunk/pkg/common/Engine/DeusExMachina/ForceEngine.hpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/ForceEngine.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/DeusExMachina/ForceEngine.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,12 +10,8 @@
#include<yade/core/DeusExMachina.hpp>
-class Force;
-
class ForceEngine : public DeusExMachina
{
- private :
- shared_ptr<Force> actionParameterForce;
public :
Vector3r force;
@@ -26,7 +22,6 @@
protected :
virtual void registerAttributes();
- NEEDS_BEX("Force");
REGISTER_CLASS_NAME(ForceEngine);
REGISTER_BASE_CLASS_NAME(DeusExMachina);
};
Modified: trunk/pkg/common/Engine/DeusExMachina/GravityEngines.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/GravityEngines.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/DeusExMachina/GravityEngines.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -24,11 +24,7 @@
if(b->isClumpMember()) continue;
shared_ptr<ParticleParameters> p=YADE_PTR_CAST<ParticleParameters>(b->physicalParameters);
if(p!=0) //not everything derives from ParticleParameters; this line was assert(p); - Janek
- #ifdef BEX_CONTAINER
- ncb->bex.addForce(b->getId(),gravity*p->mass);
- #else
- static_cast<Force*>(ncb->physicalActions->find(b->getId(),cachedForceClassIndex).get())->force+=gravity*p->mass;
- #endif
+ ncb->bex.addForce(b->getId(),gravity*p->mass);
}
}
@@ -38,13 +34,8 @@
if(b->isClumpMember() || b->getId()==centralBody) continue; // skip clump members and central body
Real F=accel*YADE_PTR_CAST<ParticleParameters>(b->physicalParameters)->mass;
Vector3r toCenter=centralPos-b->physicalParameters->se3.position; toCenter.Normalize();
- #ifdef BEX_CONTAINER
- rootBody->bex.addForce(b->getId(),F*toCenter);
- if(reciprocal) rootBody->bex.addForce(centralBody,-F*toCenter);
- #else
- static_cast<Force*>(rootBody->physicalActions->find(b->getId(),cachedForceClassIndex).get())->force+=F*toCenter;
- if(reciprocal) static_cast<Force*>(rootBody->physicalActions->find(centralBody,cachedForceClassIndex).get())->force-=F*toCenter;
- #endif
+ rootBody->bex.addForce(b->getId(),F*toCenter);
+ if(reciprocal) rootBody->bex.addForce(centralBody,-F*toCenter);
}
}
@@ -58,11 +49,6 @@
const Vector3r x2=axisPoint+axisDirection;
Vector3r closestAxisPoint=(x2-x1) * /* t */ (-(x1-x0).Dot(x2-x1))/((x2-x1).SquaredLength());
Vector3r toAxis=closestAxisPoint-x0; toAxis.Normalize();
- #ifdef BEX_CONTAINER
- rootBody->bex.addForce(b->getId(),acceleration*myMass*toAxis);
- #else
- static_pointer_cast<Force>(rootBody->physicalActions->find(b->getId(),cachedForceClassIndex))->force+=acceleration*myMass*toAxis;
- //if(b->getId()==20){ TRVAR3(toAxis,acceleration*myMass*toAxis,static_pointer_cast<Force>(rootBody->physicalActions->find(b->getId(),cachedForceClassIndex))->force); }
- #endif
+ rootBody->bex.addForce(b->getId(),acceleration*myMass*toAxis);
}
}
Modified: trunk/pkg/common/Engine/DeusExMachina/GravityEngines.hpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/GravityEngines.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/DeusExMachina/GravityEngines.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -2,21 +2,18 @@
// 2007,2008 © Václav Šmilauer <eudoxos@xxxxxxxx>
#pragma once
#include<yade/core/DeusExMachina.hpp>
-#include<yade/pkg-common/Force.hpp>
/* Homogeneous gravity field; applies gravity*mass force on all bodies.
*
* @bug is a DeusExMachina, but doesn't care about subscribedBodies.
*/
class GravityEngine : public DeusExMachina{
- int cachedForceClassIndex;
public :
Vector3r gravity;
- GravityEngine(): gravity(Vector3r::ZERO){shared_ptr<Force> f(new Force); cachedForceClassIndex=f->getClassIndex();};
+ GravityEngine(): gravity(Vector3r::ZERO){};
virtual ~GravityEngine(){};
virtual void applyCondition(MetaBody*);
protected :
- NEEDS_BEX("Force");
REGISTER_ATTRIBUTES(DeusExMachina,(gravity));
REGISTER_CLASS_AND_BASE(GravityEngine,DeusExMachina);
};
@@ -29,8 +26,6 @@
* @bug is a DeusExMachina, but doesn't care about subscribedBodies.
*/
class CentralGravityEngine: public DeusExMachina {
- private:
- int cachedForceClassIndex;
public:
//! The body towards which all other bodies are attracted.
body_id_t centralBody;
@@ -38,12 +33,11 @@
Real accel;
//! Whether to apply reciprocal force to the central body as well
bool reciprocal;
- CentralGravityEngine(){ shared_ptr<Force> f(new Force); cachedForceClassIndex=f->getClassIndex(); reciprocal=false; }
+ CentralGravityEngine(){ reciprocal=false; }
virtual ~CentralGravityEngine(){};
virtual void applyCondition(MetaBody*);
protected:
virtual void registerAttributes(){DeusExMachina::registerAttributes(); REGISTER_ATTRIBUTE(centralBody); REGISTER_ATTRIBUTE(accel); REGISTER_ATTRIBUTE(reciprocal); }
- NEEDS_BEX("Force");
REGISTER_CLASS_NAME(CentralGravityEngine);
REGISTER_BASE_CLASS_NAME(DeusExMachina);
};
@@ -54,8 +48,6 @@
* @bug is a DeusExMachina, but doesn't care about subscribedBodies.
*/
class AxialGravityEngine: public DeusExMachina {
- private:
- int cachedForceClassIndex;
public:
//! point through which the axis is passing
Vector3r axisPoint;
@@ -63,12 +55,11 @@
Vector3r axisDirection;
//! magnitude of acceleration that will be applied
Real acceleration;
- AxialGravityEngine(){ shared_ptr<Force> f(new Force); cachedForceClassIndex=f->getClassIndex(); }
+ AxialGravityEngine(){ }
virtual ~AxialGravityEngine(){};
virtual void applyCondition(MetaBody*);
protected:
virtual void registerAttributes(){DeusExMachina::registerAttributes(); REGISTER_ATTRIBUTE(axisPoint); REGISTER_ATTRIBUTE(axisDirection); REGISTER_ATTRIBUTE(acceleration); }
- NEEDS_BEX("Force");
REGISTER_CLASS_NAME(AxialGravityEngine);
REGISTER_BASE_CLASS_NAME(DeusExMachina);
};
Modified: trunk/pkg/common/Engine/DeusExMachina/MomentEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/MomentEngine.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/DeusExMachina/MomentEngine.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -8,13 +8,12 @@
#include"MomentEngine.hpp"
#include<yade/pkg-common/ParticleParameters.hpp>
-#include<yade/pkg-common/Momentum.hpp>
#include<yade/core/MetaBody.hpp>
-MomentEngine::MomentEngine() : actionParameterMoment(new Momentum), moment(Vector3r::ZERO)
+MomentEngine::MomentEngine() : moment(Vector3r::ZERO)
{
}
@@ -40,11 +39,7 @@
{
if(ncb->bodies->exists( *ii ))
{
- #ifdef BEX_CONTAINER
- ncb->bex.addTorque(*ii,moment);
- #else
- static_cast<Momentum*>( ncb->physicalActions->find( *ii , actionParameterMoment->getClassIndex() ).get() )->momentum += moment;
- #endif
+ ncb->bex.addTorque(*ii,moment);
} else {
std::cerr << "MomentEngine: body " << *ii << "doesn't exist, cannot apply moment.";
}
Modified: trunk/pkg/common/Engine/DeusExMachina/MomentEngine.hpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/MomentEngine.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/DeusExMachina/MomentEngine.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,12 +10,9 @@
#include<yade/core/DeusExMachina.hpp>
-class Momentum;
class MomentEngine : public DeusExMachina
{
- private :
- shared_ptr<Momentum> actionParameterMoment;
public :
Vector3r moment;
@@ -26,7 +23,6 @@
protected :
virtual void registerAttributes();
- NEEDS_BEX("Momentum");
REGISTER_CLASS_NAME(MomentEngine);
REGISTER_BASE_CLASS_NAME(DeusExMachina);
};
Modified: trunk/pkg/common/Engine/EngineUnit/CundallNonViscousDamping.cpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/CundallNonViscousDamping.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/EngineUnit/CundallNonViscousDamping.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -2,13 +2,10 @@
#include<yade/pkg-common/ParticleParameters.hpp>
#include<yade/pkg-common/RigidBodyParameters.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
#include"CundallNonViscousDamping.hpp"
YADE_PLUGIN("CundallNonViscousForceDamping","CundallNonViscousMomentumDamping");
-#ifdef BEX_CONTAINER
//! damping of force, for bodies that have only ParticleParameters
void CundallNonViscousForceDamping::go(const shared_ptr<PhysicalParameters>& pp, const Body* body, MetaBody* rb){
if(body->isClump()) return;
@@ -31,39 +28,3 @@
}
rb->bex.addForce(id,df); rb->bex.addTorque(id,dt);
}
-#else
-// this is Cundall non-viscous local damping, applied to force (Force)
-void CundallNonViscousForceDamping::go( const shared_ptr<PhysicalAction>& a
- , const shared_ptr<PhysicalParameters>& b
- , const Body* body)
-{
- if(body->isClump()) return;
- Force * af = static_cast<Force*>(a.get());
- ParticleParameters * p = static_cast<ParticleParameters*>(b.get());
-
- for (int i=0; i<3; ++i)
- {
- af->force[i] *= 1 - damping*Mathr::Sign(af->force[i]*p->velocity[i]);
- }
-}
-
-// this is Cundall non-viscous local damping, applied to momentum (Momentum)
-void CundallNonViscousMomentumDamping::go( const shared_ptr<PhysicalAction>& a
- , const shared_ptr<PhysicalParameters>& b
- , const Body* body)
-{
- if(body->isClump()) return;
- Momentum * am = static_cast<Momentum*>(a.get());
- RigidBodyParameters * rb = static_cast<RigidBodyParameters*>(b.get());
-
- Vector3r& m = am->momentum;
-
- for (int i=0; i<3; ++i){
- m[i] *= 1 - damping*Mathr::Sign(m[i]*rb->angularVelocity[i]);
- }
-}
-#endif
-
-
-
-
Modified: trunk/pkg/common/Engine/EngineUnit/CundallNonViscousDamping.hpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/CundallNonViscousDamping.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/EngineUnit/CundallNonViscousDamping.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -7,14 +7,8 @@
Real damping;
CundallNonViscousForceDamping(): damping(0){};
virtual void registerAttributes(){PhysicalActionDamperUnit::registerAttributes();REGISTER_ATTRIBUTE(damping);}
- #ifdef BEX_CONTAINER
- virtual void go(const shared_ptr<PhysicalParameters>&, const Body*, MetaBody*);
- FUNCTOR1D(ParticleParameters);
- #else
- virtual void go(const shared_ptr<PhysicalAction>&, const shared_ptr<PhysicalParameters>& , const Body*);
- NEEDS_BEX("Force");
- FUNCTOR2D(Force,ParticleParameters);
- #endif
+ virtual void go(const shared_ptr<PhysicalParameters>&, const Body*, MetaBody*);
+ FUNCTOR1D(ParticleParameters);
REGISTER_CLASS_AND_BASE(CundallNonViscousForceDamping,PhysicalActionDamperUnit);
};
REGISTER_SERIALIZABLE(CundallNonViscousForceDamping);
@@ -24,14 +18,8 @@
Real damping;
CundallNonViscousMomentumDamping(): damping(0){};
virtual void registerAttributes(){PhysicalActionDamperUnit::registerAttributes();REGISTER_ATTRIBUTE(damping); }
- #ifdef BEX_CONTAINER
virtual void go(const shared_ptr<PhysicalParameters>&, const Body*, MetaBody*);
- FUNCTOR1D(RigidBodyParameters);
- #else
- virtual void go(const shared_ptr<PhysicalAction>&, const shared_ptr<PhysicalParameters>&, const Body*);
- NEEDS_BEX("Momentum");
- FUNCTOR2D(Momentum,RigidBodyParameters);
- #endif
+ FUNCTOR1D(RigidBodyParameters);
REGISTER_CLASS_AND_BASE(CundallNonViscousMomentumDamping,PhysicalActionDamperUnit);
};
REGISTER_SERIALIZABLE(CundallNonViscousMomentumDamping);
Modified: trunk/pkg/common/Engine/EngineUnit/NewtonsForceLaw.cpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/NewtonsForceLaw.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/EngineUnit/NewtonsForceLaw.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -11,19 +11,10 @@
#include"NewtonsForceLaw.hpp"
#include<yade/pkg-common/ParticleParameters.hpp>
#include<yade/pkg-common/RigidBodyParameters.hpp>
-#include<yade/pkg-common/Force.hpp>
#include<yade/core/MetaBody.hpp>
-#ifdef BEX_CONTAINER
void NewtonsForceLaw::go(const shared_ptr<PhysicalParameters>& b, const Body* bb, MetaBody* rb){
Vector3r f=rb->bex.getForce(bb->getId());
-#else
-void NewtonsForceLaw::go( const shared_ptr<PhysicalAction>& a
- , const shared_ptr<PhysicalParameters>& b
- , const Body* bb)
-{
- const Vector3r& f = YADE_CAST<Force*>(a.get())->force;
-#endif
ParticleParameters * p = YADE_CAST<ParticleParameters*>(b.get());
// normal behavior of a standalone particle or a clump itself
Modified: trunk/pkg/common/Engine/EngineUnit/NewtonsForceLaw.hpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/NewtonsForceLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/EngineUnit/NewtonsForceLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,28 +10,12 @@
#include<yade/pkg-common/PhysicalActionApplierUnit.hpp>
-#ifdef BEX_CONTAINER
- class NewtonsForceLaw: public PhysicalActionApplierUnit{
- public:
- virtual void go(const shared_ptr<PhysicalParameters>&, const Body*, MetaBody*);
- FUNCTOR1D(ParticleParameters);
- REGISTER_CLASS_AND_BASE(NewtonsForceLaw,PhysicalActionApplierUnit);
- };
-
-#else
- class NewtonsForceLaw : public PhysicalActionApplierUnit
- {
- public :
- virtual void go( const shared_ptr<PhysicalAction>&
- , const shared_ptr<PhysicalParameters>&
- , const Body*);
- NEEDS_BEX("Force");
- FUNCTOR2D(Force,ParticleParameters);
- REGISTER_CLASS_NAME(NewtonsForceLaw);
- REGISTER_BASE_CLASS_NAME(PhysicalActionApplierUnit);
- };
-#endif
-
+class NewtonsForceLaw: public PhysicalActionApplierUnit{
+ public:
+ virtual void go(const shared_ptr<PhysicalParameters>&, const Body*, MetaBody*);
+ FUNCTOR1D(ParticleParameters);
+ REGISTER_CLASS_AND_BASE(NewtonsForceLaw,PhysicalActionApplierUnit);
+};
REGISTER_SERIALIZABLE(NewtonsForceLaw);
Modified: trunk/pkg/common/Engine/EngineUnit/NewtonsMomentumLaw.cpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/NewtonsMomentumLaw.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/EngineUnit/NewtonsMomentumLaw.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,12 +10,10 @@
#include "NewtonsMomentumLaw.hpp"
#include<yade/pkg-common/RigidBodyParameters.hpp>
-#include<yade/pkg-common/Momentum.hpp>
#include<yade/lib-base/yadeWm3Extra.hpp>
#include<yade/core/MetaBody.hpp>
-#ifdef BEX_CONTAINER
-//! Newtons law for both force and momentum
+//! Newtons law for both force and torque
void NewtonsMomentumLaw::go(const shared_ptr<PhysicalParameters>& b, const Body* bb, MetaBody* rb){
body_id_t id=bb->getId();
Vector3r f=rb->bex.getForce(id); Vector3r m=rb->bex.getTorque(id);
@@ -32,24 +30,5 @@
clumpRBP->angularAcceleration+=diagDiv(m,clumpRBP->inertia);
}
}
-#else
-void NewtonsMomentumLaw::go( const shared_ptr<PhysicalAction>& a
- , const shared_ptr<PhysicalParameters>& b
- , const Body* bb)
-{
- Momentum * am = static_cast<Momentum*>(a.get());
- RigidBodyParameters * rb = static_cast<RigidBodyParameters*>(b.get());
-
- //FIXME : should be += and we should add an Engine that reset acceleration at the beginning
- if(bb->isStandalone()) rb->angularAcceleration=diagDiv(am->momentum,rb->inertia);
- else if(bb->isClump()) rb->angularAcceleration+=diagDiv(am->momentum,rb->inertia);
- else { // isClumpMember()
- const shared_ptr<Body>& clump(Body::byId(bb->clumpId));
- RigidBodyParameters* clumpRBP=YADE_CAST<RigidBodyParameters*>(clump->physicalParameters.get());
- /* angularAcceleration is reset by ClumpMemberMover engine */
- clumpRBP->angularAcceleration+=diagDiv(am->momentum,clumpRBP->inertia);
- }
-}
-#endif
YADE_PLUGIN();
Modified: trunk/pkg/common/Engine/EngineUnit/NewtonsMomentumLaw.hpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/NewtonsMomentumLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/EngineUnit/NewtonsMomentumLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -9,27 +9,12 @@
#pragma once
#include<yade/pkg-common/PhysicalActionApplierUnit.hpp>
-#ifdef BEX_CONTAINER
- class NewtonsMomentumLaw: public PhysicalActionApplierUnit{
- public:
- virtual void go(const shared_ptr<PhysicalParameters>&, const Body*, MetaBody*);
- FUNCTOR1D(RigidBodyParameters);
- REGISTER_CLASS_AND_BASE(NewtonsMomentumLaw,PhysicalActionApplierUnit);
- };
-#else
-class NewtonsMomentumLaw : public PhysicalActionApplierUnit
-{
- public :
- virtual void go( const shared_ptr<PhysicalAction>&
- , const shared_ptr<PhysicalParameters>&
- , const Body*);
-
- NEEDS_BEX("Momentum");
- FUNCTOR2D(Momentum,RigidBodyParameters);
- REGISTER_CLASS_NAME(NewtonsMomentumLaw);
- REGISTER_BASE_CLASS_NAME(PhysicalActionApplierUnit);
+class NewtonsMomentumLaw: public PhysicalActionApplierUnit{
+ public:
+ virtual void go(const shared_ptr<PhysicalParameters>&, const Body*, MetaBody*);
+ FUNCTOR1D(RigidBodyParameters);
+ REGISTER_CLASS_AND_BASE(NewtonsMomentumLaw,PhysicalActionApplierUnit);
};
-#endif
REGISTER_SERIALIZABLE(NewtonsMomentumLaw);
Modified: trunk/pkg/common/Engine/MetaEngine/ConstitutiveLaw.hpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/ConstitutiveLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/MetaEngine/ConstitutiveLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -3,37 +3,16 @@
#include<yade/core/Interaction.hpp>
#include<yade/core/EngineUnit2D.hpp>
#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
class ConstitutiveLaw: public EngineUnit2D <
void, TYPELIST_4(shared_ptr<InteractionGeometry>&, shared_ptr<InteractionPhysics>&, Interaction*, MetaBody*)
>{
- #ifndef BEX_CONTAINER
- int forceIdx, torqueIdx;
- #endif
public:
- ConstitutiveLaw(){
- // cache force/torque indices for fast access in bodyForce and bodyTorque
- #ifndef BEX_CONTAINER
- forceIdx=shared_ptr<PhysicalAction>(new Force())->getClassIndex();
- torqueIdx=shared_ptr<PhysicalAction>(new Momentum())->getClassIndex();
- #endif
- }
+ ConstitutiveLaw(){}
REGISTER_CLASS_AND_BASE(ConstitutiveLaw,EngineUnit2D);
- /*! Convenience functions to get forces/torques quickly.
- * They are not strictly necessary and for simulation that have nodes with only translational DOFs,
- * It creates no overhead runtime overhead, since intialization of Forces/Momentums
- * is done only if the derived ConstitutiveLaw says NEEDS_BEX("Force","Momentum"), for example.
- */
-#ifdef BEX_CONTAINER
+ /*! Convenience functions to get forces/torques quickly. */
void addForce (const body_id_t id, const Vector3r& f,MetaBody* rb){rb->bex.addForce (id,f);}
void addTorque(const body_id_t id, const Vector3r& t,MetaBody* rb){rb->bex.addTorque(id,t);}
-#else
- void addForce (const body_id_t id, const Vector3r& f,MetaBody* rb){static_pointer_cast<Force>(rb->physicalActions->find(id,forceIdx))->force+=f; };
- void addTorque(const body_id_t id, const Vector3r& t,MetaBody* rb){static_pointer_cast<Momentum>(rb->physicalActions->find(id,torqueIdx))->momentum+=t; };
-#endif
-
/*! Convenience function to apply force and torque from one force at contact point. Not sure if this is the right place for it. */
void applyForceAtContactPoint(const Vector3r& force, const Vector3r& contactPoint, const body_id_t id1, const Vector3r& pos1, const body_id_t id2, const Vector3r& pos2, MetaBody* rb){
addForce(id1,force,rb);
Modified: trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplier.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplier.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplier.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -9,28 +9,9 @@
#include"PhysicalActionApplier.hpp"
#include<yade/core/MetaBody.hpp>
-#ifdef BEX_CONTAINER
void PhysicalActionApplier::action(MetaBody* ncb){
FOREACH(const shared_ptr<Body>& b, *ncb->bodies){
operator()(b->physicalParameters,b.get(),ncb);
}
}
-#else
-void PhysicalActionApplier::action(MetaBody* ncb)
-{
- throw logic_error("PhysicalActionApplier cannot be used with BexContainer. Use NewtonsDampedLaw instead (or recompile with NO_BEX).");
- shared_ptr<BodyContainer>& bodies = ncb->bodies;
-
- PhysicalActionContainer::iterator pai = ncb->physicalActions->begin();
- PhysicalActionContainer::iterator paiEnd = ncb->physicalActions->end();
- for( ; pai!=paiEnd ; ++pai)
- {
- shared_ptr<PhysicalAction> action = *pai;
- int id = pai.getCurrentIndex();
- operator()( action , (*bodies)[id]->physicalParameters , (*bodies)[id].get() );
- }
-}
-#endif
-
-
YADE_PLUGIN();
Modified: trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplier.hpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplier.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplier.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -14,36 +14,13 @@
#include<yade/core/MetaEngine2D.hpp>
#include<yade/core/MetaEngine1D.hpp>
#include<yade/lib-multimethods/DynLibDispatcher.hpp>
-#include<yade/core/PhysicalAction.hpp>
#include<yade/pkg-common/PhysicalActionApplierUnit.hpp>
class Body;
-#ifdef BEX_CONTAINER
class PhysicalActionApplier: public MetaEngine1D<PhysicalParameters,PhysicalActionApplierUnit,void,TYPELIST_3(const shared_ptr<PhysicalParameters>&,const Body*, MetaBody*)>{
public: virtual void action(MetaBody*);
REGISTER_CLASS_AND_BASE(PhysicalActionApplier,MetaEngine1D);
};
REGISTER_SERIALIZABLE(PhysicalActionApplier);
-#else
-class PhysicalActionApplier : public MetaEngine2D
- <
- PhysicalAction , // base classe for dispatch
- PhysicalParameters, // base classe for dispatch
- PhysicalActionApplierUnit, // class that provides multivirtual call
- void, // return type
- TYPELIST_3( const shared_ptr<PhysicalAction>& // function arguments
- , const shared_ptr<PhysicalParameters>&
- , const Body *
- )
- >
-{
- public :
- virtual void action(MetaBody*);
- REGISTER_CLASS_NAME(PhysicalActionApplier);
- REGISTER_BASE_CLASS_NAME(MetaEngine2D);
-};
-REGISTER_SERIALIZABLE(PhysicalActionApplier);
-#endif
-
Modified: trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplierUnit.hpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplierUnit.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplierUnit.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -8,30 +8,13 @@
#pragma once
-#include<yade/core/PhysicalAction.hpp>
#include<yade/core/PhysicalParameters.hpp>
#include<yade/core/Body.hpp>
#include<yade/core/EngineUnit2D.hpp>
#include<yade/core/EngineUnit1D.hpp>
-#ifdef BEX_CONTAINER
class PhysicalActionApplierUnit: public EngineUnit1D<void,TYPELIST_3(const shared_ptr<PhysicalParameters>&,const Body*, MetaBody*)>{
REGISTER_CLASS_AND_BASE(PhysicalActionApplierUnit,EngineUnit1D);
};
REGISTER_SERIALIZABLE(PhysicalActionApplierUnit);
-#else
-class PhysicalActionApplierUnit : public EngineUnit2D
- <
- void ,
- TYPELIST_3( const shared_ptr<PhysicalAction>&
- , const shared_ptr<PhysicalParameters>&
- , const Body*
- )
- >
-{
- REGISTER_CLASS_NAME(PhysicalActionApplierUnit);
- REGISTER_BASE_CLASS_NAME(EngineUnit2D);
-};
-REGISTER_SERIALIZABLE(PhysicalActionApplierUnit);
-#endif
Modified: trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamper.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamper.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamper.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -11,27 +11,10 @@
#include "PhysicalActionDamper.hpp"
#include<yade/core/MetaBody.hpp>
-#ifdef BEX_CONTAINER
void PhysicalActionDamper::action(MetaBody* ncb){
+ ncb->bex.sync();
FOREACH(const shared_ptr<Body>& b, *ncb->bodies){
operator()(b->physicalParameters,b.get(),ncb);
}
}
-#else
-void PhysicalActionDamper::action(MetaBody* ncb)
-{
- shared_ptr<BodyContainer>& bodies = ncb->bodies;
- PhysicalActionContainer::iterator pai = ncb->physicalActions->begin();
- PhysicalActionContainer::iterator paiEnd = ncb->physicalActions->end();
- for( ; pai!=paiEnd ; ++pai)
- {
- shared_ptr<PhysicalAction> action = *pai;
- int id = pai.getCurrentIndex();
- // FIXME - solve the problem of Body's id
- operator()( action , (*bodies)[id]->physicalParameters , (*bodies)[id].get() );
- }
-}
-#endif
-
-
YADE_PLUGIN();
Modified: trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamper.hpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamper.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamper.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -11,36 +11,12 @@
#include<yade/core/MetaEngine2D.hpp>
#include<yade/core/MetaEngine1D.hpp>
#include<yade/lib-multimethods/DynLibDispatcher.hpp>
-#include<yade/core/PhysicalAction.hpp>
#include<yade/pkg-common/PhysicalActionDamperUnit.hpp>
class Body;
class MetaBody;
-#ifdef BEX_CONTAINER
- class PhysicalActionDamper: public MetaEngine1D<PhysicalParameters,PhysicalActionDamperUnit,void,TYPELIST_3(const shared_ptr<PhysicalParameters>&, const Body*, MetaBody*)>{
- public: virtual void action(MetaBody*);
- REGISTER_CLASS_AND_BASE(PhysicalActionDamper,MetaEngine1D);
- };
- REGISTER_SERIALIZABLE(PhysicalActionDamper);
-#else
- class PhysicalActionDamper : public MetaEngine2D
- < PhysicalAction, // base classe for dispatch
- PhysicalParameters, // base classe for dispatch
- PhysicalActionDamperUnit, // class that provides multivirtual call
- void, // return type
- TYPELIST_3( const shared_ptr<PhysicalAction>& // function arguments
- , const shared_ptr<PhysicalParameters>&
- , const Body *
- )
- >
- {
- public :
- virtual void action(MetaBody*);
-
- REGISTER_CLASS_NAME(PhysicalActionDamper);
- REGISTER_BASE_CLASS_NAME(MetaEngine2D);
- };
- REGISTER_SERIALIZABLE(PhysicalActionDamper);
-#endif
-
-
+class PhysicalActionDamper: public MetaEngine1D<PhysicalParameters,PhysicalActionDamperUnit,void,TYPELIST_3(const shared_ptr<PhysicalParameters>&, const Body*, MetaBody*)>{
+ public: virtual void action(MetaBody*);
+ REGISTER_CLASS_AND_BASE(PhysicalActionDamper,MetaEngine1D);
+};
+REGISTER_SERIALIZABLE(PhysicalActionDamper);
Modified: trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamperUnit.hpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamperUnit.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamperUnit.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -8,14 +8,12 @@
#pragma once
-#include<yade/core/PhysicalAction.hpp>
#include<yade/core/PhysicalParameters.hpp>
#include<yade/core/Body.hpp>
#include<yade/core/MetaBody.hpp>
#include<yade/core/EngineUnit2D.hpp>
#include<yade/core/EngineUnit1D.hpp>
-#ifdef BEX_CONTAINER
class PhysicalActionDamperUnit: public EngineUnit1D<void,TYPELIST_3(const shared_ptr<PhysicalParameters>&,const Body*, MetaBody*)>{
REGISTER_CLASS_AND_BASE(PhysicalActionDamperUnit,EngineUnit1D);
/* We are friend of BexContainer. These functions can be used safely provided that bex is NEVER read after being modified. */
@@ -23,18 +21,3 @@
Vector3r getTorqueUnsynced(body_id_t id, MetaBody* rb){ return rb->bex.getTorqueUnsynced(id);}
};
REGISTER_SERIALIZABLE(PhysicalActionDamperUnit);
-#else
-class PhysicalActionDamperUnit : public EngineUnit2D
- <
- void ,
- TYPELIST_3( const shared_ptr<PhysicalAction>&
- , const shared_ptr<PhysicalParameters>&
- , const Body*
- )
- >
-{
- REGISTER_CLASS_NAME(PhysicalActionDamperUnit);
- REGISTER_BASE_CLASS_NAME(EngineUnit2D);
-};
-REGISTER_SERIALIZABLE(PhysicalActionDamperUnit);
-#endif
Modified: trunk/pkg/common/Engine/ParallelEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/ParallelEngine.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/ParallelEngine.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -15,7 +15,9 @@
void ParallelEngine::action(MetaBody* rootBody){
// openMP warns if the iteration variable is unsigned...
const int size=(int)slaves.size();
- #pragma omp parallel for
+ #ifdef YADE_OPENMP
+ #pragma omp parallel for
+ #endif
for(int i=0; i<size; i++){
// run every slave group sequentially
FOREACH(const shared_ptr<Engine>& e, slaves[i]) {
Deleted: trunk/pkg/common/Engine/StandAloneEngine/PhysicalActionContainerInitializer.cpp
===================================================================
--- trunk/pkg/common/Engine/StandAloneEngine/PhysicalActionContainerInitializer.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/StandAloneEngine/PhysicalActionContainerInitializer.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,64 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2004 by Janek Kozicki *
-* cosurgi@xxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#include "PhysicalActionContainerInitializer.hpp"
-#include<yade/core/MetaBody.hpp>
-#include<yade/lib-factory/ClassFactory.hpp>
-#include<yade/core/PhysicalAction.hpp>
-#include<yade/core/Engine.hpp>
-#include<boost/foreach.hpp>
-
-CREATE_LOGGER(PhysicalActionContainerInitializer);
-
-PhysicalActionContainerInitializer::PhysicalActionContainerInitializer()
-{
- physicalActionNames.clear();
-}
-
-PhysicalActionContainerInitializer::~PhysicalActionContainerInitializer()
-{
-}
-
-void PhysicalActionContainerInitializer::registerAttributes()
-{
- REGISTER_ATTRIBUTE(physicalActionNames);
-}
-
-void PhysicalActionContainerInitializer::action(MetaBody* ncb)
-{
- #ifdef BEX_CONTAINER
- // this is not necessary, since BexContainer grows upon request.
- // But it takes about 10 resizes to get to 2000 bodies (only at the beginning), so you can save a few milliseconds here
- ncb->bex.resize(ncb->bodies->size());
- #else
- list<string> allNames;
- // copy physical action names that were passed by the user directly
- allNames.insert(allNames.end(),physicalActionNames.begin(),physicalActionNames.end());
- LOG_DEBUG("allNames as defined by the user: "); FOREACH(string an,allNames) LOG_DEBUG(an);
- // loop over all engines, get Bex from them
- FOREACH(shared_ptr<Engine> e, ncb->engines){
- list<string> bex=e->getNeededBex();
- allNames.insert(allNames.end(),bex.begin(),bex.end());
- LOG_DEBUG("The following engines were inserted by "<<e->getClassName()<<":"); FOREACH(string b,bex) LOG_DEBUG(b);
- }
- LOG_DEBUG("allNames after loop over engines: "); FOREACH(string an,allNames) LOG_DEBUG(an);
- // eliminate all duplicates
- allNames.sort();
- allNames.unique();
- LOG_DEBUG("allNames after sort and unique: "); FOREACH(string an,allNames) LOG_DEBUG(an);
-
- vector<shared_ptr<PhysicalAction> > physicalActions;
- FOREACH(string physicalActionName, allNames){
- physicalActions.push_back(YADE_PTR_CAST<PhysicalAction>(ClassFactory::instance().createShared(physicalActionName)));
- }
- ncb->physicalActions->prepare(physicalActions);
- #endif
-}
-
-
-YADE_PLUGIN();
Deleted: trunk/pkg/common/Engine/StandAloneEngine/PhysicalActionContainerInitializer.hpp
===================================================================
--- trunk/pkg/common/Engine/StandAloneEngine/PhysicalActionContainerInitializer.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/StandAloneEngine/PhysicalActionContainerInitializer.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,38 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2004 by Janek Kozicki *
-* cosurgi@xxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#pragma once
-
-#include<yade/core/StandAloneEngine.hpp>
-
-#include <vector>
-#include <string>
-
-class Body;
-
-class PhysicalActionContainerInitializer : public StandAloneEngine
-{
- public :
- std::vector<std::string> physicalActionNames;
-
- PhysicalActionContainerInitializer();
- virtual ~PhysicalActionContainerInitializer();
- virtual void action(MetaBody*);
-
- protected :
- virtual void registerAttributes();
-
- DECLARE_LOGGER;
-
- REGISTER_CLASS_NAME(PhysicalActionContainerInitializer);
- REGISTER_BASE_CLASS_NAME(StandAloneEngine);
-};
-
-REGISTER_SERIALIZABLE(PhysicalActionContainerInitializer);
-
-
Modified: trunk/pkg/common/Engine/StandAloneEngine/PhysicalActionContainerReseter.cpp
===================================================================
--- trunk/pkg/common/Engine/StandAloneEngine/PhysicalActionContainerReseter.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/Engine/StandAloneEngine/PhysicalActionContainerReseter.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -20,11 +20,7 @@
void PhysicalActionContainerReseter::action(MetaBody* ncb)
{
- #ifdef BEX_CONTAINER
- ncb->bex.reset();
- #else
- ncb->physicalActions->reset();
- #endif
+ ncb->bex.reset();
}
Modified: trunk/pkg/common/SConscript
===================================================================
--- trunk/pkg/common/SConscript 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/common/SConscript 2009-03-30 17:10:27 UTC (rev 1738)
@@ -18,8 +18,6 @@
env.SharedLibrary('ElasticBodyParameters',['DataClass/PhysicalParameters/ElasticBodyParameters.cpp'],
LIBS=env['LIBS']+['RigidBodyParameters','ParticleParameters',]),
env.SharedLibrary('ClosestFeatures',['DataClass/InteractionGeometry/ClosestFeatures.cpp']),
- env.SharedLibrary('Force',['DataClass/PhysicalAction/Force.cpp']),
- env.SharedLibrary('Momentum',['DataClass/PhysicalAction/Momentum.cpp']),
env.SharedLibrary('Box',['DataClass/GeometricalModel/Box.cpp']),
env.SharedLibrary('Mesh2D',['DataClass/GeometricalModel/Mesh2D.cpp']),
env.SharedLibrary('Sphere',['DataClass/GeometricalModel/Sphere.cpp']),
@@ -28,13 +26,13 @@
env.SharedLibrary('Facet',['DataClass/GeometricalModel/Facet.cpp']),
env.SharedLibrary('ColorScale',['DataClass/Widgets/ColorScale.cpp']),
env.SharedLibrary('MomentEngine',['Engine/DeusExMachina/MomentEngine.cpp'],
- LIBS=env['LIBS']+['Momentum','ParticleParameters']),
+ LIBS=env['LIBS']+['ParticleParameters']),
env.SharedLibrary('ForceEngine',['Engine/DeusExMachina/ForceEngine.cpp'],
- LIBS=env['LIBS']+['Force','ParticleParameters']),
+ LIBS=env['LIBS']+['ParticleParameters']),
env.SharedLibrary('DisplacementToForceEngine',['Engine/DeusExMachina/DisplacementToForceEngine.cpp'],
- LIBS=env['LIBS']+['Force','ParticleParameters']),
+ LIBS=env['LIBS']+['ParticleParameters']),
env.SharedLibrary('GravityEngines',['Engine/DeusExMachina/GravityEngines.cpp'],
- LIBS=env['LIBS']+['Force','ParticleParameters']),
+ LIBS=env['LIBS']+['ParticleParameters']),
env.SharedLibrary('JumpChangeSe3',['Engine/DeusExMachina/JumpChangeSe3.cpp'], LIBS=env['LIBS']+['RigidBodyParameters']),
env.SharedLibrary('Se3Interpolator',['Engine/DeusExMachina/Se3Interpolator.cpp'], LIBS=env['LIBS']+['RigidBodyParameters']),
env.SharedLibrary('RotationEngine',['Engine/DeusExMachina/RotationEngine.cpp'],
@@ -51,7 +49,6 @@
'RigidBodyParameters',
'yade-factory',
'yade-base',
- 'Force',
'ContactLaw1',
'ElasticContactInteraction',
'InteractingBox',
@@ -68,7 +65,6 @@
'RigidBodyParameters',
'yade-factory',
'yade-base',
- 'Force',
'ContactLaw1',
'ElasticContactInteraction',
'InteractingBox',
@@ -103,7 +99,7 @@
env.SharedLibrary('InteractionPhysicsMetaEngine',['Engine/MetaEngine/InteractionPhysicsMetaEngine.cpp']),
env.SharedLibrary('PhysicalActionApplier',['Engine/MetaEngine/PhysicalActionApplier.cpp']),
env.SharedLibrary('PhysicalActionDamper',['Engine/MetaEngine/PhysicalActionDamper.cpp']),
- env.SharedLibrary('ConstitutiveLawDispatcher',['Engine/MetaEngine/ConstitutiveLawDispatcher.cpp'],LIBS=env['LIBS']+['Force','Momentum']),
+ env.SharedLibrary('ConstitutiveLawDispatcher',['Engine/MetaEngine/ConstitutiveLawDispatcher.cpp']),
env.SharedLibrary('InteractionDispatchers',['Engine/MetaEngine/InteractionDispatchers.cpp'],LIBS=env['LIBS']+['InteractionGeometryMetaEngine','InteractionPhysicsMetaEngine','ConstitutiveLawDispatcher']),
env.SharedLibrary('InteractingBox2AABB',['Engine/EngineUnit/InteractingBox2AABB.cpp'],
LIBS=env['LIBS']+['BoundingVolumeMetaEngine','InteractingBox','AABB','Box',]),
@@ -116,21 +112,21 @@
env.SharedLibrary('LeapFrogPositionIntegrator',['Engine/EngineUnit/LeapFrogPositionIntegrator.cpp'],
LIBS=env['LIBS']+['PhysicalParametersMetaEngine','ParticleParameters','RigidBodyParameters']),
env.SharedLibrary('NewtonsForceLaw',['Engine/EngineUnit/NewtonsForceLaw.cpp'],
- LIBS=env['LIBS']+['PhysicalActionApplier','Force','ParticleParameters','RigidBodyParameters']),
+ LIBS=env['LIBS']+['PhysicalActionApplier','ParticleParameters','RigidBodyParameters']),
env.SharedLibrary('NewtonsMomentumLaw',['Engine/EngineUnit/NewtonsMomentumLaw.cpp'],
- LIBS=env['LIBS']+['PhysicalActionApplier','Momentum','RigidBodyParameters',]),
+ LIBS=env['LIBS']+['PhysicalActionApplier','RigidBodyParameters',]),
env.SharedLibrary('InteractingSphere2AABB',['Engine/EngineUnit/InteractingSphere2AABB.cpp'],
LIBS=env['LIBS']+['BoundingVolumeMetaEngine','InteractingSphere','AABB']),
env.SharedLibrary('CundallNonViscousDamping',
['Engine/EngineUnit/CundallNonViscousDamping.cpp'],
- LIBS=env['LIBS']+['PhysicalActionDamper','Force','Momentum','ParticleParameters','RigidBodyParameters']),
+ LIBS=env['LIBS']+['PhysicalActionDamper','ParticleParameters','RigidBodyParameters']),
env.SharedLibrary('ElasticBodySimpleRelationship',['Engine/EngineUnit/ElasticBodySimpleRelationship.cpp'],
LIBS=env['LIBS']+['ElasticBodyParameters','RigidBodyParameters','ParticleParameters','InteractionPhysicsMetaEngine','NormalShearInteractions']),
env.SharedLibrary('NormalShearInteractions',['DataClass/InteractionPhysics/NormalShearInteractions.cpp']),
#env.SharedLibrary('VelocityDamping',
# ['Engine/EngineUnit/VelocityDamping.cpp'],
- # LIBS=env['LIBS']+['Force','Momentum','RigidBodyParameters']),
+ # LIBS=env['LIBS']+['RigidBodyParameters']),
#env.SharedLibrary('PersistentTriangulationCollider',
# ['Engine/StandAloneEngine/PersistentTriangulationCollider.cpp'],
@@ -143,7 +139,6 @@
env.SharedLibrary('SpatialQuickSortCollider',['Engine/StandAloneEngine/SpatialQuickSortCollider.cpp']),
env.SharedLibrary('PersistentSAPCollider',['Engine/StandAloneEngine/PersistentSAPCollider.cpp']),
env.SharedLibrary('DistantPersistentSAPCollider',['Engine/StandAloneEngine/DistantPersistentSAPCollider.cpp']),
- env.SharedLibrary('PhysicalActionContainerInitializer',['Engine/StandAloneEngine/PhysicalActionContainerInitializer.cpp']),
env.SharedLibrary('PhysicalActionContainerReseter',['Engine/StandAloneEngine/PhysicalActionContainerReseter.cpp']),
env.SharedLibrary('GLDrawAABB',['RenderingEngine/GLDrawBoundingVolume/GLDrawAABB.cpp'],
LIBS=env['LIBS']+['yade-base','AABB','yade-opengl']),
Modified: trunk/pkg/dem/Engine/DeusExMachina/CapillaryRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/CapillaryRecorder.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/CapillaryRecorder.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -11,14 +11,13 @@
#include "CapillaryRecorder.hpp"
#include <yade/pkg-common/RigidBodyParameters.hpp>
#include <yade/pkg-common/ParticleParameters.hpp>
-#include <yade/pkg-common/Force.hpp>
#include <yade/pkg-dem/CapillaryParameters.hpp>
#include <yade/core/Omega.hpp>
#include <yade/core/MetaBody.hpp>
#include <boost/lexical_cast.hpp>
-CapillaryRecorder::CapillaryRecorder () : DataRecorder(), actionForce(new Force)
+CapillaryRecorder::CapillaryRecorder () : DataRecorder()
{
outputFile = "";
interval = 1;
@@ -53,12 +52,8 @@
{
Real fx=0, fy=0, fz=0;
- #ifdef BEX_CONTAINER
- ncb->bex.sync();
- Vector3r force=ncb->bex.getForce(bigBallId);
- #else
- Vector3r force = static_cast<Force*>(ncb->physicalActions->find(bigBallId, actionForce->getClassIndex() ) . get() )->force;
- #endif
+ ncb->bex.sync();
+ Vector3r force=ncb->bex.getForce(bigBallId);
fx=force[0];
Modified: trunk/pkg/dem/Engine/DeusExMachina/CapillaryRecorder.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/CapillaryRecorder.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/CapillaryRecorder.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,12 +13,10 @@
#include <string>
#include <fstream>
-class PhysicalAction;
class CapillaryRecorder : public DataRecorder
{
private :
- shared_ptr<PhysicalAction> actionForce;
std::ofstream ofile;
bool changed;
@@ -37,7 +35,6 @@
protected :
virtual void postProcessAttributes(bool deserializing);
- NEEDS_BEX("Force");
REGISTER_CLASS_NAME(CapillaryRecorder);
REGISTER_BASE_CLASS_NAME(DataRecorder);
};
Modified: trunk/pkg/dem/Engine/DeusExMachina/ContactStressRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/ContactStressRecorder.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/ContactStressRecorder.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -9,7 +9,6 @@
#include "ContactStressRecorder.hpp"
#include <yade/pkg-common/RigidBodyParameters.hpp>
#include <yade/pkg-common/ParticleParameters.hpp>
-#include <yade/pkg-common/Force.hpp>
#include <yade/pkg-common/Sphere.hpp>
#include <yade/pkg-dem/BodyMacroParameters.hpp>
#include <yade/pkg-dem/ElasticContactLaw.hpp>
@@ -25,7 +24,7 @@
CREATE_LOGGER(ContactStressRecorder);
-ContactStressRecorder::ContactStressRecorder () : DataRecorder(), actionForce(new Force)
+ContactStressRecorder::ContactStressRecorder () : DataRecorder()
{
outputFile = "";
Modified: trunk/pkg/dem/Engine/DeusExMachina/ContactStressRecorder.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/ContactStressRecorder.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/ContactStressRecorder.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,7 +13,6 @@
#include <string>
#include <fstream>
-class PhysicalAction;
class GeometricalModel;
class TriaxialCompressionEngine;
// class SampleCapillaryPressureEngine;
@@ -22,7 +21,6 @@
class ContactStressRecorder : public DataRecorder
{
private :
- shared_ptr<PhysicalAction> actionForce; // ???
shared_ptr<GeometricalModel> sphere_ptr;
int SpheresClassIndex;
Modified: trunk/pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -8,8 +8,6 @@
#include "HydraulicForceEngine.hpp"
#include <yade/pkg-common/ParticleParameters.hpp>
-#include <yade/pkg-common/Force.hpp>
-#include <yade/pkg-common/Momentum.hpp>
#include<yade/core/MetaBody.hpp>
#include <yade/pkg-dem/CohesiveFrictionalBodyParameters.hpp>
#include <vector>
@@ -18,7 +16,7 @@
bool HFinverted = false;
vector<Real> initialPositions;
-HydraulicForceEngine::HydraulicForceEngine() : actionParameterForce(new Force), actionParameterMomentum(new Momentum), gravity(Vector3r::ZERO), isActivated(false)
+HydraulicForceEngine::HydraulicForceEngine() : gravity(Vector3r::ZERO), isActivated(false)
{
dummyParameter = false;
}
@@ -73,11 +71,7 @@
//cerr << "translate it" << endl;
if ((static_cast<CohesiveFrictionalBodyParameters*> (b->physicalParameters.get()))->isBroken == true)
{
- #ifdef BEX_CONTAINER
- ncb->bex.addForce(b->getId(),Vector3r(0,5,0));
- #else
- static_cast<Force*>( ncb->physicalActions->find( b->getId() , actionParameterForce->getClassIndex() ).get() )->force += Vector3r(0,5,0);
- #endif
+ ncb->bex.addForce(b->getId(),Vector3r(0,5,0));
}
// else b->geometricalModel->diffuseColor= Vector3r(0.5,0.9,0.3);
}
@@ -103,14 +97,8 @@
Vector3r t (mx,my,mz);
//f /= -10000;
//t *= 0;
- #ifdef BEX_CONTAINER
- ncb->bex.addForce(id,f);
- ncb->bex.addTorque(id,t);
- #else
- static_cast<Force*>( ncb->physicalActions->find( id , actionParameterForce->getClassIndex() ).get() )->force += f;
- //cerr << "added force = " << f << endl;
- static_cast<Momentum*>( ncb->physicalActions->find( id , actionParameterMomentum->getClassIndex() ).get() )->momentum += t;
- #endif
+ ncb->bex.addForce(id,f);
+ ncb->bex.addTorque(id,t);
}
}
Modified: trunk/pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,15 +10,8 @@
#include<yade/core/DeusExMachina.hpp>
-class Force;
-class Momentum;
-
class HydraulicForceEngine : public DeusExMachina
{
- private :
- shared_ptr<Force> actionParameterForce;
- shared_ptr<Momentum> actionParameterMomentum;
-
public :
Vector3r gravity;
bool isActivated;
@@ -30,7 +23,6 @@
protected :
virtual void registerAttributes();
- NEEDS_BEX("Force","Momentum");
REGISTER_CLASS_NAME(HydraulicForceEngine);
REGISTER_BASE_CLASS_NAME(DeusExMachina);
};
Deleted: trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,69 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2004 by Janek Kozicki *
-* cosurgi@xxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#include <yade/pkg-dem/MakeItFlat.hpp>
-#include <yade/pkg-common/ParticleParameters.hpp>
-#include <yade/pkg-common/Force.hpp>
-#include <yade/core/MetaBody.hpp>
-
-MakeItFlat::MakeItFlat() : actionParameterForce(new Force)
-{
- direction=1;
- plane_position=0;
- reset_force=true;
-}
-
-
-MakeItFlat::~MakeItFlat()
-{
-}
-
-
-void MakeItFlat::registerAttributes()
-{
- REGISTER_ATTRIBUTE(direction);
- REGISTER_ATTRIBUTE(plane_position);
- REGISTER_ATTRIBUTE(reset_force);
-}
-
-
-void MakeItFlat::applyCondition(MetaBody* ncb)
-{
- shared_ptr<BodyContainer>& bodies = ncb->bodies;
-
- BodyContainer::iterator bi = bodies->begin();
- BodyContainer::iterator biEnd = bodies->end();
- for( ; bi!=biEnd ; ++bi )
- {
- shared_ptr<Body> b = *bi;
- /* skip bodies that are within a clump;
- * even if they are marked isDynamic==false, forces applied to them are passed to the clump, which is dynamic;
- * and since clump is a body with mass equal to the sum of masses of its components, it would have HydraulicForce applied twice.
- *
- * The choice is to skip (b->isClumpMember()) or (b->isClump()). We rather skip members,
- * since that will apply smaller number of forces and (theoretically) improve numerical stability ;-) */
- if(b->isClumpMember()) continue;
-
- if(b->geometricalModel->getClassName()=="Sphere")
- {
- ParticleParameters* p = dynamic_cast<ParticleParameters*>(b->physicalParameters.get());
- if (p)
- {
- p->se3.position[direction]=plane_position;
- if(reset_force)
- #ifdef BEX_CONTAINER
- throw runtime_error("BexContainer doesn't work with MakeIfFlat resetting forces, since it would have to sync() frequently. Use PhysicalParameters::blockedDOFs instead, MakeItFlat will be removed.");
- #else
- static_cast<Force*>( ncb->physicalActions->find( b->getId() , actionParameterForce->getClassIndex() ).get() )->force[direction]=0;//
- #endif
- }
- }
- }
-}
-
-YADE_PLUGIN();
Deleted: trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/MakeItFlat.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,39 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2004 by Janek Kozicki *
-* cosurgi@xxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#pragma once
-
-#include<yade/core/DeusExMachina.hpp>
-
-class Force;
-
-class MakeItFlat : public DeusExMachina
-{
- private :
- shared_ptr<Force> actionParameterForce;
-
- public :
- MakeItFlat();
- virtual ~MakeItFlat();
-
- virtual void applyCondition(MetaBody*);
-
- int direction;
- Real plane_position;
- bool reset_force;
-
- protected :
- virtual void registerAttributes();
- NEEDS_BEX("Force");
- REGISTER_CLASS_NAME(MakeItFlat);
- REGISTER_BASE_CLASS_NAME(DeusExMachina);
-};
-
-REGISTER_SERIALIZABLE(MakeItFlat);
-
-
Modified: trunk/pkg/dem/Engine/DeusExMachina/NewtonsDampedLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/NewtonsDampedLaw.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/NewtonsDampedLaw.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -9,8 +9,6 @@
#include"NewtonsDampedLaw.hpp"
#include<yade/core/MetaBody.hpp>
#include<yade/pkg-common/RigidBodyParameters.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-#include<yade/pkg-common/Force.hpp>
#include<yade/lib-base/yadeWm3Extra.hpp>
YADE_PLUGIN("NewtonsDampedLaw");
@@ -25,29 +23,18 @@
NewtonsDampedLaw::NewtonsDampedLaw()
{
damping = 0.2;
- forceClassIndex = (new Force)->getClassIndex();
- momentumClassIndex = (new Momentum)->getClassIndex();
}
void NewtonsDampedLaw::applyCondition ( MetaBody * ncb )
{
- #ifdef BEX_CONTAINER
- #ifdef YADE_OPENMP
- ncb->bex.sync();
- #endif
- #endif
+ ncb->bex.sync();
FOREACH(const shared_ptr<Body>& b, *ncb->bodies){
if (!b->isDynamic) continue;
RigidBodyParameters* rb = YADE_CAST<RigidBodyParameters*>(b->physicalParameters.get());
unsigned int id = b->getId();
- #ifdef BEX_CONTAINER
- const Vector3r& m=ncb->bex.getTorque(id);
- const Vector3r& f=ncb->bex.getForce(id);
- #else
- const Vector3r& m = ( static_cast<Momentum*> ( ncb->physicalActions->find ( id, momentumClassIndex ).get() ) )->momentum;
- const Vector3r& f = ( static_cast<Force*> ( ncb->physicalActions->find ( id, forceClassIndex ).get() ) )->force;
- #endif
+ const Vector3r& m=ncb->bex.getTorque(id);
+ const Vector3r& f=ncb->bex.getForce(id);
Real dt = Omega::instance().getTimeStep();
Modified: trunk/pkg/dem/Engine/DeusExMachina/NewtonsDampedLaw.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/NewtonsDampedLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/NewtonsDampedLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -38,10 +38,6 @@
public :
///damping coefficient for Cundall's non viscous damping
Real damping;
-
- private :
- int forceClassIndex, momentumClassIndex;
-
public :
virtual void applyCondition(MetaBody *);
NewtonsDampedLaw();
@@ -49,7 +45,6 @@
protected :
virtual void registerAttributes();
- NEEDS_BEX("Force","Momentum");
REGISTER_CLASS_NAME(NewtonsDampedLaw);
REGISTER_BASE_CLASS_NAME(DeusExMachina);
};
Deleted: trunk/pkg/dem/Engine/DeusExMachina/ResultantForceEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/ResultantForceEngine.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/ResultantForceEngine.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,100 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2004 by Janek Kozicki *
-* cosurgi@xxxxxxxxxx *
-* Copyright (C) 2006 by Bruno Chareyre *
-* bruno.chareyre@xxxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-#include"ResultantForceEngine.hpp"
-
-#ifndef BEX_CONTAINER
-
- #include<yade/pkg-common/ParticleParameters.hpp>
- #include<yade/pkg-common/Force.hpp>
- #include<yade/pkg-dem/GlobalStiffness.hpp>
- #include<Wm3Math.h>
- #include<yade/lib-base/yadeWm3.hpp>
- #include<yade/lib-base/yadeWm3Extra.hpp>
-
-
-
- #include<yade/core/MetaBody.hpp>
-
-
- ResultantForceEngine::ResultantForceEngine() : actionParameterGlobalStiffness(new GlobalStiffness), actionParameterForce(new Force)
- {
- interval =1;
- damping = 0.1;
- force = Vector3r::ZERO;
- previoustranslation = Vector3r::ZERO;
- stiffness = Vector3r::ZERO;
- max_vel = 0.001;
- }
-
- ResultantForceEngine::~ResultantForceEngine()
- {
- }
-
-
- void ResultantForceEngine::registerAttributes()
- {
- DeusExMachina::registerAttributes();
- REGISTER_ATTRIBUTE(interval);
- REGISTER_ATTRIBUTE(damping);
- REGISTER_ATTRIBUTE(force);
- REGISTER_ATTRIBUTE(previoustranslation);
- REGISTER_ATTRIBUTE(stiffness);
- REGISTER_ATTRIBUTE(max_vel);
- }
-
-
-
- void ResultantForceEngine::applyCondition(MetaBody* ncb)
- {
- //cerr << "void ResultantForceEngine::applyCondition(Body* body)" << std::endl;
- shared_ptr<BodyContainer>& bodies = ncb->bodies;
-
- std::vector<int>::const_iterator ii = subscribedBodies.begin();
- std::vector<int>::const_iterator iiEnd = subscribedBodies.end();
-
- //cerr << "std::vector<int>::const_iterator iiEnd = subscribedBodies.end();" << Omega::instance().getCurrentIteration() << std::endl;
-
-
-
- for(;ii!=iiEnd;++ii)
- {
- //cerr << "for(;ii!=iiEnd;++ii)" << std::endl;
- //if( bodies->exists(*ii) )
- //{
- //Update stiffness only if it has been computed by StiffnessCounter (see "interval")
- if (Omega::instance().getCurrentIteration() % interval == 0) stiffness =
- (static_cast<GlobalStiffness*>( ncb->physicalActions->find (*ii, actionParameterGlobalStiffness->getClassIndex() ).get() ))->stiffness;
-
- //cerr << "static_cast<GlobalStiffness*>( ncb->physicalActions->find (*ii, actionParameterGlobalStiffness->getClassIndex() ).get() ))->stiffness" << std::endl;
-
- if(PhysicalParameters* p = dynamic_cast<PhysicalParameters*>((*bodies)[*ii]->physicalParameters.get()))
- {
- //cerr << "dynamic_cast<PhysicalParameters*>((*bodies)[*ii]->physicalParameters.get()" << std::endl;
- // GlobalStiffness* sm = static_cast<GlobalStiffness*>( ncb->physicalActions->find (*ii, actionParameterGlobalStiffness->getClassIndex() ).get() );
-
- Vector3r effectiveforce =
- static_cast<Force*>( ncb->physicalActions->find( *ii,actionParameterForce->getClassIndex() ).get() )->force;
- Vector3r deltaf (effectiveforce - force);
- Vector3r translation
- (stiffness.X()==0 ? Mathr::Sign(deltaf.X())*max_vel : Mathr::Sign(deltaf.X())*std::min( abs(deltaf.X()/stiffness.X()), max_vel),
- stiffness.Y()==0 ? Mathr::Sign(deltaf.Y())*max_vel : Mathr::Sign(deltaf.Y())*std::min( abs(deltaf.Y()/stiffness.Y()), max_vel),
- stiffness.Z()==0 ? Mathr::Sign(deltaf.Z())*max_vel : Mathr::Sign(deltaf.Z())*std::min( abs(deltaf.Z()/stiffness.Z()), max_vel) );
- previoustranslation = (1-damping)*translation + 0.9*previoustranslation;// formula for "steady-flow" evolution with fluctuations
- p->se3.position += previoustranslation;
- //p->velocity = previoustranslation/dt;//FIXME : useless???
- }
- //}
- }
- }
-
-
- YADE_PLUGIN();
-
-#endif
Deleted: trunk/pkg/dem/Engine/DeusExMachina/ResultantForceEngine.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/ResultantForceEngine.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/ResultantForceEngine.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,53 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2004 by Janek Kozicki *
-* cosurgi@xxxxxxxxxx *
-* Copyright (C) 2006 by Bruno Chareyre *
-* bruno.chareyre@xxxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#pragma once
-#include<yade/core/DeusExMachina.hpp>
-#ifndef BEX_CONTAINER
-
- class PhysicalAction;
-
- class ResultantForceEngine : public DeusExMachina
- {
- private :
- shared_ptr<PhysicalAction> actionParameterGlobalStiffness;
- shared_ptr<PhysicalAction> actionParameterForce;
-
-
- public :
- //! CAUTION : interval must be equal to the interval of the StiffnessCounter, it is used here to check if stiffness has been computed
- unsigned int interval;
- //! Defines the prescibed resultant force
- Vector3r force;
- //! Stores the value of the translation at the previous time step
- Vector3r previoustranslation;
- //! The value of stiffness (updated according to interval)
- Vector3r stiffness;
- //! damping coefficient - damping=1 implies a "perfect" control of the resultant force
- Real damping;
- //! maximum velocity (usefull to prevent explosions when stiffness is very low...)
- Real max_vel;
-
- ResultantForceEngine();
- virtual ~ResultantForceEngine();
-
- virtual void applyCondition(MetaBody*);
-
-
- protected :
- virtual void registerAttributes();
- NEEDS_BEX("Force","GlobalStiffness");
- REGISTER_CLASS_NAME(ResultantForceEngine);
- REGISTER_BASE_CLASS_NAME(DeusExMachina);
- };
-
- REGISTER_SERIALIZABLE(ResultantForceEngine);
-#endif
-
Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -9,7 +9,6 @@
#include "TriaxialCompressionEngine.hpp"
#include<yade/core/MetaBody.hpp>
#include<yade/core/Omega.hpp>
-#include<yade/pkg-common/Force.hpp>
#include<yade/pkg-dem/BodyMacroParameters.hpp>
#include<yade/lib-base/yadeWm3Extra.hpp>
#include<boost/lexical_cast.hpp>
@@ -24,7 +23,7 @@
CREATE_LOGGER(TriaxialCompressionEngine);
-TriaxialCompressionEngine::TriaxialCompressionEngine() : actionForce(new Force), uniaxialEpsilonCurr(strain[1])
+TriaxialCompressionEngine::TriaxialCompressionEngine() : uniaxialEpsilonCurr(strain[1])
{
translationAxis=TriaxialStressController::normal[wall_bottom_id];
translationAxisx=Vector3r(1,0,0);
Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -17,7 +17,6 @@
-class PhysicalAction;
@@ -51,7 +50,6 @@
class TriaxialCompressionEngine : public TriaxialStressController
{
private :
- shared_ptr<PhysicalAction> actionForce;
std::string Phase1End;//used to name output files based on current state
public :
Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialStateRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialStateRecorder.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialStateRecorder.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -12,7 +12,6 @@
//#include <yade/pkg-common/RigidBodyParameters.hpp>
#include <yade/pkg-common/ParticleParameters.hpp>
//#include <yade/pkg-dem/BodyMacroParameters.hpp>
-//#include <yade/pkg-common/Force.hpp>
//#include <yade/pkg-dem/ElasticContactLaw.hpp>
//#include <yade/pkg-dem/TriaxialStressController.hpp>
#include <yade/pkg-dem/TriaxialCompressionEngine.hpp>
Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialStateRecorder.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialStateRecorder.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialStateRecorder.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -24,13 +24,11 @@
*/
-class PhysicalAction;
class TriaxialCompressionEngine;
class TriaxialStateRecorder : public DataRecorder
{
private :
- //shared_ptr<PhysicalAction> actionForce; // ???
shared_ptr<TriaxialCompressionEngine> triaxialCompressionEngine;
std::ofstream ofile;
Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -12,7 +12,6 @@
#include<yade/pkg-common/InteractingBox.hpp>
#include<yade/pkg-dem/SpheresContactGeometry.hpp>
#include<yade/pkg-dem/ElasticContactInteraction.hpp>
-#include<yade/pkg-common/Force.hpp>
#include<yade/pkg-common/RigidBodyParameters.hpp>
@@ -24,9 +23,6 @@
TriaxialStressController::TriaxialStressController(): wall_bottom_id(wall_id[0]), wall_top_id(wall_id[1]), wall_left_id(wall_id[2]), wall_right_id(wall_id[3]), wall_front_id(wall_id[4]), wall_back_id(wall_id[5])
{
- //StiffnessMatrixClassIndex = actionParameterStiffnessMatrix->getClassIndex();
- shared_ptr<Force> tmpF(new Force);
- ForceClassIndex=tmpF->getClassIndex();
firstRun = true;
previousStress = 0;
@@ -197,10 +193,9 @@
void TriaxialStressController::applyCondition(MetaBody* ncb)
{
//cerr << "TriaxialStressController::applyCondition" << endl;
- #ifdef BEX_CONTAINER
- // sync thread storage of BexContainer
- ncb->bex.sync();
- #endif
+
+ // sync thread storage of BexContainer
+ ncb->bex.sync();
shared_ptr<BodyContainer>& bodies = ncb->bodies;
@@ -382,9 +377,7 @@
*/
Real TriaxialStressController::ComputeUnbalancedForce(MetaBody * ncb, bool maxUnbalanced)
{
- #ifdef BEX_CONTAINER
- ncb->bex.sync();
- #endif
+ ncb->bex.sync();
//compute the mean contact force
Real MeanForce = 0.f;
long nForce = 0;
@@ -406,7 +399,6 @@
}
if (nForce!=0) MeanForce /= nForce;
-// int actionForceIndex = actionForce->getClassIndex();
if (!maxUnbalanced) {
//compute mean Unbalanced Force
Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -11,11 +11,9 @@
#include<yade/core/DeusExMachina.hpp>
#include<yade/core/MetaBody.hpp>
#include<yade/lib-base/yadeWm3.hpp>
-#include<yade/pkg-common/Force.hpp>
#define TR {if (Omega::instance().getCurrentIteration()%100==0) TRACE; }
-class PhysicalAction;
class MetaBody;
class PhysicalParameters;
@@ -28,18 +26,9 @@
class TriaxialStressController : public DeusExMachina
{
private :
- //shared_ptr<PhysicalAction> actionParameterForce;
- //int cachedForceClassIndex;
- int ForceClassIndex;
Real previousStress, previousMultiplier; //previous mean stress and size multiplier
bool firstRun;
- inline const Vector3r getForce(MetaBody* rb, body_id_t id){
- #ifdef BEX_CONTAINER
- return rb->bex.getForce(id); // needs sync, which is done at the beginning of applyCondition
- #else
- return static_cast<Force*>(rb->physicalActions->find(id,ForceClassIndex).get())->force;
- #endif
- }
+ inline const Vector3r getForce(MetaBody* rb, body_id_t id){ return rb->bex.getForce(id); /* needs sync, which is done at the beginning of applyCondition */ }
public :
@@ -111,7 +100,6 @@
protected :
virtual void registerAttributes();
- NEEDS_BEX("Force");
REGISTER_CLASS_NAME(TriaxialStressController);
REGISTER_BASE_CLASS_NAME(DeusExMachina);
};
Modified: trunk/pkg/dem/Engine/DeusExMachina/WallStressRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/WallStressRecorder.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/WallStressRecorder.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,7 +10,6 @@
#include <yade/pkg-common/RigidBodyParameters.hpp>
#include <yade/pkg-common/ParticleParameters.hpp>
#include <yade/pkg-dem/BodyMacroParameters.hpp>
-#include <yade/pkg-common/Force.hpp>
#include <yade/pkg-dem/ElasticContactLaw.hpp>
#include <yade/pkg-dem/SpheresContactGeometry.hpp>
@@ -21,7 +20,7 @@
#include <boost/lexical_cast.hpp>
-WallStressRecorder::WallStressRecorder () : DataRecorder(), actionForce(new Force)
+WallStressRecorder::WallStressRecorder () : DataRecorder()
{
outputFile = "";
@@ -91,16 +90,10 @@
/// calcul des contraintes via forces resultantes sur murs
Real SIG_wall_11 = 0, SIG_wall_22 = 0, SIG_wall_33 = 0;
- #ifdef BEX_CONTAINER
- ncb->bex.sync();
- Vector3r F_wall_11=ncb->bex.getForce(wall_left_id);
- Vector3r F_wall_22=ncb->bex.getForce(wall_top_id);
- Vector3r F_wall_33=ncb->bex.getForce(wall_front_id);
- #else
- Vector3r F_wall_11 = static_cast<Force*>( ncb->physicalActions->find(wall_left_id, actionForce->getClassIndex() ). get() )->force;
- Vector3r F_wall_22 = static_cast<Force*>( ncb->physicalActions->find(wall_top_id, actionForce->getClassIndex() ). get() )->force;
- Vector3r F_wall_33 = static_cast<Force*>( ncb->physicalActions->find(wall_front_id, actionForce->getClassIndex() ). get() )->force;
- #endif
+ ncb->bex.sync();
+ Vector3r F_wall_11=ncb->bex.getForce(wall_left_id);
+ Vector3r F_wall_22=ncb->bex.getForce(wall_top_id);
+ Vector3r F_wall_33=ncb->bex.getForce(wall_front_id);
SIG_wall_11 = F_wall_11[0]/(depth*height);
SIG_wall_22 = F_wall_22[1]/(depth*width);
Modified: trunk/pkg/dem/Engine/DeusExMachina/WallStressRecorder.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/WallStressRecorder.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/DeusExMachina/WallStressRecorder.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,12 +13,10 @@
#include <string>
#include <fstream>
-class PhysicalAction;
class WallStressRecorder : public DataRecorder
{
private :
- shared_ptr<PhysicalAction> actionForce; // ???
std::ofstream ofile;
bool changed;
@@ -41,7 +39,6 @@
protected :
virtual void postProcessAttributes(bool deserializing);
- NEEDS_BEX("Force");
REGISTER_CLASS_NAME(WallStressRecorder);
REGISTER_BASE_CLASS_NAME(DataRecorder);
};
Modified: trunk/pkg/dem/Engine/EngineUnit/ef2_Spheres_NormalShear_ElasticFrictionalLaw.hpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/ef2_Spheres_NormalShear_ElasticFrictionalLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/EngineUnit/ef2_Spheres_NormalShear_ElasticFrictionalLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -4,7 +4,6 @@
* Has only purely elastic normal and shear components. */
class ef2_Spheres_NormalShear_ElasticFrictionalLaw: public ConstitutiveLaw {
virtual void go(shared_ptr<InteractionGeometry>&, shared_ptr<InteractionPhysics>&, Interaction*, MetaBody*);
- NEEDS_BEX("Force","Momentum");
FUNCTOR2D(SpheresContactGeometry,NormalShearInteraction);
REGISTER_CLASS_AND_BASE(ef2_Spheres_NormalShear_ElasticFrictionalLaw,ConstitutiveLaw);
};
Modified: trunk/pkg/dem/Engine/EngineUnit/ef2_Spheres_Viscoelastic_SimpleViscoelasticContactLaw.hpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/ef2_Spheres_Viscoelastic_SimpleViscoelasticContactLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/EngineUnit/ef2_Spheres_Viscoelastic_SimpleViscoelasticContactLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -15,7 +15,6 @@
{
public :
virtual void go(shared_ptr<InteractionGeometry>&, shared_ptr<InteractionPhysics>&, Interaction*, MetaBody*);
- NEEDS_BEX("Force","Momentum");
FUNCTOR2D(SpheresContactGeometry,ViscoelasticInteraction);
REGISTER_CLASS_AND_BASE(ef2_Spheres_Viscoelastic_SimpleViscoelasticContactLaw,ConstitutiveLaw);
};
Modified: trunk/pkg/dem/Engine/StandAloneEngine/CapillaryCohesiveLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/CapillaryCohesiveLaw.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/CapillaryCohesiveLaw.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -18,9 +18,6 @@
#include <yade/pkg-dem/CapillaryParameters.hpp>
#include <yade/core/Omega.hpp>
#include <yade/core/MetaBody.hpp>
-#include <yade/pkg-common/Force.hpp>
-#include <yade/pkg-common/Momentum.hpp>
-#include <yade/core/PhysicalAction.hpp>
#include <Wm3Vector3.h>
#include <yade/lib-base/yadeWm3.hpp>
@@ -35,7 +32,7 @@
//int compteur1 = 0;
//int compteur2 = 0;
-CapillaryCohesiveLaw::CapillaryCohesiveLaw() : InteractionSolver() , actionForce(new Force) , actionMomentum(new Momentum)
+CapillaryCohesiveLaw::CapillaryCohesiveLaw() : InteractionSolver()
{
sdecGroupMask=1;
@@ -291,13 +288,8 @@
else if (currentContactPhysics->fusionNumber !=0)
currentContactPhysics->Fcap /= (currentContactPhysics->fusionNumber+1);
}
- #ifdef BEX_CONTAINER
- ncb->bex.addForce((*ii)->getId1(), currentContactPhysics->Fcap);
- ncb->bex.addForce((*ii)->getId2(),-currentContactPhysics->Fcap);
- #else
- static_cast<Force*> (ncb->physicalActions->find( (*ii)->getId1() , actionForce ->getClassIndex()).get())->force += currentContactPhysics->Fcap;
- static_cast<Force*> (ncb->physicalActions->find( (*ii)->getId2() , actionForce ->getClassIndex()).get())->force -= currentContactPhysics->Fcap;
- #endif
+ ncb->bex.addForce((*ii)->getId1(), currentContactPhysics->Fcap);
+ ncb->bex.addForce((*ii)->getId2(),-currentContactPhysics->Fcap);
//cerr << "id1/id2 " << (*ii)->getId1() << "/" << (*ii)->getId2() << " Fcap= " << currentContactPhysics->Fcap << endl;
Modified: trunk/pkg/dem/Engine/StandAloneEngine/CapillaryCohesiveLaw.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/CapillaryCohesiveLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/CapillaryCohesiveLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -42,7 +42,6 @@
const int NB_R_VALUES = 10;
-class PhysicalAction;
class capillarylaw; // fait appel a la classe def plus bas
class Interaction;
@@ -71,10 +70,6 @@
class CapillaryCohesiveLaw : public InteractionSolver
{
- private :
- shared_ptr<PhysicalAction> actionForce;
- shared_ptr<PhysicalAction> actionMomentum;
-
public :
int sdecGroupMask;
Real CapillaryPressure;
@@ -90,7 +85,6 @@
protected :
void registerAttributes();
virtual void postProcessAttributes(bool deserializing);
- NEEDS_BEX("Force","Momentum");
REGISTER_CLASS_NAME(CapillaryCohesiveLaw);
REGISTER_BASE_CLASS_NAME(InteractionSolver);
Modified: trunk/pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,15 +13,12 @@
#include<yade/pkg-dem/SDECLinkPhysics.hpp>
#include<yade/core/Omega.hpp>
#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-#include<yade/core/PhysicalAction.hpp>
Vector3r translation_vect (0.10,0,0);
-CohesiveFrictionalContactLaw::CohesiveFrictionalContactLaw() : InteractionSolver() , actionForce(new Force) , actionMomentum(new Momentum)
+CohesiveFrictionalContactLaw::CohesiveFrictionalContactLaw() : InteractionSolver()
{
sdecGroupMask=1;
momentRotationLaw = true;
@@ -255,17 +252,10 @@
// cerr << "shearForce " << shearForce << endl;
// cerr << "f= " << f << endl;
// it will be some macro( body->physicalActions, ActionType , bodyId )
- #ifdef BEX_CONTAINER
- ncb->bex.addForce (id1, f);
- ncb->bex.addForce (id2,-f);
- ncb->bex.addTorque(id1, c1x.Cross(f));
- ncb->bex.addTorque(id2,-c2x.Cross(f));
- #else
- static_cast<Force*> ( ncb->physicalActions->find( id1 , actionForce ->getClassIndex() ).get() )->force -= f;
- static_cast<Force*> ( ncb->physicalActions->find( id2 , actionForce ->getClassIndex() ).get() )->force += f;
- static_cast<Momentum*>( ncb->physicalActions->find( id1 , actionMomentum->getClassIndex() ).get() )->momentum -= c1x.Cross(f);
- static_cast<Momentum*>( ncb->physicalActions->find( id2 , actionMomentum->getClassIndex() ).get() )->momentum += c2x.Cross(f);
- #endif
+ ncb->bex.addForce (id1, f);
+ ncb->bex.addForce (id2,-f);
+ ncb->bex.addTorque(id1, c1x.Cross(f));
+ ncb->bex.addTorque(id2,-c2x.Cross(f));
///// /// Moment law ///
///// if(momentRotationLaw /*&& currentContactPhysics->cohesionBroken == false*/ )
@@ -364,13 +354,8 @@
Vector3r moment = moment_twist + moment_bending;
currentContactPhysics->moment_twist = moment_twist;
currentContactPhysics->moment_bending = moment_bending;
- #ifdef BEX_CONTAINER
- ncb->bex.addTorque(id1,-moment);
- ncb->bex.addTorque(id2, moment);
- #else
- static_cast<Momentum*>( ncb->physicalActions->find( id1 , actionMomentum->getClassIndex() ).get() )->momentum -= moment;
- static_cast<Momentum*>( ncb->physicalActions->find( id2 , actionMomentum->getClassIndex() ).get() )->momentum += moment;
- #endif
+ ncb->bex.addTorque(id1,-moment);
+ ncb->bex.addTorque(id2, moment);
}
/// Moment law END ///
Modified: trunk/pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,15 +13,10 @@
#include <set>
#include <boost/tuple/tuple.hpp>
-class PhysicalAction;
class CohesiveFrictionalContactLaw : public InteractionSolver
{
/// Attributes
- private :
- shared_ptr<PhysicalAction> actionForce;
- shared_ptr<PhysicalAction> actionMomentum;
-
public :
int sdecGroupMask;
bool momentRotationLaw, erosionActivated, detectBrokenBodies,always_use_moment_law;
@@ -34,7 +29,6 @@
protected :
void registerAttributes();
- NEEDS_BEX("Force","Momentum");
REGISTER_CLASS_NAME(CohesiveFrictionalContactLaw);
REGISTER_BASE_CLASS_NAME(InteractionSolver);
};
Modified: trunk/pkg/dem/Engine/StandAloneEngine/ContactLaw1.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ContactLaw1.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ContactLaw1.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,16 +13,13 @@
#include<yade/pkg-dem/SDECLinkPhysics.hpp>
#include<yade/core/Omega.hpp>
#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-#include<yade/core/PhysicalAction.hpp>
#include <yade/lib-miniWm3/Wm3Math.h>
Vector3r translation_vect (0.10,0,0);
-ContactLaw1::ContactLaw1() : InteractionSolver() , actionForce(new Force) , actionMomentum(new Momentum)
+ContactLaw1::ContactLaw1() : InteractionSolver()
{
sdecGroupMask=1;
momentRotationLaw = true;
@@ -214,17 +211,10 @@
// cerr << "shearForce " << shearForce << endl;
// cerr << "f= " << f << endl;
// it will be some macro( body->physicalActions, ActionType , bodyId )
- #ifdef BEX_CONTAINER
- ncb->bex.addForce (id1,-f);
- ncb->bex.addForce (id2,+f);
- ncb->bex.addTorque(id1,-c1x.Cross(f));
- ncb->bex.addTorque(id2, c2x.Cross(f));
- #else
- static_cast<Force*> ( ncb->physicalActions->find( id1 , actionForce ->getClassIndex() ).get() )->force -= f;
- static_cast<Force*> ( ncb->physicalActions->find( id2 , actionForce ->getClassIndex() ).get() )->force += f;
- static_cast<Momentum*>( ncb->physicalActions->find( id1 , actionMomentum->getClassIndex() ).get() )->momentum -= c1x.Cross(f);
- static_cast<Momentum*>( ncb->physicalActions->find( id2 , actionMomentum->getClassIndex() ).get() )->momentum += c2x.Cross(f);
- #endif
+ ncb->bex.addForce (id1,-f);
+ ncb->bex.addForce (id2,+f);
+ ncb->bex.addTorque(id1,-c1x.Cross(f));
+ ncb->bex.addTorque(id2, c2x.Cross(f));
///// /// Moment law ///
///// if(momentRotationLaw /*&& currentContactPhysics->cohesionBroken == false*/ )
@@ -313,13 +303,8 @@
nbreInteracMomPlastif++;
}
}
- #ifdef BEX_CONTAINER
- ncb->bex.addTorque(id1,-moment);
- ncb->bex.addTorque(id2,+moment);
- #else
- static_cast<Momentum*>( ncb->physicalActions->find( id1 , actionMomentum->getClassIndex() ).get() )->momentum -= moment;
- static_cast<Momentum*>( ncb->physicalActions->find( id2 , actionMomentum->getClassIndex() ).get() )->momentum += moment;
- #endif
+ ncb->bex.addTorque(id1,-moment);
+ ncb->bex.addTorque(id2,+moment);
}
/// Moment law END ///
Modified: trunk/pkg/dem/Engine/StandAloneEngine/ContactLaw1.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ContactLaw1.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ContactLaw1.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -26,15 +26,9 @@
*/
-class PhysicalAction;
-
class ContactLaw1 : public InteractionSolver
{
/// Attributes
- private :
- shared_ptr<PhysicalAction> actionForce;
- shared_ptr<PhysicalAction> actionMomentum;
-
public :
int sdecGroupMask;
Real coeff_dech; // = kn(unload) / kn(load)
Modified: trunk/pkg/dem/Engine/StandAloneEngine/ElasticCohesiveLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ElasticCohesiveLaw.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ElasticCohesiveLaw.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -16,15 +16,12 @@
#include<yade/core/Omega.hpp>
#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-#include<yade/core/PhysicalAction.hpp>
#include<yade/lib-base/yadeWm3Extra.hpp>
-ElasticCohesiveLaw::ElasticCohesiveLaw() : InteractionSolver() , actionForce(new Force) , actionMomentum(new Momentum)
+ElasticCohesiveLaw::ElasticCohesiveLaw() : InteractionSolver()
{
sdecGroupMask=1;
first=true;
@@ -113,17 +110,10 @@
currentContactPhysics->shearForce -= currentContactPhysics->ks*shearDisplacement;
Vector3r f = currentContactPhysics->normalForce + currentContactPhysics->shearForce;
- #ifdef BEX_CONTAINER
- ncb->bex.addForce (id1,-f);
- ncb->bex.addForce (id2,+f);
- ncb->bex.addTorque(id1,-c1x.Cross(f));
- ncb->bex.addTorque(id2, c2x.Cross(f));
- #else
- static_cast<Force*> ( ncb->physicalActions->find( id1 , actionForce ->getClassIndex() ).get() )->force -= f;
- static_cast<Force*> ( ncb->physicalActions->find( id2 , actionForce ->getClassIndex() ).get() )->force += f;
- static_cast<Momentum*>( ncb->physicalActions->find( id1 , actionMomentum->getClassIndex() ).get() )->momentum -= c1x.Cross(f);
- static_cast<Momentum*>( ncb->physicalActions->find( id2 , actionMomentum->getClassIndex() ).get() )->momentum += c2x.Cross(f);
- #endif
+ ncb->bex.addForce (id1,-f);
+ ncb->bex.addForce (id2,+f);
+ ncb->bex.addTorque(id1,-c1x.Cross(f));
+ ncb->bex.addTorque(id2, c2x.Cross(f));
@@ -219,13 +209,8 @@
//if (normElastic<=normMPlastic)
//{
- #ifdef BEX_CONTAINER
- ncb->bex.addTorque(id1,-q_n_i*mElastic);
- ncb->bex.addTorque(id2, q_n_i*mElastic);
- #else
- static_cast<Momentum*>( ncb->physicalActions->find( id1 , actionMomentum->getClassIndex() ).get() )->momentum -= q_n_i*mElastic;
- static_cast<Momentum*>( ncb->physicalActions->find( id2 , actionMomentum->getClassIndex() ).get() )->momentum += q_n_i*mElastic;
- #endif
+ ncb->bex.addTorque(id1,-q_n_i*mElastic);
+ ncb->bex.addTorque(id2, q_n_i*mElastic);
//}
//else
Modified: trunk/pkg/dem/Engine/StandAloneEngine/ElasticCohesiveLaw.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ElasticCohesiveLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ElasticCohesiveLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,14 +13,11 @@
#include <set>
#include <boost/tuple/tuple.hpp>
-class PhysicalAction;
class ElasticCohesiveLaw : public InteractionSolver
{
private :
bool first; // FIXME - remove that!
- shared_ptr<PhysicalAction> actionForce;
- shared_ptr<PhysicalAction> actionMomentum;
public :
int sdecGroupMask;
Modified: trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,9 +13,6 @@
#include<yade/pkg-dem/SDECLinkPhysics.hpp>
#include<yade/core/Omega.hpp>
#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-#include<yade/core/PhysicalAction.hpp>
#include<yade/extra/Shop.hpp>
@@ -46,15 +43,8 @@
Shop::applyForceAtContactPoint(force,contGeom->contactPoint,i->getId1(),contGeom->pos1,i->getId2(),contGeom->pos2,rb);
Vector3r bendAbs; Real torsionAbs; contGeom->bendingTorsionAbs(bendAbs,torsionAbs);
- #ifdef BEX_CONTAINER
- rb->bex.addTorque(i->getId1(), contGeom->normal*torsionAbs*ktor+bendAbs*kb);
- rb->bex.addTorque(i->getId2(),-contGeom->normal*torsionAbs*ktor-bendAbs*kb);
- #else
- Shop::Bex::momentum(i->getId1(),rb)+=contGeom->normal*torsionAbs*ktor;
- Shop::Bex::momentum(i->getId2(),rb)-=contGeom->normal*torsionAbs*ktor;
- Shop::Bex::momentum(i->getId1(),rb)+=bendAbs*kb;
- Shop::Bex::momentum(i->getId2(),rb)-=bendAbs*kb;
- #endif
+ rb->bex.addTorque(i->getId1(), contGeom->normal*torsionAbs*ktor+bendAbs*kb);
+ rb->bex.addTorque(i->getId2(),-contGeom->normal*torsionAbs*ktor-bendAbs*kb);
}
}
@@ -62,16 +52,9 @@
ElasticContactLaw::ElasticContactLaw() : InteractionSolver()
-#ifndef BEX_CONTAINER
- , actionForce(new Force) , actionMomentum(new Momentum)
-#endif
{
sdecGroupMask=1;
momentRotationLaw = true;
- #ifndef BEX_CONTAINER
- actionForceIndex = actionForce->getClassIndex();
- actionMomentumIndex = actionMomentum->getClassIndex();
- #endif
#ifdef SCG_SHEAR
useShear=false;
#endif
@@ -94,9 +77,6 @@
if(!functor) functor=shared_ptr<ef2_Spheres_Elastic_ElasticLaw>(new ef2_Spheres_Elastic_ElasticLaw);
functor->momentRotationLaw=momentRotationLaw;
functor->sdecGroupMask=sdecGroupMask;
- #ifndef BEX_CONTAINER
- functor->actionForceIndex=actionForceIndex; functor->actionMomentumIndex=actionMomentumIndex;
- #endif
#ifdef SCG_SHEAR
functor->useShear=useShear;
#endif
@@ -158,17 +138,10 @@
Vector3r f=currentContactPhysics->normalForce + shearForce;
Vector3r _c1x(currentContactGeometry->contactPoint-de1->se3.position),
_c2x(currentContactGeometry->contactPoint-de2->se3.position);
- #ifdef BEX_CONTAINER
- ncb->bex.addForce (id1,-f);
- ncb->bex.addForce (id2,+f);
- ncb->bex.addTorque(id1,-_c1x.Cross(f));
- ncb->bex.addTorque(id2, _c2x.Cross(f));
- #else
- static_cast<Force*> ( ncb->physicalActions->find( id1 , actionForceIndex).get() )->force -= f;
- static_cast<Force*> ( ncb->physicalActions->find( id2 , actionForceIndex ).get() )->force += f;
- static_cast<Momentum*>( ncb->physicalActions->find( id1 , actionMomentumIndex ).get() )->momentum -= _c1x.Cross(f);
- static_cast<Momentum*>( ncb->physicalActions->find( id2 , actionMomentumIndex ).get() )->momentum += _c2x.Cross(f);
- #endif
+ ncb->bex.addForce (id1,-f);
+ ncb->bex.addForce (id2,+f);
+ ncb->bex.addTorque(id1,-_c1x.Cross(f));
+ ncb->bex.addTorque(id2, _c2x.Cross(f));
currentContactPhysics->prevNormal = currentContactGeometry->normal;
}
Modified: trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -9,7 +9,6 @@
#pragma once
#include<yade/core/InteractionSolver.hpp>
-#include<yade/core/PhysicalAction.hpp>
// only to see whether SCG_SHEAR is defined, may be removed in the future
#include<yade/pkg-dem/SpheresContactGeometry.hpp>
@@ -18,7 +17,6 @@
#include <set>
#include <boost/tuple/tuple.hpp>
-class PhysicalAction;
class ElasticContactLaw2: public InteractionSolver{
public:
@@ -31,7 +29,6 @@
InteractionSolver::registerAttributes();
REGISTER_ATTRIBUTE(isCohesive);
}
- NEEDS_BEX("Force","Momentum");
REGISTER_CLASS_NAME(ElasticContactLaw2);
REGISTER_BASE_CLASS_NAME(InteractionSolver);
};
@@ -42,9 +39,6 @@
virtual void go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, MetaBody* rootBody);
int sdecGroupMask;
bool momentRotationLaw;
- #ifndef BEX_CONTAINER
- int actionForceIndex,actionMomentumIndex;
- #endif
#ifdef SCG_SHEAR
bool useShear;
#endif
@@ -67,14 +61,6 @@
{
/// Attributes
private :
- #ifndef BEX_CONTAINER
- shared_ptr<PhysicalAction> actionForce;
- shared_ptr<PhysicalAction> actionMomentum;
- int actionForceIndex;
- int actionMomentumIndex;
- NEEDS_BEX("Force","Momentum");
- #endif
-
public :
int sdecGroupMask;
bool momentRotationLaw;
Modified: trunk/pkg/dem/Engine/StandAloneEngine/ForceRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ForceRecorder.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ForceRecorder.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -12,13 +12,12 @@
#include<yade/pkg-common/RigidBodyParameters.hpp>
#include<yade/core/Omega.hpp>
#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
#include<boost/lexical_cast.hpp>
#include<boost/filesystem/operations.hpp>
CREATE_LOGGER(ForceRecorder);
-ForceRecorder::ForceRecorder () : DataRecorder(), actionForce(new Force)
+ForceRecorder::ForceRecorder () : DataRecorder()
{
outputFile = "";
interval = 50;
@@ -69,9 +68,7 @@
void ForceRecorder::action(MetaBody * ncb)
{
if (first) init();
- #ifdef BEX_CONTAINER
- ncb->bex.sync();
- #endif
+ ncb->bex.sync();
Real x=0, y=0, z=0;
@@ -79,11 +76,7 @@
{
if(ncb->bodies->exists(i))
{
- #ifdef BEX_CONTAINER
- Vector3r force=ncb->bex.getForce(i);
- #else
- Vector3r force = YADE_CAST<Force*>(ncb->physicalActions->find( i , actionForce->getClassIndex() ) . get() )->force;
- #endif
+ Vector3r force=ncb->bex.getForce(i);
x+=force[0];
y+=force[1];
Modified: trunk/pkg/dem/Engine/StandAloneEngine/ForceRecorder.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ForceRecorder.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ForceRecorder.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,12 +13,10 @@
#include <string>
#include <fstream>
-class PhysicalAction;
class ForceRecorder : public DataRecorder
{
private :
- shared_ptr<PhysicalAction> actionForce;
std::ofstream ofile;
bool changed;
@@ -40,7 +38,6 @@
virtual void postProcessAttributes(bool deserializing);
void init();
DECLARE_LOGGER;
- NEEDS_BEX("Force");
REGISTER_CLASS_NAME(ForceRecorder);
REGISTER_BASE_CLASS_NAME(DataRecorder);
};
Modified: trunk/pkg/dem/Engine/StandAloneEngine/GeometricalModelForceColorizer.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/GeometricalModelForceColorizer.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/GeometricalModelForceColorizer.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,13 +10,12 @@
#include<yade/pkg-common/RigidBodyParameters.hpp>
#include<yade/core/Omega.hpp>
#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
#include <boost/lexical_cast.hpp>
#include<yade/lib-base/yadeWm3Extra.hpp>
//#include <Wm3Vector3r.hpp>
-GeometricalModelForceColorizer::GeometricalModelForceColorizer () : StandAloneEngine(), actionForce(new Force)
+GeometricalModelForceColorizer::GeometricalModelForceColorizer () : StandAloneEngine()
{
}
@@ -31,9 +30,7 @@
void GeometricalModelForceColorizer::action(MetaBody * ncb)
{
// FIXME the same in GLDrawLatticeBeamState.cpp
- #ifdef BEX_CONTAINER
- ncb->bex.sync();
- #endif
+ ncb->bex.sync();
BodyContainer* bodies = ncb->bodies.get();
@@ -47,11 +44,7 @@
if(body->isDynamic)
{
unsigned int i = body -> getId();
- #ifdef BEX_CONTAINER
- Vector3r force=ncb->bex.getForce(i);
- #else
- Vector3r force = YADE_CAST<Force*>(ncb->physicalActions->find( i , actionForce->getClassIndex() ) . get() )->force;
- #endif
+ Vector3r force=ncb->bex.getForce(i);
min = std::min( force[0] , std::min( force[1] , std::min( force[2], min ) ) );
max = std::max( force[0] , std::max( force[1] , std::max( force[2], max ) ) );
}
@@ -67,11 +60,7 @@
{
GeometricalModel* gm = body->geometricalModel.get();
unsigned int i = body -> getId();
- #ifdef BEX_CONTAINER
- Vector3r force=ncb->bex.getForce(i);
- #else
- Vector3r force = YADE_CAST<Force*>(ncb->physicalActions->find( i , actionForce->getClassIndex() ) . get() )->force;
- #endif
+ Vector3r force=ncb->bex.getForce(i);
gm->diffuseColor[0] = (force[2]-min)/(max-min);
gm->diffuseColor[1] = (force[2]-min)/(max-min);
Modified: trunk/pkg/dem/Engine/StandAloneEngine/GeometricalModelForceColorizer.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/GeometricalModelForceColorizer.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/GeometricalModelForceColorizer.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,20 +10,14 @@
#include<yade/core/StandAloneEngine.hpp>
-class PhysicalAction;
-
class GeometricalModelForceColorizer : public StandAloneEngine
{
- private :
- shared_ptr<PhysicalAction> actionForce;
-
public :
GeometricalModelForceColorizer ();
virtual void action(MetaBody*);
virtual bool isActivated();
- NEEDS_BEX("Force");
REGISTER_CLASS_NAME(GeometricalModelForceColorizer);
REGISTER_BASE_CLASS_NAME(StandAloneEngine);
};
Deleted: trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessCounter.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessCounter.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessCounter.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,114 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2006 by Bruno Chareyre *
-* bruno.chareyre@xxxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#include<yade/pkg-dem/SpheresContactGeometry.hpp>
-#include<yade/pkg-common/NormalShearInteractions.hpp>
-#include<yade/pkg-dem/ElasticContactInteraction.hpp>
-#include<yade/core/Omega.hpp>
-#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-#include<yade/core/PhysicalAction.hpp>
-#include<yade/pkg-dem/GlobalStiffness.hpp>
-#include"GlobalStiffnessCounter.hpp"
-
-GlobalStiffnessCounter::GlobalStiffnessCounter() : InteractionSolver()
-{
- interval=100;
- //sdecGroupMask=1;
- actionForceIndex=shared_ptr<Force>(new Force)->getClassIndex();
- actionMomentumIndex=shared_ptr<Momentum>(new Momentum)->getClassIndex();
- actionStiffnessIndex=shared_ptr<GlobalStiffness>(new GlobalStiffness)->getClassIndex();
-}
-
-
-void GlobalStiffnessCounter::registerAttributes()
-{
- InteractionSolver::registerAttributes();
- REGISTER_ATTRIBUTE(interval);
- //REGISTER_ATTRIBUTE(sdecGroupMask);
-}
-
-bool GlobalStiffnessCounter::isActivated()
-{
- return ((Omega::instance().getCurrentIteration() % interval == 0) || (Omega::instance().getCurrentIteration() < (long int) 2));
-}
-
-#if 0
-bool GlobalStiffnessCounter::getSphericalElasticInteractionParameters(const shared_ptr<Interaction>& contact, Vector3r& normal, Real& kn, Real& ks, Real& radius1, Real& radius2){
- shared_ptr<SpheresContactGeometry> currentContactGeometry=YADE_PTR_CAST<SpheresContactGeometry>(contact->interactionGeometry);
- shared_ptr<ElasticContactInteraction> currentContactPhysics=YADE_PTR_CAST<ElasticContactInteraction>(contact->interactionPhysics);
-
- Real fn=currentContactPhysics->normalForce.SquaredLength();
- if(fn==0) return false;//This test means : is something happening at this contact : no question about numerical error
- normal=currentContactGeometry->normal;
- radius1=currentContactGeometry->radius1; radius2=currentContactGeometry->radius2;
- kn=currentContactPhysics->kn; ks=currentContactPhysics->ks;
- return true;
-}
-#endif
-
-void GlobalStiffnessCounter::traverseInteractions(MetaBody* ncb, const shared_ptr<InteractionContainer>& interactions){
- #ifdef BEX_CONTAINER
- return;
- #else
- FOREACH(const shared_ptr<Interaction>& contact, *interactions){
- if(!contact->isReal) continue;
-
- SpheresContactGeometry* geom=YADE_CAST<SpheresContactGeometry*>(contact->interactionGeometry.get()); assert(geom);
- NormalShearInteraction* phys=YADE_CAST<NormalShearInteraction*>(contact->interactionPhysics.get()); assert(phys);
- // all we need for getting stiffness
- Vector3r& normal=geom->normal; Real& kn=phys->kn; Real& ks=phys->ks; Real& radius1=geom->radius1; Real& radius2=geom->radius2;
- // FIXME? NormalShearInteraction knows nothing about whether the contact is "active" (force!=0) or not;
- // former code: if(force==0) continue; /* disregard this interaction, it is not active */.
- // It seems though that in such case either the interaction is accidentally at perfect equilibrium (unlikely)
- // or it should have been deleted already. Right?
- //ANSWER : some interactions can exist without fn, e.g. distant capillary force, wich does not contribute to the overall stiffness via kn. The test is needed.
- Real fn = (static_cast<ElasticContactInteraction *> (contact->interactionPhysics.get()))->normalForce.SquaredLength();
-
- if (fn!=0) {
-
- //Diagonal terms of the translational stiffness matrix
- Vector3r diag_stiffness = Vector3r(std::pow(normal.X(),2),std::pow(normal.Y(),2),std::pow(normal.Z(),2));
- diag_stiffness *= kn-ks;
- diag_stiffness = diag_stiffness + Vector3r(1,1,1)*ks;
-
- //diagonal terms of the rotational stiffness matrix
- // Vector3r branch1 = currentContactGeometry->normal*currentContactGeometry->radius1;
- // Vector3r branch2 = currentContactGeometry->normal*currentContactGeometry->radius2;
- Vector3r diag_Rstiffness =
- Vector3r(std::pow(normal.Y(),2)+std::pow(normal.Z(),2),
- std::pow(normal.X(),2)+std::pow(normal.Z(),2),
- std::pow(normal.X(),2)+std::pow(normal.Y(),2));
- diag_Rstiffness *= ks;
- //cerr << "diag_Rstifness=" << diag_Rstiffness << endl;
-
- PhysicalAction* st = ncb->physicalActions->find(contact->getId1(),actionStiffnessIndex).get();
- GlobalStiffness* s = static_cast<GlobalStiffness*>(st);
- s->stiffness += diag_stiffness;
- s->Rstiffness += diag_Rstiffness*pow(radius1,2);
- st = ncb->physicalActions->find(contact->getId2(),actionStiffnessIndex).get();
- s = static_cast<GlobalStiffness*>(st);
- s->stiffness += diag_stiffness;
- s->Rstiffness += diag_Rstiffness*pow(radius2,2);
-
- }
- }
- #endif
-}
-
-void GlobalStiffnessCounter::action(MetaBody* ncb)
-{
- // transient Links
- traverseInteractions(ncb,ncb->transientInteractions);
- // ignore pesistent links, unused and deprecated
-}
-
-
-
-YADE_PLUGIN();
Deleted: trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessCounter.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessCounter.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessCounter.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -1,50 +0,0 @@
-/*************************************************************************
-* Copyright (C) 2006 by Bruno Chareyre *
-* bruno.chareyre@xxxxxxxxxxx *
-* *
-* This program is free software; it is licensed under the terms of the *
-* GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#pragma once
-
-#include<yade/core/InteractionSolver.hpp>
-
-#include <set>
-#include <boost/tuple/tuple.hpp>
-
-class PhysicalAction;
-
-
-class GlobalStiffnessCounter : public InteractionSolver
-{
-/// Attributes
- private :
- int actionForceIndex;
- int actionMomentumIndex;
- int actionStiffnessIndex;
-
- bool getInteractionParameters(const shared_ptr<Interaction>& contact, Vector3r& normal, Real& kn, Real& ks, Real& radius1, Real& radius2);
- bool getSphericalElasticInteractionParameters(const shared_ptr<Interaction>& contact, Vector3r& normal, Real& kn, Real& ks, Real& radius1, Real& radius2);
- void traverseInteractions(MetaBody* ncb, const shared_ptr<InteractionContainer>& interactions);
-
- public :
- unsigned int interval;
- //int sdecGroupMask;
-
- GlobalStiffnessCounter();
- void action(MetaBody*);
- virtual bool isActivated();
-
- protected :
- void registerAttributes();
- NEEDS_BEX("Force","Momentum","GlobalStiffness");
- REGISTER_CLASS_NAME(GlobalStiffnessCounter);
- REGISTER_BASE_CLASS_NAME(InteractionSolver);
-};
-
-REGISTER_SERIALIZABLE(GlobalStiffnessCounter);
-
-
-
-
Modified: trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessTimeStepper.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessTimeStepper.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessTimeStepper.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -14,15 +14,13 @@
#include<yade/core/Interaction.hpp>
#include<yade/core/MetaBody.hpp>
#include<yade/pkg-common/Sphere.hpp>
-#include<yade/pkg-dem/GlobalStiffness.hpp>
CREATE_LOGGER(GlobalStiffnessTimeStepper);
YADE_PLUGIN("GlobalStiffnessTimeStepper");
-GlobalStiffnessTimeStepper::GlobalStiffnessTimeStepper() : TimeStepper() , sdecContactModel(new MacroMicroElasticRelationships), actionParameterGlobalStiffness(new GlobalStiffness)
+GlobalStiffnessTimeStepper::GlobalStiffnessTimeStepper() : TimeStepper() , sdecContactModel(new MacroMicroElasticRelationships)
{
//cerr << "GlobalStiffnessTimeStepper()" << endl;
- globalStiffnessClassIndex = actionParameterGlobalStiffness->getClassIndex();
sdecGroupMask = 1;
timestepSafetyCoefficient = 0.8;
computedOnce = false;
@@ -55,15 +53,9 @@
// Sphere* sphere = static_cast<Sphere*>(body->geometricalModel.get());
- #ifdef BEX_CONTAINER
- Vector3r& stiffness= stiffnesses[body->getId()];
- Vector3r& Rstiffness=Rstiffnesses[body->getId()];
- #else
- Vector3r& stiffness = (static_cast<GlobalStiffness*>( ncb->physicalActions->find (body->getId(), globalStiffnessClassIndex).get()))->stiffness;
- Vector3r& Rstiffness = (static_cast<GlobalStiffness*>( ncb->physicalActions->find (body->getId(), globalStiffnessClassIndex).get()))->Rstiffness;
- #endif
+ Vector3r& stiffness= stiffnesses[body->getId()];
+ Vector3r& Rstiffness=Rstiffnesses[body->getId()];
- //cerr << "Vector3r& stiffness = (static_cast<GlobalStiffness*>( ncb" << endl;
if(! ( /* sphere && */ sdec && stiffness) )
return; // not possible to compute!
//cerr << "return; // not possible to compute!" << endl;
@@ -137,11 +129,8 @@
void GlobalStiffnessTimeStepper::computeTimeStep(MetaBody* ncb)
{
+ computeStiffnesses(ncb);
- #ifdef BEX_CONTAINER
- computeStiffnesses(ncb);
- #endif
-
shared_ptr<BodyContainer>& bodies = ncb->bodies;
// shared_ptr<InteractionContainer>& transientInteractions = ncb->transientInteractions;
@@ -189,53 +178,50 @@
string(", BUT timestep is ")+lexical_cast<string>(Omega::instance().getTimeStep()))<<".");
}
-#ifdef BEX_CONTAINER
- void GlobalStiffnessTimeStepper::computeStiffnesses(MetaBody* rb){
- /* check size */
- size_t size=stiffnesses.size();
- if(size<rb->bodies->size()){
- size=rb->bodies->size();
- stiffnesses.resize(size); Rstiffnesses.resize(size);
- }
- /* reset stored values */
- memset(stiffnesses[0], 0,sizeof(Vector3r)*size);
- memset(Rstiffnesses[0],0,sizeof(Vector3r)*size);
- /* loop copied verbatim from GlobalStiffnessCounter */
- FOREACH(const shared_ptr<Interaction>& contact, *rb->interactions){
- if(!contact->isReal) continue;
+void GlobalStiffnessTimeStepper::computeStiffnesses(MetaBody* rb){
+ /* check size */
+ size_t size=stiffnesses.size();
+ if(size<rb->bodies->size()){
+ size=rb->bodies->size();
+ stiffnesses.resize(size); Rstiffnesses.resize(size);
+ }
+ /* reset stored values */
+ memset(stiffnesses[0], 0,sizeof(Vector3r)*size);
+ memset(Rstiffnesses[0],0,sizeof(Vector3r)*size);
+ FOREACH(const shared_ptr<Interaction>& contact, *rb->interactions){
+ if(!contact->isReal) continue;
- SpheresContactGeometry* geom=YADE_CAST<SpheresContactGeometry*>(contact->interactionGeometry.get()); assert(geom);
- NormalShearInteraction* phys=YADE_CAST<NormalShearInteraction*>(contact->interactionPhysics.get()); assert(phys);
- // all we need for getting stiffness
- Vector3r& normal=geom->normal; Real& kn=phys->kn; Real& ks=phys->ks; Real& radius1=geom->radius1; Real& radius2=geom->radius2;
- // FIXME? NormalShearInteraction knows nothing about whether the contact is "active" (force!=0) or not;
- // former code: if(force==0) continue; /* disregard this interaction, it is not active */.
- // It seems though that in such case either the interaction is accidentally at perfect equilibrium (unlikely)
- // or it should have been deleted already. Right?
- //ANSWER : some interactions can exist without fn, e.g. distant capillary force, wich does not contribute to the overall stiffness via kn. The test is needed.
- Real fn = (static_cast<NormalShearInteraction *> (contact->interactionPhysics.get()))->normalForce.SquaredLength();
+ SpheresContactGeometry* geom=YADE_CAST<SpheresContactGeometry*>(contact->interactionGeometry.get()); assert(geom);
+ NormalShearInteraction* phys=YADE_CAST<NormalShearInteraction*>(contact->interactionPhysics.get()); assert(phys);
+ // all we need for getting stiffness
+ Vector3r& normal=geom->normal; Real& kn=phys->kn; Real& ks=phys->ks; Real& radius1=geom->radius1; Real& radius2=geom->radius2;
+ // FIXME? NormalShearInteraction knows nothing about whether the contact is "active" (force!=0) or not;
+ // former code: if(force==0) continue; /* disregard this interaction, it is not active */.
+ // It seems though that in such case either the interaction is accidentally at perfect equilibrium (unlikely)
+ // or it should have been deleted already. Right?
+ //ANSWER : some interactions can exist without fn, e.g. distant capillary force, wich does not contribute to the overall stiffness via kn. The test is needed.
+ Real fn = (static_cast<NormalShearInteraction *> (contact->interactionPhysics.get()))->normalForce.SquaredLength();
- if (fn!=0) {
- //Diagonal terms of the translational stiffness matrix
- Vector3r diag_stiffness = Vector3r(std::pow(normal.X(),2),std::pow(normal.Y(),2),std::pow(normal.Z(),2));
- diag_stiffness *= kn-ks;
- diag_stiffness = diag_stiffness + Vector3r(1,1,1)*ks;
+ if (fn!=0) {
+ //Diagonal terms of the translational stiffness matrix
+ Vector3r diag_stiffness = Vector3r(std::pow(normal.X(),2),std::pow(normal.Y(),2),std::pow(normal.Z(),2));
+ diag_stiffness *= kn-ks;
+ diag_stiffness = diag_stiffness + Vector3r(1,1,1)*ks;
- //diagonal terms of the rotational stiffness matrix
- // Vector3r branch1 = currentContactGeometry->normal*currentContactGeometry->radius1;
- // Vector3r branch2 = currentContactGeometry->normal*currentContactGeometry->radius2;
- Vector3r diag_Rstiffness =
- Vector3r(std::pow(normal.Y(),2)+std::pow(normal.Z(),2),
- std::pow(normal.X(),2)+std::pow(normal.Z(),2),
- std::pow(normal.X(),2)+std::pow(normal.Y(),2));
- diag_Rstiffness *= ks;
- //cerr << "diag_Rstifness=" << diag_Rstiffness << endl;
-
- stiffnesses [contact->getId1()]+=diag_stiffness;
- Rstiffnesses[contact->getId1()]+=diag_Rstiffness*pow(radius1,2);
- stiffnesses [contact->getId2()]+=diag_stiffness;
- Rstiffnesses[contact->getId2()]+=diag_Rstiffness*pow(radius2,2);
- }
+ //diagonal terms of the rotational stiffness matrix
+ // Vector3r branch1 = currentContactGeometry->normal*currentContactGeometry->radius1;
+ // Vector3r branch2 = currentContactGeometry->normal*currentContactGeometry->radius2;
+ Vector3r diag_Rstiffness =
+ Vector3r(std::pow(normal.Y(),2)+std::pow(normal.Z(),2),
+ std::pow(normal.X(),2)+std::pow(normal.Z(),2),
+ std::pow(normal.X(),2)+std::pow(normal.Y(),2));
+ diag_Rstiffness *= ks;
+ //cerr << "diag_Rstifness=" << diag_Rstiffness << endl;
+
+ stiffnesses [contact->getId1()]+=diag_stiffness;
+ Rstiffnesses[contact->getId1()]+=diag_Rstiffness*pow(radius1,2);
+ stiffnesses [contact->getId2()]+=diag_stiffness;
+ Rstiffnesses[contact->getId2()]+=diag_Rstiffness*pow(radius2,2);
}
}
-#endif
+}
Modified: trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessTimeStepper.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessTimeStepper.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/GlobalStiffnessTimeStepper.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -21,23 +21,18 @@
class BodyContainer;
class MacroMicroElasticRelationships;
class MetaBody;
-class PhysicalAction;
class GlobalStiffnessTimeStepper : public TimeStepper
{
private :
- #ifdef BEX_CONTAINER
vector<Vector3r> stiffnesses;
vector<Vector3r> Rstiffnesses;
- void computeStiffnesses(MetaBody*); // what GlobalStiffnessCounter used to do
- #endif
+ void computeStiffnesses(MetaBody*);
Real newDt, previousDt;
bool computedSomething,
computedOnce;
shared_ptr<MacroMicroElasticRelationships> sdecContactModel;
- shared_ptr<PhysicalAction> actionParameterGlobalStiffness;
- int globalStiffnessClassIndex;
void findTimeStepFromBody(const shared_ptr<Body>& body, MetaBody * ncb);
void findTimeStepFromInteraction(const shared_ptr<Interaction>& , shared_ptr<BodyContainer>&);
@@ -60,7 +55,6 @@
protected :
virtual void registerAttributes();
- NEEDS_BEX("GlobalStiffness");
REGISTER_CLASS_NAME(GlobalStiffnessTimeStepper);
REGISTER_BASE_CLASS_NAME(TimeStepper);
};
Modified: trunk/pkg/dem/Engine/StandAloneEngine/MicroMacroAnalyser.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/MicroMacroAnalyser.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/MicroMacroAnalyser.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -14,9 +14,6 @@
#include<yade/core/Omega.hpp>
#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-#include<yade/core/PhysicalAction.hpp>
#include <yade/pkg-common/InteractingSphere.hpp>
@@ -29,10 +26,8 @@
CREATE_LOGGER(MicroMacroAnalyser);
-MicroMacroAnalyser::MicroMacroAnalyser() : StandAloneEngine() , actionForce(new Force) , actionMomentum(new Momentum)
+MicroMacroAnalyser::MicroMacroAnalyser() : StandAloneEngine()
{
- actionForceIndex = actionForce->getClassIndex();
- actionMomentumIndex = actionMomentum->getClassIndex();
analyser = shared_ptr<KinematicLocalisationAnalyser> (new KinematicLocalisationAnalyser);
analyser->SetConsecutive (true);
analyser->SetNO_ZERO_ID (false);
Modified: trunk/pkg/dem/Engine/StandAloneEngine/MicroMacroAnalyser.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/MicroMacroAnalyser.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/MicroMacroAnalyser.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -21,17 +21,12 @@
This class is using a separate library built from extra/triangulation sources
*/
-class PhysicalAction;
class KinematicLocalisationAnalyser;
class MicroMacroAnalyser : public StandAloneEngine
{
/// Attributes
private :
- shared_ptr<PhysicalAction> actionForce;
- shared_ptr<PhysicalAction> actionMomentum;
- int actionForceIndex;
- int actionMomentumIndex;
std::ofstream ofile;
shared_ptr<TriaxialCompressionEngine> triaxialCompressionEngine;
Modified: trunk/pkg/dem/Engine/StandAloneEngine/MyTetrahedronLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/MyTetrahedronLaw.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/MyTetrahedronLaw.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -12,12 +12,8 @@
#include<yade/pkg-common/NormalShearInteractions.hpp>
#include<yade/core/Omega.hpp>
#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-#include<yade/core/PhysicalAction.hpp>
-
-MyTetrahedronLaw::MyTetrahedronLaw() : InteractionSolver() , actionForce(new Force) , actionMomentum(new Momentum)
+MyTetrahedronLaw::MyTetrahedronLaw() : InteractionSolver()
{
}
@@ -73,17 +69,10 @@
Vector3r x = currentContactGeometry->contactPoints[i][j];
Vector3r c1x = (x - de1->se3.position);
Vector3r c2x = (x - de2->se3.position);
- #ifdef BEX_CONTAINER
- ncb->bex.addForce (id1,-force);
- ncb->bex.addForce (id2,+force);
- ncb->bex.addTorque(id1,-c1x.Cross(force));
- ncb->bex.addTorque(id2, c2x.Cross(force));
- #else
- static_cast<Force*> ( ncb->physicalActions->find( id1 , actionForce ->getClassIndex() ).get() )->force -= force;
- static_cast<Force*> ( ncb->physicalActions->find( id2 , actionForce ->getClassIndex() ).get() )->force += force;
- static_cast<Momentum*>( ncb->physicalActions->find( id1 , actionMomentum->getClassIndex() ).get() )->momentum -= c1x.Cross(force);
- static_cast<Momentum*>( ncb->physicalActions->find( id2 , actionMomentum->getClassIndex() ).get() )->momentum += c2x.Cross(force);
- #endif
+ ncb->bex.addForce (id1,-force);
+ ncb->bex.addForce (id2,+force);
+ ncb->bex.addTorque(id1,-c1x.Cross(force));
+ ncb->bex.addTorque(id2, c2x.Cross(force));
}
}
Modified: trunk/pkg/dem/Engine/StandAloneEngine/MyTetrahedronLaw.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/MyTetrahedronLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/MyTetrahedronLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -25,30 +25,14 @@
* tetrahedron's center on direction perpendicular to the acting force.
*/
-class PhysicalAction;
-
class MyTetrahedronLaw : public InteractionSolver
{
- private :
- /// those two are here only because this class needs to access
- /// the ID number of Force and Momentum
- ///
- /// those variables are actually not used to store a value of
- /// Force and Momentum, just to get ID, although normally they are
- /// used to store this value.
- ///
- /// I already have a better solution for that.
- ///
- shared_ptr<PhysicalAction> actionForce;
- shared_ptr<PhysicalAction> actionMomentum;
-
public :
MyTetrahedronLaw();
void action(MetaBody*);
protected :
void registerAttributes();
- NEEDS_BEX("Force","Momentum");
REGISTER_CLASS_NAME(MyTetrahedronLaw);
REGISTER_BASE_CLASS_NAME(InteractionSolver);
};
Modified: trunk/pkg/dem/Engine/StandAloneEngine/ViscousForceDamping.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ViscousForceDamping.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ViscousForceDamping.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -16,12 +16,8 @@
#include<yade/pkg-dem/SDECLinkPhysics.hpp>
#include<yade/core/Omega.hpp>
#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-#include<yade/core/PhysicalAction.hpp>
-
-ViscousForceDamping::ViscousForceDamping() : InteractionSolver() , actionForce(new Force) , actionMomentum(new Momentum), betaNormal(0.0), betaShear(0.0)
+ViscousForceDamping::ViscousForceDamping() : InteractionSolver() ,betaNormal(0.0), betaShear(0.0)
{
sdecGroupMask=1;
momentRotationLaw = true;
@@ -140,17 +136,10 @@
Vector3r viscousDampingForce = normalDampingForce + shearDampingForce;
// Add forces
- #ifdef BEX_CONTAINER
- ncb->bex.addForce (id1,-viscousDampingForce);
- ncb->bex.addForce (id2,+viscousDampingForce);
- ncb->bex.addTorque(id1,-c1x.Cross(viscousDampingForce));
- ncb->bex.addTorque(id2, c2x.Cross(viscousDampingForce));
- #else
- static_cast<Force*> ( ncb->physicalActions->find( id1 , actionForce ->getClassIndex() ).get() )->force -= viscousDampingForce;
- static_cast<Force*> ( ncb->physicalActions->find( id2 , actionForce ->getClassIndex() ).get() )->force += viscousDampingForce;
- static_cast<Momentum*>( ncb->physicalActions->find( id1 , actionMomentum->getClassIndex() ).get() )->momentum -= c1x.Cross(viscousDampingForce);
- static_cast<Momentum*>( ncb->physicalActions->find( id2 , actionMomentum->getClassIndex() ).get() )->momentum += c2x.Cross(viscousDampingForce);
- #endif
+ ncb->bex.addForce (id1,-viscousDampingForce);
+ ncb->bex.addForce (id2,+viscousDampingForce);
+ ncb->bex.addTorque(id1,-c1x.Cross(viscousDampingForce));
+ ncb->bex.addTorque(id2, c2x.Cross(viscousDampingForce));
currentContactPhysics->prevNormal = currentContactGeometry->normal;
}
}
Modified: trunk/pkg/dem/Engine/StandAloneEngine/ViscousForceDamping.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ViscousForceDamping.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ViscousForceDamping.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -16,15 +16,9 @@
#include <set>
#include <boost/tuple/tuple.hpp>
-class PhysicalAction;
-
class ViscousForceDamping : public InteractionSolver
{
/// Attributes
- private :
- shared_ptr<PhysicalAction> actionForce;
- shared_ptr<PhysicalAction> actionMomentum;
-
public :
Real betaNormal;
Modified: trunk/pkg/dem/Engine/StandAloneEngine/VolumicContactLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/VolumicContactLaw.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/VolumicContactLaw.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,11 +13,7 @@
#include<yade/pkg-dem/SDECLinkPhysics.hpp>
#include<yade/core/Omega.hpp>
#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-#include<yade/core/PhysicalAction.hpp>
-
#include <yade/pkg-common/InteractingSphere.hpp>
#include "VolumicContactLaw.hpp"
//#include<yade/extra/TesselationWrapper.h>
@@ -29,14 +25,11 @@
//../../YADE/trunk/examples/sphere_100_poly.txt
-VolumicContactLaw::VolumicContactLaw() : InteractionSolver() , actionForce(new Force) , actionMomentum(new Momentum)
+VolumicContactLaw::VolumicContactLaw() : InteractionSolver()
//, T1(new TesselationWrapper)
{
sdecGroupMask=1;
momentRotationLaw = true;
- actionForceIndex = actionForce->getClassIndex();
- actionMomentumIndex = actionMomentum->getClassIndex();
-
}
@@ -479,17 +472,10 @@
Vector3r f = currentContactPhysics->normalForce + shearForce;
- #ifdef BEX_CONTAINER
- ncb->bex.addForce (id1,-f);
- ncb->bex.addForce (id2,+f);
- ncb->bex.addTorque(id1,-c1x.Cross(f));
- ncb->bex.addTorque(id2, c2x.Cross(f));
- #else
- static_cast<Force*> ( ncb->physicalActions->find( id1 , actionForceIndex).get() )->force -= f;
- static_cast<Force*> ( ncb->physicalActions->find( id2 , actionForceIndex ).get() )->force += f;
- static_cast<Momentum*>( ncb->physicalActions->find( id1 , actionMomentumIndex ).get() )->momentum -= c1x.Cross(f);
- static_cast<Momentum*>( ncb->physicalActions->find( id2 , actionMomentumIndex ).get() )->momentum += c2x.Cross(f);
- #endif
+ ncb->bex.addForce (id1,-f);
+ ncb->bex.addForce (id2,+f);
+ ncb->bex.addTorque(id1,-c1x.Cross(f));
+ ncb->bex.addTorque(id2, c2x.Cross(f));
currentContactPhysics->prevNormal = currentContactGeometry->normal;
}
Modified: trunk/pkg/dem/Engine/StandAloneEngine/VolumicContactLaw.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/VolumicContactLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/Engine/StandAloneEngine/VolumicContactLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,17 +13,9 @@
#include <set>
#include <boost/tuple/tuple.hpp>
-class PhysicalAction;
-
class VolumicContactLaw : public InteractionSolver
{
/// Attributes
- private :
- shared_ptr<PhysicalAction> actionForce;
- shared_ptr<PhysicalAction> actionMomentum;
- int actionForceIndex;
- int actionMomentumIndex;
-
public :
int sdecGroupMask;
bool momentRotationLaw;
@@ -44,7 +36,6 @@
protected :
void registerAttributes();
- NEEDS_BEX("Force","Momentum");
REGISTER_CLASS_NAME(VolumicContactLaw);
REGISTER_BASE_CLASS_NAME(InteractionSolver);
};
Modified: trunk/pkg/dem/PreProcessor/CohesiveTriaxialTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/CohesiveTriaxialTest.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/CohesiveTriaxialTest.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -16,7 +16,6 @@
#include<yade/pkg-dem/CohesiveFrictionalRelationships.hpp>
#include<yade/pkg-dem/CohesiveFrictionalBodyParameters.hpp>
#include<yade/pkg-dem/SDECLinkPhysics.hpp>
-#include<yade/pkg-dem/GlobalStiffnessCounter.hpp>
#include<yade/pkg-dem/GlobalStiffnessTimeStepper.hpp>
#include<yade/pkg-dem/PositionOrientationRecorder.hpp>
@@ -54,14 +53,12 @@
#include<yade/pkg-common/InteractingSphere.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
#include<yade/pkg-common/InteractionHashMap.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/extra/Shop.hpp>
@@ -274,7 +271,6 @@
createBox(body,center,halfSize,wall_bottom_wire);
if(wall_bottom) {
rootBody->bodies->insert(body);
- //(resultantforceEngine->subscribedBodies).push_back(body->getId());
triaxialcompressionEngine->wall_bottom_id = body->getId();
//triaxialStateRecorder->wall_bottom_id = body->getId();
forcerec->startId = body->getId();
@@ -570,11 +566,6 @@
velocityRecorder-> outputFile = velocityRecordFile;
velocityRecorder-> interval = recordIntervalIter;
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
- //physicalActionInitializer->physicalActionNames.push_back("StiffnessMatrix");
- physicalActionInitializer->physicalActionNames.push_back("GlobalStiffness");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
shared_ptr<InteractionGeometryEngineUnit> s1(new InteractingSphere2InteractingSphere4SpheresContactGeometry);
@@ -638,10 +629,6 @@
//stiffnesscounter->sdecGroupMask = 2;
//stiffnesscounter->interval = timeStepUpdateInterval;
- shared_ptr<GlobalStiffnessCounter> globalStiffnessCounter(new GlobalStiffnessCounter);
- //globalStiffnessCounter->sdecGroupMask = 2;
- globalStiffnessCounter->interval = timeStepUpdateInterval;
-
// moving walls to regulate the stress applied + compress when the packing is dense an stable
//cerr << "triaxialcompressionEngine = shared_ptr<TriaxialCompressionEngine> (new TriaxialCompressionEngine);" << std::endl;
triaxialcompressionEngine = shared_ptr<TriaxialCompressionEngine> (new TriaxialCompressionEngine);
@@ -693,7 +680,6 @@
rootBody->engines.push_back(triaxialcompressionEngine);
//rootBody->engines.push_back(stiffnesscounter);
//rootBody->engines.push_back(stiffnessMatrixTimeStepper);
- rootBody->engines.push_back(globalStiffnessCounter);
rootBody->engines.push_back(globalStiffnessTimeStepper);
rootBody->engines.push_back(triaxialStateRecorder);
rootBody->engines.push_back(hydraulicForceEngine);//<-------------HYDRAULIC ENGINE HERE
@@ -702,7 +688,6 @@
rootBody->engines.push_back(positionIntegrator);
if(!rotationBlocked)
rootBody->engines.push_back(orientationIntegrator);
- //rootBody->engines.push_back(resultantforceEngine);
//rootBody->engines.push_back(triaxialstressController);
@@ -716,7 +701,6 @@
rootBody->engines.push_back(positionOrientationRecorder);}
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/DirectShearCis.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/DirectShearCis.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/DirectShearCis.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -39,7 +39,6 @@
#include<yade/pkg-common/MetaInteractingGeometry.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalActionDamper.hpp>
#include<yade/pkg-common/PhysicalActionApplier.hpp>
@@ -59,7 +58,6 @@
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include <boost/filesystem/convenience.hpp>
#include <utility>
@@ -313,9 +311,6 @@
shared_ptr<CinemDNCEngine> kinematic = shared_ptr<CinemDNCEngine>(new CinemDNCEngine);
kinematic->shearSpeed = shearSpeed;
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
@@ -375,7 +370,6 @@
rootBody->engines.push_back(possnap);
rootBody->engines.push_back(forcesnap);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/Funnel.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/Funnel.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/Funnel.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -26,7 +26,6 @@
#include<yade/pkg-common/MetaInteractingGeometry.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalActionDamper.hpp>
#include<yade/pkg-common/PhysicalActionApplier.hpp>
@@ -44,7 +43,6 @@
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
Funnel::Funnel () : FileGenerator()
@@ -265,9 +263,6 @@
void Funnel::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
@@ -322,7 +317,6 @@
rootBody->engines.push_back(orientationIntegrator);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/HydraulicTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/HydraulicTest.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/HydraulicTest.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -44,12 +44,10 @@
#include<yade/pkg-common/InteractingSphere.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/pkg-common/TranslationEngine.hpp>
Modified: trunk/pkg/dem/PreProcessor/MembraneTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/MembraneTest.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/MembraneTest.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -36,7 +36,6 @@
#include<yade/pkg-common/MetaInteractingGeometry.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalActionDamper.hpp>
#include<yade/pkg-common/PhysicalActionApplier.hpp>
@@ -56,7 +55,6 @@
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/pkg-dem/SimpleViscoelasticBodyParameters.hpp>
@@ -304,10 +302,6 @@
void MembraneTest::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
-
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2BssSweptSphereLineSegment4SpheresContactGeometry");
@@ -351,7 +345,6 @@
rootBody->engines.push_back(orientationIntegrator);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(interactingGeometryDispatcher);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/ModifiedTriaxialTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/ModifiedTriaxialTest.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/ModifiedTriaxialTest.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -16,7 +16,6 @@
#include<yade/pkg-dem/SimpleElasticRelationships.hpp>
#include<yade/pkg-dem/BodyMacroParameters.hpp>
#include<yade/pkg-dem/SDECLinkPhysics.hpp>
-#include<yade/pkg-dem/GlobalStiffnessCounter.hpp>
#include<yade/pkg-dem/GlobalStiffnessTimeStepper.hpp>
#include<yade/pkg-dem/PositionOrientationRecorder.hpp>
@@ -40,7 +39,6 @@
#include<yade/pkg-common/GravityEngines.hpp>
#include<yade/pkg-common/HydraulicForceEngine.hpp>
-#include<yade/pkg-common/MakeItFlat.hpp>
#include<yade/pkg-common/PhysicalActionApplier.hpp>
#include<yade/pkg-common/PhysicalActionDamper.hpp>
#include<yade/pkg-common/CundallNonViscousDamping.hpp>
@@ -53,14 +51,12 @@
#include<yade/pkg-common/InteractingSphere.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
#include<yade/pkg-common/InteractionHashMap.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include <boost/filesystem/convenience.hpp>
#include <boost/lexical_cast.hpp>
@@ -355,7 +351,6 @@
createBox(body,center,halfSize,wall_bottom_wire);
if(wall_bottom) {
rootBody->bodies->insert(body);
- //(resultantforceEngine->subscribedBodies).push_back(body->getId());
triaxialcompressionEngine->wall_bottom_id = body->getId();
wallStressRecorder->wall_bottom_id = body->getId();
forcerec->startId = body->getId();
@@ -571,12 +566,6 @@
velocityRecorder-> outputFile = velocityRecordFile;
velocityRecorder-> interval = recordIntervalIter;
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
- //physicalActionInitializer->physicalActionNames.push_back("StiffnessMatrix");
- physicalActionInitializer->physicalActionNames.push_back("GlobalStiffness");
-
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
interactionGeometryDispatcher->add("InteractingBox2InteractingSphere4SpheresContactGeometry");
@@ -631,9 +620,6 @@
//stiffnesscounter->sdecGroupMask = 2;
//stiffnesscounter->interval = timeStepUpdateInterval;
- shared_ptr<GlobalStiffnessCounter> globalStiffnessCounter(new GlobalStiffnessCounter);
- globalStiffnessCounter->sdecGroupMask = 2;
- globalStiffnessCounter->interval = timeStepUpdateInterval;
// moving walls to regulate the stress applied + compress when the packing is dense an stable
//cerr << "triaxialcompressionEngine = shared_ptr<TriaxialCompressionEngine> (new TriaxialCompressionEngine);" << std::endl;
@@ -681,23 +667,15 @@
rootBody->engines.push_back(triaxialcompressionEngine);
//rootBody->engines.push_back(stiffnesscounter);
//rootBody->engines.push_back(stiffnessMatrixTimeStepper);
- rootBody->engines.push_back(globalStiffnessCounter);
rootBody->engines.push_back(globalStiffnessTimeStepper);
rootBody->engines.push_back(wallStressRecorder);
rootBody->engines.push_back(gravityCondition);
// replaced by PhysicalParameters::blockedDOFs
- #if 0
- if(want_2d){
- shared_ptr<MakeItFlat> makeItFlat(new MakeItFlat);
- rootBody->engines.push_back(makeItFlat);
- }
- #endif
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(resultantforceEngine);
//rootBody->engines.push_back(triaxialstressController);
@@ -711,7 +689,6 @@
rootBody->engines.push_back(positionOrientationRecorder);}
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/SDECImpactTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/SDECImpactTest.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/SDECImpactTest.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -44,13 +44,11 @@
#include<yade/pkg-common/InteractingSphere.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include <boost/filesystem/convenience.hpp>
@@ -464,9 +462,6 @@
velocityRecorder-> outputFile = velocityRecordFile;
velocityRecorder-> interval = recordIntervalIter;
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
@@ -530,7 +525,6 @@
rootBody->engines.push_back(forcerec);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/SDECLinkedSpheres.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/SDECLinkedSpheres.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/SDECLinkedSpheres.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -48,12 +48,10 @@
#include<yade/pkg-common/InteractingSphere.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
SDECLinkedSpheres::SDECLinkedSpheres () : FileGenerator()
@@ -313,10 +311,6 @@
void SDECLinkedSpheres::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
-
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
interactionGeometryDispatcher->add("InteractingBox2InteractingSphere4SpheresContactGeometry");
@@ -378,7 +372,6 @@
rootBody->engines.push_back(orientationIntegrator);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/SDECMovingWall.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/SDECMovingWall.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/SDECMovingWall.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -29,7 +29,6 @@
#include<yade/pkg-common/MetaInteractingGeometry.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalActionDamper.hpp>
#include<yade/pkg-common/PhysicalActionApplier.hpp>
@@ -49,7 +48,6 @@
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
SDECMovingWall::SDECMovingWall () : FileGenerator()
@@ -348,10 +346,6 @@
void SDECMovingWall::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
-
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
interactionGeometryDispatcher->add("InteractingBox2InteractingSphere4SpheresContactGeometry");
@@ -417,7 +411,6 @@
rootBody->engines.push_back(kinematic);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/SDECSpheresPlane.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/SDECSpheresPlane.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/SDECSpheresPlane.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -30,7 +30,6 @@
#include<yade/pkg-common/MetaInteractingGeometry.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalActionDamper.hpp>
#include<yade/pkg-common/PhysicalActionApplier.hpp>
@@ -48,7 +47,6 @@
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
SDECSpheresPlane::SDECSpheresPlane () : FileGenerator()
@@ -318,9 +316,6 @@
void SDECSpheresPlane::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
@@ -379,7 +374,6 @@
//rootBody->engines.push_back(positionOrientationRecorder);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/STLImporterTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/STLImporterTest.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/STLImporterTest.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -26,10 +26,8 @@
#include<yade/pkg-common/MetaInteractingGeometry.hpp>
#include<yade/pkg-common/MetaInteractingGeometry2AABB.hpp>
#include<yade/pkg-common/PhysicalActionApplier.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
#include<yade/pkg-common/PhysicalActionDamper.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/Sphere.hpp>
#include<yade/pkg-dem/BodyMacroParameters.hpp>
@@ -223,9 +221,6 @@
void STLImporterTest::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
@@ -291,7 +286,6 @@
rootBody->engines.push_back(kinematic);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/SimpleShear.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/SimpleShear.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/SimpleShear.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -18,7 +18,6 @@
#include <yade/pkg-dem/CohesiveFrictionalBodyParameters.hpp>
#include <yade/pkg-dem/ContactLaw1.hpp>
#include <yade/pkg-dem/CL1Relationships.hpp>
-#include<yade/pkg-dem/GlobalStiffnessCounter.hpp>
#include<yade/pkg-dem/GlobalStiffnessTimeStepper.hpp>
#include <yade/pkg-dem/PositionOrientationRecorder.hpp>
@@ -39,7 +38,6 @@
#include<yade/pkg-common/MetaInteractingGeometry.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-dem/NewtonsDampedLaw.hpp>
#include<yade/pkg-common/GravityEngines.hpp>
@@ -55,7 +53,6 @@
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include <boost/filesystem/convenience.hpp>
#include <utility>
@@ -306,10 +303,6 @@
shared_ptr<CinemDNCEngine> kinematic = shared_ptr<CinemDNCEngine>(new CinemDNCEngine);
kinematic->shearSpeed = shearSpeed;
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
- physicalActionInitializer->physicalActionNames.push_back("GlobalStiffness");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
@@ -333,14 +326,11 @@
globalStiffnessTimeStepper->timeStepUpdateInterval = timeStepUpdateInterval;
globalStiffnessTimeStepper->defaultDt=1e-5;
- shared_ptr<GlobalStiffnessCounter> globalStiffnessCounter(new GlobalStiffnessCounter);
- globalStiffnessCounter->interval = timeStepUpdateInterval;
rootBody->engines.clear();
rootBody->engines.push_back(shared_ptr<Engine>(new PhysicalActionContainerReseter));
- rootBody->engines.push_back(globalStiffnessCounter);
rootBody->engines.push_back(globalStiffnessTimeStepper);
rootBody->engines.push_back(boundingVolumeDispatcher);
rootBody->engines.push_back(shared_ptr<Engine>(new PersistentSAPCollider));
@@ -355,7 +345,6 @@
// rootBody->engines.push_back(possnap);
// rootBody->engines.push_back(forcesnap);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/TestSimpleViscoelastic.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TestSimpleViscoelastic.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/TestSimpleViscoelastic.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -24,9 +24,7 @@
#include<yade/pkg-common/MetaInteractingGeometry2AABB.hpp>
#include<yade/pkg-common/PersistentSAPCollider.hpp>
#include<yade/pkg-common/PhysicalActionApplier.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/Sphere.hpp>
#include<yade/pkg-common/Box.hpp>
@@ -162,9 +160,6 @@
void TestSimpleViscoelastic::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
@@ -216,7 +211,6 @@
rootBody->engines.push_back(interactionRecorder);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/TetrahedronsTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TetrahedronsTest.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/TetrahedronsTest.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -29,7 +29,6 @@
#include<yade/pkg-common/MetaInteractingGeometry.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalActionDamper.hpp>
#include<yade/pkg-common/PhysicalActionApplier.hpp>
@@ -48,7 +47,6 @@
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
TetrahedronsTest::TetrahedronsTest () : FileGenerator()
@@ -300,13 +298,7 @@
void TetrahedronsTest::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- // all the strings here are just class names
- // those class names in each class are registered with REGISTER_CLASS_NAME(SomeClass);
- //
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
shared_ptr<InteractionPhysicsMetaEngine> interactionPhysicsDispatcher(new InteractionPhysicsMetaEngine);
// so for this simple example I use ElasticBodyParameters : to store young modulus,
@@ -387,7 +379,6 @@
rootBody->engines.push_back(orientationIntegrator);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(interactingGeometryDispatcher);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/ThreePointBending.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/ThreePointBending.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/ThreePointBending.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -46,12 +46,10 @@
#include<yade/pkg-common/InteractingSphere.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/pkg-common/TranslationEngine.hpp>
@@ -297,9 +295,6 @@
void ThreePointBending::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
@@ -364,7 +359,6 @@
rootBody->engines.push_back(kinematic);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/TriaxialTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTest.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/TriaxialTest.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -19,10 +19,8 @@
#include<yade/pkg-dem/SimpleElasticRelationships.hpp>
#include<yade/pkg-dem/BodyMacroParameters.hpp>
#include<yade/pkg-dem/SDECLinkPhysics.hpp>
-#include<yade/pkg-dem/GlobalStiffnessCounter.hpp>
#include<yade/pkg-dem/GlobalStiffnessTimeStepper.hpp>
#include<yade/pkg-dem/PositionOrientationRecorder.hpp>
-#include<yade/pkg-dem/MakeItFlat.hpp>
#include<yade/pkg-dem/AveragePositionRecorder.hpp>
//#include<yade/pkg-dem/ForceRecorder.hpp>
@@ -56,13 +54,11 @@
#include<yade/pkg-common/InteractingSphere.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/pkg-common/InteractionDispatchers.hpp>
@@ -166,9 +162,7 @@
isotropicCompaction=false;
fixedPorosity = 1;
- #ifdef BEX_CONTAINER
- parallel=false;
- #endif
+ parallel=false;
@@ -239,9 +233,7 @@
REGISTER_ATTRIBUTE(isotropicCompaction);
REGISTER_ATTRIBUTE(fixedPorosity);
REGISTER_ATTRIBUTE(fixedBoxDims);
- #ifdef BEX_CONTAINER
- REGISTER_ATTRIBUTE(parallel);
- #endif
+ REGISTER_ATTRIBUTE(parallel);
}
@@ -313,7 +305,6 @@
createBox(body,center,halfSize,wall_bottom_wire);
if(wall_bottom) {
rootBody->bodies->insert(body);
- //(resultantforceEngine->subscribedBodies).push_back(body->getId());
triaxialcompressionEngine->wall_bottom_id = body->getId();
//triaxialStateRecorder->wall_bottom_id = body->getId();
}
@@ -522,11 +513,6 @@
void TriaxialTest::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
- //physicalActionInitializer->physicalActionNames.push_back("StiffnessMatrix");
- physicalActionInitializer->physicalActionNames.push_back("GlobalStiffness");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
@@ -543,13 +529,11 @@
boundingVolumeDispatcher->add("InteractingSphere2AABB");
boundingVolumeDispatcher->add("InteractingBox2AABB");
boundingVolumeDispatcher->add("MetaInteractingGeometry2AABB");
-
-
-
shared_ptr<GravityEngine> gravityCondition(new GravityEngine);
gravityCondition->gravity = gravity;
+#if 0
shared_ptr<CundallNonViscousForceDamping> actionForceDamping(new CundallNonViscousForceDamping);
actionForceDamping->damping = dampingForce;
shared_ptr<CundallNonViscousMomentumDamping> actionMomentumDamping(new CundallNonViscousMomentumDamping);
@@ -561,37 +545,21 @@
shared_ptr<PhysicalActionApplier> applyActionDispatcher(new PhysicalActionApplier);
applyActionDispatcher->add("NewtonsForceLaw");
applyActionDispatcher->add("NewtonsMomentumLaw");
-
shared_ptr<PhysicalParametersMetaEngine> positionIntegrator(new PhysicalParametersMetaEngine);
positionIntegrator->add("LeapFrogPositionIntegrator");
shared_ptr<PhysicalParametersMetaEngine> orientationIntegrator(new PhysicalParametersMetaEngine);
orientationIntegrator->add("LeapFrogOrientationIntegrator");
+#endif
- //shared_ptr<ElasticCriterionTimeStepper> sdecTimeStepper(new ElasticCriterionTimeStepper);
- //sdecTimeStepper->sdecGroupMask = 2;
- //sdecTimeStepper->timeStepUpdateInterval = timeStepUpdateInterval;
-
- //shared_ptr<StiffnessMatrixTimeStepper> stiffnessMatrixTimeStepper(new StiffnessMatrixTimeStepper);
- //stiffnessMatrixTimeStepper->sdecGroupMask = 2;
- //stiffnessMatrixTimeStepper->timeStepUpdateInterval = timeStepUpdateInterval;
-
globalStiffnessTimeStepper=shared_ptr<GlobalStiffnessTimeStepper>(new GlobalStiffnessTimeStepper);
globalStiffnessTimeStepper->sdecGroupMask = 2;
globalStiffnessTimeStepper->timeStepUpdateInterval = timeStepUpdateInterval;
globalStiffnessTimeStepper->defaultDt = defaultDt;
- shared_ptr<ElasticContactLaw> elasticContactLaw(new ElasticContactLaw);
- elasticContactLaw->sdecGroupMask = 2;
-
-
//shared_ptr<StiffnessCounter> stiffnesscounter(new StiffnessCounter);
//stiffnesscounter->sdecGroupMask = 2;
//stiffnesscounter->interval = timeStepUpdateInterval;
- shared_ptr<GlobalStiffnessCounter> globalStiffnessCounter(new GlobalStiffnessCounter);
- // globalStiffnessCounter->sdecGroupMask = 2;
- globalStiffnessCounter->interval = timeStepUpdateInterval;
-
// moving walls to regulate the stress applied + compress when the packing is dense an stable
//cerr << "triaxialcompressionEngine = shared_ptr<TriaxialCompressionEngine> (new TriaxialCompressionEngine);" << std::endl;
triaxialcompressionEngine = shared_ptr<TriaxialCompressionEngine> (new TriaxialCompressionEngine);
@@ -615,8 +583,6 @@
triaxialcompressionEngine->isotropicCompaction = isotropicCompaction;
-
-
// recording global stress
if(recordIntervalIter>0){
triaxialStateRecorder = shared_ptr<TriaxialStateRecorder>(new TriaxialStateRecorder);
@@ -642,64 +608,40 @@
rootBody->engines.clear();
rootBody->engines.push_back(shared_ptr<Engine>(new PhysicalActionContainerReseter));
-// rootBody->engines.push_back(sdecTimeStepper);
rootBody->engines.push_back(boundingVolumeDispatcher);
rootBody->engines.push_back(shared_ptr<Engine>(new PersistentSAPCollider));
- #ifdef BEX_CONTAINER
if(parallel){
- #if 1
- shared_ptr<InteractionDispatchers> ids(new InteractionDispatchers);
- ids->geomDispatcher=interactionGeometryDispatcher;
- ids->physDispatcher=interactionPhysicsDispatcher;
- ids->constLawDispatcher=shared_ptr<ConstitutiveLawDispatcher>(new ConstitutiveLawDispatcher);
- shared_ptr<ef2_Spheres_Elastic_ElasticLaw> see(new ef2_Spheres_Elastic_ElasticLaw);
- see->sdecGroupMask=elasticContactLaw->sdecGroupMask;
- ids->constLawDispatcher->add(see);
- rootBody->engines.push_back(ids);
- #else
- rootBody->engines.push_back(interactionGeometryDispatcher);
- rootBody->engines.push_back(interactionPhysicsDispatcher);
- shared_ptr<ConstitutiveLawDispatcher> cld(new ConstitutiveLawDispatcher);
- shared_ptr<ef2_Spheres_Elastic_ElasticLaw> see(new ef2_Spheres_Elastic_ElasticLaw);
- see->sdecGroupMask=elasticContactLaw->sdecGroupMask;
- cld->add(see);
- rootBody->engines.push_back(cld);
- #endif
+ shared_ptr<InteractionDispatchers> ids(new InteractionDispatchers);
+ ids->geomDispatcher=interactionGeometryDispatcher;
+ ids->physDispatcher=interactionPhysicsDispatcher;
+ ids->constLawDispatcher=shared_ptr<ConstitutiveLawDispatcher>(new ConstitutiveLawDispatcher);
+ shared_ptr<ef2_Spheres_Elastic_ElasticLaw> see(new ef2_Spheres_Elastic_ElasticLaw);
+ see->sdecGroupMask=2;
+ ids->constLawDispatcher->add(see);
+ rootBody->engines.push_back(ids);
} else {
- #endif
rootBody->engines.push_back(interactionGeometryDispatcher);
rootBody->engines.push_back(interactionPhysicsDispatcher);
+ shared_ptr<ElasticContactLaw> elasticContactLaw(new ElasticContactLaw);
+ elasticContactLaw->sdecGroupMask = 2;
rootBody->engines.push_back(elasticContactLaw);
- #ifdef BEX_CONTAINER
}
- #endif
//rootBody->engines.push_back(stiffnesscounter);
//rootBody->engines.push_back(stiffnessMatrixTimeStepper);
- rootBody->engines.push_back(globalStiffnessCounter);
rootBody->engines.push_back(globalStiffnessTimeStepper);
rootBody->engines.push_back(triaxialcompressionEngine);
if(recordIntervalIter>0) rootBody->engines.push_back(triaxialStateRecorder);
//rootBody->engines.push_back(gravityCondition);
- rootBody->engines.push_back(shared_ptr<Engine> (new NewtonsDampedLaw));
+ shared_ptr<NewtonsDampedLaw> newton(new NewtonsDampedLaw);
+ newton->damping=dampingMomentum;
+ rootBody->engines.push_back(newton);
//if (0) rootBody->engines.push_back(shared_ptr<Engine>(new MicroMacroAnalyser));
- // replaced by PhysicalParameters::blockedDOFs
- #if 0
- if(biaxial2dTest){
- shared_ptr<MakeItFlat> makeItFlat(new MakeItFlat);
- makeItFlat->direction=2;
- makeItFlat->plane_position = (lowerCorner[2]+upperCorner[2])*0.5;
- makeItFlat->reset_force = false;
- rootBody->engines.push_back(makeItFlat);
- }
- #endif
-
//if(!rotationBlocked)
// rootBody->engines.push_back(orientationIntegrator);
- //rootBody->engines.push_back(resultantforceEngine);
//rootBody->engines.push_back(triaxialstressController);
@@ -710,7 +652,6 @@
}
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/TriaxialTest.hpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTest.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/TriaxialTest.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -37,7 +37,7 @@
2/ The class TriaxialStateRecorder is used to write to a file the history of stresses and strains.
- 3/ TriaxialTest is currently using a group of classes including GlobalStiffness (data), GlobalStiffnessCounter (updater) and GlobalStiffnessTimeStepper to compute an appropriate dt for the numerical scheme. The TriaxialTest is the only preprocessor using these classes in Yade because they have been developped AFTER most of preprocessor examples, BUT they can be used in principle in any situation and they have nothing specifically related to the triaxial test.
+ 3/ TriaxialTest is currently using GlobalStiffnessTimeStepper to compute an appropriate dt for the numerical scheme. The TriaxialTest is the only preprocessor using these classes in Yade because they have been developped AFTER most of preprocessor examples, BUT they can be used in principle in any situation and they have nothing specifically related to the triaxial test.
@note TriaxialStressController::ComputeUnbalancedForce(...) returns a value that can be usefull for evaluating the stability of the packing. It is defined as (mean force on particles)/(mean contact force), so that it tends to 0 in a stable packing. This parameter is checked by TriaxialCompressionEngine to switch from one stage of the simulation to the next one (e.g. stop isotropic confinment and start axial loading)
@@ -106,10 +106,8 @@
//!flag to choose an isotropic compaction until a fixed porosity choosing a same translation speed for the six walls
,isotropicCompaction;
- #ifdef BEX_CONTAINER
- //! Generate parallel simulation, if it is supported
- bool parallel;
- #endif
+ //! Generate parallel simulation
+ bool parallel;
int recordIntervalIter
,timeStepUpdateInterval
Modified: trunk/pkg/dem/PreProcessor/TriaxialTestWater.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTestWater.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/TriaxialTestWater.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -22,7 +22,6 @@
#include<yade/pkg-dem/BodyMacroParameters.hpp>
#include<yade/pkg-dem/SDECLinkPhysics.hpp>
-#include<yade/pkg-dem/GlobalStiffnessCounter.hpp>
#include<yade/pkg-dem/GlobalStiffnessTimeStepper.hpp>
#include<yade/pkg-dem/PositionOrientationRecorder.hpp>
@@ -60,14 +59,12 @@
#include<yade/pkg-common/InteractingSphere.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
#include<yade/pkg-common/InteractionHashMap.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/extra/Shop.hpp>
@@ -297,7 +294,6 @@
createBox(body,center,halfSize,wall_bottom_wire);
if(wall_bottom) {
rootBody->bodies->insert(body);
- //(resultantforceEngine->subscribedBodies).push_back(body->getId());
triaxialcompressionEngine->wall_bottom_id = body->getId();
//triaxialStateRecorder->wall_bottom_id = body->getId();
}
@@ -514,11 +510,6 @@
void TriaxialTestWater::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
- //physicalActionInitializer->physicalActionNames.push_back("StiffnessMatrix");
- physicalActionInitializer->physicalActionNames.push_back("GlobalStiffness");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
@@ -586,9 +577,6 @@
//stiffnesscounter->sdecGroupMask = 2;
//stiffnesscounter->interval = timeStepUpdateInterval;
- shared_ptr<GlobalStiffnessCounter> globalStiffnessCounter(new GlobalStiffnessCounter);
- // globalStiffnessCounter->sdecGroupMask = 2;
- globalStiffnessCounter->interval = timeStepUpdateInterval;
// moving walls to regulate the stress applied + compress when the packing is dense an stable
//cerr << "triaxialcompressionEngine = shared_ptr<TriaxialCompressionEngine> (new TriaxialCompressionEngine);" << std::endl;
@@ -663,7 +651,6 @@
//rootBody->engines.push_back(stiffnesscounter);
//rootBody->engines.push_back(stiffnessMatrixTimeStepper);
- rootBody->engines.push_back(globalStiffnessCounter);
rootBody->engines.push_back(globalStiffnessTimeStepper);
if(water)
{
@@ -679,7 +666,6 @@
//if(!rotationBlocked)
// rootBody->engines.push_back(orientationIntegrator);
- //rootBody->engines.push_back(resultantforceEngine);
//rootBody->engines.push_back(triaxialstressController);
@@ -689,7 +675,6 @@
rootBody->engines.push_back(positionOrientationRecorder);}
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/dem/PreProcessor/TriaxialTestWater.hpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTestWater.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/PreProcessor/TriaxialTestWater.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -38,7 +38,7 @@
2/ The class TriaxialStateRecorder is used to write to a file the history of stresses and strains.
- 3/ TriaxialTestWater is currently using a group of classes including GlobalStiffness (data), GlobalStiffnessCounter (updater) and GlobalStiffnessTimeStepper to compute an appropriate dt for the numerical scheme. The TriaxialTestWater is the only preprocessor using these classes in Yade because they have been developped AFTER most of preprocessor examples, BUT they can be used in principle in any situation and they have nothing specifically related to the triaxial test.
+ 3/ TriaxialTestWater is currently using GlobalStiffnessTimeStepper to compute an appropriate dt for the numerical scheme. The TriaxialTestWater is the only preprocessor using these classes in Yade because they have been developped AFTER most of preprocessor examples, BUT they can be used in principle in any situation and they have nothing specifically related to the triaxial test.
@note TriaxialStressController::ComputeUnbalancedForce(...) returns a value that can be usefull for evaluating the stability of the packing. It is defined as (mean force on particles)/(mean contact force), so that it tends to 0 in a stable packing. This parameter is checked by TriaxialCompressionEngine to switch from one stage of the simulation to the next one (e.g. stop isotropic confinment and start axial loading)
Modified: trunk/pkg/dem/SConscript
===================================================================
--- trunk/pkg/dem/SConscript 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/dem/SConscript 2009-03-30 17:10:27 UTC (rev 1738)
@@ -18,8 +18,6 @@
'yade-base',
'GLDrawInteractingSphere',
'yade-multimethods',
- 'Force',
- 'Momentum',
'Sphere',
'RigidBodyParameters',
'InteractingSphere',
@@ -85,10 +83,6 @@
['DataClass/InteractionPhysics/SDECLinkPhysics.cpp'],
LIBS=env['LIBS']+['NormalShearInteractions']),
- env.SharedLibrary('GlobalStiffness',
- ['DataClass/PhysicalAction/GlobalStiffness.cpp'],
- LIBS=env['LIBS']+['yade-base']),
-
env.SharedLibrary('MacroMicroElasticRelationships',
['Engine/EngineUnit/MacroMicroElasticRelationships.cpp'],
LIBS=env['LIBS']+['SDECLinkPhysics',
@@ -194,8 +188,6 @@
'BodyMacroParameters',
'yade-base',
'yade-multimethods',
- 'Force',
- 'Momentum',
'Sphere',
'RigidBodyParameters']),
@@ -232,8 +224,6 @@
'yade-base',
'GLDrawInteractingSphere',
'yade-multimethods',
- 'Force',
- 'Momentum',
'Sphere',
'RigidBodyParameters']),
@@ -249,8 +239,6 @@
'yade-base',
'yade-multimethods',
- 'Force',
- 'Momentum',
'Sphere',
'RigidBodyParameters']),
@@ -262,8 +250,6 @@
'yade-serialization',
'yade-base',
'yade-multimethods',
- 'Force',
- 'Momentum',
'Sphere',
'RigidBodyParameters']),
@@ -284,7 +270,7 @@
env.SharedLibrary('ForceRecorder',
['Engine/StandAloneEngine/ForceRecorder.cpp'],
- LIBS=env['LIBS']+['RigidBodyParameters', 'Force']),
+ LIBS=env['LIBS']+['RigidBodyParameters']),
env.SharedLibrary('PositionOrientationRecorder',
['Engine/StandAloneEngine/PositionOrientationRecorder.cpp'],
@@ -307,22 +293,6 @@
['Engine/StandAloneEngine/VelocityRecorder.cpp'],
LIBS=env['LIBS']+['ParticleParameters']),
- env.SharedLibrary('GlobalStiffnessCounter',
- ['Engine/StandAloneEngine/GlobalStiffnessCounter.cpp'],
- LIBS=env['LIBS']+['SDECLinkPhysics',
- 'ElasticContactInteraction',
- 'SDECLinkGeometry',
- 'SpheresContactGeometry',
- 'BodyMacroParameters',
- 'yade-serialization',
- 'yade-base',
- 'yade-multimethods',
- 'Force',
- 'Momentum',
- 'Sphere',
- 'RigidBodyParameters',
- 'GlobalStiffness' ]),
-
env.SharedLibrary('GlobalStiffnessTimeStepper',
['Engine/StandAloneEngine/GlobalStiffnessTimeStepper.cpp'],
LIBS=env['LIBS']+['yade-base',
@@ -331,25 +301,16 @@
'SpheresContactGeometry',
'MacroMicroElasticRelationships',
'Sphere',
- 'GlobalStiffness']),
+ ]),
env.SharedLibrary('GeometricalModelForceColorizer',
['Engine/StandAloneEngine/GeometricalModelForceColorizer.cpp'],
- LIBS=env['LIBS']+['RigidBodyParameters', 'Force']),
+ LIBS=env['LIBS']+['RigidBodyParameters',]),
- env.SharedLibrary('ResultantForceEngine',
- ['Engine/DeusExMachina/ResultantForceEngine.cpp'],
- LIBS=env['LIBS']+[
- 'yade-base',
- 'Force',
- 'ParticleParameters',
- 'GlobalStiffness']),
-
env.SharedLibrary('TriaxialStressController',
['Engine/DeusExMachina/TriaxialStressController.cpp'],
LIBS=env['LIBS']+[
'yade-base',
- 'Force',
'ParticleParameters',
'RigidBodyParameters',
'ElasticContactInteraction',
@@ -362,7 +323,6 @@
['Engine/DeusExMachina/TriaxialCompressionEngine.cpp'],
LIBS=env['LIBS']+[
'yade-base',
- 'Force',
'ParticleParameters',
'ElasticContactInteraction',
'TriaxialStressController',
@@ -411,8 +371,6 @@
'GravityEngines',
'yade-serialization',
'yade-base',
-
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -444,7 +402,6 @@
'MetaInteractingGeometry',
'GravityEngines',
'yade-serialization',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -480,7 +437,6 @@
'CinemDNCEngine',
'yade-serialization',
'yade-base',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -502,8 +458,6 @@
'CohesiveFrictionalBodyParameters',
'ContactLaw1',
'CL1Relationships',
- 'GlobalStiffness',
- 'GlobalStiffnessCounter',
'GlobalStiffnessTimeStepper',
'PositionOrientationRecorder',
'PositionRecorder',
@@ -518,7 +472,6 @@
'CinemDNCEngine',
'yade-serialization',
'yade-base',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -551,7 +504,6 @@
'SpheresContactGeometry',
'yade-base',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -581,7 +533,6 @@
'GravityEngines',
'yade-serialization',
'yade-base',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -612,7 +563,6 @@
'TranslationEngine',
'yade-serialization',
'yade-base',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -639,7 +589,6 @@
'CundallNonViscousDamping',
'MetaInteractingGeometry',
'GravityEngines',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractingGeometryMetaEngine',
@@ -677,7 +626,6 @@
'CundallNonViscousDamping',
'MetaInteractingGeometry',
'GravityEngines',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractingGeometryMetaEngine',
@@ -706,14 +654,12 @@
# 'MicroMacroAnalyser',
'SimpleElasticRelationships',
'ElasticCriterionTimeStepper',
- 'MakeItFlat',
'InteractingSphere',
'InteractingBox',
'NewtonsDampedLaw',
'MetaInteractingGeometry',
'GravityEngines',
'yade-serialization',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -726,9 +672,6 @@
'AABB',
'PersistentSAPCollider',
'MetaInteractingGeometry2AABB',
- 'GlobalStiffness',
- 'GlobalStiffnessCounter',
- 'ResultantForceEngine',
'TriaxialStressController',
'TriaxialCompressionEngine',
'GlobalStiffnessTimeStepper',
@@ -758,7 +701,6 @@
'MetaInteractingGeometry',
'GravityEngines',
'yade-serialization',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -771,9 +713,6 @@
'AABB',
'DistantPersistentSAPCollider',
'MetaInteractingGeometry2AABB',
- 'GlobalStiffness',
- 'GlobalStiffnessCounter',
- 'ResultantForceEngine',
'TriaxialStressController',
'TriaxialCompressionEngine',
'GlobalStiffnessTimeStepper',
@@ -800,7 +739,6 @@
'yade-base',
'Shop',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -823,7 +761,6 @@
'ElasticContactInteraction',
'SpheresContactGeometry',
'BodyMacroParameters',
- 'Force',
'TriaxialStressController',
'TriaxialCompressionEngine',
'Sphere',
@@ -845,7 +782,6 @@
'CapillaryParameters',
'TriaxialStressController',
'TriaxialCompressionEngine',
- 'Force',
'CapillaryCohesiveLaw']),
env.SharedLibrary('TriaxialTestWater',
@@ -870,7 +806,6 @@
MetaInteractingGeometry
GravityEngines
yade-serialization
- PhysicalActionContainerInitializer
PhysicalActionContainerReseter
InteractionGeometryMetaEngine
InteractionPhysicsMetaEngine
@@ -883,9 +818,6 @@
AABB
PersistentSAPCollider
MetaInteractingGeometry2AABB
- GlobalStiffness
- GlobalStiffnessCounter
- ResultantForceEngine
TriaxialStressController
MacroMicroElasticRelationshipsWater
TriaxialCompressionEngine
@@ -897,7 +829,6 @@
'ElasticContactInteraction',
'SpheresContactGeometry',
'BodyMacroParameters',
- 'Force',
'TriaxialStressController',
'TriaxialCompressionEngine',
'Sphere',
@@ -910,8 +841,6 @@
'ElasticContactInteraction',
'SpheresContactGeometry',
'BodyMacroParameters',
- 'Force',
- 'Momentum',
'RigidBodyParameters',
'Sphere',
'ElasticContactLaw']),
@@ -951,20 +880,12 @@
env.SharedLibrary('HydraulicForceEngine',
['Engine/DeusExMachina/HydraulicForceEngine.cpp'],
- LIBS=env['LIBS']+['yade-base', 'Force', 'Momentum', 'ParticleParameters', 'CohesiveFrictionalBodyParameters', 'TriaxialCompressionEngine', 'GravityEngines'],
+ LIBS=env['LIBS']+['yade-base', 'ParticleParameters', 'CohesiveFrictionalBodyParameters', 'TriaxialCompressionEngine', 'GravityEngines'],
CPPPATH=env['CPPPATH']+['Engine/DeusExMachina',
'DataClass/PhysicalAction',
'$PREFIX/include',
'DataClass/PhysicalParameters']),
-env.SharedLibrary('MakeItFlat',
- ['Engine/DeusExMachina/MakeItFlat.cpp'],
- LIBS=env['LIBS']+['yade-base', 'Force', 'ParticleParameters'],
- CPPPATH=env['CPPPATH']+['Engine/DeusExMachina',
- 'DataClass/PhysicalAction',
- '$PREFIX/include',
- 'DataClass/PhysicalParameters']),
-
env.SharedLibrary('StaticSpheresAttractionEngine',
['Engine/DeusExMachina/StaticSpheresAttractionEngine.cpp'],
LIBS=env['LIBS']+['yade-base', 'Sphere', 'StaticAttractionEngine', 'ElasticContactInteraction'],
@@ -988,7 +909,6 @@
'MetaInteractingGeometry',
'GravityEngines',
'yade-serialization',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -1001,9 +921,6 @@
'AABB',
'DistantPersistentSAPCollider',
'MetaInteractingGeometry2AABB',
- 'GlobalStiffness',
- 'GlobalStiffnessCounter',
- 'ResultantForceEngine',
'TriaxialStressController',
'TriaxialCompressionEngine',
'GlobalStiffnessTimeStepper',
@@ -1011,7 +928,6 @@
'TriaxialStateRecorder',
'PositionOrientationRecorder',
'HydraulicForceEngine',
- 'MakeItFlat',
'TranslationEngine',]),
@@ -1020,8 +936,6 @@
LIBS=env['LIBS']+['yade-serialization',
'yade-base',
'yade-multimethods',
- 'Force',
- 'Momentum',
'RigidBodyParameters'
]),
@@ -1054,8 +968,6 @@
'yade-serialization',
'yade-base',
'yade-multimethods',
- 'Force',
- 'Momentum',
'Sphere',
'RigidBodyParameters'])
@@ -1091,7 +1003,6 @@
,'ParticleParameters'
,'RigidBodyRecorder'
,'PhysicalActionApplier'
- ,'PhysicalActionContainerInitializer'
,'PhysicalActionContainerReseter'
,'PhysicalParametersMetaEngine'
,'PersistentSAPCollider'
@@ -1118,7 +1029,6 @@
,'MetaInteractingGeometry2AABB'
,'ParticleParameters'
,'PhysicalActionApplier'
- ,'PhysicalActionContainerInitializer'
,'PhysicalActionContainerReseter'
,'PhysicalParametersMetaEngine'
,'SpatialQuickSortCollider'
@@ -1145,8 +1055,6 @@
#'yade-base',
#'GLDrawInteractingSphere',
#'yade-multimethods',
- #'Force',
- #'Momentum',
#'Sphere',
#'RigidBodyParameters',
#'InteractingSphere',
Modified: trunk/pkg/fem/Engine/StandAloneEngine/FEMLaw.cpp
===================================================================
--- trunk/pkg/fem/Engine/StandAloneEngine/FEMLaw.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/fem/Engine/StandAloneEngine/FEMLaw.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,7 +10,6 @@
#include "FEMLaw.hpp"
#include<yade/pkg-fem/FEMTetrahedronData.hpp>
#include<yade/pkg-fem/FEMNodeData.hpp>
-#include<yade/pkg-common/Force.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/io.hpp>
@@ -18,7 +17,7 @@
using namespace boost::numeric;
-FEMLaw::FEMLaw() : InteractionSolver() , actionForce(new Force)
+FEMLaw::FEMLaw() : InteractionSolver()
{
nodeGroupMask = 1;
tetrahedronGroupMask = 2;
@@ -75,11 +74,7 @@
Vector3r force = Vector3r( fe( i*3 , 0 )
, fe( i*3 + 1 , 0 )
, fe( i*3 + 2 , 0 ));
- #ifdef BEX_CONTAINER
- fem->bex.addForce(femTet->ids[i],force);
- #else
- static_cast<Force*>(fem->physicalActions->find( femTet->ids[i] , actionForce ->getClassIndex() ).get() )->force += force;
- #endif
+ fem->bex.addForce(femTet->ids[i],force);
}
}
Modified: trunk/pkg/fem/Engine/StandAloneEngine/FEMLaw.hpp
===================================================================
--- trunk/pkg/fem/Engine/StandAloneEngine/FEMLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/fem/Engine/StandAloneEngine/FEMLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,13 +10,9 @@
#include<yade/core/InteractionSolver.hpp>
-class PhysicalAction;
-
class FEMLaw : public InteractionSolver
{
/// Attributes
- private :
- shared_ptr<PhysicalAction> actionForce;
public :
int nodeGroupMask
,tetrahedronGroupMask;
@@ -30,7 +26,6 @@
/// Serializtion
protected :
virtual void registerAttributes();
- NEEDS_BEX("Force");
REGISTER_CLASS_NAME(FEMLaw);
REGISTER_BASE_CLASS_NAME(InteractionSolver);
Modified: trunk/pkg/fem/PreProcessor/FEMBeam.cpp
===================================================================
--- trunk/pkg/fem/PreProcessor/FEMBeam.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/fem/PreProcessor/FEMBeam.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -26,7 +26,6 @@
// engines
#include<yade/pkg-common/CundallNonViscousDamping.hpp>
#include<yade/pkg-common/CundallNonViscousDamping.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
#include<yade/pkg-common/GravityEngines.hpp>
#include<yade/pkg-common/TranslationEngine.hpp>
@@ -47,7 +46,6 @@
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include <boost/filesystem/convenience.hpp>
@@ -173,9 +171,6 @@
shared_ptr<PhysicalActionApplier> applyActionDispatcher(new PhysicalActionApplier);
applyActionDispatcher->add("NewtonsForceLaw");
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum"); // FIXME - should be unnecessery, but BUG in PhysicalActionVectorVector
rootBody->engines.clear();
rootBody->engines.push_back(shared_ptr<Engine>(new PhysicalActionContainerReseter));
@@ -190,7 +185,6 @@
rootBody->initializers.push_back(bodyPhysicalParametersDispatcher);
rootBody->initializers.push_back(boundingVolumeDispatcher);
rootBody->initializers.push_back(geometricalModelDispatcher);
- rootBody->initializers.push_back(physicalActionInitializer);
femSetTextLoaderFunctor->go(rootBody->physicalParameters,rootBody.get()); // load FEM from file.
Modified: trunk/pkg/fem/SConscript
===================================================================
--- trunk/pkg/fem/SConscript 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/fem/SConscript 2009-03-30 17:10:27 UTC (rev 1738)
@@ -93,7 +93,6 @@
LIBS=env['LIBS']+['yade-base',
'FEMTetrahedronData',
- 'Force',
'ParticleParameters'],
CPPPATH=env['CPPPATH']+['$PREFIX/include',
'DataClass/PhysicalParameters',
@@ -116,7 +115,6 @@
'yade-serialization',
'yade-base',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
Modified: trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeBeamParameters.hpp
===================================================================
--- trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeBeamParameters.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeBeamParameters.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -40,7 +40,6 @@
// where does it belong, what is it?
- // a PhysicalAction !
Real count
,torsionAngle;
Quaternionr bendingRotation
Modified: trunk/pkg/lattice/Engine/StandAloneEngine/BeamRecorder.hpp
===================================================================
--- trunk/pkg/lattice/Engine/StandAloneEngine/BeamRecorder.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/lattice/Engine/StandAloneEngine/BeamRecorder.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -15,7 +15,6 @@
#include <list>
#include <vector>
-//class PhysicalAction;
class BeamRecorder : public DataRecorder
{ // given a section plane it records all the beams that cross it: their deformation projected
Modified: trunk/pkg/lattice/Engine/StandAloneEngine/LatticeLaw.hpp
===================================================================
--- trunk/pkg/lattice/Engine/StandAloneEngine/LatticeLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/lattice/Engine/StandAloneEngine/LatticeLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -14,7 +14,6 @@
#include<yade/core/BodyContainer.hpp>
#include <list>
-class PhysicalAction;
class LatticeLaw : public InteractionSolver
Modified: trunk/pkg/lattice/Engine/StandAloneEngine/MovingSupport.hpp
===================================================================
--- trunk/pkg/lattice/Engine/StandAloneEngine/MovingSupport.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/lattice/Engine/StandAloneEngine/MovingSupport.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -15,7 +15,6 @@
#include <list>
#include <vector>
-//class PhysicalAction;
class MovingSupport : public DataRecorder
{ // given a section plane it deletes all the beams that cross it, and remembers the nodes that they did connect.
Modified: trunk/pkg/lattice/Engine/StandAloneEngine/NodeRecorder.hpp
===================================================================
--- trunk/pkg/lattice/Engine/StandAloneEngine/NodeRecorder.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/lattice/Engine/StandAloneEngine/NodeRecorder.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -15,7 +15,6 @@
#include <list>
#include <vector>
-//class PhysicalAction;
class NodeRecorder : public DataRecorder
{ // records average position of nodes in a given region
Modified: trunk/pkg/lattice/Engine/StandAloneEngine/StrainRecorder.hpp
===================================================================
--- trunk/pkg/lattice/Engine/StandAloneEngine/StrainRecorder.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/lattice/Engine/StandAloneEngine/StrainRecorder.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,12 +13,10 @@
#include <string>
#include <fstream>
-//class PhysicalAction;
class StrainRecorder : public DataRecorder
{
private :
-// shared_ptr<PhysicalAction> actionForce;
std::ofstream ofile;
public :
Modified: trunk/pkg/lattice/PreProcessor/LatticeExample.cpp
===================================================================
--- trunk/pkg/lattice/PreProcessor/LatticeExample.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/lattice/PreProcessor/LatticeExample.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -36,13 +36,11 @@
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/pkg-common/DisplacementEngine.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/PhysicalActionApplier.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/Quadrilateral.hpp>
#include<yade/pkg-common/ParticleParameters.hpp>
Modified: trunk/pkg/lattice/SConscript
===================================================================
--- trunk/pkg/lattice/SConscript 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/lattice/SConscript 2009-03-30 17:10:27 UTC (rev 1738)
@@ -169,7 +169,6 @@
'BoundingVolumeMetaEngine',
'PhysicalActionApplier',
'PhysicalParametersMetaEngine',
- 'PhysicalActionContainerInitializer',
'ParticleParameters',
'AABB',
'Quadrilateral',
Modified: trunk/pkg/mass-spring/Engine/StandAloneEngine/MassSpringLaw.cpp
===================================================================
--- trunk/pkg/mass-spring/Engine/StandAloneEngine/MassSpringLaw.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/mass-spring/Engine/StandAloneEngine/MassSpringLaw.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,12 +13,10 @@
#include<yade/core/MetaBody.hpp>
#include<yade/pkg-common/Mesh2D.hpp>
#include<yade/pkg-common/ParticleParameters.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
#include<yade/lib-base/yadeWm3Extra.hpp>
-MassSpringLaw::MassSpringLaw () : InteractionSolver(), actionForce(new Force) , actionMomentum(new Momentum)
+MassSpringLaw::MassSpringLaw () : InteractionSolver()
{
}
@@ -68,13 +66,8 @@
Real e = (l-l0)/l0;
Real relativeVelocity = dir.Dot((p1->velocity-p2->velocity));
Vector3r f3 = (e*physics->stiffness + relativeVelocity* ( 1.0 - physics->damping ) )*dir;
- #ifdef BEX_CONTAINER
- massSpring->bex.addForce(id1,-f3);
- massSpring->bex.addForce(id2, f3);
- #else
- static_cast<Force*> ( massSpring->physicalActions->find( id1 , actionForce->getClassIndex() ).get() )->force -= f3;
- static_cast<Force*> ( massSpring->physicalActions->find( id2 , actionForce->getClassIndex() ).get() )->force += f3;
- #endif
+ massSpring->bex.addForce(id1,-f3);
+ massSpring->bex.addForce(id2, f3);
}
}
Modified: trunk/pkg/mass-spring/Engine/StandAloneEngine/MassSpringLaw.hpp
===================================================================
--- trunk/pkg/mass-spring/Engine/StandAloneEngine/MassSpringLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/mass-spring/Engine/StandAloneEngine/MassSpringLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -9,14 +9,9 @@
#pragma once
#include<yade/core/InteractionSolver.hpp>
-#include<yade/core/PhysicalAction.hpp>
class MassSpringLaw : public InteractionSolver
{
- private :
- shared_ptr<PhysicalAction> actionForce;
- shared_ptr<PhysicalAction> actionMomentum;
-
public :
int springGroupMask;
MassSpringLaw ();
@@ -24,7 +19,6 @@
protected :
void registerAttributes();
- NEEDS_BEX("Force","Momentum");
REGISTER_CLASS_NAME(MassSpringLaw);
REGISTER_BASE_CLASS_NAME(InteractionSolver);
};
Modified: trunk/pkg/mass-spring/PreProcessor/HangingCloth.cpp
===================================================================
--- trunk/pkg/mass-spring/PreProcessor/HangingCloth.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/mass-spring/PreProcessor/HangingCloth.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -52,14 +52,12 @@
//#include<yade/pkg-common/MassSpringBody2RigidBodyLaw.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/GravityEngines.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
HangingCloth::HangingCloth () : FileGenerator()
@@ -150,9 +148,6 @@
rootBody->transientInteractions = shared_ptr<InteractionContainer>(new InteractionVecSet);
rootBody->bodies = shared_ptr<BodyContainer>(new BodyRedirectionVector);
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4SpheresContactGeometry");
@@ -216,7 +211,6 @@
rootBody->engines.push_back(orientationIntegrator);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
rootBody->initializers.push_back(geometricalModelDispatcher);
Modified: trunk/pkg/mass-spring/SConscript
===================================================================
--- trunk/pkg/mass-spring/SConscript 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/mass-spring/SConscript 2009-03-30 17:10:27 UTC (rev 1738)
@@ -29,8 +29,6 @@
'ParticleParameters',
'yade-serialization',
'yade-multimethods',
- 'Force',
- 'Momentum',
'Mesh2D'],
CPPPATH=env['CPPPATH']+['DataClass/InteractionPhysics',
'DataClass/InteractionGeometry']),
@@ -49,7 +47,6 @@
'MacroMicroElasticRelationships',
'yade-serialization',
'yade-base',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'GravityEngines',
'InteractionGeometryMetaEngine',
Modified: trunk/pkg/realtime-rigidbody/Engine/StandAloneEngine/FrictionLessElasticContactLaw.cpp
===================================================================
--- trunk/pkg/realtime-rigidbody/Engine/StandAloneEngine/FrictionLessElasticContactLaw.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/realtime-rigidbody/Engine/StandAloneEngine/FrictionLessElasticContactLaw.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -16,14 +16,12 @@
#include<yade/pkg-common/ClosestFeatures.hpp>
#include<yade/core/Omega.hpp>
#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
#include<yade/lib-base/yadeWm3Extra.hpp>
-FrictionLessElasticContactLaw::FrictionLessElasticContactLaw () : InteractionSolver(), actionForce(new Force) , actionMomentum(new Momentum)
+FrictionLessElasticContactLaw::FrictionLessElasticContactLaw () : InteractionSolver()
{
}
@@ -77,17 +75,10 @@
Vector3r v2 = rb2->velocity+rb2->angularVelocity.Cross(o2p);
Real relativeVelocity = dir.Dot(v2-v1);
Vector3r f = (elongation*stiffness+relativeVelocity*viscosity)/size*dir;
- #ifdef BEX_CONTAINER
- ncb->bex.addForce (id1, f);
- ncb->bex.addForce (id2,-f);
- ncb->bex.addTorque(id1, o1p.Cross(f));
- ncb->bex.addTorque(id2,-o2p.Cross(f));
- #else
- static_cast<Force*> ( ncb->physicalActions->find( id1 , actionForce ->getClassIndex() ).get() )->force += f;
- static_cast<Force*> ( ncb->physicalActions->find( id2 , actionForce ->getClassIndex() ).get() )->force -= f;
- static_cast<Momentum*>( ncb->physicalActions->find( id1 , actionMomentum->getClassIndex() ).get() )->momentum += o1p.Cross(f);
- static_cast<Momentum*>( ncb->physicalActions->find( id2 , actionMomentum->getClassIndex() ).get() )->momentum -= o2p.Cross(f);
- #endif
+ ncb->bex.addForce (id1, f);
+ ncb->bex.addForce (id2,-f);
+ ncb->bex.addTorque(id1, o1p.Cross(f));
+ ncb->bex.addTorque(id2,-o2p.Cross(f));
}
}
Modified: trunk/pkg/realtime-rigidbody/Engine/StandAloneEngine/FrictionLessElasticContactLaw.hpp
===================================================================
--- trunk/pkg/realtime-rigidbody/Engine/StandAloneEngine/FrictionLessElasticContactLaw.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/realtime-rigidbody/Engine/StandAloneEngine/FrictionLessElasticContactLaw.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -10,21 +10,15 @@
#include<yade/core/InteractionSolver.hpp>
-class PhysicalAction;
class FrictionLessElasticContactLaw : public InteractionSolver
{
- private :
- shared_ptr<PhysicalAction> actionForce;
- shared_ptr<PhysicalAction> actionMomentum;
-
public :
FrictionLessElasticContactLaw ();
void action(MetaBody*);
protected :
void registerAttributes();
- NEEDS_BEX("Force","Momentum");
REGISTER_CLASS_NAME(FrictionLessElasticContactLaw);
REGISTER_BASE_CLASS_NAME(InteractionSolver);
Modified: trunk/pkg/realtime-rigidbody/PreProcessor/BoxStack.cpp
===================================================================
--- trunk/pkg/realtime-rigidbody/PreProcessor/BoxStack.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/realtime-rigidbody/PreProcessor/BoxStack.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -35,13 +35,11 @@
#include<yade/pkg-common/MetaInteractingGeometry2AABB.hpp>
#include<yade/pkg-common/MetaInteractingGeometry.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/GravityEngines.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
BoxStack::BoxStack () : FileGenerator()
@@ -243,9 +241,6 @@
void BoxStack::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4ClosestFeatures");
@@ -300,7 +295,6 @@
// rootBody->engines.push_back(kinematic);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/realtime-rigidbody/PreProcessor/RotatingBox.cpp
===================================================================
--- trunk/pkg/realtime-rigidbody/PreProcessor/RotatingBox.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/realtime-rigidbody/PreProcessor/RotatingBox.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -25,7 +25,6 @@
#include<yade/pkg-common/CundallNonViscousDamping.hpp>
#include<yade/pkg-common/CundallNonViscousDamping.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/BoundingVolumeMetaEngine.hpp>
#include<yade/pkg-common/MetaInteractingGeometry2AABB.hpp>
@@ -35,7 +34,6 @@
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/pkg-common/PhysicalActionDamper.hpp>
#include<yade/pkg-common/PhysicalActionApplier.hpp>
@@ -262,9 +260,6 @@
void RotatingBox::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
interactionGeometryDispatcher->add("InteractingSphere2InteractingSphere4ClosestFeatures");
@@ -320,7 +315,6 @@
rootBody->engines.push_back(kinematic);
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/realtime-rigidbody/SConscript
===================================================================
--- trunk/pkg/realtime-rigidbody/SConscript 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/realtime-rigidbody/SConscript 2009-03-30 17:10:27 UTC (rev 1738)
@@ -36,8 +36,6 @@
LIBS=env['LIBS']+['yade-base',
'yade-serialization',
'yade-multimethods',
- 'Momentum',
- 'Force',
'ClosestFeatures',
'RigidBodyParameters']),
@@ -52,7 +50,6 @@
'CundallNonViscousDamping',
'GravityEngines',
'yade-serialization',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'PhysicalActionApplier',
@@ -78,7 +75,6 @@
'CundallNonViscousDamping',
'MetaInteractingGeometry',
'yade-serialization',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'GravityEngines',
'InteractionGeometryMetaEngine',
Modified: trunk/pkg/snow/Engine/ElawSnowLayersDeformation.cpp
===================================================================
--- trunk/pkg/snow/Engine/ElawSnowLayersDeformation.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/snow/Engine/ElawSnowLayersDeformation.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,14 +13,11 @@
#include<yade/pkg-dem/SDECLinkPhysics.hpp>
#include<yade/core/Omega.hpp>
#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-common/Force.hpp>
-#include<yade/pkg-common/Momentum.hpp>
-#include<yade/core/PhysicalAction.hpp>
#include<yade/pkg-snow/BssSnowGrain.hpp>
#include<yade/pkg-snow/BshSnowGrain.hpp>
-ElawSnowLayersDeformation::ElawSnowLayersDeformation() : InteractionSolver() , actionForce(new Force) , actionMomentum(new Momentum)
+ElawSnowLayersDeformation::ElawSnowLayersDeformation() : InteractionSolver()
{
sdecGroupMask=1;
creep_viscosity = 1000.0;
Modified: trunk/pkg/snow/Engine/ElawSnowLayersDeformation.hpp
===================================================================
--- trunk/pkg/snow/Engine/ElawSnowLayersDeformation.hpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/snow/Engine/ElawSnowLayersDeformation.hpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -13,15 +13,10 @@
#include <set>
#include <boost/tuple/tuple.hpp>
-class PhysicalAction;
class ElawSnowLayersDeformation : public InteractionSolver
{
/// Attributes
- private :
- shared_ptr<PhysicalAction> actionForce;
- shared_ptr<PhysicalAction> actionMomentum;
-
public :
int sdecGroupMask;
Real creep_viscosity;
@@ -31,7 +26,6 @@
protected :
void registerAttributes();
- NEEDS_BEX("Force","Momentum");
REGISTER_CLASS_NAME(ElawSnowLayersDeformation);
REGISTER_BASE_CLASS_NAME(InteractionSolver);
};
Modified: trunk/pkg/snow/PreProcessor/SnowCreepTest.cpp
===================================================================
--- trunk/pkg/snow/PreProcessor/SnowCreepTest.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/snow/PreProcessor/SnowCreepTest.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -16,7 +16,6 @@
#include<yade/pkg-dem/CohesiveFrictionalRelationships.hpp>
#include<yade/pkg-dem/CohesiveFrictionalBodyParameters.hpp>
#include<yade/pkg-dem/SDECLinkPhysics.hpp>
-#include<yade/pkg-dem/GlobalStiffnessCounter.hpp>
#include<yade/pkg-dem/GlobalStiffnessTimeStepper.hpp>
#include<yade/pkg-dem/PositionOrientationRecorder.hpp>
@@ -54,14 +53,12 @@
#include<yade/pkg-common/InteractingSphere.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
#include<yade/pkg-common/InteractionHashMap.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/extra/Shop.hpp>
@@ -282,7 +279,6 @@
createBox(body,center,halfSize,wall_bottom_wire);
if(wall_bottom) {
rootBody->bodies->insert(body);
- //(resultantforceEngine->subscribedBodies).push_back(body->getId());
triaxialcompressionEngine->wall_bottom_id = body->getId();
//triaxialStateRecorder->wall_bottom_id = body->getId();
forcerec->startId = body->getId();
@@ -578,11 +574,6 @@
velocityRecorder-> outputFile = velocityRecordFile;
velocityRecorder-> interval = recordIntervalIter;
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
- //physicalActionInitializer->physicalActionNames.push_back("StiffnessMatrix");
- physicalActionInitializer->physicalActionNames.push_back("GlobalStiffness");
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
shared_ptr<InteractionGeometryEngineUnit> s1(new InteractingSphere2InteractingSphere4SpheresContactGeometry);
@@ -649,9 +640,6 @@
//stiffnesscounter->sdecGroupMask = 2;
//stiffnesscounter->interval = timeStepUpdateInterval;
- shared_ptr<GlobalStiffnessCounter> globalStiffnessCounter(new GlobalStiffnessCounter);
- // globalStiffnessCounter->sdecGroupMask = 2;
- globalStiffnessCounter->interval = timeStepUpdateInterval;
// moving walls to regulate the stress applied + compress when the packing is dense an stable
//cerr << "triaxialcompressionEngine = shared_ptr<TriaxialCompressionEngine> (new TriaxialCompressionEngine);" << std::endl;
@@ -704,7 +692,6 @@
rootBody->engines.push_back(triaxialcompressionEngine);
//rootBody->engines.push_back(stiffnesscounter);
//rootBody->engines.push_back(stiffnessMatrixTimeStepper);
- rootBody->engines.push_back(globalStiffnessCounter);
rootBody->engines.push_back(globalStiffnessTimeStepper);
rootBody->engines.push_back(triaxialStateRecorder);
// rootBody->engines.push_back(hydraulicForceEngine);//<-------------HYDRAULIC ENGINE HERE
@@ -713,7 +700,6 @@
rootBody->engines.push_back(positionIntegrator);
if(!rotationBlocked)
rootBody->engines.push_back(orientationIntegrator);
- //rootBody->engines.push_back(resultantforceEngine);
//rootBody->engines.push_back(triaxialstressController);
@@ -727,7 +713,6 @@
rootBody->engines.push_back(positionOrientationRecorder);}
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/snow/PreProcessor/SnowVoxelsLoader.cpp
===================================================================
--- trunk/pkg/snow/PreProcessor/SnowVoxelsLoader.cpp 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/snow/PreProcessor/SnowVoxelsLoader.cpp 2009-03-30 17:10:27 UTC (rev 1738)
@@ -9,7 +9,6 @@
#include<yade/pkg-dem/CohesiveFrictionalRelationships.hpp>
#include<yade/pkg-dem/CohesiveFrictionalBodyParameters.hpp>
#include<yade/pkg-dem/SDECLinkPhysics.hpp>
-#include<yade/pkg-dem/GlobalStiffnessCounter.hpp>
#include<yade/pkg-dem/GlobalStiffnessTimeStepper.hpp>
#include<yade/pkg-dem/PositionOrientationRecorder.hpp>
@@ -47,14 +46,12 @@
#include<yade/pkg-common/InteractingSphere.hpp>
#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalActionContainerInitializer.hpp>
#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
#include<yade/pkg-common/InteractionHashMap.hpp>
-#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/pkg-snow/ElawSnowLayersDeformation.hpp>
#include<yade/extra/Shop.hpp>
@@ -396,11 +393,6 @@
void SnowVoxelsLoader::createActors(shared_ptr<MetaBody>& rootBody)
{
- shared_ptr<PhysicalActionContainerInitializer> physicalActionInitializer(new PhysicalActionContainerInitializer);
- physicalActionInitializer->physicalActionNames.push_back("Force");
- physicalActionInitializer->physicalActionNames.push_back("Momentum");
- physicalActionInitializer->physicalActionNames.push_back("GlobalStiffness");
-
shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
shared_ptr<InteractionGeometryEngineUnit> s1(new Ef2_BssSnowGrain_BssSnowGrain_makeIstSnowLayersContact);
@@ -461,9 +453,6 @@
cohesiveFrictionalContactLaw->twist_creep = use_grain_twist_creep;
cohesiveFrictionalContactLaw->creep_viscosity = creep_viscosity;
- shared_ptr<GlobalStiffnessCounter> globalStiffnessCounter(new GlobalStiffnessCounter);
- // globalStiffnessCounter->sdecGroupMask = 2;
- globalStiffnessCounter->interval = timeStepUpdateInterval;
// moving walls to regulate the stress applied + compress when the packing is dense an stable
//cerr << "triaxialcompressionEngine = shared_ptr<TriaxialCompressionEngine> (new TriaxialCompressionEngine);" << std::endl;
@@ -522,7 +511,6 @@
rootBody->engines.push_back(triaxialcompressionEngine);
//rootBody->engines.push_back(stiffnesscounter);
//rootBody->engines.push_back(stiffnessMatrixTimeStepper);
- rootBody->engines.push_back(globalStiffnessCounter);
rootBody->engines.push_back(globalStiffnessTimeStepper);
rootBody->engines.push_back(triaxialStateRecorder);
if(use_gravity_engine)
@@ -534,7 +522,6 @@
rootBody->engines.push_back(positionIntegrator);
//if(!rotationBlocked)
rootBody->engines.push_back(orientationIntegrator);
- //rootBody->engines.push_back(resultantforceEngine);
//rootBody->engines.push_back(triaxialstressController);
@@ -548,7 +535,6 @@
//rootBody->engines.push_back(positionOrientationRecorder);}
rootBody->initializers.clear();
- rootBody->initializers.push_back(physicalActionInitializer);
rootBody->initializers.push_back(boundingVolumeDispatcher);
}
Modified: trunk/pkg/snow/SConscript
===================================================================
--- trunk/pkg/snow/SConscript 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/pkg/snow/SConscript 2009-03-30 17:10:27 UTC (rev 1738)
@@ -59,8 +59,6 @@
'BssSnowGrain',
'BshSnowGrain',
'yade-multimethods',
- 'Force',
- 'Momentum',
'Sphere',
'RigidBodyParameters']),
@@ -95,7 +93,6 @@
'MetaInteractingGeometry',
'GravityEngines',
'yade-serialization',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -108,9 +105,6 @@
'AABB',
'DistantPersistentSAPCollider',
'MetaInteractingGeometry2AABB',
- 'GlobalStiffness',
- 'GlobalStiffnessCounter',
- 'ResultantForceEngine',
'TriaxialStressController',
'TriaxialCompressionEngine',
'GlobalStiffnessTimeStepper',
@@ -138,7 +132,6 @@
'MetaInteractingGeometry',
'GravityEngines',
'yade-serialization',
- 'PhysicalActionContainerInitializer',
'PhysicalActionContainerReseter',
'InteractionGeometryMetaEngine',
'InteractionPhysicsMetaEngine',
@@ -152,9 +145,6 @@
'AABB',
'DistantPersistentSAPCollider',
'MetaInteractingGeometry2AABB',
- 'GlobalStiffness',
- 'GlobalStiffnessCounter',
- 'ResultantForceEngine',
'TriaxialStressController',
'TriaxialCompressionEngine',
'GlobalStiffnessTimeStepper',
Modified: trunk/scripts/chain-distant-interactions.py
===================================================================
--- trunk/scripts/chain-distant-interactions.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/scripts/chain-distant-interactions.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -3,7 +3,6 @@
o=Omega()
o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingBox2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
o.engines=[
Modified: trunk/scripts/constitutive-law.py
===================================================================
--- trunk/scripts/constitutive-law.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/scripts/constitutive-law.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -2,7 +2,6 @@
# -*- encoding=utf-8 -*-
O.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingBox2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
O.engines=[
Modified: trunk/scripts/cylindrical-layer-packing.py
===================================================================
--- trunk/scripts/cylindrical-layer-packing.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/scripts/cylindrical-layer-packing.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -8,9 +8,7 @@
# we will use this in both initializers and engines, so we save it to a temp variable to save typing
aabbDispatcher=MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingBox2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
-o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer',{'physicalActionNames':['Force','Momentum','GlobalStiffness']}),
- aabbDispatcher]
+o.initializers=[aabbDispatcher]
o.engines=[
StandAloneEngine('PhysicalActionContainerReseter'),
Modified: trunk/scripts/exact-rot-facet.py
===================================================================
--- trunk/scripts/exact-rot-facet.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/scripts/exact-rot-facet.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -7,7 +7,6 @@
from math import *
o=Omega()
o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingBox2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
o.engines=[
Modified: trunk/scripts/exact-rot.py
===================================================================
--- trunk/scripts/exact-rot.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/scripts/exact-rot.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -3,7 +3,6 @@
from math import *
o=Omega()
o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingBox2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
o.engines=[
Modified: trunk/scripts/multi.py
===================================================================
--- trunk/scripts/multi.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/scripts/multi.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -8,7 +8,6 @@
o=Omega()
o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingFacet2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
o.engines=[
Modified: trunk/scripts/simple-scene-graph.py
===================================================================
--- trunk/scripts/simple-scene-graph.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/scripts/simple-scene-graph.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -3,7 +3,6 @@
o=Omega()
o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingBox2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
o.engines=[
Modified: trunk/scripts/simple-scene-parallel.py
===================================================================
--- trunk/scripts/simple-scene-parallel.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/scripts/simple-scene-parallel.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -3,7 +3,6 @@
o=Omega()
o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingBox2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
o.engines=[
Modified: trunk/scripts/simple-scene-player.py
===================================================================
--- trunk/scripts/simple-scene-player.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/scripts/simple-scene-player.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -3,7 +3,6 @@
o=Omega()
o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingBox2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
o.engines=[
Modified: trunk/scripts/simple-scene-video.py
===================================================================
--- trunk/scripts/simple-scene-video.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/scripts/simple-scene-video.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -3,7 +3,6 @@
o=Omega()
o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingBox2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
o.engines=[
Modified: trunk/scripts/simple-scene.py
===================================================================
--- trunk/scripts/simple-scene.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/scripts/simple-scene.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -9,8 +9,6 @@
## Initializers are run before the simulation.
o.initializers=[
- ## Create and reset to zero container of all PhysicalActions that will be used
- StandAloneEngine('PhysicalActionContainerInitializer'),
## Create bounding boxes. They are needed to zoom the 3d view properly before we start the simulation.
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingBox2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
@@ -57,21 +55,21 @@
## This MetaEngine acts on all PhysicalActions and selects the right EngineUnit base on type of the PhysicalAction.
#
# note that following 4 engines (till the end) can be replaced by an optimized monolithic version:
- DeusExMachina('NewtonsDampedLaw',{'damping':0.0}),
+# DeusExMachina('NewtonsDampedLaw',{'damping':0.0}),
#
-# MetaEngine('PhysicalActionDamper',[
-# EngineUnit('CundallNonViscousForceDamping',{'damping':0.2}),
-# EngineUnit('CundallNonViscousMomentumDamping',{'damping':0.2})
-# ]),
+ MetaEngine('PhysicalActionDamper',[
+ EngineUnit('CundallNonViscousForceDamping',{'damping':0.2}),
+ EngineUnit('CundallNonViscousMomentumDamping',{'damping':0.2})
+ ]),
## Now we have forces and momenta acting on bodies. Newton's law calculates acceleration that corresponds to them.
-# MetaEngine('PhysicalActionApplier',[
-# EngineUnit('NewtonsForceLaw'),
-# EngineUnit('NewtonsMomentumLaw'),
-# ]),
+ MetaEngine('PhysicalActionApplier',[
+ EngineUnit('NewtonsForceLaw'),
+ EngineUnit('NewtonsMomentumLaw'),
+ ]),
## Acceleration results in velocity change. Integrating the velocity over dt, position of the body will change.
-# MetaEngine('PhysicalParametersMetaEngine',[EngineUnit('LeapFrogPositionIntegrator')]),
+ MetaEngine('PhysicalParametersMetaEngine',[EngineUnit('LeapFrogPositionIntegrator')]),
## Angular acceleration changes angular velocity, resulting in position and/or orientation change of the body.
-# MetaEngine('PhysicalParametersMetaEngine',[EngineUnit('LeapFrogOrientationIntegrator')]),
+ MetaEngine('PhysicalParametersMetaEngine',[EngineUnit('LeapFrogOrientationIntegrator')]),
]
Modified: trunk/scripts/test-sphere-facet-corner.py
===================================================================
--- trunk/scripts/test-sphere-facet-corner.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/scripts/test-sphere-facet-corner.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -17,7 +17,6 @@
## Initializers
o.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingFacet2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
Modified: trunk/scripts/test-sphere-facet.py
===================================================================
--- trunk/scripts/test-sphere-facet.py 2009-03-29 20:43:38 UTC (rev 1737)
+++ trunk/scripts/test-sphere-facet.py 2009-03-30 17:10:27 UTC (rev 1738)
@@ -18,7 +18,6 @@
#
O.initializers=[
- StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingBox2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
O.engines=[