← Back to team overview

yade-dev team mailing list archive

[svn] r1888 - in trunk: . core core/containers debian extra extra/tetra gui gui/py gui/qt3 lib lib/factory lib/import lib/multimethods lib/serialization lib/smoothing pkg/common pkg/common/DataClass/BoundingVolume pkg/common/DataClass/GeometricalModel pkg/common/DataClass/InteractingGeometry pkg/common/DataClass/InteractionGeometry pkg/common/DataClass/PhysicalParameters pkg/common/DataClass/Widgets pkg/common/Engine/DeusExMachina pkg/common/Engine/EngineUnit pkg/common/Engine/FilterEngine pkg/common/Engine/MetaEngine pkg/common/Engine/StandAloneEngine pkg/common/RenderingEngine/GLDrawBoundingVolume pkg/common/RenderingEngine/GLDrawGeometricalModel pkg/common/RenderingEngine/GLDrawInteractingGeometry pkg/common/RenderingEngine/GLDrawInteractionGeometry pkg/common/RenderingEngine/GLDrawInteractionPhysics pkg/common/RenderingEngine/GLDrawShadowVolume pkg/common/RenderingEngine/GLDrawState pkg/common/RenderingEngine/GLDrawWidgets pkg/common/RenderingEngine/OpenGLRender! ingEngine pkg/dem pkg/dem/DataClass pkg/dem/DataClass/InteractingGeometry pkg/dem/DataClass/InteractionGeometry pkg/dem/DataClass/InteractionPhysics pkg/dem/DataClass/PhysicalParameters pkg/dem/Engine/DeusExMachina pkg/dem/Engine/EngineUnit pkg/dem/Engine/StandAloneEngine pkg/dem/PreProcessor pkg/dem/RenderingEngine/GLDrawCohesiveFrictionalContactInteraction pkg/dem/RenderingEngine/GLDrawElasticContactInteraction pkg/dem/RenderingEngine/GLDrawInteractingMyTetrahedron pkg/dem/RenderingEngine/GLDrawSDECLinkGeometry pkg/dem/RenderingEngine/GLDrawSpheresContactGeometry pkg/dem/RenderingEngine/GLDrawViscoelasticInteraction pkg/dem/meta pkg/fem pkg/fem/DataClass/GeometricalModel pkg/fem/DataClass/PhysicalParameters pkg/fem/Engine/EngineUnit pkg/fem/Engine/StandAloneEngine pkg/fem/PreProcessor pkg/lattice pkg/lattice/DataClass/GeometricalModel pkg/lattice/DataClass/InteractingGeometry pkg/lattice/DataClass/InteractionPhysics pkg/lattice/DataClass/PhysicalParameters pkg/lattice/Eng! ine/EngineUnit pkg/lattice/Engine/StandAloneEngine pkg/lattice! /PreProc

 

Author: eudoxos
Date: 2009-07-27 20:08:23 +0200 (Mon, 27 Jul 2009)
New Revision: 1888

Added:
   trunk/pkg/common/Engine/MetaEngine/BoundingVolumeEngineUnit.cpp
   trunk/pkg/common/Engine/MetaEngine/ConstitutiveLaw.cpp
   trunk/pkg/common/Engine/MetaEngine/GeometricalModelEngineUnit.cpp
   trunk/pkg/common/Engine/MetaEngine/InteractingGeometryEngineUnit.cpp
   trunk/pkg/common/Engine/MetaEngine/InteractionGeometryEngineUnit.cpp
   trunk/pkg/common/Engine/MetaEngine/InteractionPhysicsEngineUnit.cpp
   trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplierUnit.cpp
   trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamperUnit.cpp
   trunk/pkg/common/Engine/MetaEngine/PhysicalParametersEngineUnit.cpp
   trunk/pkg/dem/PreProcessor/TetraTestGen.cpp
   trunk/pkg/dem/PreProcessor/TetraTestGen.hpp
   trunk/pkg/dem/meta/
   trunk/pkg/dem/meta/ConcretePM.cpp
   trunk/pkg/dem/meta/ConcretePM.hpp
   trunk/pkg/dem/meta/RockPM.cpp
   trunk/pkg/dem/meta/RockPM.hpp
   trunk/pkg/dem/meta/Shop.cpp
   trunk/pkg/dem/meta/Shop.hpp
   trunk/pkg/dem/meta/Tetra.cpp
   trunk/pkg/dem/meta/Tetra.hpp
   trunk/py/3rd-party/
   trunk/py/3rd-party/README
   trunk/py/3rd-party/boost-python-indexing-suite-v2-noSymlinkHeaders/
   trunk/py/3rd-party/pygts-0.3.1/
   trunk/py/WeightedAverage2d.cpp
   trunk/scripts/fix-plugin-names.py
   trunk/yadeSCons.py
Removed:
   trunk/extra/Shop.cpp
   trunk/extra/Shop.hpp
   trunk/extra/tetra/Tetra.cpp
   trunk/extra/tetra/Tetra.hpp
   trunk/extra/tetra/TetraTestGen.cpp
   trunk/extra/tetra/TetraTestGen.hpp
   trunk/lib/py/
   trunk/lib/serialization-bin/
   trunk/lib/smoothing/WeightedAverage2d.cpp
   trunk/pkg/common/Engine/MetaEngine/EngineUnits.cpp
   trunk/pkg/common/SConscript
   trunk/pkg/dem/ConcretePM.cpp
   trunk/pkg/dem/ConcretePM.hpp
   trunk/pkg/dem/RockPM.cpp
   trunk/pkg/dem/RockPM.hpp
   trunk/pkg/dem/SConscript
   trunk/pkg/lattice/SConscript
   trunk/pkg/mass-spring/SConscript
   trunk/pkg/realtime-rigidbody/SConscript
Modified:
   trunk/ChangeLog
   trunk/SConscript
   trunk/SConstruct
   trunk/core/Engine.hpp
   trunk/core/MetaBody.cpp
   trunk/core/MetaBody.hpp
   trunk/core/Omega.hpp
   trunk/core/PhysicalParameters.cpp
   trunk/core/PhysicalParameters.hpp
   trunk/core/SConscript
   trunk/core/Timing.hpp
   trunk/core/containers/BodyAssocVector.cpp
   trunk/core/containers/BodyRedirectionVector.cpp
   trunk/core/containers/InteractionHashMap.cpp
   trunk/core/containers/InteractionVecMap.cpp
   trunk/core/containers/InteractionVecMap.hpp
   trunk/core/yade.cpp
   trunk/debian/rules
   trunk/extra/SConscript
   trunk/gui/SConscript
   trunk/gui/py/PythonUI_rc.py
   trunk/gui/py/pyAttrUtils.hpp
   trunk/gui/qt3/GLViewer.cpp
   trunk/gui/qt3/QtGUI-python.cpp
   trunk/gui/qt3/QtGUI.cpp
   trunk/gui/qt3/SimulationController.cpp
   trunk/lib/SConscript
   trunk/lib/factory/ClassFactory.hpp
   trunk/lib/import/STLImporter.cpp
   trunk/lib/multimethods/DynLibDispatcher.hpp
   trunk/lib/serialization/Serializable.hpp
   trunk/pkg/common/DataClass/BoundingVolume/AABB.cpp
   trunk/pkg/common/DataClass/BoundingVolume/BoundingSphere.cpp
   trunk/pkg/common/DataClass/GeometricalModel/Box.cpp
   trunk/pkg/common/DataClass/GeometricalModel/Facet.cpp
   trunk/pkg/common/DataClass/GeometricalModel/Mesh2D.cpp
   trunk/pkg/common/DataClass/GeometricalModel/Quadrilateral.cpp
   trunk/pkg/common/DataClass/GeometricalModel/Sphere.cpp
   trunk/pkg/common/DataClass/GeometricalModel/Tetrahedron.cpp
   trunk/pkg/common/DataClass/InteractingGeometry/InteractingBox.cpp
   trunk/pkg/common/DataClass/InteractingGeometry/InteractingFacet.cpp
   trunk/pkg/common/DataClass/InteractingGeometry/InteractingSphere.cpp
   trunk/pkg/common/DataClass/InteractingGeometry/MetaInteractingGeometry.cpp
   trunk/pkg/common/DataClass/InteractionGeometry/ClosestFeatures.cpp
   trunk/pkg/common/DataClass/PhysicalParameters/ElasticBodyParameters.cpp
   trunk/pkg/common/DataClass/PhysicalParameters/ElasticBodyParameters.hpp
   trunk/pkg/common/DataClass/PhysicalParameters/ParticleParameters.cpp
   trunk/pkg/common/DataClass/PhysicalParameters/RigidBodyParameters.cpp
   trunk/pkg/common/DataClass/PhysicalParameters/RigidBodyParameters.hpp
   trunk/pkg/common/DataClass/Widgets/ColorScale.cpp
   trunk/pkg/common/Engine/DeusExMachina/DisplacementEngine.cpp
   trunk/pkg/common/Engine/DeusExMachina/DisplacementToForceEngine.cpp
   trunk/pkg/common/Engine/DeusExMachina/FixedOrientationEngine.cpp
   trunk/pkg/common/Engine/DeusExMachina/FixedPositionEngine.cpp
   trunk/pkg/common/Engine/DeusExMachina/ForceEngine.cpp
   trunk/pkg/common/Engine/DeusExMachina/LinearInterpolate.hpp
   trunk/pkg/common/Engine/DeusExMachina/MomentEngine.cpp
   trunk/pkg/common/Engine/DeusExMachina/PressTestEngine.hpp
   trunk/pkg/common/Engine/DeusExMachina/RotationEngine.cpp
   trunk/pkg/common/Engine/DeusExMachina/StaticAttractionEngine.cpp
   trunk/pkg/common/Engine/DeusExMachina/TranslationEngine.cpp
   trunk/pkg/common/Engine/EngineUnit/ElasticBodySimpleRelationship.cpp
   trunk/pkg/common/Engine/EngineUnit/InteractingBox2AABB.cpp
   trunk/pkg/common/Engine/EngineUnit/InteractingFacet2AABB.cpp
   trunk/pkg/common/Engine/EngineUnit/InteractingSphere2AABB.cpp
   trunk/pkg/common/Engine/EngineUnit/LeapFrogOrientationIntegrator.cpp
   trunk/pkg/common/Engine/EngineUnit/LeapFrogPositionIntegrator.cpp
   trunk/pkg/common/Engine/EngineUnit/MetaInteractingGeometry2AABB.cpp
   trunk/pkg/common/Engine/EngineUnit/NewtonsForceLaw.cpp
   trunk/pkg/common/Engine/EngineUnit/NewtonsMomentumLaw.cpp
   trunk/pkg/common/Engine/FilterEngine/ColorizedLayerFilter.cpp
   trunk/pkg/common/Engine/FilterEngine/ColorizedTimeFilter.cpp
   trunk/pkg/common/Engine/FilterEngine/ColorizedVelocityFilter.cpp
   trunk/pkg/common/Engine/FilterEngine/PythonRunnerFilter.cpp
   trunk/pkg/common/Engine/MetaEngine/BoundingVolumeMetaEngine.cpp
   trunk/pkg/common/Engine/MetaEngine/GeometricalModelMetaEngine.cpp
   trunk/pkg/common/Engine/MetaEngine/InteractingGeometryMetaEngine.cpp
   trunk/pkg/common/Engine/MetaEngine/InteractionGeometryMetaEngine.cpp
   trunk/pkg/common/Engine/MetaEngine/InteractionPhysicsMetaEngine.cpp
   trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplier.cpp
   trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamper.cpp
   trunk/pkg/common/Engine/MetaEngine/PhysicalParametersMetaEngine.cpp
   trunk/pkg/common/Engine/StandAloneEngine/DistantPersistentSAPCollider.cpp
   trunk/pkg/common/Engine/StandAloneEngine/PeriodicPythonRunner.cpp
   trunk/pkg/common/Engine/StandAloneEngine/PersistentSAPCollider.cpp
   trunk/pkg/common/Engine/StandAloneEngine/PersistentTriangulationCollider.cpp
   trunk/pkg/common/Engine/StandAloneEngine/ResetPositionEngine.cpp
   trunk/pkg/common/RenderingEngine/GLDrawBoundingVolume/GLDrawAABB.cpp
   trunk/pkg/common/RenderingEngine/GLDrawBoundingVolume/GLDrawBoundingSphere.cpp
   trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawBox.cpp
   trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawFacet.cpp
   trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawMesh2D.cpp
   trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawQuadrilateral.cpp
   trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawSphere.cpp
   trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawTetrahedron.cpp
   trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawTube.cpp
   trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawBssSweptSphereLineSegment.cpp
   trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingBox.cpp
   trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingFacet.cpp
   trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingSphere.cpp
   trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawMetaInteractingGeometry.cpp
   trunk/pkg/common/RenderingEngine/GLDrawInteractionGeometry/GLDrawClosestFeatures.cpp
   trunk/pkg/common/RenderingEngine/GLDrawInteractionPhysics/GLDrawNormalInteraction.cpp
   trunk/pkg/common/RenderingEngine/GLDrawShadowVolume/GLDrawBoxShadowVolume.cpp
   trunk/pkg/common/RenderingEngine/GLDrawShadowVolume/GLDrawSphereShadowVolume.cpp
   trunk/pkg/common/RenderingEngine/GLDrawState/GLDrawParticleState.cpp
   trunk/pkg/common/RenderingEngine/GLDrawState/GLDrawRigidBodyState.cpp
   trunk/pkg/common/RenderingEngine/GLDrawWidgets/GLDrawColorScale.cpp
   trunk/pkg/common/RenderingEngine/OpenGLRenderingEngine/OpenGLRenderingEngine.cpp
   trunk/pkg/dem/DataClass/Clump.cpp
   trunk/pkg/dem/DataClass/InteractingGeometry/InteractingMyTetrahedron.cpp
   trunk/pkg/dem/DataClass/InteractionGeometry/InteractionOfMyTetrahedron.cpp
   trunk/pkg/dem/DataClass/InteractionGeometry/SDECLinkGeometry.cpp
   trunk/pkg/dem/DataClass/InteractionPhysics/CapillaryParameters.hpp
   trunk/pkg/dem/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.cpp
   trunk/pkg/dem/DataClass/InteractionPhysics/ContactLaw1Interaction.cpp
   trunk/pkg/dem/DataClass/InteractionPhysics/ElasticContactInteraction.cpp
   trunk/pkg/dem/DataClass/InteractionPhysics/SDECLinkPhysics.cpp
   trunk/pkg/dem/DataClass/InteractionPhysics/ViscoelasticInteraction.cpp
   trunk/pkg/dem/DataClass/PhysicalParameters/BodyMacroParameters.cpp
   trunk/pkg/dem/DataClass/PhysicalParameters/CohesiveFrictionalBodyParameters.cpp
   trunk/pkg/dem/DataClass/PhysicalParameters/SimpleViscoelasticBodyParameters.cpp
   trunk/pkg/dem/Engine/DeusExMachina/CapillaryPressureEngine.cpp
   trunk/pkg/dem/Engine/DeusExMachina/CapillaryRecorder.cpp
   trunk/pkg/dem/Engine/DeusExMachina/CapillaryStressRecorder.cpp
   trunk/pkg/dem/Engine/DeusExMachina/ContactStressRecorder.cpp
   trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp
   trunk/pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.cpp
   trunk/pkg/dem/Engine/DeusExMachina/SampleCapillaryPressureEngine.hpp
   trunk/pkg/dem/Engine/DeusExMachina/StaticSpheresAttractionEngine.cpp
   trunk/pkg/dem/Engine/DeusExMachina/ThreeDTriaxialEngine.cpp
   trunk/pkg/dem/Engine/DeusExMachina/ThreeDTriaxialEngine.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/TriaxialStressController.cpp
   trunk/pkg/dem/Engine/DeusExMachina/WallStressRecorder.cpp
   trunk/pkg/dem/Engine/EngineUnit/BasicViscoelasticRelationships.cpp
   trunk/pkg/dem/Engine/EngineUnit/CL1Relationships.cpp
   trunk/pkg/dem/Engine/EngineUnit/CohesiveFrictionalRelationships.cpp
   trunk/pkg/dem/Engine/EngineUnit/InteractingBox2InteractingSphere4SpheresContactGeometry.cpp
   trunk/pkg/dem/Engine/EngineUnit/InteractingFacet2InteractingSphere4SpheresContactGeometry.cpp
   trunk/pkg/dem/Engine/EngineUnit/InteractingMyTetrahedron2AABB.cpp
   trunk/pkg/dem/Engine/EngineUnit/InteractingMyTetrahedron2InteractingBox4InteractionOfMyTetrahedron.cpp
   trunk/pkg/dem/Engine/EngineUnit/InteractingMyTetrahedron2InteractingMyTetrahedron4InteractionOfMyTetrahedron.cpp
   trunk/pkg/dem/Engine/EngineUnit/InteractingSphere2InteractingSphere4SpheresContactGeometry.cpp
   trunk/pkg/dem/Engine/EngineUnit/MacroMicroElasticRelationships.cpp
   trunk/pkg/dem/Engine/EngineUnit/SimpleElasticRelationships.cpp
   trunk/pkg/dem/Engine/EngineUnit/SimpleElasticRelationshipsWater.cpp
   trunk/pkg/dem/Engine/EngineUnit/SimpleViscoelasticRelationships.cpp
   trunk/pkg/dem/Engine/EngineUnit/Tetrahedron2InteractingMyTetrahedron.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/AveragePositionRecorder.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/ContactLaw1.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/ElasticCohesiveLaw.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/ElasticCriterionTimeStepper.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/ForceRecorder.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/GeometricalModelForceColorizer.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/MGPRecorder.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/MicroMacroAnalyser.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/MyTetrahedronLaw.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/PositionOrientationRecorder.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/RigidBodyRecorder.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/SimpleViscoelasticSpheresInteractionRecorder.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/UniaxialStrainer.hpp
   trunk/pkg/dem/Engine/StandAloneEngine/VelocityRecorder.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/ViscousForceDamping.hpp
   trunk/pkg/dem/Engine/StandAloneEngine/VolumicContactLaw.cpp
   trunk/pkg/dem/PreProcessor/CohesiveTriaxialTest.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/SimpleScene.cpp
   trunk/pkg/dem/PreProcessor/SimpleScene.hpp
   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/TriaxialTestWater.cpp
   trunk/pkg/dem/PreProcessor/UniaxialStrainerGen.hpp
   trunk/pkg/dem/RenderingEngine/GLDrawCohesiveFrictionalContactInteraction/GLDrawCohesiveFrictionalContactInteraction.cpp
   trunk/pkg/dem/RenderingEngine/GLDrawElasticContactInteraction/GLDrawElasticContactInteraction.cpp
   trunk/pkg/dem/RenderingEngine/GLDrawInteractingMyTetrahedron/GLDrawInteractingMyTetrahedron.cpp
   trunk/pkg/dem/RenderingEngine/GLDrawSDECLinkGeometry/GLDrawSDECLinkGeometry.cpp
   trunk/pkg/dem/RenderingEngine/GLDrawSpheresContactGeometry/GLDrawSpheresContactGeometry.cpp
   trunk/pkg/dem/RenderingEngine/GLDrawViscoelasticInteraction/GLDrawViscoelasticInteraction.cpp
   trunk/pkg/fem/DataClass/GeometricalModel/FEMSetGeometry.cpp
   trunk/pkg/fem/DataClass/PhysicalParameters/FEMNodeData.cpp
   trunk/pkg/fem/DataClass/PhysicalParameters/FEMSetParameters.cpp
   trunk/pkg/fem/DataClass/PhysicalParameters/FEMTetrahedronData.cpp
   trunk/pkg/fem/DataClass/PhysicalParameters/FEMTetrahedronData.hpp
   trunk/pkg/fem/Engine/EngineUnit/FEMSet2Tetrahedrons.cpp
   trunk/pkg/fem/Engine/EngineUnit/FEMSetTextLoader.cpp
   trunk/pkg/fem/Engine/EngineUnit/FEMTetrahedronStiffness.cpp
   trunk/pkg/fem/Engine/StandAloneEngine/FEMLaw.cpp
   trunk/pkg/fem/PreProcessor/FEMBeam.cpp
   trunk/pkg/fem/SConscript
   trunk/pkg/lattice/DataClass/GeometricalModel/LatticeSetGeometry.cpp
   trunk/pkg/lattice/DataClass/GeometricalModel/LineSegment.cpp
   trunk/pkg/lattice/DataClass/InteractingGeometry/LatticeInteractingGeometry.cpp
   trunk/pkg/lattice/DataClass/InteractionPhysics/LatticeBeamAngularSpring.cpp
   trunk/pkg/lattice/DataClass/InteractionPhysics/NonLocalDependency.cpp
   trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeBeamParameters.cpp
   trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeNodeParameters.cpp
   trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeSetParameters.cpp
   trunk/pkg/lattice/Engine/EngineUnit/LatticeSet2LatticeBeams.cpp
   trunk/pkg/lattice/Engine/StandAloneEngine/BeamRecorder.cpp
   trunk/pkg/lattice/Engine/StandAloneEngine/LatticeLaw.cpp
   trunk/pkg/lattice/Engine/StandAloneEngine/MeasurePoisson.cpp
   trunk/pkg/lattice/Engine/StandAloneEngine/MovingSupport.cpp
   trunk/pkg/lattice/Engine/StandAloneEngine/NodeRecorder.cpp
   trunk/pkg/lattice/Engine/StandAloneEngine/NonLocalInitializer.cpp
   trunk/pkg/lattice/Engine/StandAloneEngine/StrainRecorder.cpp
   trunk/pkg/lattice/PreProcessor/LatticeExample.cpp
   trunk/pkg/lattice/PreProcessor/LatticeExample.hpp
   trunk/pkg/lattice/PreProcessor/LatticeExampleCTData.cpp
   trunk/pkg/lattice/PreProcessor/LatticeExampleCTData.hpp
   trunk/pkg/lattice/PreProcessor/LatticeExampleSimple.cpp
   trunk/pkg/lattice/PreProcessor/LatticeExampleSimple.hpp
   trunk/pkg/lattice/RenderingEngine/GLDrawLatticeBeamState/GLDrawLatticeBeamState.cpp
   trunk/pkg/lattice/RenderingEngine/GLDrawLatticeInteractingGeometry/GLDrawLatticeInteractingGeometry.cpp
   trunk/pkg/lattice/RenderingEngine/GLDrawLatticeSetGeometry/GLDrawLatticeSetGeometry.cpp
   trunk/pkg/lattice/RenderingEngine/GLDrawLineSegment/GLDrawLineSegment.cpp
   trunk/pkg/mass-spring/DataClass/InteractionGeometry/SpringGeometry.cpp
   trunk/pkg/mass-spring/DataClass/InteractionPhysics/SpringPhysics.cpp
   trunk/pkg/mass-spring/DataClass/PhysicalParameters/ParticleSetParameters.cpp
   trunk/pkg/mass-spring/Engine/EngineUnit/ParticleSet2Mesh2D.cpp
   trunk/pkg/mass-spring/Engine/StandAloneEngine/MassSpringLaw.cpp
   trunk/pkg/mass-spring/PreProcessor/HangingCloth.cpp
   trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingBox4ClosestFeatures.cpp
   trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingSphere4ClosestFeatures.cpp
   trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingSphere2InteractingSphere4ClosestFeatures.cpp
   trunk/pkg/realtime-rigidbody/Engine/StandAloneEngine/FrictionLessElasticContactLaw.cpp
   trunk/pkg/realtime-rigidbody/PreProcessor/BoxStack.cpp
   trunk/pkg/realtime-rigidbody/PreProcessor/RotatingBox.cpp
   trunk/pkg/snow/DataClass/BssSnowGrain.cpp
   trunk/pkg/snow/DataClass/BssSnowGrain.hpp
   trunk/pkg/snow/Engine/Ef2_BssSnowGrain_AABB_makeAABB.cpp
   trunk/pkg/snow/Engine/Ef2_BssSnowGrain_BssSnowGrain_makeIstSnowLayersContact.cpp
   trunk/pkg/snow/Engine/Ef2_BssSnowGrain_BssSnowGrain_makeSpheresContactGeometry.cpp
   trunk/pkg/snow/Engine/Ef2_InteractingBox_BssSnowGrain_makeIstSnowLayersContact.cpp
   trunk/pkg/snow/Engine/Ef2_InteractingBox_BssSnowGrain_makeSpheresContactGeometry.cpp
   trunk/pkg/snow/Engine/ElawSnowLayersDeformation.cpp
   trunk/pkg/snow/PreProcessor/SnowCreepTest.cpp
   trunk/pkg/snow/PreProcessor/SnowVoxelsLoader.cpp
   trunk/pkg/snow/RenderingEngine/Ef1_BshSnowGrain_glDraw.cpp
   trunk/pkg/snow/RenderingEngine/Ef1_BssSnowGrain_glDraw.cpp
   trunk/py/SConscript
   trunk/py/_packPredicates.cpp
   trunk/py/_packSpheres.cpp
   trunk/py/_utils.cpp
   trunk/py/utils.py
   trunk/py/yadeWrapper/customConverters.cpp
   trunk/py/yadeWrapper/yadeWrapper.cpp
   trunk/scripts/linkdeps.py
   trunk/scripts/test/facet-sphere.py
Log:
1. BIG CHANGE: pkg/ no longer have SConscript files but are scanned at startup for plugins. See http://yade.wikia.com/wiki/ImplicitBuilds for some details. Let me know if there are some problems.

Known bugs: snow and fem don't build, add the to exclude= things. Will be fixed (hopefuly) soon.

This allows for monolithic build (scons linkStrategy=monolithic) which is much faster and has smaller disk usage also.

2. Add pkg/dem/meta directory for what doesn't fit in either category
3. Move Shop to pkg/dem
4. Revamp python wrapper so that most classes don't use proxies anymore. The old interface is moslty kept, let me know if you have problems. Adapted a few things for those changes.
5. All classes _must_ have YADE_PLUGIN("PLuginName"), not YADE_PLUGIN (changed everywhere)
6. Move a few files around
7. Remove EngineUnits, make separate .cpp files for every type




Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/ChangeLog	2009-07-27 18:08:23 UTC (rev 1888)
@@ -652,7 +652,7 @@
 
 r.1066 (Vaclav)
   1. Clump code cleanup
-  2. Python may now be embedded in yade: (i) SConscruct checks for it and #defines EMBED_PYTHON if present. (ii) main sets up the interpreter. One disadvantage is that Python runs in its own thread, so pressing ^C during simulation doesn't quit yade (^\ still works).
+  2. Python may now be embedded in yade: (i) SConscruct checks for it and #defines YADE_PYTHON if present. (ii) main sets up the interpreter. One disadvantage is that Python runs in its own thread, so pressing ^C during simulation doesn't quit yade (^\ still works).
   3. New class PythonRecorder that evaluates arbitrary expression when activated.
   4. Pyade interface that makes it possible to retrieve some values from yade in Python. For example, you can now record body #5 z-velocity and z-angularVelocity every 10 iterations by setting PythonRecorder::expression="if (S.i%10==0): print B[5].v[2],B[5].w[2]". Retrievable attributes are documented in the source (or the Doxygen documentation).
   - The python stuff is not very logically still in yade-extra/clump, which has become my playground. Once it matures and someone want it, it may move. Let me know it you find it useful.

Modified: trunk/SConscript
===================================================================
--- trunk/SConscript	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/SConscript	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,2 +1,2 @@
 Import('*')
-SConscript(dirs=env['yadeModules'],duplicate=0)
+SConscript(dirs=['core','lib']+[d for d in ('extra','py','gui') if d not in env['exclude']],duplicate=0)

Modified: trunk/SConstruct
===================================================================
--- trunk/SConstruct	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/SConstruct	2009-07-27 18:08:23 UTC (rev 1888)
@@ -129,10 +129,11 @@
 	ListVariable('exclude','Yade components that will not be built','none',names=['qt3','gui','extra','common','dem','fem','lattice','mass-spring','realtime-rigidbody','snow']),
 	EnumVariable('PGO','Whether to "gen"erate or "use" Profile-Guided Optimization','',['','gen','use'],{'no':'','0':'','false':''},1),
 	# OK, dummy prevents bug in scons: if one selects all, it says all in scons.config, but without quotes, which generates error.
-	ListVariable('features','Optional features that are turned on','python,log4cxx,openGL',names=['openGL','python','log4cxx','binfmt','CGAL','dummy','GTS']),
+	ListVariable('features','Optional features that are turned on','python,log4cxx,openGL',names=['openGL','python','log4cxx','CGAL','dummy','GTS']),
 	('jobs','Number of jobs to run at the same time (same as -j, but saved)',4,None,int),
 	('extraModules', 'Extra directories with their own SConscript files (must be in-tree) (whitespace separated)',None,None,Split),
 	('buildPrefix','Where to create build-[version][variant] directory for intermediary files','..'),
+	EnumVariable('linkStrategy','How to link plugins together','per-class',['per-class','per-pkg[broken]','monolithic','static[broken]']),
 	('version','Yade version (if not specified, guess will be attempted)',None),
 	('CPPPATH', 'Additional paths for the C preprocessor (whitespace separated)',None,None,Split),
 	('LIBPATH','Additional paths for the linker (whitespace separated)',None,None,Split),
@@ -177,23 +178,11 @@
 ###########################################
 ################# BUILD DIRECTORY #########
 ###########################################
-
+import yadeSCons
 ##ALL generated stuff should go here - therefore we must determine it very early!!
-
+env['realVersion']=yadeSCons.getRealVersion()
 if not env.has_key('version'):
-	"Attempts to get yade version from RELEASE file if it exists or from svn."
-	if os.path.exists('RELEASE'):
-		env['version']=file('RELEASE').readline().strip()
-	if not env.has_key('version'):
-		for l in os.popen("LC_ALL=C bzr version-info 2>/dev/null").readlines():
-			m=re.match(r'revno: ([0-9]+)',l)
-			if m: env['version']='bzr'+m.group(1)
-	if not env.has_key('version'):
-		for l in os.popen("LC_ALL=C svn info").readlines():
-			m=re.match(r'Revision: ([0-9]+)',l)
-			if m: env['version']='svn'+m.group(1)
-	if not env.has_key('version'):
-		env['version']='unknown'
+	env['version']=env['realVersion']
 
 env['SUFFIX']='-'+env['version']+env['variant']
 print "Yade version is `%s', installed files will be suffixed with `%s'."%(env['version'],env['SUFFIX'])
@@ -312,10 +301,11 @@
 	ok&=CheckLib_maybeMT(conf,'boost_filesystem','boost/filesystem/path.hpp','c++','boost::filesystem::path();')
 	ok&=CheckLib_maybeMT(conf,'boost_iostreams','boost/iostreams/device/file.hpp','c++','boost::iostreams::file_sink("");')
 	ok&=CheckLib_maybeMT(conf,'boost_regex','boost/regex.hpp','c++','boost::regex("");')
+	ok&=CheckLib_maybeMT(conf,'boost_serialization','boost/archive/archive_exception.hpp','c++','try{} catch (const boost::archive::archive_exception& e) {};')
+	ok&=CheckLib_maybeMT(conf,'boost_program_options','boost/program_options.hpp','c++','boost::program_options::options_description o;')
 	env['haveForeach']=conf.CheckCXXHeader('boost/foreach.hpp','<>')
 	if not env['haveForeach']: print "(OK, local version will be used instead)"
-	ok&=conf.CheckLibWithHeader('sqlite3','sqlite3.h','c++','sqlite3_close(0L);',autoadd=0)
-
+	ok&=conf.CheckLibWithHeader('sqlite3','sqlite3.h','c++','sqlite3_close(0L);',autoadd=1)
 	if not env['useMiniWm3']: ok&=conf.CheckLibWithHeader('Wm3Foundation','Wm3Math.h','c++','Wm3::Math<double>::PI;',autoadd=1)
 
 
@@ -353,7 +343,7 @@
 			and CheckLib_maybeMT(conf,'boost_python','boost/python.hpp','c++','boost::python::scope();')
 			and conf.CheckCXXHeader(['Python.h','numpy/ndarrayobject.h'],'<>'))
 		if not ok: featureNotOK('python')
-		env.Append(CPPDEFINES=['EMBED_PYTHON'])
+		env.Append(CPPDEFINES=['YADE_PYTHON'])
 	if 'CGAL' in env['features']:
 		ok=cong.CheckLibWithHeader('CGAL','CGAL/Exact_predicates_inexact_constructions_kernel.h','c++','CGAL::Exact_predicates_inexact_constructions_kernel::Point_3();')
 		if not ok: featureNotOK('CGAL')
@@ -392,24 +382,13 @@
 ## PREFIX must be absolute path. Why?!
 env['PREFIX']=os.path.abspath(env['PREFIX'])
 
-# paths to in-tree SConscript files
-libDirs=['lib','pkg/common','pkg/dem','pkg/fem','pkg/lattice','pkg/mass-spring','pkg/realtime-rigidbody','pkg/snow','extra','gui','py']
-#libDirs = libDirs + ['pkg/gram'] 
-# BUT: exclude stuff that should be excluded
-libDirs=[x for x in libDirs if not re.match('^.*/('+'|'.join(env['exclude'])+')$',x)]
+libDirs=('extra','gui','lib','py','plugins')
 # where are we going to be installed... pkg/dem becomes pkg-dem
-instLibDirs=[os.path.join('$PREFIX','lib','yade$SUFFIX',x.replace('/','-')) for x in libDirs]
-# directory for yade-$version.pc
-pcDir=os.path.join('$PREFIX','lib','pkgconfig')
-# will install in the following dirs (needed?)
-instDirs=[os.path.join('$PREFIX','bin')]+instLibDirs # +[pcDir]
+instLibDirs=[os.path.join('$PREFIX','lib','yade$SUFFIX',x) for x in libDirs]
 # where are we going to be run - may be different (packaging)
-runtimeLibDirs=[os.path.join('$runtimePREFIX','lib','yade$SUFFIX',x.replace('/','-')) for x in libDirs]
+runtimeLibDirs=[os.path.join('$runtimePREFIX','lib','yade$SUFFIX',x) for x in libDirs]
 
-## not used for now...
-#instIncludeDirs=['yade-core']+[os.path.join('$PREFIX','include','yade',string.split(x,os.path.sep)[-1]) for x in libDirs]
 
-
 ### PREPROCESSOR FLAGS
 env.Append(CPPDEFINES=[('SUFFIX',r'\"$SUFFIX\"'),('PREFIX',r'\"$runtimePREFIX\"')])
 if env['QUAD_PRECISION']: env.Append(CPPDEFINES='QUAD_PRECISION')
@@ -516,20 +495,41 @@
 			os.symlink(relpath(link,target),link)
 	if not env['haveForeach']:
 		mkSymlink(boostDir+'/foreach.hpp','extra/foreach.hpp_local')
-	mkSymlink(boostDir+'/python','lib/py/boost-python-indexing-suite-v2-noSymlinkHeaders')
+	mkSymlink(boostDir+'/python','py/3rd-party/boost-python-indexing-suite-v2-noSymlinkHeaders')
 	#env.InstallAs(env['PREFIX']+'/include/yade-'+env['version']+'/boost/foreach.hpp',foreachTarget)
-	env.Default(env.Alias('install',instDirs)) # build and install everything that should go to instDirs, which are $PREFIX/{bin,lib} (uses scons' Install)
+	env.Default(env.Alias('install',['$PREFIX/bin','$PREFIX/lib'])) # build and install everything that should go to instDirs, which are $PREFIX/{bin,lib} (uses scons' Install)
 
 env.Export('env');
 
-if env.has_key('extraModules'):
-	env['yadeModules']=env['extraModules']+libDirs+['core']
-	env.Append(LIBPATH=[os.path.join('#',x) for x in env['extraModules']])
-else: env['yadeModules']=libDirs+['core']
+######
+### combining builder
+#####
+# http://www.scons.org/wiki/CombineBuilder
+import SCons.Action
+import SCons.Builder
+def combiner_build(target, source, env):
+	"""generate a file, that's including all sources"""
+	out=""
+	for src in source: out+="#include \"%s\"\n"%src.abspath
+	open(str(target[0]),'w').write(out)
+	return 0
+env.Append(BUILDERS = {'Combine': env.Builder(action = SCons.Action.Action(combiner_build, "> $TARGET"),target_factory = env.fs.File,)})
 
-#env['yadeModules']=['lib','core','extra']
+import yadeSCons
+allPlugs=yadeSCons.scanAllPlugins(None)
+buildPlugs=yadeSCons.getWantedPlugins(allPlugs,env['exclude'],env['features'],env['linkStrategy'])
+def linkPlugins(plugins):
+	"""Given list of plugins we need to link to, return list of real libraries that we should link to."""
+	ret=set()
+	for p in plugins:
+		ret.add(buildPlugs[p].obj)
+	return list(ret)
 
-# read top-level SConscript file. It is used only so that build_dir is set. This file reads all SConscripts from in yadeModules
+env['linkPlugins']=linkPlugins
+
+yadeSCons.buildPluginLibs(env,buildPlugs)
+
+# read top-level SConscript file. It is used only so that build_dir is set. This file reads all necessary SConscripts
 env.SConscript(dirs=['.'],build_dir=buildDir,duplicate=0)
 
 #################################################################################

Modified: trunk/core/Engine.hpp
===================================================================
--- trunk/core/Engine.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/Engine.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -16,11 +16,13 @@
 
 class Body;
 
-class Engine : public Serializable
-{
-	public :
-		string label; /* user-definable label, to convenienty retrieve this particular engine instance even if multiple engines of the same type exist */
-		TimingInfo timingInfo; // hihg-level profiling information; not serializable
+class Engine: public Serializable{
+	public:
+		//! user-definable label, to convenienty retrieve this particular engine instance even if multiple engines of the same type exist
+		string label;
+		//! high-level profiling information; not serializable
+		TimingInfo timingInfo; 
+		//! precise profiling information (timing of fragments of the engine)
 		shared_ptr<TimingDeltas> timingDeltas;
 		Engine() {};
 		virtual ~Engine() {};

Modified: trunk/core/MetaBody.cpp
===================================================================
--- trunk/core/MetaBody.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/MetaBody.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -34,7 +34,7 @@
 bool TimingInfo::enabled=false;
 
 MetaBody::MetaBody() :
-	Body(),bodies(new BodyRedirectionVector), interactions(new InteractionVecMap), persistentInteractions(interactions),transientInteractions(interactions)
+	Body(),bodies(new BodyRedirectionVector), interactions(new InteractionVecMap), transientInteractions(interactions)
 {	
 	engines.clear();
 	initializers.clear();

Modified: trunk/core/MetaBody.hpp
===================================================================
--- trunk/core/MetaBody.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/MetaBody.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -24,9 +24,7 @@
 		vector<shared_ptr<Engine> >		engines;
 		vector<shared_ptr<Engine> >		initializers; // FIXME: see MovingSupport:50
 		shared_ptr<InteractionContainer> interactions;
-
-		// only aliases for interactions
-		__attribute__((__deprecated__)) shared_ptr<InteractionContainer>&	persistentInteractions; // disappear, reappear according to physical (or any other non-spatial) criterion
+		// only alias for interactions, will be removed
 		shared_ptr<InteractionContainer>&	transientInteractions;	// disappear, reappear according to spatial criterion
 
 		BexContainer bex;

Modified: trunk/core/Omega.hpp
===================================================================
--- trunk/core/Omega.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/Omega.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -11,7 +11,7 @@
 #pragma once
 
 // qt3 sucks
-#ifdef EMBED_PYTHON
+#ifdef YADE_PYTHON
 	#ifdef QT_MOC_CPP
 		#undef slots
 		#include<Python.h>

Modified: trunk/core/PhysicalParameters.cpp
===================================================================
--- trunk/core/PhysicalParameters.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/PhysicalParameters.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,3 +1,25 @@
 // (C) 2004 by Olivier Galizzi <olivier.galizzi@xxxxxxx>
 
-#include "PhysicalParameters.hpp"
+#include"PhysicalParameters.hpp"
+#include<boost/foreach.hpp>
+#include<stdexcept>
+#ifndef FOREACH
+	#define FOREACH BOOST_FOREACH
+#endif
+
+std::vector<std::string> PhysicalParameters::blockedDOFs_vec_get() const {
+	std::vector<std::string> ret;
+	#define _SET_DOF(DOF_ANY,str) if((blockedDOFs & PhysicalParameters::DOF_ANY)!=0) ret.push_back(str);
+	_SET_DOF(DOF_X,"x"); _SET_DOF(DOF_Y,"y"); _SET_DOF(DOF_Z,"z"); _SET_DOF(DOF_RX,"rx"); _SET_DOF(DOF_RY,"ry"); _SET_DOF(DOF_RZ,"rz");
+	#undef _SET_DOF
+	return ret;
+}
+void PhysicalParameters::blockedDOFs_vec_set(const std::vector<string>& dofs){
+	FOREACH(const std::string s, dofs){
+		#define _GET_DOF(DOF_ANY,str) if(s==str) { blockedDOFs|=PhysicalParameters::DOF_ANY; continue; }
+		_GET_DOF(DOF_X,"x"); _GET_DOF(DOF_Y,"y"); _GET_DOF(DOF_Z,"z"); _GET_DOF(DOF_RX,"rx"); _GET_DOF(DOF_RY,"ry"); _GET_DOF(DOF_RZ,"rz");
+		#undef _GET_DOF
+		throw std::invalid_argument("Invalid  DOF specification `"+s+"', must be ∈{x,y,z,rx,ry,rz}.");
+	}
+}
+

Modified: trunk/core/PhysicalParameters.hpp
===================================================================
--- trunk/core/PhysicalParameters.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/PhysicalParameters.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -6,6 +6,8 @@
 #include<yade/lib-serialization/Serializable.hpp>
 #include<yade/lib-multimethods/Indexable.hpp>
 #include<yade/lib-base/yadeWm3Extra.hpp>
+#include<vector>
+#include<string>
 
 class PhysicalParameters: public Serializable, public Indexable
 {
@@ -35,6 +37,8 @@
 			//Vector3<bool> would be actually better, I'm not checking now if it would work.
 		};
 		static unsigned axisDOF(int axis, bool rotationalDOF=false){return 1<<(axis+(rotationalDOF?3:0));} //! Return DOF_* constant for given axis∈{0,1,2} and rotationalDOF∈{false(default),true}; e.g. axisDOF(0,true)==DOF_RX
+		std::vector<std::string> blockedDOFs_vec_get() const;
+		void blockedDOFs_vec_set(const std::vector<std::string>& dofs);
 
 	REGISTER_ATTRIBUTES(/*no base*/,(se3)(refSe3)(blockedDOFs));
 	REGISTER_CLASS_AND_BASE(PhysicalParameters,Serializable Indexable);

Modified: trunk/core/SConscript
===================================================================
--- trunk/core/SConscript	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/SConscript	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,7 +1,7 @@
 Import('*')
 env.InstallAs(['$PREFIX/bin/yade$SUFFIX'],[
 	env.Program('yade',
-		['Body.cpp',
+		env.Combine('core.cpp',['Body.cpp',
 			'BodyContainer.cpp',
 			'BoundingVolume.cpp',
 			'Collider.cpp',
@@ -29,13 +29,20 @@
 			'containers/BodyAssocVector.cpp',
 			'containers/InteractionHashMap.cpp',
 			'containers/InteractionVecMap.cpp',
-			],
-		LIBS=env['LIBS']+['yade-base',
+			]),
+		LIBS=env['LIBS']+[
+			'yade-base',
 			'yade-serialization',
 			'yade-factory',
-			'yade-loki',
 			'yade-multimethods',
+			'yade-computational-geometry',
+			'sqlite3x',
+			'XMLFormatManager',
+			'miniWm3',
+			'STLImporter',
 			'rt', # realtime lib, for clock_gettime 
-			],
+			]+
+			['$QGLVIEWER_LIB','yade-opengl'] if 'YADE_OPENGL' in env['CPPDEFINES'] else [],
+		CPPDEFINES=env['CPPDEFINES']+[('YADE_VERSION','\\"'+env['realVersion']+'\\"'),]
 		)
 ])

Modified: trunk/core/Timing.hpp
===================================================================
--- trunk/core/Timing.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/Timing.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -29,4 +29,5 @@
 			TimingInfo::delta now=TimingInfo::getNow();
 			data[i].nExec+=1; data[i].nsec+=now-last; last=now; i++;
 		}
+		void reset(){ data.clear(); labels.clear(); }
 };

Modified: trunk/core/containers/BodyAssocVector.cpp
===================================================================
--- trunk/core/containers/BodyAssocVector.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/containers/BodyAssocVector.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -216,4 +216,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("BodyAssocVector");
\ No newline at end of file

Modified: trunk/core/containers/BodyRedirectionVector.cpp
===================================================================
--- trunk/core/containers/BodyRedirectionVector.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/containers/BodyRedirectionVector.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -261,4 +261,4 @@
 }
 
 
-// YADE_PLUGIN();
+// YADE_PLUGIN("BodyRedirectionVector");
\ No newline at end of file

Modified: trunk/core/containers/InteractionHashMap.cpp
===================================================================
--- trunk/core/containers/InteractionHashMap.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/containers/InteractionHashMap.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -167,4 +167,4 @@
 {
 	return interactions.size();
 }
-YADE_PLUGIN();
+YADE_PLUGIN("InteractionHashMap");
\ No newline at end of file

Modified: trunk/core/containers/InteractionVecMap.cpp
===================================================================
--- trunk/core/containers/InteractionVecMap.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/containers/InteractionVecMap.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -196,4 +196,4 @@
 	return currentSize;
 }
 
-// YADE_PLUGIN();
+// YADE_PLUGIN("InteractionVecMap");
\ No newline at end of file

Modified: trunk/core/containers/InteractionVecMap.hpp
===================================================================
--- trunk/core/containers/InteractionVecMap.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/containers/InteractionVecMap.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,4 +1,5 @@
 // 2008 © Sergei Dorofeenko <sega@xxxxxxxxxxxxxxxx>
+#pragma once
 
 #include<yade/core/InteractionContainer.hpp>
 #include<yade/core/Interaction.hpp>

Modified: trunk/core/yade.cpp
===================================================================
--- trunk/core/yade.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/core/yade.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -8,7 +8,7 @@
 *  GNU General Public License v2 or later. See file LICENSE for details. *
 *************************************************************************/
 
-#ifdef EMBED_PYTHON
+#ifdef YADE_PYTHON
 	#include<Python.h>
 	extern int Py_OptimizeFlag;
 #endif
@@ -63,7 +63,7 @@
 void
 sigHandler(int sig){
 	switch(sig){
-	#ifdef EMBED_PYTHON
+	#ifdef YADE_PYTHON
 		case SIGINT:
 			LOG_DEBUG("Finalizing Python...");
 			Py_Finalize();
@@ -172,7 +172,7 @@
 	 * which locks renderMutex, calls instance() in turn, but since not constructed yet,
 	 * instance() → Omega::Omega → init → resetRootBody → lock renderMutex → deadlock */
 	Omega::instance().init();
-	Omega::instance().yadeVersionName = "Yet Another Dynamic Engine 0.12.x, beta, SVN snapshot.";
+	Omega::instance().yadeVersionName = "Yet Another Dynamic Engine, version " YADE_VERSION;
 
 	// This makes boost stop bitching about dot-files and other files that may not exist on MS-DOS 3.3;
 	// see http://www.boost.org/libs/filesystem/doc/portability_guide.htm#recommendations for what all they consider bad.
@@ -227,7 +227,7 @@
 	filesystem::path yadeConfigFile  = filesystem::path(Omega::instance().yadeConfigPath + "/preferences.xml", filesystem::native);
 
 
-	#ifdef EMBED_PYTHON
+	#ifdef YADE_PYTHON
 		/* see http://www.python.org/dev/peps/pep-0311 for threading with Python embedded */
 		LOG_DEBUG("Initializing Python...");
 		Py_OptimizeFlag=1;
@@ -256,7 +256,7 @@
 	
 	LOG_INFO("Loading "<<yadeConfigFile.string()); IOFormatManager::loadFromFile("XMLFormatManager",yadeConfigFile.string(),"preferences",Omega::instance().preferences);
 
-	LOG_INFO("Loading plugins"); Omega::instance().scanPlugins(string(PREFIX "/lib/yade" SUFFIX));
+	LOG_INFO("Loading plugins"); Omega::instance().scanPlugins(string(PREFIX "/lib/yade" SUFFIX "/plugins" ));
 	Omega::instance().init();
 
 	Omega::instance().setSimulationFileName(simulationFileName); //init() resets to "";
@@ -287,7 +287,7 @@
  	// for(int i=0;i<argc; i++)cerr<<"Argument "<<i<<": "<<argv[i]<<endl;
 	int ok = frontEnd->run(argc,argv);
 
-	#ifdef EMBED_PYTHON
+	#ifdef YADE_PYTHON
 		/* pyFinalize crashes with boost:python<=1.35
 		 * http://www.boost.org/libs/python/todo.html#pyfinalize-safety has explanation 
 		 * once this is fixed, you should remove workaround that saves history from ipython session in gui/py/PythonUI_rc.py:63

Modified: trunk/debian/rules
===================================================================
--- trunk/debian/rules	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/debian/rules	2009-07-27 18:08:23 UTC (rev 1888)
@@ -58,7 +58,7 @@
 	###   (a) use fakeroot-tcp instead of fakeroot
 	###   (b) use just 1 job
 	#debug build
-	NO_SCONS_GET_RECENT= scons buildPrefix=debian runtimePREFIX=/usr version=${VERSION} features=GTS,python,log4cxx,openGL openmp=True exclude=realtime-rigidbody,mass-spring,snow,fem PREFIX=debian/yade${_VERSION}-dbg/usr variant=-dbg optimize=0 debug=1 
+	NO_SCONS_GET_RECENT= scons buildPrefix=debian runtimePREFIX=/usr version=${VERSION} linkStrategy=monolithic features=GTS,python,log4cxx,openGL openmp=True exclude=realtime-rigidbody,mass-spring,snow,fem PREFIX=debian/yade${_VERSION}-dbg/usr variant=-dbg optimize=0 debug=1 
 	#optimized build
 	NO_SCONS_GET_RECENT= scons PREFIX=debian/yade${_VERSION}/usr variant='' optimize=1 debug=0
 	#install platform-independent files (docs, scripts, examples)

Modified: trunk/extra/SConscript
===================================================================
--- trunk/extra/SConscript	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/extra/SConscript	2009-07-27 18:08:23 UTC (rev 1888)
@@ -5,62 +5,6 @@
 
 env.Install('$PREFIX/lib/yade$SUFFIX/extra',[
 
-	env.SharedLibrary('Tetra',['tetra/Tetra.cpp'],LIBS=env['LIBS']+['Tetrahedron',
-         'ParticleParameters',
-         'RigidBodyParameters',
-			'ElasticBodyParameters',
-			'BodyMacroParameters',
-         'AABB',
-			'EngineUnits',
-			]),
-	
-	env.SharedLibrary('TetraTestGen',['tetra/TetraTestGen.cpp'],LIBS=env['LIBS']+['Shop','Tetra']),
-
-	env.SharedLibrary('Shop',
-		['Shop.cpp'],
-		LIBS=env['LIBS']+[
-			'ElasticContactLaw',
-			'ElasticCohesiveLaw',
-			'MacroMicroElasticRelationships',
-			'ElasticCriterionTimeStepper',
-			'InteractingSphere',
-			'InteractingBox',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'yade-serialization',
-			'yade-base',	
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'Box',
-			'Sphere',
-			'Tetra',
-			'AABB',
-			'PersistentSAPCollider',
-			'ParticleParameters',
-			'MetaInteractingGeometry',
-			'MetaInteractingGeometry2AABB',
-			'InteractingSphere2AABB',
-			'InteractingBox2AABB',
-			'NewtonsMomentumLaw',
-			'NewtonsForceLaw',
-			'LeapFrogPositionIntegrator',
-			'LeapFrogOrientationIntegrator',
-			'InteractingBox2InteractingSphere4SpheresContactGeometry',
-			'InteractingSphere2InteractingSphere4SpheresContactGeometry',
-			#'Clump',
-			'yade-multimethods',
-			'SpheresContactGeometry',
-			'ElasticContactInteraction',
-			'SimpleViscoelasticBodyParameters',
-			'SDECLinkGeometry',
-			'SDECLinkPhysics',
-			]),
 ])
 
 

Deleted: trunk/extra/Shop.cpp
===================================================================
--- trunk/extra/Shop.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/extra/Shop.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,1146 +0,0 @@
-// 2007 © Václav Šmilauer <eudoxos@xxxxxxxx>
-#include"Shop.hpp"
-
-#include<limits>
-
-#include<boost/filesystem/convenience.hpp>
-#include<boost/tokenizer.hpp>
-
-#include<yade/core/MetaBody.hpp>
-#include<yade/core/Body.hpp>
-
-#include<yade/pkg-common/MetaInteractingGeometry2AABB.hpp>
-#include<yade/pkg-common/MetaInteractingGeometry.hpp>
-#include<yade/pkg-common/Box.hpp>
-#include<yade/pkg-common/AABB.hpp>
-#include<yade/pkg-common/Sphere.hpp>
-#include<yade/pkg-common/PersistentSAPCollider.hpp>
-
-#include<yade/pkg-common/InteractingBox.hpp>
-#include<yade/pkg-common/InteractingSphere.hpp>
-
-#include<yade/pkg-common/InteractingSphere2AABB.hpp>
-#include<yade/pkg-common/InteractingBox2AABB.hpp>
-#include<yade/pkg-common/MetaInteractingGeometry.hpp>
-#include<yade/pkg-common/MetaInteractingGeometry2AABB.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-dem/MacroMicroElasticRelationships.hpp>
-#include<yade/pkg-dem/SimpleViscoelasticBodyParameters.hpp>
-
-/*class InteractingSphere2AABB;
-class InteractingBox2AABB;
-class MetaInteractingGeometry;
-class MetaInteractingGeometry2AABB; */
-
-
-#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
-#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
-
-#include<yade/pkg-common/InteractionGeometryMetaEngine.hpp>
-#include<yade/pkg-common/InteractionPhysicsMetaEngine.hpp>
-#include<yade/pkg-common/BoundingVolumeMetaEngine.hpp>
-#include<yade/pkg-common/PhysicalActionDamper.hpp>
-#include<yade/pkg-common/PhysicalActionApplier.hpp>
-#include<yade/pkg-common/CundallNonViscousDamping.hpp>
-#include<yade/pkg-common/CundallNonViscousDamping.hpp>
-#include<yade/pkg-common/GravityEngines.hpp>
-
-#include<yade/pkg-dem/BodyMacroParameters.hpp>
-#include<yade/pkg-dem/ElasticCriterionTimeStepper.hpp>
-#include<yade/pkg-dem/ElasticContactLaw.hpp>
-
-#include<yade/pkg-dem/SpheresContactGeometry.hpp>
-#include<yade/pkg-dem/ElasticContactInteraction.hpp>
-
-
-#include<yade/extra/Tetra.hpp>
-
-
-#define _SPEC_CAST(orig,cast) template<> void Shop::setDefault<orig>(string key, orig val){setDefault(key,cast(val));}
-_SPEC_CAST(const char*,string);
-_SPEC_CAST(char*,string);
-#undef _SPEC_CAST
-
-CREATE_LOGGER(Shop);
-
-map<string,boost::any> Shop::defaults;
-
-/* 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.
- */
-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){
-	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));
-}
-
-
-Real Shop::unbalancedForce(bool useMaxForce, MetaBody* _rb){
-	MetaBody* rb=_rb ? _rb : Omega::instance().getRootBody().get();
-	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;
-		currF=rb->bex.getForce(b->id).Length(); maxF=max(currF,maxF); sumF+=currF;
-	}
-	Real meanF=sumF/rb->bodies->size(); 
-	// get max force on contacts
-	Real maxContactF=0;
-	FOREACH(const shared_ptr<Interaction>& I, *rb->transientInteractions){
-		if(!I->isReal()) continue;
-		shared_ptr<NormalShearInteraction> nsi=YADE_PTR_CAST<NormalShearInteraction>(I->interactionPhysics); assert(nsi);
-		maxContactF=max(maxContactF,(nsi->normalForce+nsi->shearForce).Length());
-	}
-	return (useMaxForce?maxF:meanF)/maxContactF;
-}
-
-Real Shop::kineticEnergy(MetaBody* _rb){
-	MetaBody* rb=_rb ? _rb : Omega::instance().getRootBody().get();
-	Real ret=0.;
-	FOREACH(const shared_ptr<Body>& b, *rb->bodies){
-		if(!b->isDynamic) continue;
-		shared_ptr<RigidBodyParameters> rbp=YADE_PTR_CAST<RigidBodyParameters>(b->physicalParameters); assert(rbp);
-		// ½(mv²+ωIω)
-		ret+=.5*(rbp->mass*rbp->velocity.SquaredLength()+rbp->angularVelocity.Dot(diagMult(rbp->inertia,rbp->angularVelocity)));
-	}
-	return ret;
-}
-
-
-
-
-
-template <typename valType> valType Shop::getDefault(const string& key) {
-	ensureInit();
-	try{return boost::any_cast<valType>(defaults[key]);}
-	catch(boost::bad_any_cast& e){
-		LOG_FATAL("Cast error while getting key `"<<key<<"' of type `"<<typeid(valType).name()<<"' ("<<e.what()<<").");
-		if(!hasDefault(key) || (defaults[key].type()==typeid(void))){LOG_FATAL("Key `"<<key<<"' not defined in the map.");}
-		else{LOG_INFO("(key `"<<key<<"' exists and if of type `"<<defaults[key].type().name()<<"').");}
-		throw;
-	}
-}
-
-void Shop::init(){
-	//LOG_INFO("Container length is "<<defaults.size()<<endl);
-	/*for(map<string,boost::any>::iterator I=defaults.begin(); I!=defaults.end(); I++){
-		LOG_INFO("Key `"<<I->first<<", type `"<<I->second.type().name()<<"'.");
-	}*/
-
-	defaults["container_is_not_empty"]=boost::any(0); // prevent loops from ensureInit();
-
-	setDefault<int>("body_sdecGroupMask",55);
-	
-	setDefault("phys_density",2e3);
-	setDefault("phys_young",30e9);
-	setDefault("phys_poisson",.3);
-	setDefault("phys_frictionAngle",0.5236); //30˚
-	setDefault("phys_se3_orientation",Quaternionr(Vector3r(0,0,1),0));
-
-	setDefault("aabb_randomColor",false);
-	setDefault("aabb_color",Vector3r(0,1,0));
-
-	setDefault("mold_randomColor",true);
-	setDefault("mold_color",Vector3r(1,0,0));
-
-	setDefault("shape_randomColor",true);
-	setDefault("shape_color",Vector3r(0,0,1));
-
-	setDefault("shape_wire",false);
-	setDefault("shape_shadowCaster",true);
-
-	setDefault("param_damping",.2);
-	setDefault("param_gravity",Vector3r(0,0,-10));
-	setDefault<int>("param_timeStepUpdateInterval",300);
-	setDefault("param_momentRotationLaw",true);
-
-	setDefault("param_pythonInitExpr",string("print 'Hello world!'"));
-	setDefault("param_pythonRunExpr",string(""));
-
-}
-
-/*! Create root body. */
-shared_ptr<MetaBody> Shop::rootBody(){
-	shared_ptr<MetaBody> rootBody = shared_ptr<MetaBody>(new MetaBody);
-	rootBody->isDynamic=false;
-	
-	shared_ptr<ParticleParameters> physics(new ParticleParameters);
-	physics->se3=Se3r(Vector3r(0,0,0),Quaternionr(Vector3r(0,0,1),0));
-	physics->mass=0;
-	physics->velocity=Vector3r::ZERO;
-	physics->acceleration=Vector3r::ZERO;
-	rootBody->physicalParameters=physics;
-
-	shared_ptr<MetaInteractingGeometry> set(new MetaInteractingGeometry());	set->diffuseColor=Vector3r(0,0,1);
-	rootBody->interactingGeometry=YADE_PTR_CAST<InteractingGeometry>(set);	
-	
-	shared_ptr<AABB> aabb(new AABB); aabb->diffuseColor=Vector3r(0,0,1);
-	rootBody->boundingVolume=YADE_PTR_CAST<BoundingVolume>(aabb);
-	
-
-	return rootBody;
-}
-
-
-/*! Assign default set of actors (initializers and engines) to an existing MetaBody.
- */
-void Shop::rootBodyActors(shared_ptr<MetaBody> rootBody){
-	// initializers	
-	rootBody->initializers.clear();
-
-	shared_ptr<BoundingVolumeMetaEngine> boundingVolumeDispatcher	= shared_ptr<BoundingVolumeMetaEngine>(new BoundingVolumeMetaEngine);
-	boundingVolumeDispatcher->add(new InteractingSphere2AABB);
-	boundingVolumeDispatcher->add(new InteractingBox2AABB);
-	boundingVolumeDispatcher->add(new TetraAABB);
-	boundingVolumeDispatcher->add(new MetaInteractingGeometry2AABB);
-	rootBody->initializers.push_back(boundingVolumeDispatcher);
-
-	//engines
-	rootBody->engines.clear();
-
-	/* big fat FIXME:
-	 * for some */
-	#define GO(type) try{cerr<<"Cast to" #type<<" gives: "<<getDefault<type>("body_sdecGroupMask")<<endl;} catch(boost::bad_any_cast){}
-	/*	GO(unsigned short); GO(short); GO(char);GO(int);GO(unsigned int);GO(long);GO(unsigned long);GO(long long);GO(unsigned long long); */
-	
-	if(getDefault<int>("param_timeStepUpdateInterval")>0){
-		shared_ptr<ElasticCriterionTimeStepper> sdecTimeStepper(new ElasticCriterionTimeStepper);
-		sdecTimeStepper->sdecGroupMask=getDefault<int>("body_sdecGroupMask");
-		sdecTimeStepper->timeStepUpdateInterval=getDefault<int>("param_timeStepUpdateInterval");
-		sdecTimeStepper->timeStepUpdateInterval=300;
-		rootBody->engines.push_back(sdecTimeStepper);
-	}
-
-	rootBody->engines.push_back(shared_ptr<Engine>(new PhysicalActionContainerReseter));
-
-	rootBody->engines.push_back(boundingVolumeDispatcher);
-
-	rootBody->engines.push_back(shared_ptr<Engine>(new PersistentSAPCollider));
-
-	shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
-	interactionGeometryDispatcher->add(new InteractingSphere2InteractingSphere4SpheresContactGeometry);
-	interactionGeometryDispatcher->add(new InteractingBox2InteractingSphere4SpheresContactGeometry);
-	interactionGeometryDispatcher->add(new Tetra2TetraBang);
-	rootBody->engines.push_back(interactionGeometryDispatcher);
-
-	shared_ptr<InteractionPhysicsMetaEngine> interactionPhysicsDispatcher(new InteractionPhysicsMetaEngine);
-	interactionPhysicsDispatcher->add(new MacroMicroElasticRelationships);
-	rootBody->engines.push_back(interactionPhysicsDispatcher);
-		
-	shared_ptr<ElasticContactLaw> constitutiveLaw(new ElasticContactLaw);
-	constitutiveLaw->sdecGroupMask = getDefault<int>("body_sdecGroupMask");
-	constitutiveLaw->momentRotationLaw = getDefault<bool>("param_momentRotationLaw");
-	rootBody->engines.push_back(constitutiveLaw);
-
-	if(getDefault<Vector3r>("param_gravity")!=Vector3r(0,0,0)){
-		shared_ptr<GravityEngine> gravityCondition(new GravityEngine);
-		gravityCondition->gravity=getDefault<Vector3r>("param_gravity");
-		rootBody->engines.push_back(gravityCondition);
-	}
-	
-	if(getDefault<double>("param_damping")>0){
-		shared_ptr<CundallNonViscousForceDamping> actionForceDamping(new CundallNonViscousForceDamping);
-		actionForceDamping->damping = getDefault<double>("param_damping");
-		shared_ptr<CundallNonViscousMomentumDamping> actionMomentumDamping(new CundallNonViscousMomentumDamping);
-		actionMomentumDamping->damping = getDefault<double>("param_damping");
-		shared_ptr<PhysicalActionDamper> actionDampingDispatcher(new PhysicalActionDamper);
-		actionDampingDispatcher->add(actionForceDamping);
-		actionDampingDispatcher->add(actionMomentumDamping);
-		rootBody->engines.push_back(actionDampingDispatcher);
-	}
-	
-	shared_ptr<PhysicalActionApplier> applyActionDispatcher(new PhysicalActionApplier);
-	applyActionDispatcher->add(new NewtonsForceLaw);
-	applyActionDispatcher->add(new NewtonsMomentumLaw);
-	rootBody->engines.push_back(applyActionDispatcher);
-	
-	shared_ptr<PhysicalParametersMetaEngine> positionIntegrator(new PhysicalParametersMetaEngine);
-	positionIntegrator->add(new LeapFrogPositionIntegrator);
-	rootBody->engines.push_back(positionIntegrator);
-
-	shared_ptr<PhysicalParametersMetaEngine> orientationIntegrator(new PhysicalParametersMetaEngine);
-	orientationIntegrator->add(new LeapFrogOrientationIntegrator);
-	rootBody->engines.push_back(orientationIntegrator);
-}
-
-
-/*! Create body - sphere. */
-shared_ptr<Body> Shop::sphere(Vector3r center, Real radius){
-	// body itself
-	shared_ptr<Body> body=shared_ptr<Body>(new Body(body_id_t(0),getDefault<int>("body_sdecGroupMask")));
-	body->isDynamic=true;
-
-	// physics
-	shared_ptr<BodyMacroParameters> physics(new BodyMacroParameters);
-	physics->angularVelocity=Vector3r(0,0,0);
-	physics->velocity=Vector3r(0,0,0);
-	physics->mass=4.0/3.0*Mathr::PI*radius*radius*radius*getDefault<double>("phys_density");
-	physics->inertia=Vector3r(2.0/5.0*physics->mass*radius*radius,2.0/5.0*physics->mass*radius*radius,2.0/5.0*physics->mass*radius*radius);
-	physics->se3=Se3r(center,Quaternionr(Vector3r(0,0,1),0));
-	physics->young=getDefault<double>("phys_young");
-	physics->poisson=getDefault<double>("phys_poisson");
-	physics->frictionAngle=getDefault<double>("phys_frictionAngle");
-	body->physicalParameters=physics;
-
-	// aabb
-	shared_ptr<AABB> aabb(new AABB);
-	aabb->diffuseColor=getDefault<bool>("aabb_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("aabb_color");
-	body->boundingVolume=aabb;
-
-	// mold
-	shared_ptr<InteractingSphere> mold(new InteractingSphere);
-	mold->radius=radius;
-	mold->diffuseColor=getDefault<bool>("mold_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("mold_color");
-	body->interactingGeometry=mold;
-
-	//shape
-	shared_ptr<Sphere> shape(new Sphere);
-	shape->radius=radius;
-	shape->diffuseColor=getDefault<bool>("shape_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("shape_color");
-	shape->wire=getDefault<bool>("shape_wire");
-	shape->shadowCaster=getDefault<bool>("shape_shadowCaster");
-	body->geometricalModel=shape;
-
-	return body;
-
-}
-
-/*! Create body - box. */
-shared_ptr<Body> Shop::box(Vector3r center, Vector3r extents){
-		shared_ptr<Body> body=shared_ptr<Body>(new Body(body_id_t(0),getDefault<int>("body_sdecGroupMask")));
-		body->isDynamic=true;
-
-		shared_ptr<BodyMacroParameters> physics(new BodyMacroParameters);
-		physics->angularVelocity=Vector3r(0,0,0);
-		physics->velocity=Vector3r(0,0,0);
-		physics->mass=8*extents[0]*extents[1]*extents[2]*getDefault<double>("phys_density");
-		physics->inertia=Vector3r(physics->mass*(4*extents[1]*extents[1]+4*extents[2]*extents[2])/12.,physics->mass*(4*extents[0]*extents[0]+4*extents[2]*extents[2])/12.,physics->mass*(4*extents[0]*extents[0]+4*extents[1]*extents[1])/12.);
-		physics->se3=Se3r(center,Quaternionr(Vector3r(0,0,1),0));
-		physics->young=getDefault<double>("phys_young");
-		physics->poisson=getDefault<double>("phys_poisson");
-		physics->frictionAngle=getDefault<double>("phys_frictionAngle");
-		body->physicalParameters=physics;
-
-		// aabb
-		shared_ptr<AABB> aabb(new AABB);
-		aabb->diffuseColor=getDefault<bool>("aabb_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("aabb_color");
-		body->boundingVolume=aabb;
-
-		//shape
-		shared_ptr<Box> shape(new Box);
-		shape->extents=extents;
-		shape->diffuseColor=getDefault<bool>("shape_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("shape_color");
-		shape->wire=getDefault<bool>("shape_wire");
-		shape->shadowCaster=getDefault<bool>("shape_shadowCaster");
-		body->geometricalModel=shape;
-
-		// mold
-		shared_ptr<InteractingBox> mold(new InteractingBox);
-		mold->extents=extents;
-		mold->diffuseColor=getDefault<bool>("mold_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("mold_color");
-		body->interactingGeometry=mold;
-
-		return body;
-}
-
-/*! Create body - tetrahedron. */
-shared_ptr<Body> Shop::tetra(Vector3r v_global[4]){
-		shared_ptr<Body> body=shared_ptr<Body>(new Body(body_id_t(0),getDefault<int>("body_sdecGroupMask")));
-		body->isDynamic=true;
-
-		Vector3r centroid=(v_global[0]+v_global[1]+v_global[2]+v_global[3])*.25;
-		Vector3r v[4]; for(int i=0; i<4; i++) v[i]=v_global[i]-centroid;
-
-		shared_ptr<BodyMacroParameters> physics(new BodyMacroParameters);
-		physics->angularVelocity=Vector3r(0,0,0);
-		physics->velocity=Vector3r(0,0,0);
-		physics->mass=getDefault<double>("phys_density")*TetrahedronVolume(v);
-		// inertia will be calculated below, by TetrahedronWithLocalAxesPrincipal
-		physics->se3=Se3r(centroid,Quaternionr(Vector3r(0,0,1),0));
-		physics->young=getDefault<double>("phys_young");
-		physics->poisson=getDefault<double>("phys_poisson");
-		physics->frictionAngle=getDefault<double>("phys_frictionAngle");
-		body->physicalParameters=physics;
-
-		// aabb
-		shared_ptr<AABB> aabb(new AABB);
-		aabb->diffuseColor=getDefault<bool>("aabb_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("aabb_color");
-		body->boundingVolume=aabb;
-
-		//shape
-		shared_ptr<Tetrahedron> shape(new Tetrahedron);
-		shape->v[0]=v[0]; shape->v[1]=v[1]; shape->v[2]=v[2]; shape->v[3]=v[3];
-		shape->diffuseColor=getDefault<bool>("shape_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("shape_color");
-		shape->wire=getDefault<bool>("shape_wire");
-		shape->shadowCaster=getDefault<bool>("shape_shadowCaster");
-		body->geometricalModel=shape;
-
-		// mold
-		shared_ptr<TetraMold> mold(new TetraMold(v[0],v[1],v[2],v[3]));
-		mold->diffuseColor=getDefault<bool>("mold_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("mold_color");
-		body->interactingGeometry=mold;
-
-		// make local axes coincident with principal axes
-		TetrahedronWithLocalAxesPrincipal(body);
-
-		return body;
-}
-
-
-void Shop::saveSpheresToFile(string fname){
-	const shared_ptr<MetaBody>& rootBody=Omega::instance().getRootBody();
-	ofstream f(fname.c_str());
-	if(!f.good()) throw runtime_error("Unable to open file `"+fname+"'");
-
-	FOREACH(shared_ptr<Body> b, *rootBody->bodies){
-		if (!b->isDynamic) continue;
-		shared_ptr<InteractingSphere>	intSph=dynamic_pointer_cast<InteractingSphere>(b->interactingGeometry);
-		if(!intSph) continue;
-		const Vector3r& pos=b->physicalParameters->se3.position;
-		f<<pos[0]<<" "<<pos[1]<<" "<<pos[2]<<" "<<intSph->radius<<endl; // <<" "<<1<<" "<<1<<endl;
-	}
-	f.close();
-}
-
-vector<pair<Vector3r,Real> > Shop::loadSpheresFromFile(string fname, Vector3r& minXYZ, Vector3r& maxXYZ){
-	if(!boost::filesystem::exists(fname)) {
-		throw std::invalid_argument(string("File with spheres `")+fname+"' doesn't exist.");
-	}
-	vector<pair<Vector3r,Real> > spheres;
-	ifstream sphereFile(fname.c_str());
-	if(!sphereFile.good()) throw std::runtime_error("File with spheres `"+fname+"' couldn't be opened.");
-	Vector3r C;
-	Real r=0;
-	string line;
-	size_t lineNo=0;
-	while(std::getline(sphereFile, line, '\n')){
-		lineNo++;
-		boost::tokenizer<boost::char_separator<char> > toks(line,boost::char_separator<char>(" \t"));
-		int i=0;
-		FOREACH(const string& s, toks){
-			if(i<3) C[i]=lexical_cast<Real>(s);
-			if(i==3) r=lexical_cast<Real>(s);
-			i++;
-		}
-		if(i==0) continue; // empty line, skipped (can be the last one)
-		// Wenjie's format: 5 per line are boxes, which should be skipped
-		if(i==5) continue;
-		if((i!=4) and (i!=6)) {
-			LOG_ERROR("Line "+lexical_cast<string>(lineNo)+" in the spheres file "+fname+" has "+lexical_cast<string>(i)+" columns instead of 0,4,5 or 6.");
-			LOG_ERROR("The result may be garbage!");
-		}
-		for(int j=0; j<3; j++) { minXYZ[j]=(spheres.size()>0?min(C[j]-r,minXYZ[j]):C[j]-r); maxXYZ[j]=(spheres.size()>0?max(C[j]+r,maxXYZ[j]):C[j]+r);}
-		spheres.push_back(pair<Vector3r,Real>(C,r));
-	}
-	return spheres;
-}
-
-
-vector<pair<Vector3r,Real> > Shop::loadSpheresSmallSdecXyz(Vector3r& minXYZ, Vector3r& maxXYZ){
-	int i=-1;
-	vector<pair<Vector3r,Real> > spheres;
-	while(Shop::smallSdecXyzData[++i].r>0){
-		Vector3r C(smallSdecXyzData[i].C0,smallSdecXyzData[i].C1,smallSdecXyzData[i].C2); Real r(smallSdecXyzData[i].r);
-		for(int j=0; j<3; j++) { minXYZ[j]=(spheres.size()>0?min(C[j]-r,minXYZ[j]):C[j]-r); maxXYZ[j]=(spheres.size()>0?max(C[j]+r,maxXYZ[j]):C[j]+r);}
-		spheres.push_back(pair<Vector3r,Real>(C,r));
-		//LOG_DEBUG("Loaded sphere with radius "<<r<<" at "<<C);
-	}
-	return spheres;
-}
-
-Real Shop::PWaveTimeStep(shared_ptr<MetaBody> _rb){
-	shared_ptr<MetaBody> rb=_rb;
-	if(!rb)rb=Omega::instance().getRootBody();
-	Real dt=std::numeric_limits<Real>::infinity();
-	FOREACH(const shared_ptr<Body>& b, *rb->bodies){
-		if(!b->physicalParameters || !b->geometricalModel) continue;
-		shared_ptr<ElasticBodyParameters> ebp=dynamic_pointer_cast<ElasticBodyParameters>(b->physicalParameters);
-		shared_ptr<Sphere> s=dynamic_pointer_cast<Sphere>(b->geometricalModel);
-		if(!ebp || !s) continue;
-		Real density=ebp->mass/((4/3.)*Mathr::PI*pow(s->radius,3));
-		dt=min(dt,s->radius/sqrt(ebp->young/density));
-	}
-	return dt;
-}
-
-
-shared_ptr<Interaction> Shop::createExplicitInteraction(body_id_t id1, body_id_t id2){
-	InteractionGeometryMetaEngine* geomMeta=NULL;
-	InteractionPhysicsMetaEngine* physMeta=NULL;
-	shared_ptr<MetaBody> rb=Omega::instance().getRootBody();
-	if(rb->transientInteractions->find(body_id_t(id1),body_id_t(id2))!=0) throw runtime_error(string("transientInteraction already exists between #")+lexical_cast<string>(id1)+" and "+lexical_cast<string>(id2));
-	FOREACH(const shared_ptr<Engine>& e, rb->engines){
-		if(!geomMeta) { geomMeta=dynamic_cast<InteractionGeometryMetaEngine*>(e.get()); if(geomMeta) continue; }
-		if(!physMeta) { physMeta=dynamic_cast<InteractionPhysicsMetaEngine*>(e.get()); if(physMeta) continue; }
-		if(geomMeta&&physMeta){break;}
-	}
-	if(!geomMeta) throw runtime_error("No InteractionGeometryMetaEngine in engines.");
-	if(!physMeta) throw runtime_error("No InteractionPhysicsMetaEngine in engines.");
-	shared_ptr<Body> b1=Body::byId(id1,rb), b2=Body::byId(id2,rb);
-	shared_ptr<Interaction> i=geomMeta->explicitAction(b1,b2);
-	physMeta->explicitAction(b1->physicalParameters,b2->physicalParameters,i);
-	rb->transientInteractions->insert(i);
-	return i;
-}
-
-Shop::sphereGeomStruct Shop::smallSdecXyzData[]={
-	{0.027814,0.028311,0.053055,0.006921},
-	{0.040115,0.039488,0.051634,0.009072},
-	{0.014935,0.042338,0.065370,0.014248},
-	{0.040157,0.020724,0.049777,0.007933},
-	{0.054315,0.030277,0.034105,0.015247},
-	{0.084782,0.035042,0.040466,0.006506},
-	{0.063445,0.049730,0.067288,0.011911},
-	{0.068606,0.025283,0.065262,0.012022},
-	{0.088031,0.014291,0.039471,0.014521},
-	{0.116754,0.037915,0.051292,0.008274},
-	{0.100791,0.035164,0.067461,0.013108},
-	{0.114599,0.012268,0.055589,0.015359},
-	{0.138767,0.018895,0.036148,0.009280},
-	{0.145595,0.044496,0.031125,0.015939},
-	{0.132246,0.042180,0.051209,0.007763},
-	{0.143392,0.023461,0.060496,0.015920},
-	{0.171105,0.022212,0.032836,0.012108},
-	{0.181104,0.037549,0.046727,0.010873},
-	{0.166356,0.047869,0.055943,0.008384},
-	{0.182075,0.018453,0.050915,0.008701},
-	{0.199011,0.025231,0.029222,0.016017},
-	{0.223922,0.034850,0.046495,0.009033},
-	{0.201425,0.039383,0.074087,0.010160},
-	{0.208859,0.020393,0.059165,0.015109},
-	{0.247185,0.029358,0.040632,0.009137},
-	{0.256247,0.054160,0.035898,0.007448},
-	{0.241821,0.048789,0.051785,0.013900},
-	{0.262536,0.027938,0.052724,0.007258},
-	{0.266457,0.015729,0.044737,0.007849},
-	{0.300361,0.040203,0.038619,0.010238},
-	{0.269716,0.038512,0.048249,0.006284},
-	{0.284778,0.015856,0.057268,0.010625},
-	{0.308568,0.015046,0.037486,0.015678},
-	{0.324288,0.040734,0.028459,0.015762},
-	{0.312379,0.037454,0.070796,0.013332},
-	{0.325630,0.017879,0.071709,0.009211},
-	{0.337472,0.021731,0.049983,0.015831},
-	{0.363910,0.040206,0.054198,0.013145},
-	{0.347960,0.050663,0.050631,0.006258},
-	{0.353319,0.027257,0.066410,0.007567},
-	{0.382606,0.035870,0.041879,0.009000},
-	{0.403064,0.040715,0.052848,0.013380},
-	{0.378583,0.049140,0.071144,0.009526},
-	{0.392096,0.013326,0.048449,0.016326},
-	{0.419694,0.020328,0.050734,0.012238},
-	{0.435554,0.040547,0.055823,0.013440},
-	{0.416138,0.032889,0.071377,0.008786},
-	{0.438445,0.022231,0.064865,0.007190},
-	{0.449096,0.034012,0.035415,0.006513},
-	{0.465516,0.041105,0.049831,0.016459},
-	{0.451849,0.034788,0.071794,0.010092},
-	{0.470798,0.014474,0.061308,0.013016},
-	{0.022520,0.051083,0.034275,0.015762},
-	{0.051991,0.077988,0.036367,0.009543},
-	{0.020986,0.077522,0.050688,0.015394},
-	{0.045377,0.061146,0.050244,0.013259},
-	{0.070165,0.058855,0.037378,0.014762},
-	{0.079072,0.088030,0.037625,0.009745},
-	{0.070175,0.083486,0.059729,0.008680},
-	{0.080809,0.052527,0.057405,0.008263},
-	{0.102876,0.053069,0.047621,0.012600},
-	{0.129932,0.071275,0.041493,0.015762},
-	{0.100905,0.082761,0.049471,0.015577},
-	{0.114885,0.069784,0.065561,0.008883},
-	{0.124029,0.048642,0.037433,0.006910},
-	{0.151400,0.072980,0.032672,0.007510},
-	{0.125754,0.087963,0.056533,0.007065},
-	{0.151978,0.057727,0.065740,0.009624},
-	{0.170038,0.050106,0.034273,0.009151},
-	{0.180330,0.067662,0.044758,0.013741},
-	{0.163195,0.080867,0.050099,0.008542},
-	{0.193257,0.052669,0.058994,0.009924},
-	{0.213500,0.053456,0.046639,0.012293},
-	{0.214894,0.078031,0.032394,0.009344},
-	{0.204112,0.073752,0.062427,0.013778},
-	{0.209893,0.055436,0.071207,0.007226},
-	{0.229179,0.063602,0.037779,0.008378},
-	{0.253466,0.070318,0.046778,0.010045},
-	{0.243394,0.085523,0.061896,0.013644},
-	{0.268095,0.055682,0.049778,0.010865},
-	{0.272490,0.056346,0.032166,0.007300},
-	{0.293444,0.075937,0.050821,0.007124},
-	{0.268497,0.087864,0.061002,0.010071},
-	{0.285287,0.053447,0.056283,0.007652},
-	{0.303399,0.065465,0.032905,0.015762},
-	{0.331186,0.075873,0.030308,0.014024},
-	{0.305661,0.077322,0.067721,0.013776},
-	{0.321014,0.057758,0.055215,0.012434},
-	{0.340583,0.055745,0.032542,0.006766},
-	{0.363513,0.081185,0.053753,0.009367},
-	{0.342074,0.072811,0.056793,0.013501},
-	{0.362170,0.061143,0.054690,0.007397},
-	{0.370272,0.074686,0.039972,0.007302},
-	{0.402953,0.071810,0.034403,0.012804},
-	{0.382151,0.086219,0.067255,0.009054},
-	{0.382421,0.059723,0.048574,0.013805},
-	{0.418492,0.059752,0.050291,0.011257},
-	{0.431649,0.077456,0.029368,0.012777},
-	{0.423405,0.082143,0.054675,0.011680},
-	{0.438239,0.060029,0.044749,0.009130},
-	{0.451129,0.062181,0.031179,0.009710},
-	{0.479146,0.076782,0.041030,0.013576},
-	{0.450502,0.080910,0.050514,0.015762},
-	{0.469945,0.064905,0.054090,0.006331},
-	{0.013563,0.097184,0.042932,0.007007},
-	{0.045430,0.112786,0.026860,0.013686},
-	{0.026238,0.108238,0.071820,0.008664},
-	{0.045567,0.084792,0.054663,0.010547},
-	{0.055851,0.098322,0.045255,0.008878},
-	{0.092159,0.113570,0.039595,0.014076},
-	{0.042022,0.114607,0.055621,0.014833},
-	{0.076167,0.098666,0.069346,0.010212},
-	{0.091668,0.095217,0.029729,0.006767},
-	{0.114684,0.116416,0.048755,0.009589},
-	{0.101121,0.106787,0.066807,0.014051},
-	{0.117768,0.092385,0.068330,0.006541},
-	{0.136812,0.102557,0.043292,0.008163},
-	{0.140060,0.121797,0.037341,0.012236},
-	{0.129633,0.101076,0.058761,0.006790},
-	{0.148062,0.103611,0.061993,0.009901},
-	{0.154918,0.097447,0.035701,0.011902},
-	{0.173991,0.107853,0.041188,0.010506},
-	{0.163383,0.113509,0.070590,0.007969},
-	{0.183313,0.096713,0.054555,0.008896},
-	{0.193900,0.091794,0.032836,0.015762},
-	{0.221431,0.105734,0.041347,0.016142},
-	{0.210572,0.112748,0.064643,0.009085},
-	{0.220128,0.094827,0.066506,0.011310},
-	{0.244598,0.102360,0.048021,0.008201},
-	{0.260796,0.107346,0.041782,0.007826},
-	{0.247778,0.114675,0.056955,0.007342},
-	{0.263854,0.105240,0.057300,0.008131},
-	{0.275329,0.080384,0.035952,0.016171},
-	{0.282596,0.108994,0.045510,0.014327},
-	{0.273227,0.123662,0.063561,0.010354},
-	{0.286850,0.088067,0.054854,0.007260},
-	{0.305680,0.088521,0.040830,0.008724},
-	{0.323658,0.122036,0.045958,0.009372},
-	{0.305577,0.108660,0.055999,0.010069},
-	{0.326432,0.092403,0.071328,0.010172},
-	{0.332822,0.094105,0.046980,0.010736},
-	{0.360057,0.114979,0.050602,0.008675},
-	{0.345196,0.113199,0.049286,0.006350},
-	{0.359002,0.099534,0.049942,0.006821},
-	{0.379041,0.093289,0.031702,0.012829},
-	{0.380592,0.110656,0.050707,0.012044},
-	{0.372838,0.103784,0.069441,0.009079},
-	{0.398837,0.089939,0.069654,0.008117},
-	{0.404951,0.099259,0.042662,0.015929},
-	{0.430865,0.122250,0.034910,0.014087},
-	{0.408865,0.117363,0.058603,0.007815},
-	{0.433797,0.100725,0.068087,0.010539},
-	{0.451913,0.097993,0.031985,0.009479},
-	{0.468554,0.117154,0.051922,0.008497},
-	{0.450291,0.108384,0.052179,0.011764},
-	{0.468896,0.094189,0.071862,0.008497},
-	{0.017769,0.123023,0.046288,0.012482},
-	{0.039600,0.152973,0.031490,0.013071},
-	{0.022486,0.159910,0.058277,0.006730},
-	{0.053035,0.135514,0.059822,0.006873},
-	{0.060820,0.135597,0.032391,0.009756},
-	{0.075793,0.140311,0.044451,0.007184},
-	{0.059415,0.151698,0.048706,0.013209},
-	{0.075397,0.146441,0.067826,0.009066},
-	{0.096374,0.134144,0.029818,0.009090},
-	{0.114668,0.150443,0.049586,0.009896},
-	{0.098456,0.146495,0.056580,0.008196},
-	{0.115068,0.135950,0.063642,0.006871},
-	{0.120480,0.129505,0.039205,0.007619},
-	{0.156971,0.148691,0.034191,0.009631},
-	{0.137556,0.146645,0.052913,0.006461},
-	{0.141950,0.131573,0.059911,0.010688},
-	{0.168096,0.130776,0.044977,0.013464},
-	{0.181562,0.156313,0.051610,0.015347},
-	{0.157127,0.150002,0.051947,0.008174},
-	{0.193242,0.120660,0.050909,0.012412},
-	{0.201771,0.131287,0.031430,0.011359},
-	{0.221674,0.149773,0.053281,0.006817},
-	{0.205379,0.141341,0.053543,0.011532},
-	{0.224583,0.129576,0.068306,0.012332},
-	{0.238902,0.136528,0.043920,0.011950},
-	{0.258910,0.151108,0.049705,0.013475},
-	{0.232642,0.144977,0.060278,0.006814},
-	{0.257772,0.129747,0.049843,0.007917},
-	{0.272859,0.130994,0.031434,0.013547},
-	{0.298637,0.152991,0.041282,0.015762},
-	{0.278487,0.158034,0.062419,0.008408},
-	{0.294879,0.136446,0.061848,0.007854},
-	{0.305700,0.128154,0.049784,0.009982},
-	{0.317822,0.154906,0.054591,0.007666},
-	{0.313082,0.139892,0.064913,0.007314},
-	{0.318412,0.124214,0.060868,0.006584},
-	{0.345403,0.128047,0.055609,0.007438},
-	{0.364150,0.139196,0.044629,0.013056},
-	{0.335338,0.144636,0.042778,0.015825},
-	{0.370092,0.124629,0.059323,0.007443},
-	{0.381964,0.126156,0.033148,0.011118},
-	{0.405718,0.145022,0.044830,0.007344},
-	{0.384403,0.150897,0.061572,0.015826},
-	{0.394762,0.130323,0.049303,0.009909},
-	{0.418237,0.126941,0.051554,0.007327},
-	{0.427303,0.148241,0.032287,0.012279},
-	{0.408184,0.153492,0.057158,0.007815},
-	{0.434164,0.125257,0.064771,0.012118},
-	{0.445472,0.139238,0.049416,0.009855},
-	{0.469080,0.147719,0.054616,0.015762},
-	{0.446519,0.149106,0.070188,0.007289},
-	{0.463066,0.128741,0.072069,0.010712},
-	{0.030541,0.171854,0.034568,0.007470},
-	{0.036934,0.187996,0.038951,0.010436},
-	{0.017296,0.187394,0.069932,0.015775},
-	{0.045470,0.171678,0.064724,0.015762},
-	{0.056514,0.169207,0.032678,0.010404},
-	{0.079003,0.186246,0.029530,0.016079},
-	{0.059706,0.192913,0.050156,0.012943},
-	{0.081987,0.176494,0.057278,0.010079},
-	{0.098980,0.166199,0.053356,0.010173},
-	{0.117318,0.178623,0.040798,0.015290},
-	{0.102820,0.182572,0.068939,0.007422},
-	{0.119261,0.172887,0.062372,0.007118},
-	{0.134901,0.165613,0.030499,0.008886},
-	{0.147868,0.177545,0.033698,0.009023},
-	{0.136653,0.175577,0.056404,0.008907},
-	{0.141868,0.158596,0.054271,0.006316},
-	{0.165708,0.172844,0.039254,0.010243},
-	{0.182639,0.183677,0.050062,0.011541},
-	{0.165084,0.185889,0.065932,0.012227},
-	{0.180948,0.173447,0.066522,0.007376},
-	{0.196132,0.172251,0.035240,0.011530},
-	{0.227201,0.182137,0.045706,0.008997},
-	{0.204299,0.184844,0.052950,0.010342},
-	{0.225988,0.175305,0.062124,0.008828},
-	{0.237177,0.160547,0.051402,0.009195},
-	{0.261161,0.186504,0.033019,0.015762},
-	{0.241624,0.187436,0.069292,0.007769},
-	{0.257173,0.165912,0.069549,0.008701},
-	{0.275377,0.158582,0.034952,0.008984},
-	{0.288726,0.191148,0.034408,0.009808},
-	{0.271403,0.185700,0.067431,0.011799},
-	{0.284218,0.172191,0.051535,0.010347},
-	{0.306049,0.174027,0.032682,0.007870},
-	{0.316942,0.179608,0.046528,0.010610},
-	{0.313026,0.194025,0.059273,0.009027},
-	{0.316419,0.168708,0.067588,0.006369},
-	{0.344253,0.166378,0.030810,0.010546},
-	{0.367887,0.186357,0.033459,0.007112},
-	{0.358319,0.179340,0.050728,0.013841},
-	{0.366596,0.160155,0.045909,0.007602},
-	{0.383817,0.160452,0.034727,0.012399},
-	{0.396469,0.185253,0.029237,0.015979},
-	{0.377815,0.185629,0.073245,0.013364},
-	{0.396205,0.166460,0.049105,0.007346},
-	{0.413309,0.167440,0.053605,0.007275},
-	{0.434009,0.184506,0.031699,0.013620},
-	{0.411121,0.187057,0.053929,0.011981},
-	{0.435082,0.168647,0.049551,0.010284},
-	{0.451053,0.158269,0.035414,0.012610},
-	{0.470872,0.191256,0.051955,0.013847},
-	{0.447897,0.178522,0.059981,0.008314},
-	{0.465203,0.170594,0.069944,0.011281},
-	{0.018220,0.199513,0.032480,0.012472},
-	{0.043929,0.213054,0.038912,0.014059},
-	{0.022453,0.225231,0.059937,0.012276},
-	{0.039438,0.194934,0.058858,0.008970},
-	{0.062291,0.203776,0.030515,0.008161},
-	{0.067233,0.212277,0.050888,0.007657},
-	{0.063555,0.218942,0.074236,0.011822},
-	{0.086676,0.195765,0.056391,0.009775},
-	{0.100062,0.203963,0.032083,0.010760},
-	{0.123439,0.223656,0.039869,0.007878},
-	{0.087363,0.218666,0.047798,0.013687},
-	{0.109855,0.201133,0.048087,0.008215},
-	{0.129021,0.205306,0.043706,0.011683},
-	{0.157516,0.221570,0.036912,0.010458},
-	{0.126303,0.227505,0.059162,0.010490},
-	{0.143861,0.194185,0.066210,0.010561},
-	{0.172910,0.201043,0.033978,0.013203},
-	{0.185035,0.221440,0.045513,0.013181},
-	{0.168070,0.220355,0.072675,0.009360},
-	{0.180093,0.198384,0.061991,0.007046},
-	{0.208314,0.209539,0.044961,0.009495},
-	{0.220276,0.226073,0.034315,0.013522},
-	{0.202082,0.218715,0.068875,0.006812},
-	{0.227664,0.201788,0.056524,0.012609},
-	{0.232983,0.200019,0.028712,0.015762},
-	{0.256565,0.219723,0.031699,0.007469},
-	{0.227652,0.224321,0.057241,0.006644},
-	{0.254299,0.203686,0.071224,0.012930},
-	{0.262164,0.203438,0.047374,0.006460},
-	{0.291834,0.224737,0.049349,0.006948},
-	{0.268860,0.219381,0.069067,0.007715},
-	{0.289943,0.200233,0.060624,0.012722},
-	{0.301505,0.208536,0.039247,0.012306},
-	{0.322382,0.217100,0.051740,0.012086},
-	{0.314574,0.219134,0.070936,0.007251},
-	{0.325878,0.206084,0.069072,0.007512},
-	{0.344014,0.201827,0.047775,0.012892},
-	{0.351810,0.217320,0.036368,0.007867},
-	{0.338587,0.227804,0.063659,0.010701},
-	{0.356571,0.197024,0.069754,0.008434},
-	{0.376453,0.200295,0.047115,0.014105},
-	{0.394956,0.226437,0.029396,0.010725},
-	{0.378323,0.226833,0.061314,0.014536},
-	{0.389287,0.205171,0.066511,0.007194},
-	{0.416665,0.206194,0.024533,0.013492},
-	{0.438684,0.208898,0.032405,0.009490},
-	{0.404012,0.213687,0.050773,0.015762},
-	{0.439529,0.206631,0.054037,0.011117},
-	{0.452197,0.194638,0.042409,0.007397},
-	{0.478578,0.218454,0.044278,0.008032},
-	{0.461476,0.216922,0.055979,0.012027},
-	{0.472499,0.206672,0.070146,0.008643},
-	{0.031034,0.238557,0.044665,0.009415},
-	{0.046212,0.247434,0.048494,0.008580},
-	{0.029656,0.251629,0.061475,0.011572},
-	{0.046678,0.229877,0.059527,0.012161},
-	{0.060543,0.228584,0.035366,0.008957},
-	{0.081148,0.255496,0.031889,0.011593},
-	{0.066991,0.258165,0.055249,0.015762},
-	{0.078630,0.234901,0.067187,0.009147},
-	{0.093096,0.239315,0.031956,0.008521},
-	{0.123349,0.260861,0.042759,0.012372},
-	{0.097630,0.259258,0.071577,0.008194},
-	{0.104871,0.242539,0.055778,0.015789},
-	{0.130936,0.239003,0.044952,0.008368},
-	{0.153591,0.241938,0.041655,0.008205},
-	{0.143130,0.253503,0.053056,0.011112},
-	{0.158308,0.235817,0.066131,0.006732},
-	{0.169649,0.237061,0.031901,0.009847},
-	{0.177988,0.267639,0.051141,0.008419},
-	{0.168590,0.251903,0.050804,0.009913},
-	{0.187601,0.240303,0.056261,0.008679},
-	{0.202598,0.238631,0.030252,0.008355},
-	{0.221493,0.253090,0.049019,0.008616},
-	{0.198234,0.260140,0.040252,0.015762},
-	{0.221897,0.228125,0.071226,0.008950},
-	{0.236460,0.237179,0.031506,0.006307},
-	{0.246367,0.254381,0.050248,0.011434},
-	{0.230061,0.245247,0.060087,0.007429},
-	{0.243784,0.239481,0.061145,0.007205},
-	{0.270130,0.238534,0.030357,0.015762},
-	{0.292685,0.259379,0.051551,0.008561},
-	{0.270568,0.256201,0.053461,0.012554},
-	{0.288088,0.246768,0.065776,0.009704},
-	{0.307205,0.228427,0.050927,0.006869},
-	{0.321366,0.246094,0.045009,0.011972},
-	{0.314218,0.248123,0.067437,0.006555},
-	{0.317918,0.234420,0.056996,0.005112},
-	{0.345996,0.237475,0.032189,0.012907},
-	{0.358078,0.266408,0.046713,0.010906},
-	{0.341845,0.249863,0.050455,0.009550},
-	{0.352246,0.244796,0.066207,0.009874},
-	{0.370773,0.231259,0.033624,0.012678},
-	{0.389736,0.252726,0.029076,0.015191},
-	{0.374368,0.254883,0.060882,0.013568},
-	{0.399580,0.236433,0.066670,0.009396},
-	{0.419086,0.229820,0.030486,0.008709},
-	{0.431898,0.253013,0.026908,0.014166},
-	{0.424434,0.259566,0.058997,0.006353},
-	{0.425774,0.238512,0.052362,0.015762},
-	{0.449984,0.229928,0.034152,0.014447},
-	{0.468335,0.247681,0.035305,0.009986},
-	{0.446284,0.265609,0.058199,0.014044},
-	{0.479957,0.238820,0.056505,0.015762},
-	{0.016058,0.272296,0.031907,0.015903},
-	{0.043188,0.296346,0.035622,0.013645},
-	{0.020265,0.293955,0.054775,0.015873},
-	{0.041510,0.268037,0.070523,0.007849},
-	{0.062225,0.280373,0.040949,0.011078},
-	{0.086682,0.281592,0.035069,0.013702},
-	{0.069169,0.284177,0.059909,0.009020},
-	{0.085718,0.266880,0.066273,0.006910},
-	{0.097403,0.266171,0.048894,0.009477},
-	{0.107654,0.281428,0.038660,0.007576},
-	{0.088316,0.284050,0.066490,0.010354},
-	{0.113503,0.280552,0.060462,0.015014},
-	{0.122859,0.278804,0.036141,0.006759},
-	{0.142878,0.297979,0.037101,0.011706},
-	{0.133777,0.283064,0.049774,0.007955},
-	{0.154649,0.263474,0.065692,0.007507},
-	{0.169175,0.273460,0.031813,0.013607},
-	{0.179325,0.294941,0.051789,0.010091},
-	{0.165815,0.277188,0.064486,0.010220},
-	{0.192842,0.268948,0.065506,0.008519},
-	{0.203664,0.282860,0.030067,0.008961},
-	{0.221520,0.290705,0.031569,0.010600},
-	{0.204075,0.289620,0.057034,0.015762},
-	{0.217062,0.273218,0.067345,0.007561},
-	{0.236623,0.274054,0.029708,0.008988},
-	{0.259386,0.293049,0.032016,0.011916},
-	{0.240332,0.286268,0.050913,0.015762},
-	{0.252585,0.269128,0.068044,0.010690},
-	{0.277228,0.263086,0.036137,0.007242},
-	{0.297808,0.298823,0.038507,0.011507},
-	{0.273109,0.288314,0.070360,0.007871},
-	{0.283880,0.280089,0.053191,0.014002},
-	{0.311353,0.272674,0.042400,0.016116},
-	{0.318185,0.295940,0.050900,0.009579},
-	{0.300031,0.294218,0.056245,0.006682},
-	{0.324041,0.283074,0.063804,0.007747},
-	{0.338338,0.274337,0.045421,0.010405},
-	{0.366658,0.294673,0.036475,0.013011},
-	{0.345468,0.300165,0.061263,0.006730},
-	{0.371053,0.276011,0.062724,0.007746},
-	{0.382159,0.266197,0.045056,0.007040},
-	{0.385302,0.283479,0.044022,0.010008},
-	{0.382756,0.291084,0.070614,0.012573},
-	{0.403108,0.264928,0.054184,0.015762},
-	{0.419100,0.274729,0.031563,0.011467},
-	{0.437640,0.289426,0.049922,0.012611},
-	{0.416213,0.289680,0.065434,0.013463},
-	{0.425331,0.272106,0.052713,0.007637},
-	{0.454008,0.282624,0.038875,0.008275},
-	{0.483070,0.298139,0.038400,0.016342},
-	{0.446217,0.292641,0.069129,0.007245},
-	{0.473937,0.269688,0.049149,0.015337},
-	{0.027818,0.310268,0.030259,0.007775},
-	{0.037764,0.320592,0.051731,0.008781},
-	{0.016776,0.324398,0.064621,0.015762},
-	{0.043065,0.304671,0.073634,0.008404},
-	{0.060248,0.307914,0.031150,0.007448},
-	{0.077271,0.327681,0.031663,0.013927},
-	{0.055259,0.322950,0.050938,0.008327},
-	{0.079365,0.305257,0.051792,0.015762},
-	{0.095660,0.308012,0.031429,0.010463},
-	{0.103681,0.332264,0.031625,0.012290},
-	{0.089797,0.330875,0.053651,0.011579},
-	{0.102216,0.307408,0.054272,0.006891},
-	{0.135063,0.305375,0.051629,0.006373},
-	{0.146687,0.332542,0.040487,0.015166},
-	{0.119733,0.321591,0.052005,0.015762},
-	{0.139154,0.311001,0.062753,0.006747},
-	{0.166611,0.304212,0.025702,0.013467},
-	{0.179450,0.331099,0.030605,0.013540},
-	{0.168140,0.316792,0.050046,0.012886},
-	{0.181651,0.308754,0.061301,0.006449},
-	{0.196784,0.307080,0.030792,0.016081},
-	{0.215900,0.329030,0.028037,0.012976},
-	{0.194417,0.327273,0.054083,0.014566},
-	{0.222938,0.309720,0.049824,0.007765},
-	{0.236225,0.315755,0.036277,0.011069},
-	{0.259154,0.323023,0.045475,0.012979},
-	{0.229226,0.318793,0.058722,0.006414},
-	{0.263876,0.304803,0.055229,0.008220},
-	{0.280036,0.308037,0.046953,0.010221},
-	{0.289039,0.323201,0.031727,0.013078},
-	{0.277826,0.320270,0.068751,0.009886},
-	{0.281755,0.301785,0.064415,0.008406},
-	{0.311687,0.313114,0.034665,0.007177},
-	{0.321013,0.324686,0.029636,0.008514},
-	{0.307138,0.327658,0.072817,0.007383},
-	{0.319851,0.313892,0.064538,0.009449},
-	{0.333424,0.313519,0.041662,0.007831},
-	{0.360179,0.317042,0.032555,0.009090},
-	{0.345335,0.325054,0.051853,0.011632},
-	{0.356818,0.307255,0.054092,0.008452},
-	{0.376257,0.314516,0.044839,0.010566},
-	{0.404942,0.322076,0.039531,0.009398},
-	{0.377646,0.330732,0.066428,0.015762},
-	{0.393248,0.303006,0.052180,0.011230},
-	{0.414496,0.303557,0.046583,0.009348},
-	{0.429851,0.323348,0.043622,0.015876},
-	{0.411263,0.319949,0.059797,0.008998},
-	{0.432707,0.308279,0.070597,0.011926},
-	{0.453339,0.305155,0.030681,0.015166},
-	{0.467869,0.322571,0.052192,0.010042},
-	{0.449922,0.317745,0.059766,0.010027},
-	{0.461253,0.304033,0.060778,0.007790},
-	{0.021541,0.332873,0.040513,0.010232},
-	{0.038000,0.356554,0.031870,0.007826},
-	{0.032187,0.360165,0.053724,0.015074},
-	{0.051751,0.340670,0.059341,0.011595},
-	{0.050035,0.338842,0.039691,0.008214},
-	{0.074340,0.355322,0.033149,0.012791},
-	{0.064951,0.354774,0.051051,0.007431},
-	{0.073704,0.344766,0.063534,0.010807},
-	{0.090705,0.345601,0.029750,0.006412},
-	{0.113418,0.360863,0.031428,0.008821},
-	{0.096799,0.362099,0.049082,0.008369},
-	{0.107463,0.341185,0.072071,0.014400},
-	{0.121217,0.345472,0.047617,0.008563},
-	{0.151164,0.358997,0.045262,0.011416},
-	{0.135273,0.360729,0.057086,0.008467},
-	{0.150044,0.351765,0.063675,0.007622},
-	{0.167267,0.337703,0.045162,0.006559},
-	{0.185291,0.357837,0.029177,0.013202},
-	{0.174685,0.353137,0.051201,0.010915},
-	{0.182603,0.341175,0.071944,0.009153},
-	{0.199074,0.341536,0.033569,0.008593},
-	{0.223648,0.364790,0.032933,0.013250},
-	{0.206142,0.359909,0.070232,0.011880},
-	{0.218376,0.338725,0.063741,0.006775},
-	{0.235978,0.341262,0.044598,0.015762},
-	{0.248271,0.357981,0.028623,0.010326},
-	{0.239381,0.361261,0.054185,0.006676},
-	{0.262678,0.342288,0.073448,0.011112},
-	{0.270573,0.339357,0.051890,0.007719},
-	{0.291651,0.365260,0.034029,0.012619},
-	{0.278330,0.357467,0.061963,0.013218},
-	{0.287271,0.340846,0.047013,0.009740},
-	{0.311721,0.350588,0.047719,0.015762},
-	{0.329835,0.361562,0.031124,0.010858},
-	{0.308858,0.362142,0.074170,0.007884},
-	{0.318657,0.331854,0.062466,0.008662},
-	{0.334080,0.339898,0.036091,0.011614},
-	{0.361053,0.363146,0.028462,0.015405},
-	{0.342858,0.361137,0.049372,0.011564},
-	{0.357992,0.345258,0.056926,0.010458},
-	{0.376633,0.335585,0.028650,0.016006},
-	{0.388485,0.356145,0.042465,0.011050},
-	{0.367467,0.367712,0.056170,0.013400},
-	{0.398534,0.339188,0.050584,0.007905},
-	{0.410905,0.345867,0.031138,0.016090},
-	{0.433557,0.364385,0.032172,0.009789},
-	{0.414823,0.362718,0.050261,0.009697},
-	{0.425989,0.342978,0.064208,0.012469},
-	{0.446622,0.347487,0.046030,0.008548},
-	{0.463905,0.355130,0.053326,0.007996},
-	{0.447393,0.368651,0.049700,0.012945},
-	{0.474977,0.341544,0.046688,0.010746},
-	{0.019773,0.386775,0.049869,0.014542},
-	{0.049900,0.390242,0.042917,0.008807},
-	{0.022183,0.402617,0.069178,0.007405},
-	{0.034110,0.379357,0.068905,0.008232},
-	{0.067211,0.383096,0.027225,0.015626},
-	{0.078560,0.396236,0.052905,0.006480},
-	{0.068770,0.402250,0.062282,0.008351},
-	{0.075963,0.374658,0.055577,0.014744},
-	{0.104738,0.376287,0.048997,0.007889},
-	{0.119282,0.396959,0.048600,0.010216},
-	{0.096405,0.402327,0.056212,0.008008},
-	{0.107422,0.388063,0.061078,0.009161},
-	{0.131436,0.376425,0.038024,0.015884},
-	{0.148514,0.406019,0.048436,0.013951},
-	{0.132288,0.405409,0.061120,0.006654},
-	{0.151652,0.388678,0.066685,0.006268},
-	{0.169202,0.379342,0.050424,0.015870},
-	{0.188174,0.396136,0.022829,0.007254},
-	{0.170203,0.400366,0.065913,0.009355},
-	{0.194966,0.372889,0.055640,0.010498},
-	{0.212711,0.382905,0.044145,0.006430},
-	{0.220250,0.394315,0.029698,0.010635},
-	{0.195739,0.397199,0.044541,0.015762},
-	{0.211654,0.377701,0.056428,0.006888},
-	{0.234965,0.382146,0.029519,0.007750},
-	{0.263901,0.397112,0.046806,0.006980},
-	{0.234022,0.391910,0.051822,0.015536},
-	{0.260195,0.374135,0.045281,0.015762},
-	{0.280399,0.376799,0.056025,0.006714},
-	{0.283192,0.402145,0.026391,0.009786},
-	{0.279561,0.389831,0.070096,0.006789},
-	{0.299585,0.373604,0.057431,0.011953},
-	{0.312740,0.372343,0.033714,0.009518},
-	{0.335479,0.387674,0.036866,0.008966},
-	{0.313317,0.390191,0.058539,0.009610},
-	{0.327009,0.381826,0.052052,0.007696},
-	{0.349111,0.381525,0.050691,0.009803},
-	{0.370847,0.389607,0.040148,0.007174},
-	{0.336900,0.404187,0.051731,0.013298},
-	{0.364431,0.386995,0.051672,0.006272},
-	{0.380486,0.372616,0.037016,0.007843},
-	{0.387432,0.394596,0.035861,0.010668},
-	{0.383440,0.392839,0.070329,0.010113},
-	{0.397354,0.378289,0.069987,0.008162},
-	{0.412381,0.379269,0.031555,0.014769},
-	{0.431738,0.399853,0.031097,0.013491},
-	{0.416807,0.388592,0.068089,0.010234},
-	{0.434246,0.385754,0.051562,0.008510},
-	{0.459761,0.377812,0.034232,0.008546},
-	{0.469310,0.399879,0.030659,0.015762},
-	{0.448851,0.389468,0.070969,0.016061},
-	{0.472731,0.373287,0.052274,0.012192},
-	{0.025845,0.411569,0.031706,0.012222},
-	{0.053452,0.432332,0.034575,0.012284},
-	{0.013101,0.425034,0.052342,0.015517},
-	{0.035661,0.409240,0.053396,0.011700},
-	{0.069697,0.410872,0.045637,0.008799},
-	{0.085224,0.435507,0.032725,0.015801},
-	{0.056265,0.422981,0.058037,0.013129},
-	{0.076985,0.417420,0.069616,0.007327},
-	{0.086433,0.412353,0.047787,0.008139},
-	{0.113150,0.426126,0.051781,0.007572},
-	{0.095559,0.431375,0.071602,0.012141},
-	{0.110469,0.407765,0.062669,0.008395},
-	{0.131849,0.404271,0.035325,0.007326},
-	{0.154057,0.433609,0.051576,0.006804},
-	{0.130968,0.431234,0.049111,0.011155},
-	{0.146668,0.411976,0.072037,0.006514},
-	{0.173190,0.416526,0.046090,0.012972},
-	{0.190589,0.427391,0.031914,0.009879},
-	{0.165638,0.431320,0.062630,0.009368},
-	{0.181578,0.418447,0.070458,0.012485},
-	{0.201938,0.420097,0.050532,0.007909},
-	{0.210786,0.430524,0.043687,0.007384},
-	{0.199643,0.440108,0.058556,0.013086},
-	{0.219101,0.413160,0.043518,0.011656},
-	{0.235474,0.419530,0.052019,0.007861},
-	{0.254554,0.428819,0.029869,0.009518},
-	{0.251638,0.431825,0.063212,0.015327},
-	{0.253052,0.411818,0.042596,0.011772},
-	{0.268275,0.411836,0.031385,0.007133},
-	{0.299229,0.425848,0.044101,0.011809},
-	{0.277241,0.422348,0.053397,0.012319},
-	{0.285524,0.396817,0.050771,0.014608},
-	{0.311540,0.402649,0.035156,0.015936},
-	{0.331451,0.434548,0.035449,0.006888},
-	{0.310673,0.434227,0.066608,0.012917},
-	{0.322590,0.420054,0.049005,0.008242},
-	{0.340380,0.414409,0.031798,0.009373},
-	{0.362861,0.429363,0.031830,0.012967},
-	{0.340153,0.437578,0.060896,0.007843},
-	{0.370512,0.415453,0.055970,0.010546},
-	{-1.,-1.,-1.,-1. } /* sentinel: non-positive radius */
-};
-
-Vector3r Shop::inscribedCircleCenter(const Vector3r& v0, const Vector3r& v1, const Vector3r& v2)
-{
-	return v0+((v2-v0)*(v1-v0).Length()+(v1-v0)*(v2-v0).Length())/((v1-v0).Length()+(v2-v1).Length()+(v0-v2).Length());
-}
-
-void Shop::getViscoelasticFromSpheresInteraction( Real m, Real tc, Real en, Real es, shared_ptr<SimpleViscoelasticBodyParameters> b)
-{
-    b->kn = m/tc/tc * ( Mathr::PI*Mathr::PI + Mathr::Pow(Mathr::Log(en),2) );
-    b->cn = -2.0*m/tc * Mathr::Log(en);
-    b->ks = 2.0/7.0 * m/tc/tc * ( Mathr::PI*Mathr::PI + Mathr::Pow(Mathr::Log(es),2) );
-    b->cs = -2.0/7.0 * m/tc * Mathr::Log(es);
-
-    if (Math<Real>::FAbs(b->cn) <= Math<Real>::ZERO_TOLERANCE ) b->cn=0;
-    if (Math<Real>::FAbs(b->cs) <= Math<Real>::ZERO_TOLERANCE ) b->cs=0;
-}
-
-
-/* This function is copied almost verbatim from scientific python, module Visualization, class ColorScale
- *
- */
-Vector3r Shop::scalarOnColorScale(Real x, Real xmin, Real xmax){
-	Real xnorm=min((Real)1.,max((x-xmin)/(xmax-xmin),(Real)0.));
-	if(xnorm<.25) return Vector3r(0,.4*xnorm,1);
-	if(xnorm<.5)  return Vector3r(0,1,1.-4.*(xnorm-.25));
-	if(xnorm<.75) return Vector3r(4*(xnorm-.5),1.,0);
-	return Vector3r(1,1-4*(xnorm-.75),0);
-}
-
-/* Wrap floating point number into interval (x0,x1〉such that it is shifted
- * by integral number of the interval range. If given, *period will hold
- * this number. The wrapped value is returned.
- */
-Real Shop::periodicWrap(Real x, Real x0, Real x1, long* period){
-	Real xNorm=(x-x0)/(x1-x0);
-	Real xxNorm=xNorm-floor(xNorm);
-	if(period) *period=(long)floor(xNorm);
-	return x0+xxNorm*(x1-x0);
-}
-

Deleted: trunk/extra/Shop.hpp
===================================================================
--- trunk/extra/Shop.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/extra/Shop.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,109 +0,0 @@
-// 2007 © Václav Šmilauer <eudoxos@xxxxxxxx>
-
-#pragma once
-
-#include<string>
-#include<map>
-#include<iostream>
-#include<typeinfo>
-#include<boost/any.hpp>
-#include<boost/lambda/lambda.hpp>
-
-#include<Wm3Vector3.h>
-#include<Wm3Quaternion.h>
-#include<yade/lib-base/yadeWm3.hpp>
-#include<yade/lib-base/Logging.hpp>
-#include<yade/core/Body.hpp>
-
-#include<boost/function.hpp>
-
-/*
-#include<yade/core/MetaBody.hpp>
-#include<yade/core/Body.hpp>
-#include<yade/core/Omega.hpp>
-*/
-class MetaBody;
-class Body;
-class SimpleViscoelasticBodyParameters;
-
-using namespace std;
-using boost::shared_ptr;
-
-/*! Miscillaneous utility functions which are believed to be generally useful.
- *
- * All data members are methods are static, no instance of Shop is created. It is not serializable either.
- */
-
-class Shop{
-	private:
-		DECLARE_LOGGER;
-	public:
-		/*! map of <attribute name,value>. */
-		static map<string,boost::any> defaults;
-		/*! fills Shop::defaults with values. Called automatically. */ 
-		static void init();
-		/*! Calls Shop::init if Shop::defaults is empty (when setting or getting a default). */
-		static void ensureInit(){if(defaults.size()==0) init();}
-	public:
-		static bool hasDefault(const string& key){return defaults.find(key)!=defaults.end();}
-		/*! Retrieve default value from the map. User is responsible for casting it to the right type. */
-		template <typename valType> static valType getDefault(const string& key);
-		//template <typename valType> static valType getDefault(string key){ensureInit(); return boost::any_cast<valType>(defaults[key]);}
-		/*! Set the default value. Overrides existing value or creates new entry. Integer types are always cast to long (be careful when retrieving them). */
-		template <typename valType> static void setDefault(string key, const valType value){
-			ensureInit(); //cerr<<"Shop: Setting `"<<key<<"'="<<value<<" (type `"<<typeid(valType).name()<<"')."<<endl;
-			defaults[key]=boost::any(value);}
-
-		//! creates empty rootBody along with its parameters (boundingVolume etc.)
-		static shared_ptr<MetaBody> rootBody();
-		/*! creates engines and initilizers within given MetaBody: elastic contact law, with gravity, timestepper and damping.
-		 *
-		 * All parameters are take from Shop::defaults, which are user-settable.
-		 */
-		static void rootBodyActors(shared_ptr<MetaBody>);
-		//! create default sphere, along with its boundingVolume etc. 
-		static shared_ptr<Body> sphere(Vector3r center, Real radius);
-		//! create default box with everything needed
-		static shared_ptr<Body> box(Vector3r center, Vector3r extents);
-		//! create default tetrahedron
-		static shared_ptr<Body> tetra(Vector3r v[4]);
-
-		//! Return vector of pairs (center,radius) loaded from a file with numbers inside
-		static vector<pair<Vector3r,Real> > loadSpheresFromFile(string fname,Vector3r& minXYZ, Vector3r& maxXYZ);
-		
-		struct sphereGeomStruct{ double C0, C1, C2, r; };
-		static sphereGeomStruct smallSdecXyzData[];
-		//! Return vector of pairs (center,radius) with values from small.sdec.xyz (hardwired in the code, doesn't need that file actually)
-		static vector<pair<Vector3r,Real> > loadSpheresSmallSdecXyz(Vector3r& minXYZ, Vector3r& maxXYZ);
-		
-		//! Save spheres in the current simulation into a text file
-		static void saveSpheresToFile(string fileName);
-
-
-		//! Estimate timestep based on P-wave propagation speed
-		static Real PWaveTimeStep(shared_ptr<MetaBody> rb=shared_ptr<MetaBody>());
-
-		//! Calculate inscribed circle center of trianlge
-		static Vector3r inscribedCircleCenter(const Vector3r& v0, const Vector3r& v1, const Vector3r& v2);
-
-		/// Get viscoelastic parameters kn,cn,ks,cs from analytical solution of
-		/// a problem of interaction of pair spheres with mass m, collision
-		/// time tc and restitution coefficients en,es.
-	    static void getViscoelasticFromSpheresInteraction(Real m, Real tc, Real en, Real es, shared_ptr<SimpleViscoelasticBodyParameters> b);
-
-		//! Get unbalanced force of the whole simulation
-		static Real unbalancedForce(bool useMaxForce=false, MetaBody* _rb=NULL);
-		static Real kineticEnergy(MetaBody* _rb=NULL);
-
-		//! create transientInteraction between 2 bodies, using existing MetaEngine in Omega
-		static shared_ptr<Interaction> createExplicitInteraction(body_id_t id1, body_id_t id2);
-
-		//! apply force on contact point on both bodies (reversed on body 2)
-		static void applyForceAtContactPoint(const Vector3r& force, const Vector3r& contPt, body_id_t id1, const Vector3r& pos1, body_id_t id2, const Vector3r& pos2, MetaBody* rb);
-
-		//! map scalar variable to 1d colorscale
-		static Vector3r scalarOnColorScale(Real x, Real xmin=0., Real xmax=1.);
-
-		//! wrap floating number periodically to the given range
-		static Real periodicWrap(Real x, Real x0, Real x1, long* period=NULL);
-};

Deleted: trunk/extra/tetra/Tetra.cpp
===================================================================
--- trunk/extra/tetra/Tetra.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/extra/tetra/Tetra.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,605 +0,0 @@
-// © 2007 Václav Šmilauer <eudoxos@xxxxxxxx>
-
-#include"Tetra.hpp"
-
-YADE_PLUGIN(/* self-contained in hpp: */ "TetraMold", "TetraBang", "Tetrahedron2TetraMold","TetraAABB", 
-	/* some code in cpp (this file): */ "TetraLaw",	 "Tetra2TetraBang"
-	#ifdef YADE_OPENGL
-		,"TetraDraw"
-	#endif	
-	);
-
-
-#include<yade/core/Interaction.hpp>
-#include<yade/core/Omega.hpp>
-#include<yade/core/MetaBody.hpp>
-
-
-#include<yade/pkg-common/AABB.hpp>
-#include<yade/pkg-common/Tetrahedron.hpp>
-#include<yade/pkg-common/ElasticBodyParameters.hpp>
-#include<yade/pkg-dem/BodyMacroParameters.hpp>
-
-//#include<Wm3Tetrahedron3.h>
-//#include<Wm3IntrTetrahedron3Tetrahedron3.h> // not necessary since the cpp includes it as well
-//#include"Intersection/Wm3IntrTetrahedron3Tetrahedron3.cpp"
-//#include"Intersection/Wm3Intersector.cpp"
-
-CREATE_LOGGER(Tetra2TetraBang);
-
-/*! Calculate configuration of TetraMold - TetraMold intersection.
- *
- * Wildmagick's functions are used here: intersection is returned as a set of tetrahedra (may be empty, inwhich case there is no real intersection).
- * Then we calcualte volumetric proeprties of this intersection volume: inertia, centroid, volume.
- *
- * Contact normal (the direction in which repulsive force will act) coincides with the direction of least inertia,
- * since that is the gradient that maximizes the drop of elastic deformation energy and will reach minimum fastest.
- *
- * Equivalent cross section of the penetrating volume (as if it were a cuboid with the same inertia) and equivalent penetration depth are calculated;
- * Equivalent solid size in the dimension of normal serves as reference for strain calculation and is different for solids A and B.
- *
- * Strain will be then approximated by equivalentPenetrationDepth/.5*(maxPenetrationDepthA+maxPenetrationDepthB) (the average of A and B)
- *
- * All the relevant results are fed into TetraBang which is passed to TetraLaw later that makes actual use of all this.
- *
- * @todo thoroughly test this for numerical correctness.
- *
- */
-bool Tetra2TetraBang::go(const shared_ptr<InteractingGeometry>& cm1,const shared_ptr<InteractingGeometry>& cm2,const Se3r& se31,const Se3r& se32,const shared_ptr<Interaction>& interaction){
-	TetraMold* A = static_cast<TetraMold*>(cm1.get());
-	TetraMold* B = static_cast<TetraMold*>(cm2.get());
-	//return false;
-	
-	shared_ptr<TetraBang> bang;
-	// depending whether it's a new interaction: create new one, or use the existing one.
-	if (!interaction->interactionGeometry) bang=shared_ptr<TetraBang>(new TetraBang());
-	else bang=YADE_PTR_CAST<TetraBang>(interaction->interactionGeometry);	
-	interaction->interactionGeometry=bang;
-	
-	// use wildmagick's intersection routine?
-	#if 0
-		// transform to global coordinates, build Tetrahedron3r objects to make wm3 happy
-		Tetrahedron3r tA(se31.orientation*A->v[0]+se31.position,se31.orientation*A->v[1]+se31.position,se31.orientation*A->v[2]+se31.position,se31.orientation*A->v[3]+se31.position);
-		Tetrahedron3r tB(se32.orientation*B->v[0]+se32.position,se32.orientation*B->v[1]+se32.position,se32.orientation*B->v[2]+se32.position,se32.orientation*B->v[3]+se32.position);
-
-		IntrTetrahedron3Tetrahedron3r iAB(tA,tB);
-		bool found=iAB.Find();  //calculates the intersection volume as a composition of 0 or more tetrahedra
-
-		if(!found) return false; // no intersecting volume
-
-		Real V(0); // volume of intersection (cummulative)
-		Vector3r Sg(0,0,0); // static moment of intersection
-		vector<vector<Vector3r> > tAB;
-
-		Wm3::TArray<Wm3::Tetrahedron3d> iABinfo(iAB.GetIntersection()); // retrieve the array of 4hedra
-		for(int i=0; i<iABinfo.GetQuantity(); i++){
-			iABinfo[i];  // has i-th tehtrahedron as Tetrahedron3r&
-			#define v0 iABinfo[i].V[0]
-			#define v1 iABinfo[i].V[1]
-			#define v2 iABinfo[i].V[2]
-			#define v3 iABinfo[i].V[3]
-			Real dV=fabs(Vector3r(v1-v0).Dot((v2-v0).Cross(v3-v0)))/6.;
-			V+=dV;
-			Sg+=dV*(v0+v1+v2+v3)*.25;
-			vector<Vector3r> t; t.push_back(v0); t.push_back(v1); t.push_back(v2); t.push_back(v3);
-			tAB.push_back(t);
-			#undef v0
-			#undef v1
-			#undef v2
-			#undef v3
-		}
-	#endif
-
-	// transform to global coordinates, build Tetrahedron objects
-	Tetrahedron tA(se31.orientation*A->v[0]+se31.position,se31.orientation*A->v[1]+se31.position,se31.orientation*A->v[2]+se31.position,se31.orientation*A->v[3]+se31.position);
-	Tetrahedron tB(se32.orientation*B->v[0]+se32.position,se32.orientation*B->v[1]+se32.position,se32.orientation*B->v[2]+se32.position,se32.orientation*B->v[3]+se32.position);
-	// calculate intersection
-	#if 0
-		tB=Tetrahedron(Vector3r(0,0,0),Vector3r(1.5,1,1),Vector3r(0.5,1,1),Vector3r(1,1,.5));
-		tA=Tetrahedron(Vector3r(0,0,0),Vector3r(1,0,0),Vector3r(0,1,0),Vector3r(0,0,1));
-	#endif
-	list<Tetrahedron> tAB=Tetra2TetraIntersection(tA,tB);
-	if(tAB.size()==0) { /* LOG_DEBUG("No intersection."); */ return false;} //no intersecting volume
-
-	Real V(0); // volume of intersection (cummulative)
-	Vector3r Sg(0,0,0); // static moment of intersection
-
-	Vector3r tt[4]; for(int i=0; i<4; i++) tt[i]=tA.v[i];
-	//DEBUG TRWM3VEC(tt[0]); TRWM3VEC(tt[1]); TRWM3VEC(tt[2]); TRWM3VEC(tt[3]); TRVAR1(TetrahedronVolume(tA.v)); TRVAR1(TetrahedronVolume(tt)); TRWM3MAT(TetrahedronInertiaTensor(tA.v));
-
-	for(list<Tetrahedron>::iterator II=tAB.begin(); II!=tAB.end(); II++){
-		Real dV=TetrahedronVolume(II->v);
-		V+=dV;
-		//DEBUG TRVAR1(dV); TRWM3VEC(II->v[0]); TRWM3VEC(II->v[1]); TRWM3VEC(II->v[2]); TRWM3VEC(II->v[3]); LOG_TRACE("====")
-		Sg+=dV*(II->v[0]+II->v[1]+II->v[2]+II->v[3])*.25;
-	}
-	Vector3r centroid=Sg/V;
-	Matrix3r I(true); // inertia tensor for the composition; zero matrix initially
-		// I is purely geometrical (as if with unit density)
-	
-	// get total 
-	Vector3r dist;	for(list<Tetrahedron>::iterator II=tAB.begin(); II!=tAB.end(); II++){
-		II->v[0]-=centroid; II->v[1]-=centroid; II->v[2]-=centroid; II->v[3]-=centroid;
-		dist=(II->v[0]+II->v[1]+II->v[2]+II->v[3])*.25-centroid;
-		/* use parallel axis theorem */ 
-		I+=TetrahedronInertiaTensor(II->v)  + TetrahedronVolume(II->v)*Matrix3r(dist[0]*dist[0],dist[1]*dist[1],dist[2]*dist[2]);
-	}
-	
-	/* Now, we have the collision volumetrically described by intersection volume (V), its inertia tensor (I) and centroid (centroid; contact point).
-	 * The inertia tensor is in global coordinates; by eigendecomposition, we find principal axes, which will give us
-	 *  1. normal, the direction of the lest inertia; this is the gradient of penetration energy
-	 *  	it may have either direction mathematically, but since 4hedra are convex, 
-	 *  	normal will be always the direction pointing more towards the centroid of the other 4hedron
-	 *  2. tangent?! hopefully not needed at all. */
-
-	Matrix3r Ip, R; // principal moments of inertia, rotation matrix
-	(void) /* should check convergence*/ I.EigenDecomposition(R,Ip);
-	// according to the documentation in Wm3 header, diagonal entries are in ascending order: d0<=d1<=d2;
-	// but keep it algorithmic for now and just assert that.
-	int ix=(Ip(0,0)<Ip(1,1) && Ip(0,0)<Ip(2,2))?0:( (Ip(1,1)<Ip(0,0) && Ip(1,1)<Ip(2,2))?1:2); // index of the minimum moment of inertia
-	// the other two indices, modulated by 3, since they are ∈ {0,1,2}
-	int ixx=(ix+1)%3, ixxx=(ix+2)%3;
-	// assert what the documentation says (d0<=d1<=d2)
-	assert(ix==0);
-	Vector3r minAxis(0,0,0); minAxis[ix]=1; // the axis of minimum inertia
-	Vector3r normal=R*minAxis; normal.Normalize(); // normal is minAxis in global coordinates (normalization shouldn't be needed since R is rotation matrix, but to make sure...)
-
-	// centroid of B
-	Vector3r Bcent=se31.orientation*((B->v[0]+B->v[1]+B->v[2]+B->v[3])*.25)+se31.position;
-	// reverse direction if projection of the (contact_point-centroid_of_B) vector onto the normal is negative (i.e. the normal points more towards A)
-	if((Bcent-centroid).Dot(normal)<0) normal*=-1;
-
-	/* now estimate the area of the solid that is perpendicular to the normal. This will be needed to estimate elastic force based on Young's modulus.
-	 * Suppose we have cuboid, with edges of lengths x,y,z in the direction of respective axes.
-	 * It's inertia are Ix=(V/12)*(y^2+z^2), Iy=(V/12)*(x^2+z^2), Iz=(V/12)*(x^2+y^2) and suppose Iz is maximal; Ix, Iy and Iz are known (from decomposition above).
-	 * Then the area perpendicular to z (normal direction) is given by x*y=V/z, where V is known.
-	 * Ix+Iy-Iz=(V/12)*(y^2+z^2+x^2+z^2-x^2-y^2)=(V*z^2)/6, z=√(6*(Ix+Iy-Iz)/V)
-	 * Az=V/z=√(V^3/(6*(Ix+Iy-Iz))).
-	 *
-	 * In our case, the greatest inertia is along ixxx, the other coordinates are ixx and ix. equivalentPenetrationDepth means what was z.
-	 */
-	//DEBUG
-	TRWM3MAT(Ip); TRWM3MAT(I);
-	Real equivalentPenetrationDepth=sqrt(6.*(Ip(ix,ix)+Ip(ixx,ixx)-Ip(ixxx,ixxx))/V);
-	Real equivalentCrossSection=V/equivalentPenetrationDepth;
-	TRVAR3(V,equivalentPenetrationDepth,equivalentCrossSection);
-
-	/* Now rotate the whole inertia tensors of A and B and estimate maxPenetrationDepth -- the length of the body in the direction of the contact normal.
-	 * This will be used to calculate relative deformation, which is needed for elastic response. */
-	const shared_ptr<BodyMacroParameters>& physA=YADE_PTR_CAST<BodyMacroParameters>(Body::byId(interaction->getId1())->physicalParameters);
-	const shared_ptr<BodyMacroParameters>& physB=YADE_PTR_CAST<BodyMacroParameters>(Body::byId(interaction->getId2())->physicalParameters);
-	// WARNING: Matrix3r(Vector3r(...)) is compiled, but gives zero matrix??!! Use explicitly constructor from diagonal entries
-	Matrix3r IA(physA->inertia[0],physA->inertia[1],physA->inertia[2]); Matrix3r IB(physB->inertia[0],physB->inertia[1],physB->inertia[2]);
-	// see Clump::inertiaTensorRotate for references
-	IA=R.Transpose()*IA*R; IB=R.Transpose()*IB*R;
-
-	Real maxPenetrationDepthA=sqrt(6*(IA(ix,ix)+IA(ixx,ixx)-IA(ixxx,ixxx))/V);
-	Real maxPenetrationDepthB=sqrt(6*(IB(ix,ix)+IB(ixx,ixx)-IB(ixxx,ixxx))/V);
-	TRVAR2(maxPenetrationDepthA,maxPenetrationDepthB);
-
-	/* store calculated stuff in bang; some is redundant */
-	bang->normal=normal;
-	bang->equivalentCrossSection=equivalentCrossSection;
-	bang->contactPoint=centroid;
-	bang->penetrationVolume=V;
-
-	bang->equivalentPenetrationDepth=equivalentPenetrationDepth;
-	bang->maxPenetrationDepthA=maxPenetrationDepthA;
-	bang->maxPenetrationDepthB=maxPenetrationDepthB;
-
-	return true;
-}
-
-bool Tetra2TetraBang::goReverse(const shared_ptr<InteractingGeometry>& cm1,const shared_ptr<InteractingGeometry>& cm2,const Se3r& se31,const Se3r& se32,const shared_ptr<Interaction>& interaction){
-	// reverse only normal direction, otherwise use the inverse contact
-	bool isInteracting=go(cm2,cm1,se32,se31,interaction);
-	if(isInteracting){
-		TetraBang* bang=static_cast<TetraBang*>(interaction->interactionGeometry.get());
-		bang->normal*=-1;
-	}
-	return isInteracting;
-}
-
-
-/*! Calculate intersection o Tetrahedron A and B as union of set (std::list) of 4hedra.
- *
- * intersecting tetrahedra A and B
- * S=intersection set (4hedra)
- * S={A}
- * for face in B_faces:
- *		for t in S:  [ S is mutable, but if list, iterators remain valid? ]
- * 		tmp = clip t by face // may return multiple 4hedra or none
- * 		replace t by tmp (possibly none) in S
- * return S
- *
- */
-list<Tetrahedron> Tetra2TetraBang::Tetra2TetraIntersection(const Tetrahedron& A, const Tetrahedron& B){
-	// list of 4hedra to split; initially A
-	list<Tetrahedron> ret; ret.push_back(A);
-	/* I is vertex index at B;
-	 * clipping face is [i i1 i2], normal points away from i3 */
-	int i,i1,i2,i3;
-	Vector3r normal;
-	/* LOG_TRACE("===========================================================================================")
-	LOG_TRACE("===========================================================================================")
-	LOG_TRACE(ret.size());
-	LOG_TRACE("DUMP A and B:"); A.dump(); B.dump(); */
-	for(i=0; i<4; i++){
-		i1=(i+1)%4; i2=(i+2)%4; i3=(i+3)%4;
-		const Vector3r& P(B.v[i]); // reference point on the plane
-		normal=(B.v[i1]-P).Cross(B.v[i2]-P); normal.Normalize(); // normal
-		if((B.v[i3]-P).Dot(normal)>0) normal*=-1; // outer normal
-		/* TRWM3VEC(P); TRWM3VEC(normal); LOG_TRACE("DUMP initial tetrahedron list:"); for(list<Tetrahedron>::iterator I=ret.begin(); I!=ret.end(); I++) (*I).dump(); */
-		for(list<Tetrahedron>::iterator I=ret.begin(); I!=ret.end(); /* I++ */ ){
-			list<Tetrahedron> splitDecomposition=TetraClipByPlane(*I,P,normal);
-			// replace current list element by the result of decomposition;
-			// I points after the erased one, so decomposed 4hedra will not be touched in this iteration, just as we want.
-			// Since it will be incremented by I++ at the end of the cycle, compensate for that by I--;
-			I=ret.erase(I); ret.insert(I,splitDecomposition.begin(),splitDecomposition.end()); /* I--; */
-			/* LOG_TRACE("DUMP current tetrahedron list:"); for(list<Tetrahedron>::iterator I=ret.begin(); I!=ret.end(); I++) (*I).dump();*/ 
-		}
-	}
-	//exit(0);
-	return ret;
-}
-
-/*! Clip Tetrahedron T by plane give by point P and outer normal n.
- *
- * Algorithm: 
- *
- * clip t by face
- * 	sort points of t into positive, negative, zero (face normal n points outside)
- * 		-: inside; +: outside; 0: on face
- * 		homogeneous cases (no split):
- * 			++++, +++0, ++00, +000 :
- * 				0Δ full clip (everything outside), nothing left; return ∅
- * 			----, ---0, --00, -000 :
- * 				1Δ all inside, return identity
- *			split (at least one - and one +)
- *				-+++
- * 				1Δ [A AB AC AD]
- *				-++0
- * 				1Δ [A AB AC D]
- *				-+00:
- * 				1Δ [A AB C D]
- * 			--++:
- * 				3Δ [A AC AD B BC BD] ⇒ (e.g.) [A AC AD B] [B BC BD AD] [B AD AC BC]
- * 			--+0:
- * 				2Δ [A B AC BC D] ⇒ (e.g.) [A AC BC D] [B BC A D] 
- * 			---+:
- * 				3Δ tetrahedrize [A B C AD BD CD]
- *
- * http://members.tripod.com/~Paul_Kirby/vector/Vplanelineint.html
- */
-list<Tetrahedron> Tetra2TetraBang::TetraClipByPlane(const Tetrahedron& T, const Vector3r& P, const Vector3r& normal){
-	
-	list<Tetrahedron> ret;
-	// scaling factor for Mathr::EPSILON: average edge length
-	Real scaledEPSILON=Mathr::EPSILON*(1/6.)*((T.v[1]-T.v[0])+(T.v[2]-T.v[0])+(T.v[3]-T.v[0])+(T.v[2]-T.v[1])+(T.v[3]-T.v[1])+(T.v[3]-T.v[2])).Length();
-
-	/* TRWM3VEC(P); TRWM3VEC(normal); T.dump(); */
-
-	vector<size_t> pos, neg, zer; Real dist[4];
-	for(size_t i=0; i<4; i++){
-		dist[i]=(T.v[i]-P).Dot(normal);
-		if(dist[i]>scaledEPSILON) pos.push_back(i);
-		else if(dist[i]<-scaledEPSILON) neg.push_back(i);
-		else zer.push_back(i);
-	}
-	/* LOG_TRACE("dist[i]=["<<dist[0]<<","<<dist[1]<<","<<dist[2]<<","<<dist[3]<<"]"); */
-	#define NEG neg.size()
-	#define POS pos.size()
-	#define ZER zer.size()
-	#define PTPT(i,j) PtPtPlaneIntr(v[i],v[j],P,normal)
-	assert(NEG+POS+ZER==4);
-
-	// HOMOGENEOUS CASES
-		// ++++, +++0, ++00, +000, 0000 (degenerate (planar) tetrahedron)
-		if(POS==4 || (POS==3 && ZER==1) || (POS==2 && ZER==2) || (POS==1 && ZER==3) || ZER==4) return ret; // ∅
-	 	// ----, ---0, --00, -000 :
-		if(NEG==4 || (NEG==3 && ZER==1) || (NEG==2 && ZER==2) || (NEG==1 && ZER==3)) {ret.push_back(T); return ret;}
-	// HETEROGENEOUS CASES
-		// points are ordered -+0
-		Vector3r v[4];
-		for(size_t i=0; i<NEG; i++) v[i+  0+  0]=T.v[neg[i]];
-		for(size_t i=0; i<POS; i++) v[i+  0+NEG]=T.v[pos[i]];
-		for(size_t i=0; i<ZER; i++) v[i+POS+NEG]=T.v[zer[i]];
-		/* LOG_TRACE("NEG(in)="<<NEG<<", POS(out)="<<POS<<", ZER(boundary)="<<ZER); TRWM3VEC(v[0]); TRWM3VEC(v[1]); TRWM3VEC(v[2]); TRWM3VEC(v[3]); */
-		#define _A v[0]
-		#define _B v[1]
-		#define _C v[2]
-		#define _D v[3]
-		#define _AB PTPT(0,1)
-		#define _AC PTPT(0,2)
-		#define _AD PTPT(0,3)
-		#define _BC PTPT(1,2)
-		#define _BD PTPT(1,3)
-		#define _CD PTPT(2,3)
-		// -+++ → 1Δ [A AB AC AD]
-		if(NEG==1 && POS==3){ret.push_back(Tetrahedron(_A,_AB,_AC,_AD)); return ret;}
-		// -++0 → 1Δ [A AB AC D]
-		if(NEG==1 && POS==2 && ZER==1){ret.push_back(Tetrahedron(_A,_AB,_AC,_D)); return ret;}
-		//	-+00 → 1Δ [A AB C D]
-		if(NEG==1 && POS==1 && ZER==2){ret.push_back(Tetrahedron(_A,_AB,_C,_D)); return ret;}
-		// --++ → 3Δ [A AC AD B BC BD] ⇒ (e.g.) [A AC AD B] [B BC BD AD] [B AD AC BC]
-		if(NEG==2 && POS ==2){
-			// [A AC AD B]
-			ret.push_back(Tetrahedron(_A,_AC,_AD,_B));
-			// [B BC BD AD]
-			ret.push_back(Tetrahedron(_B,_BC,_BD,_AD));
-			// [B AD AC BC]
-			ret.push_back(Tetrahedron(_B,_AD,_AC,_BC));
-			return ret;
-		}
-		// --+0 → 2Δ [A B AC BC D] ⇒ (e.g.) [A AC BC D] [B BC A D] 
-		if(NEG==2 && POS==1 && ZER==1){
-			// [A AC BC D]
-			ret.push_back(Tetrahedron(_A,_AC,_BC,_D));
-			// [B BC A D]
-			ret.push_back(Tetrahedron(_B,_BC,_A,_D));
-			return ret;
-		}
-		// ---+ → 3Δ [A B C AD BD CD] ⇒ (e.g.) [A B C AD] [AD BD CD B] [AD C B BD]
-		if(NEG==3 && POS==1){
-			//[A B C AD]
-			ret.push_back(Tetrahedron(_A,_B,_C,_AD));
-			//[AD BD CD B]
-			ret.push_back(Tetrahedron(_AD,_BD,_CD,_B));
-			//[AD C B BD]
-			ret.push_back(Tetrahedron(_AD,_C,_B,_BD));
-			return ret;
-		}
-		#undef _A
-		#undef _B
-		#undef _C
-		#undef _D
-		#undef _AB
-		#undef _AC
-		#undef _AD
-		#undef _BC
-		#undef _BD
-		#undef _CD
-
-	#undef PTPT
-	#undef NEG
-	#undef POS
-	#undef ZER
-	// unreachable
-	assert(false);
-	return(ret); // prevent warning
-}
-
-CREATE_LOGGER(TetraLaw);
-
-/*! Apply forces on tetrahedra in collision based on geometric configuration provided by Tetra2TetraBang.
- *
- * Comments on functionality limitations are in the code. It has not been tested at all!!! */
-void TetraLaw::action(MetaBody* rootBody)
-{
-
-	for(InteractionContainer::iterator contactI=rootBody->transientInteractions->begin(); contactI!=rootBody->transientInteractions->end(); ++contactI){
-		if (!(*contactI)->isReal()) continue; // Tetra2TetraBang::go returned false for this interaction, skip it
-		const shared_ptr<TetraBang>& contactGeom(dynamic_pointer_cast<TetraBang>((*contactI)->interactionGeometry));
-		if(!contactGeom) continue;
-
-		const body_id_t idA=(*contactI)->getId1(), idB=(*contactI)->getId2();
-		const shared_ptr<Body>& A=Body::byId(idA), B=Body::byId(idB);
-			
-		if(!(A->getGroupMask()&B->getGroupMask()&sdecGroupMask)) continue; // no bits overlap in masks, skip this one
-
-		const shared_ptr<ElasticBodyParameters>& physA(dynamic_pointer_cast<ElasticBodyParameters>(A->physicalParameters));
-		const shared_ptr<ElasticBodyParameters>& physB(dynamic_pointer_cast<ElasticBodyParameters>(B->physicalParameters));
-		
-
-		/* Cross-section is volumetrically equivalent to the penetration configuration */
-		Real averageStrain=contactGeom->equivalentPenetrationDepth/(.5*(contactGeom->maxPenetrationDepthA+contactGeom->maxPenetrationDepthB));
-
-		/* Do not use NormalInteraction::kn (as calculated by ElasticBodySimpleRelationship).
-		 * NormalInteraction::kn is not Young's modulus, it is calculated by MacroMicroElasticRelationships. So perhaps
-		 * a new InteractionPhysicsEngineUnit will be needed that will just pass the average Young's modulus here?
-		 * For now, just go back to Young's moduli directly here. */
-		Real young=.5*(physA->young+physB->young);
-		TRVAR3(young,averageStrain,contactGeom->equivalentCrossSection);
-		// F=σA=εEA
-		// this is unused; should it?: contactPhys->kn
-		Vector3r F=contactGeom->normal*averageStrain*young*contactGeom->equivalentCrossSection;
-		TRWM3VEC(contactGeom->normal);
-		TRWM3VEC(F);
-		TRWM3VEC((physB->se3.position-contactGeom->contactPoint).Cross(F));
-
-		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));
-	}
-}
-
-#ifdef YADE_OPENGL
-	#include<yade/lib-opengl/OpenGLWrapper.hpp>
-	void TetraDraw::go(const shared_ptr<InteractingGeometry>& cm, const shared_ptr<PhysicalParameters>&,bool)
-	{
-		glMaterialv(GL_FRONT,GL_AMBIENT_AND_DIFFUSE,Vector3f(cm->diffuseColor[0],cm->diffuseColor[1],cm->diffuseColor[2]));
-		glColor3v(cm->diffuseColor);
-		TetraMold* t=static_cast<TetraMold*>(cm.get());
-		if (0) { // wireframe, as for Tetrahedron
-			glDisable(GL_LIGHTING);
-			glBegin(GL_LINES);
-				#define __ONEWIRE(a,b) glVertex3v(t->v[a]);glVertex3v(t->v[b])
-					__ONEWIRE(0,1);__ONEWIRE(0,2);__ONEWIRE(0,3);__ONEWIRE(1,2);__ONEWIRE(1,3);__ONEWIRE(2,3);
-				#undef __ONEWIRE
-			glEnd();
-		}
-		else
-		{
-			Vector3r center = (t->v[0]+t->v[1]+t->v[2]+t->v[3])*.25, faceCenter, n;
-			glDisable(GL_CULL_FACE); glEnable(GL_LIGHTING);
-			glBegin(GL_TRIANGLES);
-				#define __ONEFACE(a,b,c) n=(t->v[b]-t->v[a]).UnitCross(t->v[c]-t->v[a]); faceCenter=(t->v[a]+t->v[b]+t->v[c])/3.; if((faceCenter-center).Dot(n)<0)n=-n; glNormal3v(n); glVertex3v(t->v[a]); glVertex3v(t->v[b]); glVertex3v(t->v[c]);
-					__ONEFACE(3,0,1);
-					__ONEFACE(0,1,2);
-					__ONEFACE(1,2,3);
-					__ONEFACE(2,3,0);
-				#undef __ONEFACE
-			glEnd();
-		}
-	}
-#endif
-
-/*! Calculates tetrahedron inertia relative to the origin (0,0,0), with unit density (scales linearly).
-
-See article F. Tonon, "Explicit Exact Formulas for the 3-D Tetrahedron Inertia Tensor in Terms of its Vertex Coordinates", http://www.scipub.org/fulltext/jms2/jms2118-11.pdf
-
-Numerical example to check:
-
-vertices:
-	(8.33220, 11.86875, 0.93355)
-	(0.75523 ,5.00000, 16.37072)
-	(52.61236, 5.00000, 5.38580)
-	(2.00000, 5.00000, 3.00000)
-centroid:
-	(15.92492, 0.78281, 3.72962)
-intertia/density WRT centroid:
-	a/μ = 43520.33257 m⁵
-	b/μ = 194711.28938 m⁵
-	c/μ = 191168.76173 m⁵
-	a’/μ= 4417.66150 m⁵
-	b’/μ=-46343.16662 m⁵
-	c’/μ= 11996.20119 m⁵
-
-The numerical testcase (in TetraTestGen::generate) is exact as in the article for inertia (as well as centroid):
-
-43520.3
-194711
-191169
-4417.66
--46343.2
-11996.2
-
-*/
-//Matrix3r TetrahedronInertiaTensor(const Vector3r v[4]){
-Matrix3r TetrahedronInertiaTensor(const vector<Vector3r>& v){
-	#define x1 v[0][0]
-	#define y1 v[0][1]
-	#define z1 v[0][2]
-	#define x2 v[1][0]
-	#define y2 v[1][1]
-	#define z2 v[1][2]
-	#define x3 v[2][0]
-	#define y3 v[2][1]
-	#define z3 v[2][2]
-	#define x4 v[3][0]
-	#define y4 v[3][1]
-	#define z4 v[3][2]
-
-// FIXME - C array
-	assert(v.size()==4);
-
-	// Jacobian of transformation to the reference 4hedron
-	double detJ=(x2-x1)*(y3-y1)*(z4-z1)+(x3-x1)*(y4-y1)*(z2-z1)+(x4-x1)*(y2-y1)*(z3-z1)
-		-(x2-x1)*(y4-y1)*(z3-z1)-(x3-x1)*(y2-y1)*(z4-z1)-(x4-x1)*(y3-y1)*(z2-z1);
-	detJ=fabs(detJ);
-	double a=detJ*(y1*y1+y1*y2+y2*y2+y1*y3+y2*y3+
-		y3*y3+y1*y4+y2*y4+y3*y4+y4*y4+z1*z1+z1*z2+
-		z2*z2+z1*z3+z2*z3+z3*z3+z1*z4+z2*z4+z3*z4+z4*z4)/60.;
-	double b=detJ*(x1*x1+x1*x2+x2*x2+x1*x3+x2*x3+x3*x3+
-		x1*x4+x2*x4+x3*x4+x4*x4+z1*z1+z1*z2+z2*z2+z1*z3+
-		z2*z3+z3*z3+z1*z4+z2*z4+z3*z4+z4*z4)/60.;
-	double c=detJ*(x1*x1+x1*x2+x2*x2+x1*x3+x2*x3+x3*x3+x1*x4+
-		x2*x4+x3*x4+x4*x4+y1*y1+y1*y2+y2*y2+y1*y3+
-		y2*y3+y3*y3+y1*y4+y2*y4+y3*y4+y4*y4)/60.;
-	// a' in the article etc.
-	double a__=detJ*(2*y1*z1+y2*z1+y3*z1+y4*z1+y1*z2+
-		2*y2*z2+y3*z2+y4*z2+y1*z3+y2*z3+2*y3*z3+
-		y4*z3+y1*z4+y2*z4+y3*z4+2*y4*z4)/120.;
-	double b__=detJ*(2*x1*z1+x2*z1+x3*z1+x4*z1+x1*z2+
-		2*x2*z2+x3*z2+x4*z2+x1*z3+x2*z3+2*x3*z3+
-		x4*z3+x1*z4+x2*z4+x3*z4+2*x4*z4)/120.;
-	double c__=detJ*(2*x1*y1+x2*y1+x3*y1+x4*y1+x1*y2+
-		2*x2*y2+x3*y2+x4*y2+x1*y3+x2*y3+2*x3*y3+
-		x4*y3+x1*y4+x2*y4+x3*y4+2*x4*y4)/120.;
-
-	return Matrix3r(
-		a   , -b__, -c__,
-		-b__, b   , -a__,
-		-c__, -a__, c    );
-
-	#undef x1
-	#undef y1
-	#undef z1
-	#undef x2
-	#undef y2
-	#undef z2
-	#undef x3
-	#undef y3
-	#undef z3
-	#undef x4
-	#undef y4
-	#undef z4
-}
-
-/*! Caluclate tetrahedron's central inertia tensor */
-//Matrix3r TetrahedronCentralInertiaTensor(const Vector3r v[4]){
-Matrix3r TetrahedronCentralInertiaTensor(const vector<Vector3r>& v){
-	assert(v.size()==4);
-	vector<Vector3r> vv;
-
-//	Vector3r vv[4];
-	Vector3r cg=(v[0]+v[1]+v[2]+v[3])*.25;
-//	vv[0]=v[0]-cg;
-//	vv[1]=v[1]-cg;
-//	vv[2]=v[2]-cg;
-//	vv[3]=v[3]-cg;
-	vv.push_back(v[0]-cg);
-	vv.push_back(v[1]-cg);
-	vv.push_back(v[2]-cg);
-	vv.push_back(v[3]-cg);
-
-	return TetrahedronInertiaTensor(vv);
-}
-
-/*! Rotate and translate terahedron body so that its local axes are principal, keeping global position by updating vertex positions as well.
- * Updates all body parameters as need.
- *
- * @returns rotation that was done as Wm3::Quaternionr.
- * @todo check for geometrical correctness...
- * */
-Quaternionr TetrahedronWithLocalAxesPrincipal(shared_ptr<Body>& tetraBody){
-	const shared_ptr<Tetrahedron>& tShape(YADE_PTR_CAST<Tetrahedron>(tetraBody->geometricalModel));
-	const shared_ptr<RigidBodyParameters>& rbp(YADE_PTR_CAST<RigidBodyParameters>(tetraBody->physicalParameters));
-	const shared_ptr<TetraMold>& tMold(dynamic_pointer_cast<TetraMold>(tetraBody->interactingGeometry));
-
-	#define v0 tShape->v[0]
-	#define v1 tShape->v[1]
-	#define v2 tShape->v[2]
-	#define v3 tShape->v[3]
-
-	// adjust position (origin to centroid)
-	Vector3r cg=(v0+v1+v2+v3)*.25;
-	v0-=cg; v1-=cg; v2-=cg; v3-=cg;
-	//tMold->v[0]=v0; tMold->v[1]=v1; tMold->v[2]=v2; tMold->v[3]=v3;
-	rbp->se3.position+=cg;
-
-	// adjust orientation (local axes to principal axes)
-	Matrix3r I_old=TetrahedronInertiaTensor(tShape->v); //≡TetrahedronCentralInertiaTensor
-	Matrix3r I_rot(true), I_new(true); 
-	I_old.EigenDecomposition(I_rot,I_new);
-	Quaternionr I_Qrot; I_Qrot.FromRotationMatrix(I_rot);
-	//! @fixme from right to left: rotate by I_rot, then add original rotation (?!!)
-	rbp->se3.orientation=rbp->se3.orientation*I_Qrot;
-	for(size_t i=0; i<4; i++){
-		tShape->v[i]=I_Qrot.Conjugate()*tShape->v[i];
-		if(tMold) tMold->v[i]=tShape->v[i]; // this may have failed...
-	}
-
-	// set inertia
-	rbp->inertia=Vector3r(I_new(0,0),I_new(1,1),I_new(2,2));
-
-	return I_Qrot;
-	#undef v0
-	#undef v1
-	#undef v2
-	#undef v3
-}
-
-
-

Deleted: trunk/extra/tetra/Tetra.hpp
===================================================================
--- trunk/extra/tetra/Tetra.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/extra/tetra/Tetra.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,176 +0,0 @@
-// © 2007 Václav Šmilauer <eudoxos@xxxxxxxx>
-
-#pragma once
-
-#include<vector>
-
-#include<yade/core/InteractingGeometry.hpp>
-#include<yade/core/InteractionGeometry.hpp>
-#include<yade/core/InteractionSolver.hpp>
-
-#include<yade/pkg-common/Tetrahedron.hpp>
-#include<yade/pkg-common/AABB.hpp>
-#include<yade/pkg-common/BoundingVolumeEngineUnit.hpp>
-#include<yade/pkg-common/InteractingGeometryEngineUnit.hpp>
-#include<yade/pkg-common/InteractionGeometryEngineUnit.hpp>
-
-#include<Wm3Math.h>
-#include<Wm3Vector3.h>
-
-
-/* Our mold of tetrahedron: just 4 vertices.
- *
- * Self-contained. */
-class TetraMold: public InteractingGeometry{
-	public:
-		//! vertices of the tetrahedron.
-		// FIXME - a std::vector....
-		std::vector<Vector3r> v; 
-		//Vector3r v[4];
-		TetraMold(){createIndex(); v.resize(0); }
-		TetraMold(Vector3r v0, Vector3r v1, Vector3r v2, Vector3r v3){createIndex(); v.resize(4); v[0]=v0; v[1]=v1; v[2]=v2; v[3]=v3; }
-		virtual ~TetraMold (){};
-	protected:
-		REGISTER_ATTRIBUTES(InteractingGeometry,(v));
-		REGISTER_CLASS_AND_BASE(TetraMold,InteractingGeometry);
-		REGISTER_CLASS_INDEX(TetraMold,InteractingGeometry);
-};
-REGISTER_SERIALIZABLE(TetraMold);
-
-
-/*! Collision configuration for Tetra and something.
- * This is expressed as penetration volume properties: centroid, volume, orientation of principal axes, inertia.
- *
- * Self-contained. */
-
-class TetraBang: public InteractionGeometry{
-	public:
-		Real penetrationVolume;
-		Real equivalentCrossSection;
-		Real maxPenetrationDepthA, maxPenetrationDepthB, equivalentPenetrationDepth;
-		Vector3r contactPoint;
-		Vector3r normal;
-
-		TetraBang(): InteractionGeometry(){};
-		virtual ~TetraBang(){};
-	protected:
-		REGISTER_ATTRIBUTES(InteractionGeometry,(penetrationVolume)(equivalentCrossSection)(contactPoint)(normal)(equivalentPenetrationDepth)(maxPenetrationDepthA)(maxPenetrationDepthB));
-		FUNCTOR2D(TetraMold,TetraMold);
-		REGISTER_CLASS_AND_BASE(TetraBang,InteractionGeometry);
-};
-REGISTER_SERIALIZABLE(TetraBang);
-
-/*! Creates TetraMold from Tetrahedron.
- *
- * Self-contained. */
-
-class Tetrahedron2TetraMold: public InteractingGeometryEngineUnit
-{
-	public:
-		void go(const shared_ptr<GeometricalModel>& gm,shared_ptr<InteractingGeometry>& ig,const Se3r& se3,const Body*){
-			Tetrahedron* tet=static_cast<Tetrahedron*>(gm.get());
-			//! @fixme this seems superfluous?!: if(!ig)
-			ig=boost::shared_ptr<InteractingGeometry>(new TetraMold(tet->v[0],tet->v[1],tet->v[2],tet->v[3]));
-		}
-	FUNCTOR2D(Tetrahedron,TetraMold);
-	REGISTER_CLASS_NAME(Tetrahedron2TetraMold);
-	REGISTER_BASE_CLASS_NAME(InteractingGeometryEngineUnit);
-	DEFINE_FUNCTOR_ORDER_2D(Tetrahedron,TetraMold);
-};
-REGISTER_SERIALIZABLE(Tetrahedron2TetraMold);
-
-/*! Creates AABB from TetraMold. 
- *
- * Self-contained. */
-
-class TetraAABB: public BoundingVolumeEngineUnit
-{
-	public:
-		void go(const shared_ptr<InteractingGeometry>& ig, shared_ptr<BoundingVolume>& bv, const Se3r& se3, const Body*){
-			TetraMold* t=static_cast<TetraMold*>(ig.get());
-			AABB* aabb=static_cast<AABB*>(bv.get());
-			Quaternionr invRot=se3.orientation.Conjugate();
-			Vector3r v_g[4]; for(int i=0; i<4; i++) v_g[i]=se3.orientation*t->v[i]; // vertices in global coordinates
-			#define __VOP(op,ix) op(v_g[0][ix],op(v_g[1][ix],op(v_g[2][ix],v_g[3][ix])))
-				aabb->min=se3.position+Vector3r(__VOP(std::min,0),__VOP(std::min,1),__VOP(std::min,2));
-				aabb->max=se3.position+Vector3r(__VOP(std::max,0),__VOP(std::max,1),__VOP(std::max,2));
-			#undef __VOP
-			aabb->center=(aabb->min+aabb->max)*0.5;
-			aabb->halfSize=(aabb->max-aabb->min)*0.5;
-		}
-		FUNCTOR2D(TetraMold,AABB);
-		REGISTER_CLASS_NAME(TetraAABB);
-		REGISTER_BASE_CLASS_NAME(BoundingVolumeEngineUnit);
-};
-REGISTER_SERIALIZABLE(TetraAABB);
-
-#ifdef YADE_OPENGL
-	#include<yade/pkg-common/GLDrawFunctors.hpp>
-	/*! Draw TetraMold using OpenGL */
-	class TetraDraw: public GLDrawInteractingGeometryFunctor
-	{	
-		public:
-			virtual void go(const shared_ptr<InteractingGeometry>&, const shared_ptr<PhysicalParameters>&,bool);
-
-			RENDERS(TetraMold);
-			REGISTER_CLASS_NAME(TetraDraw);
-			REGISTER_BASE_CLASS_NAME(GLDrawInteractingGeometryFunctor);
-	};
-	REGISTER_SERIALIZABLE(TetraDraw);
-#endif
-
-/*! Calculate physical response based on penetration configuration given by TetraBang. */
-
-class TetraLaw: public InteractionSolver {
-	public:
-		TetraLaw():InteractionSolver(){};
-
-		int sdecGroupMask; // probably unused?!
-
-		void action(MetaBody*);
-
-	DECLARE_LOGGER;
-	REGISTER_ATTRIBUTES(InteractionSolver,/* nothing*/);
-	REGISTER_CLASS_NAME(TetraLaw);
-	REGISTER_BASE_CLASS_NAME(InteractionSolver);
-};
-REGISTER_SERIALIZABLE(TetraLaw);
-
-
-
-/*! @fixme implement Tetra2BoxBang by representing box as 6 tetrahedra. */
-
-/*! Create TetraBang (collision geometry) from colliding TetraMolds. */
-class Tetra2TetraBang: public InteractionGeometryEngineUnit
-{
-	public:
-		virtual bool go(const shared_ptr<InteractingGeometry>& cm1, const shared_ptr<InteractingGeometry>& cm2, const Se3r& se31, const Se3r& se32, const shared_ptr<Interaction>& c);
-		virtual bool goReverse(	const shared_ptr<InteractingGeometry>& cm1, const shared_ptr<InteractingGeometry>& cm2, const Se3r& se31, const Se3r& se32, const shared_ptr<Interaction>& c);
-
-		FUNCTOR2D(TetraMold,TetraMold);
-		REGISTER_CLASS_NAME(Tetra2TetraBang);
-		REGISTER_BASE_CLASS_NAME(InteractionGeometryEngineUnit);
-		DEFINE_FUNCTOR_ORDER_2D(TetraMold,TetraMold);
-		DECLARE_LOGGER;
-	private:
-		list<Tetrahedron> Tetra2TetraIntersection(const Tetrahedron& A, const Tetrahedron& B);
-		list<Tetrahedron> TetraClipByPlane(const Tetrahedron& T, const Vector3r& P, const Vector3r& n);
-		//! Intersection of line given by points A, B and plane given by P and its normal.
-		Vector3r PtPtPlaneIntr(const Vector3r& A, const Vector3r& B, const Vector3r& P, const Vector3r& normal){const double t=(P-A).Dot(normal) / (B-A).Dot(normal); /* TRWM3VEC(A); TRWM3VEC(B); TRWM3VEC(P); TRWM3VEC(normal); LOG_TRACE("t="<<t); TRWM3VEC((A+t*(B-A))); */ return A+t*(B-A); }
-};
-
-REGISTER_SERIALIZABLE(Tetra2TetraBang);
-
-
-// Miscillaneous functions
-//! Tetrahedron's volume.
-/// http://en.wikipedia.org/wiki/Tetrahedron#Surface_area_and_volume
-Real TetrahedronVolume(const Vector3r v[4]){ return fabs((Vector3r(v[3])-Vector3r(v[0])).Dot((Vector3r(v[3])-Vector3r(v[1])).Cross(Vector3r(v[3])-Vector3r(v[2]))))/6.; }
-Real TetrahedronVolume(const vector<Vector3r>& v){ return fabs(Vector3r(v[1]-v[0]).Dot(Vector3r(v[2]-v[0]).Cross(v[3]-v[0])))/6.; }
-Matrix3r TetrahedronInertiaTensor(const vector<Vector3r>& v);
-//Matrix3r TetrahedronInertiaTensor(const Vector3r v[4]);
-Matrix3r TetrahedronCentralInertiaTensor(const vector<Vector3r>& v);
-//Matrix3r TetrahedronCentralInertiaTensor(const Vector3r v[4]);
-Quaternionr TetrahedronWithLocalAxesPrincipal(shared_ptr<Body>& tetraBody);
-
-

Deleted: trunk/extra/tetra/TetraTestGen.cpp
===================================================================
--- trunk/extra/tetra/TetraTestGen.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/extra/tetra/TetraTestGen.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,69 +0,0 @@
-
-#include<yade/core/MetaBody.hpp>
-#include<yade/extra/Shop.hpp>
-
-#include"TetraTestGen.hpp"
-
-#include"Tetra.hpp"
-
-YADE_PLUGIN("TetraTestGen");
-
-bool TetraTestGen::generate()
-{
-	//Shop::setDefault("param_pythonRunExpr",string("if S.i%50==0 and S.i<1000 and S.i>500:\n\tprint S.i,len(S.sel),B[1].x, B[1].E"));
-
-	rootBody=Shop::rootBody();
-	Shop::rootBodyActors(rootBody);
-	
-	#if 0
-	shared_ptr<MetaBody> oldRootBody=Omega::instance().getRootBody();
-	Omega::instance().setRootBody(rootBody);
-	#endif
-
-	Vector3r v[4];
-
-	v[0]=Vector3r(1,1,0);
-	v[1]=Vector3r(0,-2,0);
-	v[2]=Vector3r(-1,1,0);
-	v[3]=Vector3r(0,0,-2);
-	shared_ptr<Body> ground=Shop::tetra(v);
-	ground->isDynamic=false;
-	rootBody->bodies->insert(ground);
-
-
-	for(size_t i=0; i<gridSize[0]; i++) for(size_t j=0; j<gridSize[1];j++) for(size_t k=0; k<gridSize[2];k++){
-		Vector3r center=(1./std::max(gridSize[0],gridSize[1]))*Vector3r(i-gridSize[0]/2.,j-gridSize[1]/2.,.5+k);
-		double size=.5/std::max(gridSize[0],gridSize[1]);
-		#define __VERTEX(x,y,z) center+size*(Vector3r(x,y,z)+Vector3r(Mathr::IntervalRandom(-.5,.5),Mathr::IntervalRandom(-.5,.5),Mathr::IntervalRandom(-.5,.5)))
-			v[0]=__VERTEX(1,1,0);
-			v[1]=__VERTEX(0,-1,0);
-			v[2]=__VERTEX(-1,0,0);
-			v[3]=__VERTEX(0,0,2);
-		#undef __VERTEX
-		shared_ptr<Body> t=Shop::tetra(v);
-		rootBody->bodies->insert(t);
-	}
-
-	// test inertia calculation
-	#if 1
-		v[0]=Vector3r(8.33220, -11.86875, 0.93355);
-		v[1]=Vector3r(0.75523 ,5.00000, 16.37072);
-		v[2]=Vector3r(52.61236, 5.00000, -5.38580);
-		v[3]=Vector3r(2.00000, 5.00000, 3.00000);
-		vector<Vector3r> vv;
-		for(int i=0;i<4;i++)vv.push_back(v[i]);
-		/* Vector3r cg=(v[0]+v[1]+v[2]+v[3])*.25;
-		cerr<<"Centroid: "<<cg<<endl;
-		v[0]-=cg; v[1]-=cg; v[2]-=cg; v[3]-=cg; */
-		Matrix3r I=TetrahedronCentralInertiaTensor(vv);
-		//cerr<<vv[0][0]<<" "<<vv[0][1]<<" "<<vv[0][2]<<endl;
-		cerr<<I(0,0)<<endl<<I(1,1)<<endl<<I(2,2)<<endl<<-I(1,2)<<endl<<-I(0,1)<<endl<<-I(0,2)<<endl;
-	#endif 
-
-	#if 0
-	Omega::instance().setRootBody(oldRootBody);
-	#endif
-	
-	message="ATTN: this example is not working yet!";
-	return true;
-}

Deleted: trunk/extra/tetra/TetraTestGen.hpp
===================================================================
--- trunk/extra/tetra/TetraTestGen.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/extra/tetra/TetraTestGen.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,21 +0,0 @@
-#pragma once
-
-#include<vector>
-#include<yade/core/FileGenerator.hpp>
-//#include<yade/pkg-common/Tetrahedron.hpp>
-
-/*! Test basic tetra functionality. */
-class TetraTestGen: public FileGenerator {
-	DECLARE_LOGGER;
-	public:
-		vector<size_t> gridSize;
-		TetraTestGen(){ gridSize.push_back(1); gridSize.push_back(1); gridSize.push_back(1);};
-		~TetraTestGen (){};
-		bool generate();
-	protected :
-		virtual void postProcessAttributes(bool deserializing){};
-		REGISTER_ATTRIBUTES(FileGenerator,(gridSize));
-		REGISTER_CLASS_AND_BASE(TetraTestGen,FileGenerator);
-};
-REGISTER_SERIALIZABLE(TetraTestGen);
-

Modified: trunk/gui/SConscript
===================================================================
--- trunk/gui/SConscript	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/gui/SConscript	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,9 +1,7 @@
 # vim:syntax=python
 Import('*')
+linkPlugins=env['linkPlugins']
 
-if 'EMBED_PYTHON' in env['CPPDEFINES']: linkPythonUI=['PythonUI']
-else: linkPythonUI=[]
-
 if 'qt3' not in env['exclude']:
 	env.Install('$PREFIX/lib/yade$SUFFIX/gui',[
 		env.SharedLibrary('QtGUI',
@@ -24,32 +22,25 @@
 				'qt3/QtGeneratedSimulationPlayer.ui',
 				'qt3/QtSimulationPlayer.cpp',
 				],
-			LIBS=env['LIBS']+linkPythonUI+[
-				'yade-opengl',
-				'yade-serialization',
-				'XMLFormatManager',
+			LIBS=(['PythonUI'] if 'YADE_PYTHON' in env['CPPDEFINES'] else [])+[
 				'yade-serialization-qt',
-				'GravityEngines',
-				'OpenGLRenderingEngine',
-				'PositionOrientationRecorder',
-				'sqlite3x',
-				'FilterEngine',
+				linkPlugins(['GravityEngines','OpenGLRenderingEngine','PositionOrientationRecorder','FilterEngine']),
 				'$QGLVIEWER_LIB'],
 			CPPPATH=env['CPPPATH']+['qt3']
 		),
-		env.SharedLibrary('SnapshotEngine',['qt3/SnapshotEngine.cpp'],LIBS=env['LIBS']+['QtGUI'],CPPPATH=env['CPPPATH']+['qt3']),
+		env.SharedLibrary('SnapshotEngine',['qt3/SnapshotEngine.cpp'],LIBS=env['LIBS']+['QtGUI','$QGLVIEWER_LIB'],CPPPATH=env['CPPPATH']+['qt3']),
 	])
 
 import os.path
 
-if 'EMBED_PYTHON' in env['CPPDEFINES']:
+if 'YADE_PYTHON' in env['CPPDEFINES']:
 	env.Install('$PREFIX/lib/yade$SUFFIX/gui',[
 		env.SharedLibrary('PythonUI',['py/PythonUI.cpp']),
 		env.File('PythonUI_rc.py','py'),
 	])
 	if 'qt3' not in env['exclude']:
 		env.Install('$PREFIX/lib/yade$SUFFIX/py/yade',[
-			env.SharedLibrary('_qt',['qt3/QtGUI-python.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+['QtGUI'],CPPPATH=env['CPPPATH']+[env['buildDir']+'/gui/qt3']), # CPPPATH is for files generated by moc which are indirectly included
+			env.SharedLibrary('_qt',['qt3/QtGUI-python.cpp'],SHLIBPREFIX='',LIBS=['QtGUI'],CPPPATH=env['CPPPATH']+[env['buildDir']+'/gui/qt3']), # CPPPATH is for files generated by moc which are indirectly included
 			env.File('qt.py','qt3'),
 		])
 	env.InstallAs('$PREFIX/bin/yade$SUFFIX-multi',env.File('yade-multi','py'))

Modified: trunk/gui/py/PythonUI_rc.py
===================================================================
--- trunk/gui/py/PythonUI_rc.py	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/gui/py/PythonUI_rc.py	2009-07-27 18:08:23 UTC (rev 1888)
@@ -31,15 +31,20 @@
 # not sure whether __builtins__ is the right place?
 _dd=__builtins__.__dict__
 
-classTranslations={'FileGenerator':'Preprocessor','EngineUnit1D':'EngineUnit','EngineUnit2D':'EngineUnit'}
-for root in ['StandAloneEngine','DeusExMachina','EngineUnit1D','EngineUnit2D','GeometricalModel','InteractingGeometry','PhysicalParameters','BoundingVolume','InteractingGeometry','InteractionPhysics','FileGenerator','MetaEngine']:
+classTranslations={'FileGenerator':'Preprocessor'}
+for root in [
+	'StandAloneEngine','DeusExMachina','GeometricalModel','InteractingGeometry','PhysicalParameters','BoundingVolume','InteractingGeometry','InteractionPhysics','FileGenerator',
+		# functors
+		'BoundingVolumeEngineUnit','GeometricalModelEngineUnit','InteractingGeometryEngineUnit','InteractionGeometryEngineUnit','InteractionPhysicsEngineUnit','PhysicalParametersEngineUnit','PhysicalActionDamperUnit','PhysicalActionApplierUnit','ConstitutiveLaw'
+	]:
 	root2=root if (root not in classTranslations.keys()) else classTranslations[root]
 	for p in listChildClassesRecursive(root):
-		class argStorage:
-			def __init__(self,_root,_class): self._root,self._class=_root,_class
-			def __call__(self,*args): return yade.wrapper.__dict__[self._root](self._class,*args)
-		if root=='MetaEngine': _dd[p]=argStorage(root2,p)
-		else:                  _dd[p]=lambda __r_=root2,__p_=p,**kw : yade.wrapper.__dict__[__r_](__p_,kw) # eval(root2)(p,kw)
+		#class argStorage:
+		#	def __init__(self,_root,_class): self._root,self._class=_root,_class
+		#	def __call__(self,*args): return yade.wrapper.__dict__[self._root](self._class,*args)
+		#if root=='MetaEngine': _dd[p]=argStorage(root2,p)
+		_dd[p]=lambda __r_=root2,__p_=p,**kw : yade.wrapper.__dict__[__r_](__p_,**kw) # eval(root2)(p,kw)
+_dd['Generic']=yade.wrapper.__dict__["Serializable"]
 ### end wrappers
 
 #### HANDLE RENAMED CLASSES ####

Modified: trunk/gui/py/pyAttrUtils.hpp
===================================================================
--- trunk/gui/py/pyAttrUtils.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/gui/py/pyAttrUtils.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -67,148 +67,3 @@
 	.add_property("name",&pyClass::className) \
 	.def("postProcessAttributes",&pyClass::postProcessAttributes)
 
-/********** THE FOLLOWING CAN BE DELETED AFTER A FEW WEEKS (17.7.2009) *********/
-#if 0
-/*! Helper class for accessing registered attributes through the serialization interface.
- *
- * 4 possible types of attributes are supported: bool, string, number and arrays (homogeneous) of any of them.
- * This class exposes pySet, pyGet and pyKeys methods to python so that associated object supports python syntax for dictionary member access.
- */
-class AttrAccess{
-	struct AttrDesc{int type; shared_ptr<Archive> archive;};
-	private:
-		const shared_ptr<Serializable> ser;
-		Serializable::Archives archives;
-	public:
-		DECLARE_LOGGER;
-		typedef map<string,AttrDesc> DescriptorMap;
-		//! maps attribute name to its archive and vector of its types (given as ints, from the following enum)
-		DescriptorMap descriptors;
-		//! allowed types
-		enum {BOOL,STRING,FLOAT,INTEGER,SEQ_FLOAT, SEQ_STRING, VEC_VEC }; // allowed types
-		
-		AttrAccess(Serializable* _ser): ser(shared_ptr<Serializable>(_ser)){init();}
-		AttrAccess(shared_ptr<Serializable> _ser):ser(_ser){init();}
-
-		//! create archives and descriptors, always called from the constructor
-		void init(){
-			//cerr<<typeid(std::vector<Wm3::Vector3<double> >*).name()<<endl;
-			if(ser->getArchives().empty()) ser->registerSerializableAttributes(false);
-			archives=ser->getArchives();
-			for(Serializable::Archives::iterator ai=archives.begin();ai!=archives.end();++ai){
-				if((*ai)->isFundamental() && (*ai)->getName()!="serializationDynlib"){
-					AttrDesc desc; 
-					desc.archive=*ai;
-					any instance=(*ai)->getAddress(); // gets pointer to the stored value
-					//cerr<<"["<<(*ai)->getName()<<","<<instance.type().name()<<"]";
-					// 3 possibilities: one BOOL, one or more STRINGS, one or more FLOATs (fallback if none matches)
-					if      (any_cast<string*>(&instance)) { desc.type=AttrAccess::STRING; goto found; }
-					else if (any_cast<bool*>(&instance)) { desc.type=AttrAccess::BOOL; goto found; }
-					else if (any_cast<Real*>(&instance) || any_cast<long double*>(&instance) || any_cast<double*>(&instance) || any_cast<float*>(&instance)) { desc.type=AttrAccess::FLOAT; goto found;}
-					else if (any_cast<int*>(&instance) || any_cast<unsigned int*>(&instance) || any_cast<long*>(&instance) || any_cast<unsigned long*>(&instance) || any_cast<long long*>(&instance) || any_cast<unsigned long long*>(&instance)) {desc.type=AttrAccess::INTEGER; goto found; }
-					else if (any_cast<vector<string>*>(&instance)) { desc.type=AttrAccess::SEQ_STRING; goto found; }
-				#if 0
-					else if (any_cast<vector<Vector3r>*>(&instance)) { cerr<<"WWWWWWWWWWWWW"<<endl;}
-					//else if (any_cast<vector<Vector3r>*>(&&instance)) { cerr<"QQQQQQQQQQQQQQ"<<endl;}
-					#define GET_TYPE_DIRECT(_type,ATTR_ACCESS_TYPE) try{ cerr<<"Try "<<instance.type().name()<<" to "<<typeid(_type).name()<<endl; any_cast<_type >(instance); desc.type=ATTR_ACCESS_TYPE; cerr<<"OK!!!"<<endl; goto found; } catch(boost::bad_any_cast& e){}
-					GET_TYPE_DIRECT(std::vector<Wm3::Vector3r>*,AttrAccess::VEC_VEC);
-					else if (any_cast<vector<Wm3::Vector3<double> >*>(&instance)) {
-						desc.type=AttrAccess::VEC_VEC;
-						cerr<<"Attribute "<<(*ai)->getName()<<" is a vector<Vector3r>";
-					//else if (any_cast<vector<Real>*>(&instance)) desc.type=AttrAccess::SEQ_FLOAT;
-					}
-				#endif
-					desc.type=AttrAccess::SEQ_FLOAT;
-					found:
-						descriptors[(*ai)->getName()]=desc;
-				}
-			}
-			//cerr<<dumpAttrs();
-		}
-		
-		//! Return serialized attribute by its name, as vector of strings
-		vector<string> getAttrStr(const string& name) {
-			vector<string> ret;
-			shared_ptr<Archive> arch=descriptors[name].archive;
-			stringstream stream;
-			arch->serialize(stream,*arch,0);
-			IOFormatManager::parseFundamental(stream.str(),ret);
-			return ret;
-		}
-		//! name, values and types of given attribute, on one line as string
-		string dumpAttr(const string& name) {
-			string vals,types; AttrDesc desc=descriptors[name]; vector<string> values=getAttrStr(name);
-			for(size_t i=0; i<values.size(); i++) vals+=(i>0?" ":"")+values[i];
-			string typeDesc(desc.type==BOOL?"BOOL":(desc.type==STRING?"STRING":(desc.type==FLOAT?"FLOAT":(desc.type==INTEGER?"INTEGER":(desc.type==SEQ_FLOAT?"SEQ_FLOAT":(desc.type==SEQ_STRING?"SEQ_STRING":(desc.type==VEC_VEC?"VEC_VEC":"<unknown>")))))));
-			return name+" =\t"+vals+"\t ("+typeDesc+")";
-		}
-		//! call dumpAttr for all attributes (used for debugging)
-		string dumpAttrs() { string ret; for(DescriptorMap::iterator I=descriptors.begin();I!=descriptors.end();I++) ret+=dumpAttr(I->first)+"\n"; return ret;}
-		//! set attribute by name from its serialized value
-		void setAttrStr(const string& name, const string& value){
-			LOG_DEBUG("Will set `"<<name<<"' to `"<<value<<"'.");
-			stringstream voidStream;
-			descriptors[name].archive->deserialize(voidStream,*(descriptors[name].archive),value);
-		}
-
-		//! return dictionary of attributes and their python values (debugging mosly)
-		boost::python::dict pyDict() {boost::python::dict ret; for(DescriptorMap::iterator I=descriptors.begin();I!=descriptors.end();I++)ret[I->first]=pyGet(I->first); return ret; }
-		//! return python list of keys (attribute names)
-		boost::python::list pyKeys() {boost::python::list ret; for(DescriptorMap::iterator I=descriptors.begin();I!=descriptors.end();I++)ret.append(I->first); return ret;}
-
-
-		//! return attribute value as python object
-		boost::python::object pyGet(const string& key) {
-			DescriptorMap::iterator I=descriptors.find(key);
-			if(I==descriptors.end()) throw std::invalid_argument(string("Invalid key: `")+key+"'.");
-			vector<string> raw=getAttrStr(key);
-			LOG_DEBUG("Got raw attribute `"<<key<<"'");
-			switch(descriptors[key].type){
-				case BOOL: return python::object(lexical_cast<bool>(raw[0]));
-				case FLOAT: return python::object(lexical_cast_maybeNanInf<double>(raw[0]));
-				case INTEGER: return python::object(lexical_cast_maybeNanInf<long>(raw[0]));
-				case STRING: return python::object(raw[0]);
-				case SEQ_STRING: {python::list ret; for(size_t i=0; i<raw.size(); i++) ret.append(python::object(raw[i])); return ret;}
-				case SEQ_FLOAT: {python::list ret; for(size_t i=0; i<raw.size(); i++){ ret.append(python::object(lexical_cast_maybeNanInf<double>(raw[i]))); LOG_TRACE("Appended "<<raw[i]);} return ret; }
-				case VEC_VEC: {
-					python::list ret; for(size_t i=0; i<raw.size(); i++){
-						/* raw[i] has the form "{number number number}" */
-						vector<string> s; boost::algorithm::split(s,raw[i],algorithm::is_any_of("{} "),algorithm::token_compress_on);
-						python::list subList; FOREACH(string ss, s) subList.append(python::object(lexical_cast_maybeNanInf<double>(ss)));
-						ret.append(subList);
-					}
-				}
-				default: throw runtime_error("Unhandled attribute type!");
-			}
-		}
-		//! set attribute value from python object
-		void pySet(const string& key, const python::object& val){
-			DescriptorMap::iterator I=descriptors.find(key);
-			if(I==descriptors.end()) throw std::invalid_argument(string("Invalid key: `")+key+"'.");
-			#define SAFE_EXTRACT(from,to,type) python::extract<type> to(from); if(!to.check()) throw invalid_argument(string("Could not extract type ")+#type);
-			switch(descriptors[key].type){
-				case BOOL: {SAFE_EXTRACT(val.ptr(),extr,bool); setAttrStr(key,extr()?"1":"0"); break;}
-				case FLOAT: {SAFE_EXTRACT(val.ptr(),extr,double); setAttrStr(key,lexical_cast<string>(extr())); break; }
-				case INTEGER: {SAFE_EXTRACT(val.ptr(),extr,long); setAttrStr(key,lexical_cast<string>(extr())); break; }
-				case STRING: {SAFE_EXTRACT(val.ptr(),extr,string); setAttrStr(key,extr()); break;}
-				case SEQ_STRING:{
-					if(!PySequence_Check(val.ptr())) throw invalid_argument("String sequence argument required.");
-					string strVal("[");
-					for(int i=0; i<PySequence_Size(val.ptr()); i++){SAFE_EXTRACT(PySequence_GetItem(val.ptr(),i),extr,string); strVal+=extr()+" ";}
-					setAttrStr(key,strVal+"]");
-				} 
-				break;
-				case SEQ_FLOAT:{
-					if(!PySequence_Check(val.ptr())) throw invalid_argument("Number sequence argument required.");
-					string strVal("{");
-					for(int i=0; i<PySequence_Size(val.ptr()); i++){SAFE_EXTRACT(PySequence_GetItem(val.ptr(),i),extr,double); strVal+=lexical_cast<string>(extr())+" ";}
-					setAttrStr(key,strVal+"}");
-				}
-				break;
-				default: throw runtime_error("Invalid argument types!!");
-			}
-		}
-};
-
-CREATE_LOGGER(AttrAccess);
-#endif

Modified: trunk/gui/qt3/GLViewer.cpp
===================================================================
--- trunk/gui/qt3/GLViewer.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/gui/qt3/GLViewer.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -19,7 +19,7 @@
 #include<yade/core/Interaction.hpp>
 #include<boost/filesystem/operations.hpp>
 #include<boost/version.hpp>
-#ifdef EMBED_PYTHON
+#ifdef YADE_PYTHON
 	#include<boost/python.hpp>
 	using namespace boost;
 #endif
@@ -458,7 +458,7 @@
 		Vector3r&    v = Body::byId(selection)->physicalParameters->se3.position;
 		manipulatedFrame()->setPositionAndOrientation(qglviewer::Vec(v[0],v[1],v[2]),qglviewer::Quaternion(q[0],q[1],q[2],q[3]));
 		Omega::instance().selectedBody = selection;
-		#ifdef EMBED_PYTHON
+		#ifdef YADE_PYTHON
 			try{
 				PyGILState_STATE gstate;
 					gstate = PyGILState_Ensure();

Modified: trunk/gui/qt3/QtGUI-python.cpp
===================================================================
--- trunk/gui/qt3/QtGUI-python.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/gui/qt3/QtGUI-python.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,4 +1,3 @@
-#include<yade/gui-py/pyAttrUtils.hpp>
 #include<yade/gui-qt3/YadeQtMainWindow.hpp>
 #include<boost/python.hpp>
 #include<yade/pkg-common/OpenGLRenderingEngine.hpp>
@@ -16,10 +15,6 @@
 
 using namespace boost::python;
 
-BASIC_PY_PROXY_HEAD(pyOpenGLRenderingEngine,OpenGLRenderingEngine)
-	void setRefSe3(){ proxee->setBodiesRefSe3(Omega::instance().getRootBody()); }
-BASIC_PY_PROXY_TAIL;
-
 #include<yade/gui-qt3/QtGUI.hpp>
 bool qtGuiIsActive(){return (bool)YadeQtMainWindow::self; }
 void qtGuiActivate(){
@@ -32,7 +27,8 @@
 
 void centerViews(void){ensuredMainWindow()->centerViews();}
 void Quit(void){ if(YadeQtMainWindow::self) YadeQtMainWindow::self->Quit(); }
-pyOpenGLRenderingEngine ensuredRenderer(){ensuredMainWindow()->ensureRenderer(); return pyOpenGLRenderingEngine(ensuredMainWindow()->renderer);}
+shared_ptr<OpenGLRenderingEngine> ensuredRenderer(){ensuredMainWindow()->ensureRenderer(); return ensuredMainWindow()->renderer;}
+void OpenGLRenderingEngine_setBodiesRefSe3(const shared_ptr<OpenGLRenderingEngine>& self){ self->setBodiesRefSe3(Omega::instance().getRootBody()); }
 
 #define POST_SYNTH_EVENT(EVT,checker) void evt##EVT(){QApplication::postEvent(ensuredMainWindow(),new QCustomEvent(YadeQtMainWindow::EVENT_##EVT)); bool wait=true; if(wait){while(!(bool)(ensuredMainWindow()->checker)) usleep(50000);} }
 POST_SYNTH_EVENT(PLAYER,player);
@@ -180,8 +176,8 @@
 	def("runPlayerSession",runPlayerSession,runPlayerSession_overloads(args("savedQGLState","dispParamsNo","stride","postLoadHook","startWait")));
 	def("views",getAllViews);
 
-	BASIC_PY_PROXY_WRAPPER(pyOpenGLRenderingEngine,"GLRenderer")
-		.def("setRefSe3",&pyOpenGLRenderingEngine::setRefSe3,"Make current positions and orientation reference for scaleDisplacements and scaleRotations.");
+	python::class_<OpenGLRenderingEngine, shared_ptr<OpenGLRenderingEngine>, python::bases<Serializable>, noncopyable>("OpenGLRenderingEngine")
+		.def("setRefSe3",&OpenGLRenderingEngine_setBodiesRefSe3,"Make current positions and orientation reference for scaleDisplacements and scaleRotations.");
 
 	boost::python::class_<pyGLViewer>("GLViewer")
 		.def(python::init<unsigned>())

Modified: trunk/gui/qt3/QtGUI.cpp
===================================================================
--- trunk/gui/qt3/QtGUI.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/gui/qt3/QtGUI.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -21,7 +21,7 @@
 //#endif
 #include <qapplication.h>
 
-#ifdef EMBED_PYTHON
+#ifdef YADE_PYTHON
 	#include<yade/gui-py/PythonUI.hpp>
 	#include<boost/thread.hpp>
 #endif
@@ -52,13 +52,13 @@
 		if(boost::algorithm::ends_with(string(argv[optind]),string(".xml")) ||
 			boost::algorithm::ends_with(string(argv[optind]),string(".xml.gz")) ||
 			boost::algorithm::ends_with(string(argv[optind]),string(".xml.bz2"))) Omega::instance().setSimulationFileName(string(argv[optind]));
-		#ifdef EMBED_PYTHON
+		#ifdef YADE_PYTHON
 		else if(boost::algorithm::ends_with(string(argv[optind]),string(".py"))) PythonUI::runScript=string(argv[optind]);
 		#endif
 		else optind--;
 	}
 	for (int index=optind+1; index<argc; index++) {
-		#ifdef EMBED_PYTHON
+		#ifdef YADE_PYTHON
 			LOG_DEBUG("Adding script parameter `"<<argv[index]<<"' from the command line.");
 			PythonUI::scriptArgs.push_back(string(argv[index]));
 			if(PythonUI::runScript.empty()) LOG_WARN("Got parameter `"<<argv[index]<<"', but no .py script to be run!");
@@ -71,7 +71,7 @@
 	mainWindow=new YadeQtMainWindow();
 	mainWindow->show();
 	app->setMainWidget(mainWindow);
-	#ifdef EMBED_PYTHON
+	#ifdef YADE_PYTHON
 		LOG_DEBUG("Launching Python thread now...");
 		//PyEval_InitThreads();
 		boost::thread pyThread(boost::function0<void>(&PythonUI::pythonSession));

Modified: trunk/gui/qt3/SimulationController.cpp
===================================================================
--- trunk/gui/qt3/SimulationController.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/gui/qt3/SimulationController.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -28,7 +28,7 @@
 #		define FOREACH BOOST_FOREACH
 #	endif
 
-#ifdef EMBED_PYTHON
+#ifdef YADE_PYTHON
 	#include<boost/python.hpp>
 #endif
 
@@ -95,7 +95,7 @@
 	// run timer ANY TIME (simulation may be started asynchronously)
 	updateTimerId=startTimer(refreshTime);
 
-	#ifndef EMBED_PYTHON
+	#ifndef YADE_PYTHON
 		pyOneliner->setEnabled(false);
 		pyOneliner->setText("Yade compiled without Python");
 	#endif
@@ -135,7 +135,7 @@
    execute the command and make the line empty
 */
 void SimulationController::pyOnelinerEnter(){
-#ifdef EMBED_PYTHON
+#ifdef YADE_PYTHON
 	PyGILState_STATE gstate;
 		gstate = PyGILState_Ensure();
 		try{

Modified: trunk/lib/SConscript
===================================================================
--- trunk/lib/SConscript	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/lib/SConscript	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,160 +1,76 @@
 # vim: set filetype=python :
 Import('*')
+linkPlugins=env['linkPlugins']
 import os.path 
 
-if 'EMBED_PYTHON' in env['CPPDEFINES']:
-	env.Install('$PREFIX/lib/yade$SUFFIX/py/yade',[
-		env.SharedLibrary('WeightedAverage2d',['smoothing/WeightedAverage2d.cpp'],SHLIBPREFIX='',
-			LIBS=env['LIBS']+['yade-base']),
-	])
-	env.Install('$PREFIX/lib/yade$SUFFIX/py',[
-		env.SharedLibrary('boost_python_indexing_suite_v2',['py/boost-python-indexing-suite-v2-noSymlinkHeaders/indexing_slice.cpp','py/boost-python-indexing-suite-v2-noSymlinkHeaders/python_iterator.cpp'])
-	])
+# will switch according to scons configuration to one or another
+def yadeStaticOrSharedLib(*args,**kw):
+	return env.Install('$PREFIX/lib/yade$SUFFIX/lib',env.SharedLibrary(*args,**kw))
+	#return env.Install('$PREFIX/lib/yade$SUFFIX/lib',env.StaticLibrary(*args,**kw))
 
-
 if 'qt3' not in env['exclude']:
-	env.Install('$PREFIX/lib/yade$SUFFIX/lib',[
-		env.SharedLibrary('yade-serialization-qt',
-			['serialization-qt/QtGUIGenerator.cpp'],
-			LIBS=env['LIBS']+['yade-base','XMLFormatManager']),
-		env.SharedLibrary('yade-QGLViewer',Split('''
-				QGLViewer/VRenderInterface_Qt3.ui
-				QGLViewer/ImageInterface_Qt3.ui
-				QGLViewer/qglviewer.cpp 
-				QGLViewer/camera.cpp 
-				QGLViewer/manipulatedFrame.cpp 
-				QGLViewer/manipulatedCameraFrame.cpp 
-				QGLViewer/frame.cpp 
-				QGLViewer/saveSnapshot.cpp 
-				QGLViewer/constraint.cpp 
-				QGLViewer/keyFrameInterpolator.cpp 
-				QGLViewer/mouseGrabber.cpp 
-				QGLViewer/quaternion.cpp 
-				QGLViewer/vec.cpp
-				QGLViewer/VRender/BackFaceCullingOptimizer.cpp 
-				QGLViewer/VRender/BSPSortMethod.cpp 
-				QGLViewer/VRender/EPSExporter.cpp 
-				QGLViewer/VRender/Exporter.cpp 
-				QGLViewer/VRender/FIGExporter.cpp 
-				QGLViewer/VRender/gpc.cpp 
-				QGLViewer/VRender/ParserGL.cpp 
-				QGLViewer/VRender/Primitive.cpp 
-				QGLViewer/VRender/PrimitivePositioning.cpp 
-				QGLViewer/VRender/TopologicalSortMethod.cpp 
-				QGLViewer/VRender/VisibilityOptimizer.cpp 
-				QGLViewer/VRender/Vector2.cpp 
-				QGLViewer/VRender/Vector3.cpp 
-				QGLViewer/VRender/NVector3.cpp 
-				QGLViewer/VRender/VRender.cpp
-				'''),
-				# we want to REALLY optimize this, even in debug builds of yade; and suppress all warnings also
-				CXXFLAGS=[x for x in env['CXXFLAGS'] if x not in ['-ggdb3','-g','-pg'] ]+['-O3','-g0','-w'],
-				# HACK: uic generates files in the buildDir, but gcc is invoked on files in the original dir;
-				# since the generated header is #include'd "...", it looks for it in the original dir
-				# no idea why this _does_ work with gui/qt3. Go figure.
-				CPPPATH=env['CPPPATH']+['${TARGET.dir}'],
-			),
-		])
-
-	if 'binfmt' in env['features']:
-		env.Install('$PREFIX/lib/yade$SUFFIX/lib',[
-			env.SharedLibrary('BINFormatManager',['serialization-bin/BINFormatManager.cpp']),
-		])
-
+	yadeStaticOrSharedLib('yade-serialization-qt',['serialization-qt/QtGUIGenerator.cpp'],LIBS=env['LIBS']+['yade-base','XMLFormatManager']),
+	yadeStaticOrSharedLib('yade-QGLViewer',Split('''
+		QGLViewer/VRenderInterface_Qt3.ui
+		QGLViewer/ImageInterface_Qt3.ui
+		QGLViewer/qglviewer.cpp 
+		QGLViewer/camera.cpp 
+		QGLViewer/manipulatedFrame.cpp 
+		QGLViewer/manipulatedCameraFrame.cpp 
+		QGLViewer/frame.cpp 
+		QGLViewer/saveSnapshot.cpp 
+		QGLViewer/constraint.cpp 
+		QGLViewer/keyFrameInterpolator.cpp 
+		QGLViewer/mouseGrabber.cpp 
+		QGLViewer/quaternion.cpp 
+		QGLViewer/vec.cpp
+		QGLViewer/VRender/BackFaceCullingOptimizer.cpp 
+		QGLViewer/VRender/BSPSortMethod.cpp 
+		QGLViewer/VRender/EPSExporter.cpp 
+		QGLViewer/VRender/Exporter.cpp 
+		QGLViewer/VRender/FIGExporter.cpp 
+		QGLViewer/VRender/gpc.cpp 
+		QGLViewer/VRender/ParserGL.cpp 
+		QGLViewer/VRender/Primitive.cpp 
+		QGLViewer/VRender/PrimitivePositioning.cpp 
+		QGLViewer/VRender/TopologicalSortMethod.cpp 
+		QGLViewer/VRender/VisibilityOptimizer.cpp 
+		QGLViewer/VRender/Vector2.cpp 
+		QGLViewer/VRender/Vector3.cpp 
+		QGLViewer/VRender/NVector3.cpp 
+		QGLViewer/VRender/VRender.cpp
+		'''),
+		# we want to REALLY optimize this, even in debug builds of yade; and suppress all warnings also
+		CXXFLAGS=[x for x in env['CXXFLAGS'] if x not in ['-ggdb3','-g','-pg'] ]+['-O3','-g0','-w'],
+		# HACK: uic generates files in the buildDir, but gcc is invoked on files in the original dir;
+		# since the generated header is #include'd "...", it looks for it in the original dir
+		# no idea why this _does_ work with gui/qt3. Go figure.
+		CPPPATH=env['CPPPATH']+['${TARGET.dir}'],
+	)
 if 'YADE_OPENGL' in env['CPPDEFINES']:
-	env.Install('$PREFIX/lib/yade$SUFFIX/lib',[
-		env.SharedLibrary('yade-opengl',
-			['opengl/FpsTracker.cpp',
-				'opengl/GLTextLabel.cpp',
-				'opengl/GLWindow.cpp',
-				'opengl/GLWindowsManager.cpp',
-				'opengl/GLUtils.cpp'],
-			LIBS=env['LIBS']+['glut','$QGLVIEWER_LIB']),
-	])
+	yadeStaticOrSharedLib('yade-opengl',['opengl/FpsTracker.cpp','opengl/GLTextLabel.cpp','opengl/GLWindow.cpp','opengl/GLWindowsManager.cpp','opengl/GLUtils.cpp'],LIBS=env['LIBS']+['glut','$QGLVIEWER_LIB']),
 
-if 'GTS' in env['features']:
-	env.Install('$PREFIX/lib/yade$SUFFIX/py/gts',[
-		env.SharedLibrary('_gts',['py/pygts-0.3.1/cleanup.c','py/pygts-0.3.1/edge.c','py/pygts-0.3.1/face.c','py/pygts-0.3.1/object.c','py/pygts-0.3.1/point.c','py/pygts-0.3.1/pygts.c','py/pygts-0.3.1/segment.c','py/pygts-0.3.1/surface.c','py/pygts-0.3.1/triangle.c','py/pygts-0.3.1/vertex.c'],SHLIBPREFIX='',CPPDEFINES=env['CPPDEFINES']+['PYGTS_HAS_NUMPY']),
-		env.File('py/pygts-0.3.1/__init__.py'),
-		env.File('py/pygts-0.3.1/pygts.py')
-	])
-	#
-	# the _packPredicates module needs to link to us, but linker by defaults looks for lib*.so files
-	# Therefore we will create symlink with that name (in lib/ rather than py/gts, so that it is in the RPATH
-	# without further modifications). If the file were copied (installed 2 times), static data would be
-	# created twice and it would break python type identification (among other things).
-	#
-	env.Command('$PREFIX/lib/yade$SUFFIX/lib/lib_gts__python-module.so','$PREFIX/lib/yade$SUFFIX/py/gts/_gts.so','ln -s -f ../py/gts/_gts.so $TARGET')
+yadeStaticOrSharedLib('yade-base',['base/yadeWm3Extra.cpp'],LIBS=env['LIBS']),
+yadeStaticOrSharedLib('yade-computational-geometry',['computational-geometry/Distances2D.cpp','computational-geometry/Distances3D.cpp','computational-geometry/Intersections2D.cpp','computational-geometry/Intersections3D.cpp','computational-geometry/MarchingCube.cpp'],LIBS=env['LIBS']+['yade-base']),
+yadeStaticOrSharedLib('yade-factory',['factory/ClassFactory.cpp','factory/DynLibManager.cpp','factory/FactoryExceptions.cpp']),
+yadeStaticOrSharedLib('yade-multimethods',['multimethods/Indexable.cpp','multimethods/MultiMethodsExceptions.cpp']),
+yadeStaticOrSharedLib('XMLFormatManager',['serialization-xml/XMLFormatManager.cpp','serialization-xml/XMLSaxParser.cpp'],LIBS=env['LIBS']+['yade-base','yade-serialization']),
+yadeStaticOrSharedLib('yade-serialization',['serialization/Archive.cpp','serialization/IOFormatManager.cpp','serialization/IOManagerExceptions.cpp','serialization/FormatChecker.cpp','serialization/Serializable.cpp','serialization/SerializableSingleton.cpp','serialization/SerializationExceptions.cpp'],LIBS=env['LIBS']+['yade-base','yade-factory']),
 
+# for now, keep this is as a shared lib, since it depends on things from pkg (shouldn't be the case, though...)
 env.Install('$PREFIX/lib/yade$SUFFIX/lib',[
-
-	env.SharedLibrary('yade-base',
-		['base/yadeWm3Extra.cpp'],
-		LIBS=env['LIBS']),
-
-	env.SharedLibrary('miniWm3',
-		['miniWm3/Wm3Math.cpp',
-			'miniWm3/Wm3Matrix3.cpp',
-			'miniWm3/Wm3Quaternion.cpp',
-			'miniWm3/Wm3Vector3.cpp',
-			'miniWm3/Wm3Matrix2.cpp',
-			'miniWm3/Wm3Matrix4.cpp',
-			'miniWm3/Wm3Vector2.cpp',
-			'miniWm3/Wm3Vector4.cpp',
-			'miniWm3/Wm3Memory.cpp',
-			'miniWm3/Wm3String.cpp',
-			'miniWm3/Wm3System.cpp'],
-		# miniWm3 cannot link with itself, filter it out.
-		LIBS=filter(lambda l: l!='miniWm3',env['LIBS']),
-		# miniWm3 will be always optimized and without debugging info, even in debug builds; suppress all warnings
-		CXXFLAGS=env['CXXFLAGS']+['-O3','-g0','-w']),
-
-		env.SharedLibrary('sqlite3x',Split('''
-			sqlite3x/sqlite3x_command.cpp
-			sqlite3x/sqlite3x_connection.cpp
-			sqlite3x/sqlite3x_cursor.cpp
-			sqlite3x/sqlite3x_exception.cpp
-			sqlite3x/sqlite3x_settings_db.cpp
-			sqlite3x/sqlite3x_transaction.cpp'''),LIBS='sqlite3',CXXFLAGS=env['CXXFLAGS']+['-O3','-g0']),
-
-	env.SharedLibrary('yade-computational-geometry',
-		['computational-geometry/Distances2D.cpp',
-			'computational-geometry/Distances3D.cpp',
-			'computational-geometry/Intersections2D.cpp',
-			'computational-geometry/Intersections3D.cpp',
-			'computational-geometry/MarchingCube.cpp'],
-		LIBS=env['LIBS']+['yade-base']),
-
-	env.SharedLibrary('yade-factory',
-		['factory/ClassFactory.cpp',
-			'factory/DynLibManager.cpp',
-			'factory/FactoryExceptions.cpp']),
-
-	env.SharedLibrary('yade-loki',
-		['loki/_dummySourceFile.cpp']),
-
-	env.SharedLibrary('yade-multimethods',
-		['multimethods/Indexable.cpp',
-			'multimethods/MultiMethodsExceptions.cpp']),
-
-	env.SharedLibrary('XMLFormatManager',
-		['serialization-xml/XMLFormatManager.cpp',
-			'serialization-xml/XMLSaxParser.cpp'],
-		LIBS=env['LIBS']+['yade-base','yade-serialization']), #,'BINFormatManager']),
-
-	env.SharedLibrary('yade-serialization',
-		['serialization/Archive.cpp',
-			'serialization/IOFormatManager.cpp',
-			'serialization/IOManagerExceptions.cpp',
-			'serialization/FormatChecker.cpp',
-			'serialization/Serializable.cpp',
-			'serialization/SerializableSingleton.cpp',
-			'serialization/SerializationExceptions.cpp'],
-		LIBS=env['LIBS']+['yade-base','yade-factory']),
-
-	env.SharedLibrary('STLImporter',
-		['import/STLReader.cpp', 'import/STLImporter.cpp'],
-		LIBS=env['LIBS']+['Facet','InteractingFacet','Shop']),
-
+	env.SharedLibrary('STLImporter',['import/STLReader.cpp', 'import/STLImporter.cpp'],LIBS=linkPlugins(['Facet','InteractingFacet','Shop'])
+		),
 ])
 
+#######################
+###### 3rd party libs
+#######################
+
+yadeStaticOrSharedLib('miniWm3',
+	env.Combine('miniWm3.cpp',['miniWm3/Wm3Math.cpp','miniWm3/Wm3Matrix3.cpp','miniWm3/Wm3Quaternion.cpp','miniWm3/Wm3Vector3.cpp','miniWm3/Wm3Matrix2.cpp','miniWm3/Wm3Matrix4.cpp','miniWm3/Wm3Vector2.cpp','miniWm3/Wm3Vector4.cpp','miniWm3/Wm3Memory.cpp','miniWm3/Wm3String.cpp','miniWm3/Wm3System.cpp']),
+	# miniWm3 cannot link with itself, filter it out.
+	LIBS=filter(lambda l: l!='miniWm3',env['LIBS']),
+	# miniWm3 will be always optimized and without debugging info, even in debug builds; suppress all warnings
+	CXXFLAGS=env['CXXFLAGS']+['-O3','-g0','-w']),
+yadeStaticOrSharedLib('sqlite3x',Split('sqlite3x/sqlite3x_command.cpp sqlite3x/sqlite3x_connection.cpp sqlite3x/sqlite3x_cursor.cpp sqlite3x/sqlite3x_exception.cpp sqlite3x/sqlite3x_settings_db.cpp	sqlite3x/sqlite3x_transaction.cpp'),LIBS='sqlite3',CXXFLAGS=env['CXXFLAGS']+['-O3','-g0']),

Modified: trunk/lib/factory/ClassFactory.hpp
===================================================================
--- trunk/lib/factory/ClassFactory.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/lib/factory/ClassFactory.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -26,6 +26,7 @@
 
 
 #include<yade/lib-loki/Singleton.hpp>
+#include<boost/preprocessor/cat.hpp>
 
 
 #include "FactoryExceptions.hpp"
@@ -159,5 +160,7 @@
  * 	1. Visibility must be set to "internal" (or "protected") so that other plugins' init will not shadow this one and all of them get properly executed.
  * 	2. The function must be enclosed in its own anonymous namespace, otherwise there will be clashes (liker errors) if more files with YADE_PLUGIN are linked together.
  */
-#define YADE_PLUGIN(...) namespace{ __attribute__((constructor)) __attribute__((visibility("internal"))) void registerThisPluginClasses(void){ const char* info[]={__FILE__ , ##__VA_ARGS__ , NULL}; ClassFactory::instance().registerPluginClasses(info);} }
+#define YADE_PLUGIN(...) namespace{ __attribute__((constructor)) __attribute__((visibility("internal"))) void BOOST_PP_CAT(registerThisPluginClasses,__COUNTER__) (void){ const char* info[]={__FILE__ , ##__VA_ARGS__ , NULL}; ClassFactory::instance().registerPluginClasses(info);} }
+//! Macro informing build file generator what features that particular file depends on. Has no effect at compile-time. Can be specified multiple times within a single (.cpp) file
+#define YADE_REQUIRE_FEATURE(feature)
 

Modified: trunk/lib/import/STLImporter.cpp
===================================================================
--- trunk/lib/import/STLImporter.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/lib/import/STLImporter.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -6,7 +6,7 @@
 *  GNU General Public License v2 or later. See file LICENSE for details. *
 *************************************************************************/
 #include "STLImporter.hpp"
-#include <yade/extra/Shop.hpp>
+#include <yade/pkg-dem/Shop.hpp>
 
 CREATE_LOGGER(STLImporter);
 

Modified: trunk/lib/multimethods/DynLibDispatcher.hpp
===================================================================
--- trunk/lib/multimethods/DynLibDispatcher.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/lib/multimethods/DynLibDispatcher.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -224,10 +224,10 @@
 			{
 				executor = dynamic_pointer_cast<Executor>(ClassFactory::instance().createShared(libName));
 				if (!executor){ //dynamic_cast_failed for some reason so try with static_cast
-					// cerr<<__FILE__<<":"<<__LINE__<<" ERROR dynamic_casting executor of type "<<libName<<", using static_cast. WHY?"<<endl;
+					cerr<<__FILE__<<":"<<__LINE__<<" ERROR dynamic_casting executor of type "<<libName<<", using static_cast (WHY?)"<<endl;
+					//abort();
 					executor = static_pointer_cast<Executor>(ClassFactory::instance().createShared(libName));
 				}
-				else cerr<<"COOL! Dynamic cast of type "<<libName<<" successful!"<<endl;
 			}
 			catch (FactoryCantCreate& fe)
 			{

Modified: trunk/lib/serialization/Serializable.hpp
===================================================================
--- trunk/lib/serialization/Serializable.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/lib/serialization/Serializable.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -19,7 +19,7 @@
 #	include<memory>
 	using std::shared_ptr;
 #endif
-#ifdef EMBED_PYTHON
+#ifdef YADE_PYTHON
 	#include<boost/python.hpp>
 #endif
 #include<boost/type_traits.hpp>
@@ -55,7 +55,7 @@
 //! create member function that register attributes; must be parenthesized, without commas: (attr1) (attr2) (attr3) ...
 //#define REGISTER_ATTRIBUTES(attrs) protected: void registerAttributes(){ REGISTER_ATTRIBUTES_MANY(attrs) }
 //! Same as REGISTER_ATTRIBUTES, but with first argument of base class, of which registerAttributes will be called first
-#ifndef EMBED_PYTHON
+#ifndef YADE_PYTHON
 	#define REGISTER_ATTRIBUTES(baseClass,attrs) protected: void registerAttributes(){ baseClass::registerAttributes(); REGISTER_ATTRIBUTES_MANY(attrs); }
 #else
 	#include<boost/python.hpp>
@@ -120,12 +120,14 @@
 
 		virtual void postProcessAttributes(bool /*deserializing*/) {};
 
-	#ifdef EMBED_PYTHON
+	#ifdef YADE_PYTHON
 		virtual boost::python::object pyGetAttr(const std::string& key) const { return ::pyGetAttr(key); }
 		virtual void pySetAttr(const std::string& key, const boost::python::object& value){ ::pySetAttr(key,value); };
 		virtual boost::python::list pyKeys() const {return ::pyKeys(); };
 		virtual bool pyHasKey(const std::string& key) const {return ::pyHasKey(key);}
 		virtual boost::python::dict pyDict() const { return ::pyDict(); }
+		// override for root classes only (those which have distinct python wrappers
+		virtual std::string pyRootClassName() const { return std::string("Serializable"); }
 	#endif
 
 	private :

Deleted: trunk/lib/smoothing/WeightedAverage2d.cpp
===================================================================
--- trunk/lib/smoothing/WeightedAverage2d.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/lib/smoothing/WeightedAverage2d.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,28 +0,0 @@
-#include"WeightedAverage2d.hpp"
-
-/* Tell whether point is inside polygon
- *
- * See _utils.cpp: pointInsidePolygon for docs and license.
- */
-bool pyGaussAverage::pointInsidePolygon(const Vector2r& pt, const vector<Vector2r>& vertices){
-	int i /*current node*/, j/*previous node*/; bool inside=false; int rows=(int)vertices.size();
-	const Real& testx=pt[0],testy=pt[1];
-	for(i=0,j=rows-1; i<rows; j=i++){
-		const Real& vx_i=vertices[i][0], vy_i=vertices[i][1], vx_j=vertices[j][0], vy_j=vertices[j][1];
-		if (((vy_i>testy)!=(vy_j>testy)) && (testx < (vx_j-vx_i) * (testy-vy_i) / (vy_j-vy_i) + vx_i) ) inside=!inside;
-	}
-	return inside;
-}
-
-BOOST_PYTHON_MODULE(WeightedAverage2d)
-{
-	boost::python::class_<pyGaussAverage>("GaussAverage",python::init<python::tuple,python::tuple,python::tuple,Real>())
-		.def("add",&pyGaussAverage::addPt)
-		.def("avg",&pyGaussAverage::avg)
-		.add_property("stDev",&pyGaussAverage::stDev_get,&pyGaussAverage::stDev_set)
-		.add_property("relThreshold",&pyGaussAverage::relThreshold_get,&pyGaussAverage::relThreshold_set)
-		.add_property("clips",&pyGaussAverage::clips_get,&pyGaussAverage::clips_set)
-		.add_property("data",&pyGaussAverage::data_get)
-	;
-};
-

Modified: trunk/pkg/common/DataClass/BoundingVolume/AABB.cpp
===================================================================
--- trunk/pkg/common/DataClass/BoundingVolume/AABB.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/BoundingVolume/AABB.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -16,4 +16,4 @@
 {
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("AABB");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/BoundingVolume/BoundingSphere.cpp
===================================================================
--- trunk/pkg/common/DataClass/BoundingVolume/BoundingSphere.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/BoundingVolume/BoundingSphere.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -24,4 +24,4 @@
 // 	min = center-v;
 // 	max = center+v;	
 // }
-YADE_PLUGIN();
+YADE_PLUGIN("BoundingSphere");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/GeometricalModel/Box.cpp
===================================================================
--- trunk/pkg/common/DataClass/GeometricalModel/Box.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/GeometricalModel/Box.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -8,4 +8,4 @@
 #include "Box.hpp"
 Box::Box () : GeometricalModel() { createIndex(); }
 Box::~Box (){}
-YADE_PLUGIN();
+YADE_PLUGIN("Box");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/GeometricalModel/Facet.cpp
===================================================================
--- trunk/pkg/common/DataClass/GeometricalModel/Facet.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/GeometricalModel/Facet.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -18,4 +18,4 @@
 {
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("Facet");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/GeometricalModel/Mesh2D.cpp
===================================================================
--- trunk/pkg/common/DataClass/GeometricalModel/Mesh2D.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/GeometricalModel/Mesh2D.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -47,4 +47,4 @@
 
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("Mesh2D");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/GeometricalModel/Quadrilateral.cpp
===================================================================
--- trunk/pkg/common/DataClass/GeometricalModel/Quadrilateral.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/GeometricalModel/Quadrilateral.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -31,4 +31,4 @@
 
 Quadrilateral::~Quadrilateral(){}
 
-YADE_PLUGIN();
+YADE_PLUGIN("Quadrilateral");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/GeometricalModel/Sphere.cpp
===================================================================
--- trunk/pkg/common/DataClass/GeometricalModel/Sphere.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/GeometricalModel/Sphere.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -19,4 +19,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("Sphere");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/GeometricalModel/Tetrahedron.cpp
===================================================================
--- trunk/pkg/common/DataClass/GeometricalModel/Tetrahedron.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/GeometricalModel/Tetrahedron.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -30,4 +30,4 @@
 {
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("Tetrahedron");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/InteractingGeometry/InteractingBox.cpp
===================================================================
--- trunk/pkg/common/DataClass/InteractingGeometry/InteractingBox.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/InteractingGeometry/InteractingBox.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -18,4 +18,4 @@
 {		
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingBox");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/InteractingGeometry/InteractingFacet.cpp
===================================================================
--- trunk/pkg/common/DataClass/InteractingGeometry/InteractingFacet.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/InteractingGeometry/InteractingFacet.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -42,4 +42,4 @@
 		icr = e[0].Length()*ne[0].Dot(e[2])/p;
 	}
 }
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingFacet");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/InteractingGeometry/InteractingSphere.cpp
===================================================================
--- trunk/pkg/common/DataClass/InteractingGeometry/InteractingSphere.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/InteractingGeometry/InteractingSphere.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -18,4 +18,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingSphere");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/InteractingGeometry/MetaInteractingGeometry.cpp
===================================================================
--- trunk/pkg/common/DataClass/InteractingGeometry/MetaInteractingGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/InteractingGeometry/MetaInteractingGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -17,4 +17,4 @@
 {
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("MetaInteractingGeometry");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/InteractionGeometry/ClosestFeatures.cpp
===================================================================
--- trunk/pkg/common/DataClass/InteractionGeometry/ClosestFeatures.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/InteractionGeometry/ClosestFeatures.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -28,4 +28,4 @@
 // }
 // 
 
-YADE_PLUGIN();
+YADE_PLUGIN("ClosestFeatures");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/PhysicalParameters/ElasticBodyParameters.cpp
===================================================================
--- trunk/pkg/common/DataClass/PhysicalParameters/ElasticBodyParameters.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/PhysicalParameters/ElasticBodyParameters.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -17,4 +17,4 @@
 {
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("ElasticBodyParameters");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/PhysicalParameters/ElasticBodyParameters.hpp
===================================================================
--- trunk/pkg/common/DataClass/PhysicalParameters/ElasticBodyParameters.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/PhysicalParameters/ElasticBodyParameters.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -10,7 +10,7 @@
 #pragma once
 
 
-#include "RigidBodyParameters.hpp"
+#include<yade/pkg-common/RigidBodyParameters.hpp>
 
 
 class ElasticBodyParameters : public RigidBodyParameters

Modified: trunk/pkg/common/DataClass/PhysicalParameters/ParticleParameters.cpp
===================================================================
--- trunk/pkg/common/DataClass/PhysicalParameters/ParticleParameters.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/PhysicalParameters/ParticleParameters.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -23,4 +23,4 @@
 {
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("ParticleParameters");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/PhysicalParameters/RigidBodyParameters.cpp
===================================================================
--- trunk/pkg/common/DataClass/PhysicalParameters/RigidBodyParameters.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/PhysicalParameters/RigidBodyParameters.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -22,4 +22,4 @@
 {
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("RigidBodyParameters");
\ No newline at end of file

Modified: trunk/pkg/common/DataClass/PhysicalParameters/RigidBodyParameters.hpp
===================================================================
--- trunk/pkg/common/DataClass/PhysicalParameters/RigidBodyParameters.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/PhysicalParameters/RigidBodyParameters.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -8,8 +8,7 @@
 
 #pragma once
 
-#include "ParticleParameters.hpp"
-#include <Wm3Matrix3.h>
+#include<yade/pkg-common/ParticleParameters.hpp>
 #include<yade/lib-base/yadeWm3.hpp>
 
 class RigidBodyParameters : public ParticleParameters

Modified: trunk/pkg/common/DataClass/Widgets/ColorScale.cpp
===================================================================
--- trunk/pkg/common/DataClass/Widgets/ColorScale.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/DataClass/Widgets/ColorScale.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -24,4 +24,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("ColorScale");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/DeusExMachina/DisplacementEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/DisplacementEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/DeusExMachina/DisplacementEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -76,4 +76,4 @@
 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("DisplacementEngine");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/DeusExMachina/DisplacementToForceEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/DisplacementToForceEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/DeusExMachina/DisplacementToForceEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -70,4 +70,4 @@
 		
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("DisplacementToForceEngine");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/DeusExMachina/FixedOrientationEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/FixedOrientationEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/DeusExMachina/FixedOrientationEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -47,4 +47,4 @@
 //	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("FixedOrientationEngine");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/DeusExMachina/FixedPositionEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/FixedPositionEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/DeusExMachina/FixedPositionEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -28,4 +28,4 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("FixedPositionEngine");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/DeusExMachina/ForceEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/ForceEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/DeusExMachina/ForceEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -6,7 +6,7 @@
 #include<yade/pkg-common/ParticleParameters.hpp>
 #include<yade/core/MetaBody.hpp>
 #include<yade/pkg-common/LinearInterpolate.hpp>
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 
 YADE_PLUGIN("ForceEngine","InterpolatingDirectedForceEngine");
 

Modified: trunk/pkg/common/Engine/DeusExMachina/LinearInterpolate.hpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/LinearInterpolate.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/DeusExMachina/LinearInterpolate.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,4 +1,5 @@
 // 2008 © Václav Šmilauer <eudoxos@xxxxxxxx>
+#pragma once
 
 #include<vector>
 #include<iostream>

Modified: trunk/pkg/common/Engine/DeusExMachina/MomentEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/MomentEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/DeusExMachina/MomentEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -40,4 +40,4 @@
         }
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("MomentEngine");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/DeusExMachina/PressTestEngine.hpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/PressTestEngine.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/DeusExMachina/PressTestEngine.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -16,7 +16,7 @@
 **************************************************************************/
 
 #pragma once
-#include"TranslationEngine.hpp"
+#include<yade/pkg-common/TranslationEngine.hpp>
 #include<yade/core/DeusExMachina.hpp>
 
 class PressTestEngine: public TranslationEngine{

Modified: trunk/pkg/common/Engine/DeusExMachina/RotationEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/RotationEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/DeusExMachina/RotationEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -6,7 +6,7 @@
 #include<yade/pkg-common/RigidBodyParameters.hpp>
 #include<yade/core/MetaBody.hpp>
 #include<yade/lib-base/yadeWm3Extra.hpp>
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 
 #include<yade/pkg-common/LinearInterpolate.hpp>
 

Modified: trunk/pkg/common/Engine/DeusExMachina/StaticAttractionEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/StaticAttractionEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/DeusExMachina/StaticAttractionEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -75,5 +75,4 @@
 			(*bi)->physicalParameters->se3.position+=moves[i++];
 }
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("StaticAttractionEngine");

Modified: trunk/pkg/common/Engine/DeusExMachina/TranslationEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/DeusExMachina/TranslationEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/DeusExMachina/TranslationEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -26,4 +26,4 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("TranslationEngine");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/EngineUnit/ElasticBodySimpleRelationship.cpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/ElasticBodySimpleRelationship.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/EngineUnit/ElasticBodySimpleRelationship.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -30,4 +30,4 @@
 };
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("ElasticBodySimpleRelationship");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/EngineUnit/InteractingBox2AABB.cpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/InteractingBox2AABB.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/EngineUnit/InteractingBox2AABB.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -32,4 +32,4 @@
 	aabb->max = aabb->center+aabb->halfSize;
 }
 	
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingBox2AABB");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/EngineUnit/InteractingFacet2AABB.cpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/InteractingFacet2AABB.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/EngineUnit/InteractingFacet2AABB.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -31,4 +31,4 @@
 	aabb->center = aabb->min + aabb->halfSize;
 }
 	
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingFacet2AABB");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/EngineUnit/InteractingSphere2AABB.cpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/InteractingSphere2AABB.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/EngineUnit/InteractingSphere2AABB.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -20,4 +20,4 @@
 	aabb->max = aabb->center+aabb->halfSize;	
 }
 	
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingSphere2AABB");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/EngineUnit/LeapFrogOrientationIntegrator.cpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/LeapFrogOrientationIntegrator.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/EngineUnit/LeapFrogOrientationIntegrator.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -50,4 +50,4 @@
 // 	firsts[id] = false;
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("LeapFrogOrientationIntegrator");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/EngineUnit/LeapFrogPositionIntegrator.cpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/LeapFrogPositionIntegrator.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/EngineUnit/LeapFrogPositionIntegrator.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -45,4 +45,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("LeapFrogPositionIntegrator");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/EngineUnit/MetaInteractingGeometry2AABB.cpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/MetaInteractingGeometry2AABB.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/EngineUnit/MetaInteractingGeometry2AABB.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -51,4 +51,4 @@
 	aabb->max = max;
 }
 	
-YADE_PLUGIN();
+YADE_PLUGIN("MetaInteractingGeometry2AABB");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/EngineUnit/NewtonsForceLaw.cpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/NewtonsForceLaw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/EngineUnit/NewtonsForceLaw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -33,4 +33,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("NewtonsForceLaw");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/EngineUnit/NewtonsMomentumLaw.cpp
===================================================================
--- trunk/pkg/common/Engine/EngineUnit/NewtonsMomentumLaw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/EngineUnit/NewtonsMomentumLaw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -31,4 +31,4 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("NewtonsMomentumLaw");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/FilterEngine/ColorizedLayerFilter.cpp
===================================================================
--- trunk/pkg/common/Engine/FilterEngine/ColorizedLayerFilter.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/FilterEngine/ColorizedLayerFilter.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -53,4 +53,4 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("ColorizedLayerFilter");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/FilterEngine/ColorizedTimeFilter.cpp
===================================================================
--- trunk/pkg/common/Engine/FilterEngine/ColorizedTimeFilter.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/FilterEngine/ColorizedTimeFilter.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -158,4 +158,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("ColorizedTimeFilter");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/FilterEngine/ColorizedVelocityFilter.cpp
===================================================================
--- trunk/pkg/common/Engine/FilterEngine/ColorizedVelocityFilter.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/FilterEngine/ColorizedVelocityFilter.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -155,4 +155,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("ColorizedVelocityFilter");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/FilterEngine/PythonRunnerFilter.cpp
===================================================================
--- trunk/pkg/common/Engine/FilterEngine/PythonRunnerFilter.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/FilterEngine/PythonRunnerFilter.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,2 +1,3 @@
 #include"PythonRunnerFilter.hpp"
-YADE_PLUGIN();
+YADE_PLUGIN("PythonRunnerFilter");
+YADE_REQUIRE_FEATURE(PYTHON)

Added: trunk/pkg/common/Engine/MetaEngine/BoundingVolumeEngineUnit.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/BoundingVolumeEngineUnit.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/BoundingVolumeEngineUnit.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,3 @@
+#include<yade/pkg-common/BoundingVolumeEngineUnit.hpp>
+BoundingVolumeEngineUnit::~BoundingVolumeEngineUnit(){};
+

Modified: trunk/pkg/common/Engine/MetaEngine/BoundingVolumeMetaEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/BoundingVolumeMetaEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/BoundingVolumeMetaEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -56,4 +56,4 @@
 
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("BoundingVolumeMetaEngine");
\ No newline at end of file

Added: trunk/pkg/common/Engine/MetaEngine/ConstitutiveLaw.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/ConstitutiveLaw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/ConstitutiveLaw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,3 @@
+#include<yade/pkg-common/ConstitutiveLaw.hpp>
+ConstitutiveLaw::~ConstitutiveLaw(){};
+

Deleted: trunk/pkg/common/Engine/MetaEngine/EngineUnits.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/EngineUnits.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/EngineUnits.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,20 +0,0 @@
-#include<yade/pkg-common/BoundingVolumeEngineUnit.hpp>
-#include<yade/pkg-common/GeometricalModelEngineUnit.hpp>
-#include<yade/pkg-common/InteractingGeometryEngineUnit.hpp>
-#include<yade/pkg-common/InteractionGeometryEngineUnit.hpp>
-#include<yade/pkg-common/InteractionPhysicsEngineUnit.hpp>
-#include<yade/pkg-common/PhysicalParametersEngineUnit.hpp>
-#include<yade/pkg-common/PhysicalActionDamperUnit.hpp>
-#include<yade/pkg-common/PhysicalActionApplierUnit.hpp>
-#include<yade/pkg-common/ConstitutiveLaw.hpp>
-
-BoundingVolumeEngineUnit::~BoundingVolumeEngineUnit(){};
-GeometricalModelEngineUnit::~GeometricalModelEngineUnit(){};
-InteractingGeometryEngineUnit::~InteractingGeometryEngineUnit(){};
-InteractionGeometryEngineUnit::~InteractionGeometryEngineUnit(){};
-InteractionPhysicsEngineUnit::~InteractionPhysicsEngineUnit(){};
-PhysicalParametersEngineUnit::~PhysicalParametersEngineUnit(){};
-PhysicalActionDamperUnit::~PhysicalActionDamperUnit(){};
-PhysicalActionApplierUnit::~PhysicalActionApplierUnit(){};
-ConstitutiveLaw::~ConstitutiveLaw(){};
-

Added: trunk/pkg/common/Engine/MetaEngine/GeometricalModelEngineUnit.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/GeometricalModelEngineUnit.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/GeometricalModelEngineUnit.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,2 @@
+#include<yade/pkg-common/GeometricalModelEngineUnit.hpp>
+GeometricalModelEngineUnit::~GeometricalModelEngineUnit(){};

Modified: trunk/pkg/common/Engine/MetaEngine/GeometricalModelMetaEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/GeometricalModelMetaEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/GeometricalModelMetaEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -26,4 +26,4 @@
 	 	operator()(ncb->physicalParameters,ncb->geometricalModel,ncb);
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GeometricalModelMetaEngine");
\ No newline at end of file

Added: trunk/pkg/common/Engine/MetaEngine/InteractingGeometryEngineUnit.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/InteractingGeometryEngineUnit.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/InteractingGeometryEngineUnit.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,3 @@
+#include<yade/pkg-common/InteractingGeometryEngineUnit.hpp>
+InteractingGeometryEngineUnit::~InteractingGeometryEngineUnit(){};
+

Modified: trunk/pkg/common/Engine/MetaEngine/InteractingGeometryMetaEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/InteractingGeometryMetaEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/InteractingGeometryMetaEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -25,4 +25,4 @@
 		operator()(ncb->geometricalModel,ncb->interactingGeometry,ncb->physicalParameters->se3,ncb);
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingGeometryMetaEngine");
\ No newline at end of file

Added: trunk/pkg/common/Engine/MetaEngine/InteractionGeometryEngineUnit.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/InteractionGeometryEngineUnit.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/InteractionGeometryEngineUnit.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,3 @@
+#include<yade/pkg-common/InteractionGeometryEngineUnit.hpp>
+InteractionGeometryEngineUnit::~InteractionGeometryEngineUnit(){};
+

Modified: trunk/pkg/common/Engine/MetaEngine/InteractionGeometryMetaEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/InteractionGeometryMetaEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/InteractionGeometryMetaEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -69,4 +69,4 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractionGeometryMetaEngine");
\ No newline at end of file

Added: trunk/pkg/common/Engine/MetaEngine/InteractionPhysicsEngineUnit.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/InteractionPhysicsEngineUnit.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/InteractionPhysicsEngineUnit.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,3 @@
+#include<yade/pkg-common/InteractionPhysicsEngineUnit.hpp>
+InteractionPhysicsEngineUnit::~InteractionPhysicsEngineUnit(){};
+

Modified: trunk/pkg/common/Engine/MetaEngine/InteractionPhysicsMetaEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/InteractionPhysicsMetaEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/InteractionPhysicsMetaEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -43,4 +43,4 @@
 		}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractionPhysicsMetaEngine");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplier.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplier.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplier.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -15,4 +15,4 @@
 		operator()(b->physicalParameters,b.get(),ncb);
 	}
 }
-YADE_PLUGIN();
+YADE_PLUGIN("PhysicalActionApplier");
\ No newline at end of file

Added: trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplierUnit.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplierUnit.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/PhysicalActionApplierUnit.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,3 @@
+#include<yade/pkg-common/PhysicalActionApplierUnit.hpp>
+PhysicalActionApplierUnit::~PhysicalActionApplierUnit(){};
+

Modified: trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamper.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamper.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamper.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -17,4 +17,4 @@
 		operator()(b->physicalParameters,b.get(),ncb);
 	}
 }
-YADE_PLUGIN();
+YADE_PLUGIN("PhysicalActionDamper");
\ No newline at end of file

Added: trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamperUnit.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamperUnit.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/PhysicalActionDamperUnit.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,3 @@
+#include<yade/pkg-common/PhysicalActionDamperUnit.hpp>
+PhysicalActionDamperUnit::~PhysicalActionDamperUnit(){};
+

Added: trunk/pkg/common/Engine/MetaEngine/PhysicalParametersEngineUnit.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/PhysicalParametersEngineUnit.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/PhysicalParametersEngineUnit.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,3 @@
+#include<yade/pkg-common/PhysicalParametersEngineUnit.hpp>
+PhysicalParametersEngineUnit::~PhysicalParametersEngineUnit(){};
+

Modified: trunk/pkg/common/Engine/MetaEngine/PhysicalParametersMetaEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/MetaEngine/PhysicalParametersMetaEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/MetaEngine/PhysicalParametersMetaEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -28,4 +28,4 @@
  	operator()(ncb->physicalParameters,ncb,ncb->bex);
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("PhysicalParametersMetaEngine");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/StandAloneEngine/DistantPersistentSAPCollider.cpp
===================================================================
--- trunk/pkg/common/Engine/StandAloneEngine/DistantPersistentSAPCollider.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/StandAloneEngine/DistantPersistentSAPCollider.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -252,4 +252,4 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("DistantPersistentSAPCollider");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/StandAloneEngine/PeriodicPythonRunner.cpp
===================================================================
--- trunk/pkg/common/Engine/StandAloneEngine/PeriodicPythonRunner.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/StandAloneEngine/PeriodicPythonRunner.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,2 +1,3 @@
 #include<yade/pkg-common/PeriodicPythonRunner.hpp>
-YADE_PLUGIN();
+YADE_PLUGIN("PeriodicPythonRunner");
+YADE_REQUIRE_FEATURE(PYTHON)

Modified: trunk/pkg/common/Engine/StandAloneEngine/PersistentSAPCollider.cpp
===================================================================
--- trunk/pkg/common/Engine/StandAloneEngine/PersistentSAPCollider.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/StandAloneEngine/PersistentSAPCollider.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -314,4 +314,4 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("PersistentSAPCollider");
\ No newline at end of file

Modified: trunk/pkg/common/Engine/StandAloneEngine/PersistentTriangulationCollider.cpp
===================================================================
--- trunk/pkg/common/Engine/StandAloneEngine/PersistentTriangulationCollider.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/StandAloneEngine/PersistentTriangulationCollider.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -14,11 +14,12 @@
 #include<yade/core/BodyContainer.hpp>
 #include<limits>
 #include<utility>
-#include <vector>
+#include<vector>
 #include<yade/pkg-common/InteractingSphere.hpp>
 #include<yade/pkg-common/RigidBodyParameters.hpp>
-#include"TesselationWrapper.h"
+#include<yade/extra/TesselationWrapper.h>
 
+YADE_REQUIRE_FEATURE(CGAL)
 
 PersistentTriangulationCollider::PersistentTriangulationCollider() : Collider()
 {
@@ -150,4 +151,4 @@
 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("PersistentTriangulationCollider");

Modified: trunk/pkg/common/Engine/StandAloneEngine/ResetPositionEngine.cpp
===================================================================
--- trunk/pkg/common/Engine/StandAloneEngine/ResetPositionEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/Engine/StandAloneEngine/ResetPositionEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -87,4 +87,4 @@
 	for(int i=0,e=subscribedBodies.size(); i<e; ++i)
 		os << ini_pos[i][0]<< '\t' << ini_pos[i][1]<< '\t' << ini_pos[i][2]<< std::endl;
 }
-YADE_PLUGIN();
+YADE_PLUGIN("ResetPositionEngine");
\ No newline at end of file

Modified: trunk/pkg/common/RenderingEngine/GLDrawBoundingVolume/GLDrawAABB.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawBoundingVolume/GLDrawAABB.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawBoundingVolume/GLDrawAABB.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -20,4 +20,5 @@
 	glutWireCube(1);
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawAABB");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawBoundingVolume/GLDrawBoundingSphere.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawBoundingVolume/GLDrawBoundingSphere.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawBoundingVolume/GLDrawBoundingSphere.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -18,4 +18,5 @@
 	glutWireSphere(s->radius,10,10);
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawBoundingSphere");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawBox.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawBox.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawBox.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -36,4 +36,5 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawBox");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawFacet.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawFacet.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawFacet.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -41,4 +41,5 @@
 		glEnd();
     }
 }
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawFacet");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawMesh2D.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawMesh2D.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawMesh2D.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -82,4 +82,5 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawMesh2D");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawQuadrilateral.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawQuadrilateral.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawQuadrilateral.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -214,4 +214,5 @@
 	y = X[1];
 };
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawQuadrilateral");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawSphere.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawSphere.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawSphere.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -243,4 +243,5 @@
 	glLoadMatrixf(modelview);
 }
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawSphere");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawTetrahedron.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawTetrahedron.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawTetrahedron.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -143,4 +143,5 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawTetrahedron");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawTube.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawTube.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawGeometricalModel/GLDrawTube.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -80,5 +80,5 @@
 	}
 }
 
-
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawTube");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawBssSweptSphereLineSegment.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawBssSweptSphereLineSegment.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawBssSweptSphereLineSegment.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -70,4 +70,4 @@
 
 
 YADE_PLUGIN("GLDrawBssSweptSphereLineSegment");
-
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingBox.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingBox.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingBox.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -32,4 +32,5 @@
 //	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawInteractingBox");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingFacet.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingFacet.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingFacet.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -50,4 +50,5 @@
     glEnd();
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawInteractingFacet");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingSphere.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingSphere.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingSphere.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -155,5 +155,5 @@
 		subdivideTriangle(vertices[(unsigned int)faces[i][0]],vertices[(unsigned int)faces[i][1]],vertices[(unsigned int)faces[i][2]],depth);
 }
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("GLDrawInteractingSphere");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawMetaInteractingGeometry.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawMetaInteractingGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawInteractingGeometry/GLDrawMetaInteractingGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -16,4 +16,5 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawMetaInteractingGeometry");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawInteractionGeometry/GLDrawClosestFeatures.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawInteractionGeometry/GLDrawClosestFeatures.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawInteractionGeometry/GLDrawClosestFeatures.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -43,4 +43,5 @@
 	glEnd();
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawClosestFeatures");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawInteractionPhysics/GLDrawNormalInteraction.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawInteractionPhysics/GLDrawNormalInteraction.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawInteractionPhysics/GLDrawNormalInteraction.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -39,4 +39,5 @@
 	glPopMatrix();
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawNormalInteraction");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawShadowVolume/GLDrawBoxShadowVolume.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawShadowVolume/GLDrawBoxShadowVolume.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawShadowVolume/GLDrawBoxShadowVolume.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -288,4 +288,5 @@
 
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawBoxShadowVolume");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawShadowVolume/GLDrawSphereShadowVolume.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawShadowVolume/GLDrawSphereShadowVolume.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawShadowVolume/GLDrawSphereShadowVolume.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -56,4 +56,5 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawSphereShadowVolume");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawState/GLDrawParticleState.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawState/GLDrawParticleState.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawState/GLDrawParticleState.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -39,4 +39,5 @@
 	glEnd();
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawParticleState");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawState/GLDrawRigidBodyState.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawState/GLDrawRigidBodyState.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawState/GLDrawRigidBodyState.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -48,4 +48,5 @@
 	glEnd();
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawRigidBodyState");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/GLDrawWidgets/GLDrawColorScale.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/GLDrawWidgets/GLDrawColorScale.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/GLDrawWidgets/GLDrawColorScale.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -64,4 +64,5 @@
 	glMatrixMode(GL_MODELVIEW);	
 
 }
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawColorScale");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/common/RenderingEngine/OpenGLRenderingEngine/OpenGLRenderingEngine.cpp
===================================================================
--- trunk/pkg/common/RenderingEngine/OpenGLRenderingEngine/OpenGLRenderingEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/RenderingEngine/OpenGLRenderingEngine/OpenGLRenderingEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -10,6 +10,7 @@
 #include<GL/glut.h>
 
 YADE_PLUGIN("OpenGLRenderingEngine");
+YADE_REQUIRE_FEATURE(OPENGL)
 CREATE_LOGGER(OpenGLRenderingEngine);
 
 bool OpenGLRenderingEngine::glutInitDone=false;

Deleted: trunk/pkg/common/SConscript
===================================================================
--- trunk/pkg/common/SConscript	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/common/SConscript	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,215 +0,0 @@
-# vim: set filetype=python :
-Import('*')
-
-if 'EMBED_PYTHON' in env['CPPDEFINES']:
-	env.Install("$PREFIX/lib/yade$SUFFIX/pkg-common",[
-		env.SharedLibrary('PythonRunnerFilter',['Engine/FilterEngine/PythonRunnerFilter.cpp'],LIBS=env['LIBS']+['FilterEngine']),
-		env.SharedLibrary('PeriodicPythonRunner',['Engine/StandAloneEngine/PeriodicPythonRunner.cpp']),
-	])
-
-
-env.Install('$PREFIX/lib/yade$SUFFIX/pkg-common',[
-
-	env.SharedLibrary('VelocityBins',['DataClass/VelocityBins.cpp']), # not a plugin
-	env.SharedLibrary('ParallelEngine',['Engine/ParallelEngine.cpp']),
-	env.SharedLibrary('EngineUnits',['Engine/MetaEngine/EngineUnits.cpp']),
-	env.SharedLibrary('AABB',['DataClass/BoundingVolume/AABB.cpp']),
-	env.SharedLibrary('BoundingSphere',['DataClass/BoundingVolume/BoundingSphere.cpp']),
-	env.SharedLibrary('InteractingBox',['DataClass/InteractingGeometry/InteractingBox.cpp'],),
-	env.SharedLibrary('InteractingSphere',['DataClass/InteractingGeometry/InteractingSphere.cpp']),
-	env.SharedLibrary('InteractingNode',['DataClass/InteractingGeometry/InteractingNode.cpp']),
-	env.SharedLibrary('MetaInteractingGeometry',['DataClass/InteractingGeometry/MetaInteractingGeometry.cpp']),
-	env.SharedLibrary('InteractingFacet',['DataClass/InteractingGeometry/InteractingFacet.cpp']),
-	env.SharedLibrary('ParticleParameters',['DataClass/PhysicalParameters/ParticleParameters.cpp']),
-	env.SharedLibrary('RigidBodyParameters',['DataClass/PhysicalParameters/RigidBodyParameters.cpp'],
-		LIBS=env['LIBS']+['ParticleParameters',]),
-	env.SharedLibrary('ElasticBodyParameters',['DataClass/PhysicalParameters/ElasticBodyParameters.cpp'],
-		LIBS=env['LIBS']+['RigidBodyParameters','ParticleParameters',]),
-	env.SharedLibrary('ClosestFeatures',['DataClass/InteractionGeometry/ClosestFeatures.cpp']),
-	env.SharedLibrary('Box',['DataClass/GeometricalModel/Box.cpp']),
-	env.SharedLibrary('Mesh2D',['DataClass/GeometricalModel/Mesh2D.cpp']),
-	env.SharedLibrary('Sphere',['DataClass/GeometricalModel/Sphere.cpp']),
-	env.SharedLibrary('Tetrahedron',['DataClass/GeometricalModel/Tetrahedron.cpp']),
-	env.SharedLibrary('Quadrilateral',['DataClass/GeometricalModel/Quadrilateral.cpp']),
-	env.SharedLibrary('Facet',['DataClass/GeometricalModel/Facet.cpp']),
-	env.SharedLibrary('ColorScale',['DataClass/Widgets/ColorScale.cpp']),
-	env.SharedLibrary('MomentEngine',['Engine/DeusExMachina/MomentEngine.cpp'],
-		LIBS=env['LIBS']+['ParticleParameters']),
-	env.SharedLibrary('ForceEngine',['Engine/DeusExMachina/ForceEngine.cpp'],
-		LIBS=env['LIBS']+['ParticleParameters','Shop']),
-	env.SharedLibrary('DisplacementToForceEngine',['Engine/DeusExMachina/DisplacementToForceEngine.cpp'],
-		LIBS=env['LIBS']+['ParticleParameters']),
-	env.SharedLibrary('GravityEngines',['Engine/DeusExMachina/GravityEngines.cpp'],
-		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'],
-		LIBS=env['LIBS']+['ParticleParameters','RigidBodyParameters','Shop']),
-	env.SharedLibrary('TranslationEngine',['Engine/DeusExMachina/TranslationEngine.cpp'],
-		LIBS=env['LIBS']+['ParticleParameters']),
-	env.SharedLibrary('CinemDNCEngine',['Engine/DeusExMachina/CinemDNCEngine.cpp'],
-		LIBS=env['LIBS']+['ParticleParameters','RigidBodyParameters']),
-	env.SharedLibrary('PressTestEngine',['Engine/DeusExMachina/PressTestEngine.cpp'],
-		LIBS=env['LIBS']+['TranslationEngine']),
-
-	env.SharedLibrary('CinemCNCEngine',
-		['Engine/DeusExMachina/CinemCNCEngine.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'ParticleParameters',
-			'RigidBodyParameters',
-			'yade-factory',
-			'yade-base',
-			'ContactLaw1',
-			'ElasticContactInteraction',
-			'InteractingBox',
-			'yade-serialization',
-			'yade-multimethods'],
-		CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters',
-			'$PREFIX/include',
-			'Engine/DeusExMachina']),
-
-	env.SharedLibrary('CinemKNCEngine',
-		['Engine/DeusExMachina/CinemKNCEngine.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'ParticleParameters',
-			'RigidBodyParameters',
-			'yade-factory',
-			'yade-base',
-			'ContactLaw1',
-			'ElasticContactInteraction',
-			'InteractingBox',
-			'yade-serialization',
-			'yade-multimethods'],
-		CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters',
-			'$PREFIX/include',
-			'Engine/DeusExMachina']),
-
-
-	env.SharedLibrary('StaticAttractionEngine',['Engine/DeusExMachina/StaticAttractionEngine.cpp'],
-		CPPPATH=env['CPPPATH']+['$PREFIX/include','Engine/DeusExMachina']),
-	env.SharedLibrary('DisplacementEngine',['Engine/DeusExMachina/DisplacementEngine.cpp']),
-	env.SharedLibrary('FixedPositionEngine',['Engine/DeusExMachina/FixedPositionEngine.cpp']),
-	env.SharedLibrary('FixedOrientationEngine',['Engine/DeusExMachina/FixedOrientationEngine.cpp']),
-	env.SharedLibrary('ResetPositionEngine',['Engine/StandAloneEngine/ResetPositionEngine.cpp'],
-		LIBS=env['LIBS']+['ParticleParameters']),
-	env.SharedLibrary('FilterEngine',['Engine/FilterEngine/FilterEngine.cpp']),
-	env.SharedLibrary('ColorizedLayerFilter',['Engine/FilterEngine/ColorizedLayerFilter.cpp'],
-		LIBS=env['LIBS']+['FilterEngine']),
-	env.SharedLibrary('ColorizedVelocityFilter',['Engine/FilterEngine/ColorizedVelocityFilter.cpp'],
-		LIBS=env['LIBS']+['FilterEngine','ColorScale']),
-	env.SharedLibrary('ColorizedTimeFilter',['Engine/FilterEngine/ColorizedTimeFilter.cpp'],
-		LIBS=env['LIBS']+['FilterEngine','ColorScale']),
-	env.SharedLibrary('BoundingVolumeMetaEngine',['Engine/MetaEngine/BoundingVolumeMetaEngine.cpp'],LIBS=env['LIBS']+['RigidBodyParameters','AABB','EngineUnits','VelocityBins']),
-	env.SharedLibrary('GeometricalModelMetaEngine',['Engine/MetaEngine/GeometricalModelMetaEngine.cpp'],LIBS=env['LIBS']+['EngineUnits']),
-	env.SharedLibrary('InteractingGeometryMetaEngine',['Engine/MetaEngine/InteractingGeometryMetaEngine.cpp'],LIBS=env['LIBS']+['EngineUnits']),
-	env.SharedLibrary('PhysicalParametersMetaEngine',['Engine/MetaEngine/PhysicalParametersMetaEngine.cpp'],LIBS=env['LIBS']+['EngineUnits']),
-	env.SharedLibrary('InteractionGeometryMetaEngine',['Engine/MetaEngine/InteractionGeometryMetaEngine.cpp'],LIBS=env['LIBS']+['EngineUnits']),
-	env.SharedLibrary('InteractionPhysicsMetaEngine',['Engine/MetaEngine/InteractionPhysicsMetaEngine.cpp'],LIBS=env['LIBS']+['EngineUnits']),
-	env.SharedLibrary('PhysicalActionApplier',['Engine/MetaEngine/PhysicalActionApplier.cpp'],LIBS=env['LIBS']+['EngineUnits']),
-	env.SharedLibrary('PhysicalActionDamper',['Engine/MetaEngine/PhysicalActionDamper.cpp'],LIBS=env['LIBS']+['EngineUnits']),
-	env.SharedLibrary('ConstitutiveLawDispatcher',['Engine/MetaEngine/ConstitutiveLawDispatcher.cpp'],LIBS=env['LIBS']+['EngineUnits']),
-	env.SharedLibrary('InteractionDispatchers',['Engine/MetaEngine/InteractionDispatchers.cpp'],LIBS=env['LIBS']+['InteractionGeometryMetaEngine','InteractionPhysicsMetaEngine','ConstitutiveLawDispatcher','EngineUnits']),
-	env.SharedLibrary('InteractingBox2AABB',['Engine/EngineUnit/InteractingBox2AABB.cpp'],
-		LIBS=env['LIBS']+['BoundingVolumeMetaEngine','InteractingBox','AABB','Box','EngineUnits']),
-	env.SharedLibrary('MetaInteractingGeometry2AABB',['Engine/EngineUnit/MetaInteractingGeometry2AABB.cpp'],
-		LIBS=env['LIBS']+['BoundingVolumeMetaEngine','MetaInteractingGeometry','AABB','EngineUnits']),
-	env.SharedLibrary('InteractingFacet2AABB',['Engine/EngineUnit/InteractingFacet2AABB.cpp'],
-		LIBS=env['LIBS']+['AABB','InteractingFacet','EngineUnits']),
-	env.SharedLibrary('LeapFrogOrientationIntegrator',['Engine/EngineUnit/LeapFrogOrientationIntegrator.cpp'],
-		LIBS=env['LIBS']+['PhysicalParametersMetaEngine','ParticleParameters','RigidBodyParameters','EngineUnits']),
-	env.SharedLibrary('LeapFrogPositionIntegrator',['Engine/EngineUnit/LeapFrogPositionIntegrator.cpp'],
-		LIBS=env['LIBS']+['PhysicalParametersMetaEngine','ParticleParameters','RigidBodyParameters','EngineUnits']),
-	env.SharedLibrary('NewtonsForceLaw',['Engine/EngineUnit/NewtonsForceLaw.cpp'],
-		LIBS=env['LIBS']+['PhysicalActionApplier','ParticleParameters','RigidBodyParameters','EngineUnits']),
-	env.SharedLibrary('NewtonsMomentumLaw',['Engine/EngineUnit/NewtonsMomentumLaw.cpp'],
-		LIBS=env['LIBS']+['PhysicalActionApplier','RigidBodyParameters','EngineUnits']),
-	env.SharedLibrary('InteractingSphere2AABB',['Engine/EngineUnit/InteractingSphere2AABB.cpp'],
-		LIBS=env['LIBS']+['BoundingVolumeMetaEngine','InteractingSphere','AABB','EngineUnits']),
-	env.SharedLibrary('CundallNonViscousDamping',
-		['Engine/EngineUnit/CundallNonViscousDamping.cpp'],
-		LIBS=env['LIBS']+['PhysicalActionDamper','ParticleParameters','RigidBodyParameters','EngineUnits']),
-	env.SharedLibrary('ElasticBodySimpleRelationship',['Engine/EngineUnit/ElasticBodySimpleRelationship.cpp'],
-		LIBS=env['LIBS']+['ElasticBodyParameters','RigidBodyParameters','ParticleParameters','InteractionPhysicsMetaEngine','NormalShearInteractions','EngineUnits']),
-	env.SharedLibrary('NormalShearInteractions',['DataClass/InteractionPhysics/NormalShearInteractions.cpp']),
-
-	#env.SharedLibrary('VelocityDamping',
-	#	['Engine/EngineUnit/VelocityDamping.cpp'],
-	#	LIBS=env['LIBS']+['RigidBodyParameters']),
-
-	#env.SharedLibrary('PersistentTriangulationCollider',
-	#	['Engine/StandAloneEngine/PersistentTriangulationCollider.cpp'],
-	#	LIBPATH=env['LIBPATH']+['/home/bruno/micromacro/KdevMicroMacro/src'],
-	#	LIBS=env['LIBS']+['yade-base', 'TesselationWrapper', 'CGAL',  'InteractingSphere', 'RigidBodyParameters'],
-	#	CPPPATH=env['CPPPATH']+['Engine/StandAloneEngine', '$PREFIX/include', '/home/bruno/micromacro/KdevMicroMacro/src']),
-    
-	env.SharedLibrary('SpheresFactory',['Engine/StandAloneEngine/SpheresFactory.cpp'],
-		LIBS=env['LIBS']+['AABB','InteractingSphere','Facet','Sphere','BodyMacroParameters','InteractionGeometryMetaEngine']),
-	env.SharedLibrary('SpatialQuickSortCollider',['Engine/StandAloneEngine/SpatialQuickSortCollider.cpp']),
-	env.SharedLibrary('InsertionSortCollider',['Engine/StandAloneEngine/InsertionSortCollider.cpp'],LIBS=env['LIBS']+['BoundingVolumeMetaEngine','NewtonsDampedLaw']),
-	env.SharedLibrary('PersistentSAPCollider',['Engine/StandAloneEngine/PersistentSAPCollider.cpp']),
-	env.SharedLibrary('DistantPersistentSAPCollider',['Engine/StandAloneEngine/DistantPersistentSAPCollider.cpp']),
-	env.SharedLibrary('PhysicalActionContainerReseter',['Engine/StandAloneEngine/PhysicalActionContainerReseter.cpp']),
-                
-# In the following, there is maybe too much defined LIBS (?)
-        env.SharedLibrary('BshTube',['DataClass/GeometricalModel/BshTube.cpp'],
-                LIBS=env['LIBS']+['BoundingVolumeMetaEngine','InteractingBox',]),
-        env.SharedLibrary('BssSweptSphereLineSegment',['DataClass/InteractingGeometry/BssSweptSphereLineSegment.cpp'],
-                LIBS=env['LIBS']+['BoundingVolumeMetaEngine','InteractingBox','AABB','Box',]),
-        env.SharedLibrary('BcpConnection',['DataClass/PhysicalParameters/BcpConnection.cpp'],
-                LIBS=env['LIBS']+['SimpleViscoelasticBodyParameters']),
-        env.SharedLibrary('ef2_BshTube_BssSweptSphereLineSegment_makeBssSweptSphereLineSegment',
-                        ['Engine/EngineUnit/ef2_BshTube_BssSweptSphereLineSegment_makeBssSweptSphereLineSegment.cpp'],
-                LIBS=env['LIBS']+['BoundingVolumeMetaEngine','InteractingBox','AABB','Box','BshTube','BcpConnection','BssSweptSphereLineSegment','EngineUnits']),
-        env.SharedLibrary('ef2_BssSweptSphereLineSegment_AABB_makeAABB',
-                        ['Engine/EngineUnit/ef2_BssSweptSphereLineSegment_AABB_makeAABB.cpp'],
-                LIBS=env['LIBS']+['BoundingVolumeMetaEngine','AABB','BssSweptSphereLineSegment','EngineUnits']),
-        
-                
-])
-
-if 'YADE_OPENGL' in env['CPPDEFINES']:
-	env.Install('$PREFIX/lib/yade$SUFFIX/pkg-common',[
-		env.SharedLibrary('GLDrawAABB',['RenderingEngine/GLDrawBoundingVolume/GLDrawAABB.cpp'],
-			LIBS=env['LIBS']+['yade-base','AABB','yade-opengl']),
-		env.SharedLibrary('GLDrawBoundingSphere',['RenderingEngine/GLDrawBoundingVolume/GLDrawBoundingSphere.cpp'],
-			LIBS=env['LIBS']+['yade-base','BoundingSphere','yade-opengl']),
-		env.SharedLibrary('GLDrawTetrahedron',['RenderingEngine/GLDrawGeometricalModel/GLDrawTetrahedron.cpp'],
-			LIBS=env['LIBS']+['yade-base','Tetrahedron','yade-opengl']),
-		env.SharedLibrary('GLDrawBox',['RenderingEngine/GLDrawGeometricalModel/GLDrawBox.cpp'],
-			LIBS=env['LIBS']+['yade-base','Box','yade-opengl']),
-		env.SharedLibrary('GLDrawMesh2D',['RenderingEngine/GLDrawGeometricalModel/GLDrawMesh2D.cpp'],
-			LIBS=env['LIBS']+['yade-base','Mesh2D','yade-opengl']),
-		env.SharedLibrary('GLDrawSphere',['RenderingEngine/GLDrawGeometricalModel/GLDrawSphere.cpp'],
-			LIBS=env['LIBS']+['yade-base','Sphere','yade-opengl']),               
-		env.SharedLibrary('GLDrawQuadrilateral',['RenderingEngine/GLDrawGeometricalModel/GLDrawQuadrilateral.cpp'],
-			LIBS=env['LIBS']+['yade-base','Quadrilateral','yade-opengl']),
-		env.SharedLibrary('GLDrawFacet',['RenderingEngine/GLDrawGeometricalModel/GLDrawFacet.cpp']
-			 ,LIBS=env['LIBS']+['yade-opengl','Facet']),
-		env.SharedLibrary('GLDrawInteractingBox',['RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingBox.cpp'],
-			LIBS=env['LIBS']+['yade-base','InteractingBox','yade-opengl']),
-		env.SharedLibrary('GLDrawInteractingSphere',['RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingSphere.cpp'],
-			LIBS=env['LIBS']+['yade-base','InteractingSphere','yade-opengl'],),
-				env.SharedLibrary('GLDrawBssSweptSphereLineSegment',['RenderingEngine/GLDrawInteractingGeometry/GLDrawBssSweptSphereLineSegment.cpp'],
-						 LIBS=env['LIBS']+['yade-base','BssSweptSphereLineSegment','yade-opengl']),               
-		env.SharedLibrary('GLDrawMetaInteractingGeometry',['RenderingEngine/GLDrawInteractingGeometry/GLDrawMetaInteractingGeometry.cpp'],
-			LIBS=env['LIBS']+['yade-opengl']),
-		env.SharedLibrary('GLDrawInteractingFacet',['RenderingEngine/GLDrawInteractingGeometry/GLDrawInteractingFacet.cpp']
-			 ,LIBS=env['LIBS']+['yade-opengl','InteractingFacet']),
-		env.SharedLibrary('GLDrawBoxShadowVolume',['RenderingEngine/GLDrawShadowVolume/GLDrawBoxShadowVolume.cpp'],
-			LIBS=env['LIBS']+['Box','ParticleParameters','yade-opengl','RigidBodyParameters']),
-		env.SharedLibrary('GLDrawSphereShadowVolume',['RenderingEngine/GLDrawShadowVolume/GLDrawSphereShadowVolume.cpp'],
-			LIBS=env['LIBS']+['Sphere','ParticleParameters','yade-opengl']),
-		env.SharedLibrary('GLDrawClosestFeatures',['RenderingEngine/GLDrawInteractionGeometry/GLDrawClosestFeatures.cpp'],
-			LIBS=env['LIBS']+['yade-base','ClosestFeatures','yade-opengl']),
-		env.SharedLibrary('GLDrawNormalInteraction',['RenderingEngine/GLDrawInteractionPhysics/GLDrawNormalInteraction.cpp'],LIBS=env['LIBS']+['yade-opengl','NormalShearInteractions']),
-		env.SharedLibrary('GLDrawParticleState',['RenderingEngine/GLDrawState/GLDrawParticleState.cpp'],
-			LIBS=env['LIBS']+['yade-base','ParticleParameters','yade-opengl']),
-		env.SharedLibrary('GLDrawColorScale',['RenderingEngine/GLDrawWidgets/GLDrawColorScale.cpp'],
-			LIBS=env['LIBS']+['yade-base','ColorScale','yade-opengl']),
-		env.SharedLibrary('GLDrawRigidBodyState',['RenderingEngine/GLDrawState/GLDrawRigidBodyState.cpp'],
-			LIBS=env['LIBS']+['ParticleParameters','RigidBodyParameters','GLDrawParticleState','yade-opengl']),
-		env.SharedLibrary('OpenGLRenderingEngine',['RenderingEngine/OpenGLRenderingEngine/OpenGLRenderingEngine.cpp'],
-			LIBS=env['LIBS']+['yade-base',  'glut', 'GLU', 'GL']),
-		env.SharedLibrary('GLDrawTube',['RenderingEngine/GLDrawGeometricalModel/GLDrawTube.cpp'],
-			LIBS=env['LIBS']+['yade-base','BshTube','yade-opengl']),
-	])

Deleted: trunk/pkg/dem/ConcretePM.cpp
===================================================================
--- trunk/pkg/dem/ConcretePM.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/ConcretePM.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,369 +0,0 @@
-// 2007,2008 © Václav Šmilauer <eudoxos@xxxxxxxx> 
-#include"ConcretePM.hpp"
-#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-dem/BodyMacroParameters.hpp>
-#include<yade/pkg-common/Sphere.hpp>
-#include<yade/pkg-dem/DemXDofGeom.hpp>
-#include<yade/extra/Shop.hpp>
-
-YADE_PLUGIN("CpmMat","Ip2_CpmMat_CpmMat_CpmPhys","CpmPhys","Law2_Dem3DofGeom_CpmPhys_Cpm","CpmGlobalCharacteristics",
-	#ifdef YADE_OPENGL
-		"GLDrawCpmPhys",
-	#endif	
-		"CpmPhysDamageColorizer");
-
-
-/********************** Ip2_CpmMat_CpmMat_CpmPhys ****************************/
-
-CREATE_LOGGER(Ip2_CpmMat_CpmMat_CpmPhys);
-
-void Ip2_CpmMat_CpmMat_CpmPhys::go(const shared_ptr<PhysicalParameters>& pp1, const shared_ptr<PhysicalParameters>& pp2, const shared_ptr<Interaction>& interaction){
-	if(interaction->interactionPhysics) return; 
-
-	Dem3DofGeom* contGeom=YADE_CAST<Dem3DofGeom*>(interaction->interactionGeometry.get());
-	assert(contGeom);
-
-	const shared_ptr<BodyMacroParameters>& elast1=static_pointer_cast<BodyMacroParameters>(pp1);
-	const shared_ptr<BodyMacroParameters>& elast2=static_pointer_cast<BodyMacroParameters>(pp2);
-
-	Real E12=2*elast1->young*elast2->young/(elast1->young+elast2->young); // harmonic Young's modulus average
-	//Real nu12=2*elast1->poisson*elast2->poisson/(elast1->poisson+elast2->poisson); // dtto for Poisson ratio 
-	Real minRad=(contGeom->refR1<=0?contGeom->refR2:(contGeom->refR2<=0?contGeom->refR1:min(contGeom->refR1,contGeom->refR2)));
-	Real S12=Mathr::PI*pow(minRad,2); // "surface" of interaction
-	//Real E=(E12 /* was here for Kn:  *S12/d0  */)*((1+alpha)/(beta*(1+nu12)+gamma*(1-alpha*nu12)));
-	//Real E=E12; // apply alpha, beta, gamma: garbage values of E !?
-
-	if(!neverDamage) { assert(!isnan(sigmaT)); }
-
-	shared_ptr<CpmPhys> contPhys(new CpmPhys());
-
-	contPhys->E=E12;
-	contPhys->G=E12*G_over_E;
-	contPhys->tanFrictionAngle=tan(.5*(elast1->frictionAngle+elast2->frictionAngle));
-	contPhys->undamagedCohesion=sigmaT;
-	contPhys->crossSection=S12;
-	contPhys->epsCrackOnset=epsCrackOnset;
-	contPhys->epsFracture=relDuctility*epsCrackOnset;
-	// inherited from NormalShearInteracion, used in the timestepper
-	contPhys->kn=contPhys->E*contPhys->crossSection;
-	contPhys->ks=contPhys->G*contPhys->crossSection;
-
-	if(neverDamage) contPhys->neverDamage=true;
-	if(cohesiveThresholdIter<0 || (Omega::instance().getCurrentIteration()<cohesiveThresholdIter)) contPhys->isCohesive=true;
-	else contPhys->isCohesive=false;
-	contPhys->dmgTau=dmgTau;
-	contPhys->dmgRateExp=dmgRateExp;
-	contPhys->plTau=plTau;
-	contPhys->plRateExp=plRateExp;
-	contPhys->isoPrestress=isoPrestress;
-
-	interaction->interactionPhysics=contPhys;
-}
-
-
-
-
-/********************** CpmPhys ****************************/
-CREATE_LOGGER(CpmPhys);
-
-// !! at least one virtual function in the .cpp file
-CpmPhys::~CpmPhys(){};
-
-CREATE_LOGGER(Law2_Dem3DofGeom_CpmPhys_Cpm);
-
-long CpmPhys::cummBetaIter=0, CpmPhys::cummBetaCount=0;
-
-Real CpmPhys::solveBeta(const Real c, const Real N){
-	#ifdef YADE_DEBUG
-		cummBetaCount++;
-	#endif
-	const int maxIter=20;
-	const Real maxError=1e-12;
-	Real f, ret=0.;
-	for(int i=0; i<maxIter; i++){
-		#ifdef YADE_DEBUG
-			cummBetaIter++;
-		#endif
-		Real aux=c*exp(N*ret)+exp(ret);
-		f=log(aux);
-		if(fabs(f)<maxError) return ret;
-		Real df=(c*N*exp(N*ret)+exp(ret))/aux;
-		ret-=f/df;
-	}
-	LOG_FATAL("No convergence after "<<maxIter<<" iters; c="<<c<<", N="<<N<<", ret="<<ret<<", f="<<f);
-	throw runtime_error("Law2_Dem3DofGeom_CpmPhys_Cpm::solveBeta failed to converge.");
-}
-
-Real CpmPhys::computeDmgOverstress(Real dt){
-	if(dmgStrain>=epsN*omega){ // unloading, no viscous stress
-		dmgStrain=epsN*omega;
-		LOG_TRACE("Elastic/unloading, no viscous overstress");
-		return 0.;
-	}
-	Real c=epsCrackOnset*(1-omega)*pow(dmgTau/dt,dmgRateExp)*pow(epsN*omega-dmgStrain,dmgRateExp-1.);
-	Real beta=solveBeta(c,dmgRateExp);
-	Real deltaDmgStrain=(epsN*omega-dmgStrain)*exp(beta);
-	dmgStrain+=deltaDmgStrain;
-	LOG_TRACE("deltaDmgStrain="<<deltaDmgStrain<<", viscous overstress "<<(epsN*omega-dmgStrain)*E);
-	/* σN=Kn(εN-εd); dmgOverstress=σN-(1-ω)*Kn*εN=…=Kn(ω*εN-εd) */
-	return (epsN*omega-dmgStrain)*E;
-}
-
-Real CpmPhys::computeViscoplScalingFactor(Real sigmaTNorm, Real sigmaTYield,Real dt){
-	if(sigmaTNorm<sigmaTYield) return 1.;
-	Real c=undamagedCohesion*pow(plTau/(G*dt),plRateExp)*pow(sigmaTNorm-sigmaTYield,plRateExp-1.);
-	Real beta=solveBeta(c,plRateExp);
-	//LOG_DEBUG("scaling factor "<<1.-exp(beta)*(1-sigmaTYield/sigmaTNorm));
-	return 1.-exp(beta)*(1-sigmaTYield/sigmaTNorm);
-}
-
-
-/********************** Law2_Dem3DofGeom_CpmPhys_Cpm ****************************/
-
-/// yield surface parameters
-int  Law2_Dem3DofGeom_CpmPhys_Cpm::yieldSurfType=2;
-Real Law2_Dem3DofGeom_CpmPhys_Cpm::yieldLogSpeed=.1;
-Real Law2_Dem3DofGeom_CpmPhys_Cpm::yieldEllipseShift=0.; // deprecated
-/// compressive plasticity parameters
-// approximates confinement -20MPa precisely, -100MPa a little over, -200 and -400 are OK (secant)
-Real Law2_Dem3DofGeom_CpmPhys_Cpm::epsSoft=-3e-3; // deactivated if >=0
-Real Law2_Dem3DofGeom_CpmPhys_Cpm::relKnSoft=.25;
-// >=1. to deactivate (never delete damaged contacts)
-Real Law2_Dem3DofGeom_CpmPhys_Cpm::omegaThreshold=1.;
-
-void Law2_Dem3DofGeom_CpmPhys_Cpm::go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, MetaBody* rootBody){
-	Dem3DofGeom* contGeom=static_cast<Dem3DofGeom*>(_geom.get());
-	CpmPhys* BC=static_cast<CpmPhys*>(_phys.get());
-
-	// shorthands
-		Real& epsN(BC->epsN); Real& epsNPl(BC->epsNPl); Vector3r& epsT(BC->epsT); Real& kappaD(BC->kappaD); Real& epsPlSum(BC->epsPlSum); const Real& E(BC->E); const Real& undamagedCohesion(BC->undamagedCohesion); const Real& tanFrictionAngle(BC->tanFrictionAngle); const Real& G(BC->G); const Real& crossSection(BC->crossSection); const Real& omegaThreshold(Law2_Dem3DofGeom_CpmPhys_Cpm::omegaThreshold); const Real& epsCrackOnset(BC->epsCrackOnset); Real& relResidualStrength(BC->relResidualStrength); const Real& dt=Omega::instance().getTimeStep();  const Real& epsFracture(BC->epsFracture); const bool& neverDamage(BC->neverDamage); const Real& dmgTau(BC->dmgTau); const Real& plTau(BC->plTau); const bool& isCohesive(BC->isCohesive);
-		Real& omega(BC->omega); Real& sigmaN(BC->sigmaN);  Vector3r& sigmaT(BC->sigmaT); Real& Fn(BC->Fn); Vector3r& Fs(BC->Fs); // for python access
-		const Real& yieldLogSpeed(Law2_Dem3DofGeom_CpmPhys_Cpm::yieldLogSpeed); const int& yieldSurfType(Law2_Dem3DofGeom_CpmPhys_Cpm::yieldSurfType);
-		const Real& yieldEllipseShift(Law2_Dem3DofGeom_CpmPhys_Cpm::yieldEllipseShift); 
-		const Real& epsSoft(Law2_Dem3DofGeom_CpmPhys_Cpm::epsSoft); 
-		const Real& relKnSoft(Law2_Dem3DofGeom_CpmPhys_Cpm::relKnSoft); 
-
-
-	epsN=contGeom->strainN(); epsT=contGeom->strainT();
-	
-	// debugging
-		#define YADE_VERIFY(condition) if(!(condition)){LOG_FATAL("Verification `"<<#condition<<"' failed!"); LOG_FATAL("in interaction #"<<I->getId1()<<"+#"<<I->getId2()); Omega::instance().saveSimulation("/tmp/verificationFailed.xml"); throw;}
-
-		#define NNAN(a) YADE_VERIFY(!isnan(a));
-		#define NNANV(v) YADE_VERIFY(!isnan(v[0])); assert(!isnan(v[1])); assert(!isnan(v[2]));
-		#ifdef YADE_DEBUG
-			if(isnan(epsN)){
-				LOG_FATAL("refLength="<<contGeom->refLength<<"; pos1="<<contGeom->se31.position<<"; pos2="<<contGeom->se32.position<<"; displacementN="<<contGeom->displacementN());
-			throw runtime_error("!! epsN==NaN !!");
-			}
-			NNAN(epsN); NNANV(epsT);
-		#endif
-		NNAN(epsN); NNANV(epsT);
-
-	// constitutive law 
-	#ifdef CPM_MATERIAL_MODEL
-		// complicated version
-		if(epsSoft>=0)	epsN+=BC->isoPrestress/E;
-		else{ // take softening into account for the prestress
-			Real sigmaSoft=E*epsSoft;
-			if(BC->isoPrestress>=sigmaSoft) epsN+=BC->isoPrestress/E; // on the non-softened branch yet
-			// otherwise take the regular and softened branches separately (different moduli)
-			else epsN+=sigmaSoft/E+(BC->isoPrestress-sigmaSoft)/(E*relKnSoft);
-		}
-		CPM_MATERIAL_MODEL
-	#else
-		// simplified public model
-		epsN+=BC->isoPrestress/E;
-		// very simplified version of the constitutive law
-		kappaD=max(max(0.,epsN),kappaD); // internal variable, max positive strain (non-decreasing)
-		omega=isCohesive?funcG(kappaD,epsCrackOnset,epsFracture,neverDamage):1.; // damage variable (non-decreasing, as funcG is also non-decreasing)
-		sigmaN=(1-(epsN>0?omega:0))*E*epsN; // damage taken in account in tension only
-		sigmaT=G*epsT; // trial stress
-		Real yieldSigmaT=max((Real)0.,undamagedCohesion*(1-omega)-sigmaN*tanFrictionAngle); // Mohr-Coulomb law with damage
-		if(sigmaT.SquaredLength()>yieldSigmaT*yieldSigmaT){
-			sigmaT*=yieldSigmaT/sigmaT.Length(); // stress return
-			epsPlSum+=yieldSigmaT*contGeom->slipToStrainTMax(yieldSigmaT/G); // adjust strain
-		}
-		relResidualStrength=isCohesive?(kappaD<epsCrackOnset?1.:(1-omega)*(kappaD)/epsCrackOnset):0;
-	#endif
-	sigmaN-=BC->isoPrestress;
-
-	NNAN(kappaD); NNAN(epsCrackOnset); NNAN(epsFracture); NNAN(omega);
-	NNAN(sigmaN); NNANV(sigmaT); NNAN(crossSection);
-
-	// handle broken contacts
-	if(epsN>0. && ((isCohesive && omega>omegaThreshold) || !isCohesive)){
-		if(isCohesive){
-			const shared_ptr<Body>& body1=Body::byId(I->getId1(),rootBody), body2=Body::byId(I->getId2(),rootBody); assert(body1); assert(body2);
-			const shared_ptr<CpmMat>& rbp1=YADE_PTR_CAST<CpmMat>(body1->physicalParameters), rbp2=YADE_PTR_CAST<CpmMat>(body2->physicalParameters);
-			// nice article about openMP::critical vs. scoped locks: http://www.thinkingparallel.com/2006/08/21/scoped-locking-vs-critical-in-openmp-a-personal-shootout/
-			{ boost::mutex::scoped_lock lock(rbp1->updateMutex); rbp1->numBrokenCohesive+=1; rbp1->epsPlBroken+=epsPlSum; }
-			{ boost::mutex::scoped_lock lock(rbp2->updateMutex); rbp2->numBrokenCohesive+=1; rbp2->epsPlBroken+=epsPlSum; }
-		}
-		rootBody->interactions->requestErase(I->getId1(),I->getId2());
-		return;
-	}
-
-	Fn=sigmaN*crossSection; BC->normalForce=Fn*contGeom->normal;
-	Fs=sigmaT*crossSection; BC->shearForce=Fs;
-
-	applyForceAtContactPoint(BC->normalForce+BC->shearForce, contGeom->contactPoint, I->getId1(), contGeom->se31.position, I->getId2(), contGeom->se32.position, rootBody);
-}
-
-#ifdef YADE_OPENGL
-	/********************** GLDrawCpmPhys ****************************/
-	#include<yade/lib-opengl/OpenGLWrapper.hpp>
-	#include<yade/lib-opengl/GLUtils.hpp>
-	#include<yade/lib-QGLViewer/qglviewer.h>
-
-	CREATE_LOGGER(GLDrawCpmPhys);
-
-	bool GLDrawCpmPhys::contactLine=true;
-	bool GLDrawCpmPhys::dmgLabel=true;
-	bool GLDrawCpmPhys::dmgPlane=false;
-	bool GLDrawCpmPhys::epsNLabel=true;
-	bool GLDrawCpmPhys::epsT=false;
-	bool GLDrawCpmPhys::epsTAxes=false;
-	bool GLDrawCpmPhys::normal=false;
-	bool GLDrawCpmPhys::colorStrain=false;
-
-
-	void GLDrawCpmPhys::go(const shared_ptr<InteractionPhysics>& ip, const shared_ptr<Interaction>& i, const shared_ptr<Body>& b1, const shared_ptr<Body>& b2, bool wireFrame){
-		const shared_ptr<CpmPhys>& BC=static_pointer_cast<CpmPhys>(ip);
-		const shared_ptr<Dem3DofGeom>& geom=YADE_PTR_CAST<Dem3DofGeom>(i->interactionGeometry);
-
-		//Vector3r lineColor(BC->omega,1-BC->omega,0.0); /* damaged links red, undamaged green */
-		Vector3r lineColor=Shop::scalarOnColorScale(1.-BC->relResidualStrength);
-
-		if(colorStrain) lineColor=Vector3r(
-			min((Real)1.,max((Real)0.,-BC->epsTrans/BC->epsCrackOnset)),
-			min((Real)1.,max((Real)0.,BC->epsTrans/BC->epsCrackOnset)),
-			min((Real)1.,max((Real)0.,abs(BC->epsTrans)/BC->epsCrackOnset-1)));
-
-		if(contactLine) GLUtils::GLDrawLine(b1->physicalParameters->dispSe3.position,b2->physicalParameters->dispSe3.position,lineColor);
-		if(dmgLabel){ GLUtils::GLDrawNum(BC->omega,0.5*(b1->physicalParameters->dispSe3.position+b2->physicalParameters->dispSe3.position),lineColor); }
-		else if(epsNLabel){ GLUtils::GLDrawNum(BC->epsN,0.5*(b1->physicalParameters->dispSe3.position+b2->physicalParameters->dispSe3.position),lineColor); }
-		if(BC->omega>0 && dmgPlane){
-			Real halfSize=sqrt(1-BC->relResidualStrength)*.5*.705*sqrt(BC->crossSection);
-			Vector3r midPt=.5*Vector3r(b1->physicalParameters->dispSe3.position+b2->physicalParameters->dispSe3.position);
-			glDisable(GL_CULL_FACE);
-			glPushMatrix();
-				glTranslatev(midPt);
-				Quaternionr q; q.Align(Vector3r::UNIT_Z,geom->normal);
-				Vector3r axis; Real angle; q.ToAxisAngle(axis,angle);
-				glRotatef(angle*Mathr::RAD_TO_DEG,axis[0],axis[1],axis[2]);
-				glBegin(GL_POLYGON);
-					glColor3v(lineColor); 
-					glVertex3d(halfSize,0.,0.);
-					glVertex3d(.5*halfSize,.866*halfSize,0.);
-					glVertex3d(-.5*halfSize,.866*halfSize,0.);
-					glVertex3d(-halfSize,0.,0.);
-					glVertex3d(-.5*halfSize,-.866*halfSize,0.);
-					glVertex3d(.5*halfSize,-.866*halfSize,0.);
-				glEnd();
-			glPopMatrix();
-		}
-
-		const Vector3r& cp=static_pointer_cast<Dem3DofGeom>(i->interactionGeometry)->contactPoint;
-		if(epsT){
-			Real maxShear=(BC->undamagedCohesion-BC->sigmaN*BC->tanFrictionAngle)/BC->G;
-			Real relShear=BC->epsT.Length()/maxShear;
-			Real scale=.5*geom->refLength;
-			Vector3r dirShear=BC->epsT; dirShear.Normalize();
-			if(epsTAxes){
-				GLUtils::GLDrawLine(cp-Vector3r(scale,0,0),cp+Vector3r(scale,0,0));
-				GLUtils::GLDrawLine(cp-Vector3r(0,scale,0),cp+Vector3r(0,scale,0));
-				GLUtils::GLDrawLine(cp-Vector3r(0,0,scale),cp+Vector3r(0,0,scale));
-			}
-			GLUtils::GLDrawArrow(cp,cp+dirShear*relShear*scale,Vector3r(1.,0.,0.));
-			GLUtils::GLDrawLine(cp+dirShear*relShear*scale,cp+dirShear*scale,Vector3r(.3,.3,.3));
-
-			/* normal strain */ GLUtils::GLDrawArrow(cp,cp+geom->normal*(BC->epsN/maxShear),Vector3r(0.,1.,0.));
-		}
-		//if(normal) GLUtils::GLDrawArrow(cp,cp+geom->normal*.5*BC->equilibriumDist,Vector3r(0.,1.,0.));
-	}
-#endif
-
-/********************** CpmGlobalCharacteristics ****************************/
-
-CREATE_LOGGER(CpmGlobalCharacteristics);
-void CpmGlobalCharacteristics::compute(MetaBody* rb, bool useMaxForce){
-	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)
-	Real sumF=0,maxF=0,currF;
-	FOREACH(const shared_ptr<Body>& b, *rb->bodies){
-	CpmMat* bpp(YADE_CAST<CpmMat*>(b->physicalParameters.get()));
-		bpp->epsVolumetric=0;
-		bpp->numContacts=0;
-		currF=rb->bex.getForce(b->id).Length(); maxF=max(currF,maxF); sumF+=currF;
-	}
-	Real meanF=sumF/rb->bodies->size(); 
-
-	// commulate normal strains from contacts
-	// get max force on contacts
-	Real maxContactF=0;
-	FOREACH(const shared_ptr<Interaction>& I, *rb->interactions){
-		if(!I->isReal()) continue;
-		shared_ptr<CpmPhys> BC=YADE_PTR_CAST<CpmPhys>(I->interactionPhysics); assert(BC);
-		maxContactF=max(maxContactF,max(BC->Fn,BC->Fs.Length()));
-		CpmMat* bpp1(YADE_CAST<CpmMat*>(Body::byId(I->getId1())->physicalParameters.get()));
-		CpmMat* bpp2(YADE_CAST<CpmMat*>(Body::byId(I->getId2())->physicalParameters.get()));
-		bpp1->epsVolumetric+=BC->epsN; bpp1->numContacts+=1;
-		bpp2->epsVolumetric+=BC->epsN; bpp2->numContacts+=1;
-	}
-	unbalancedForce=(useMaxForce?maxF:meanF)/maxContactF;
-
-	FOREACH(const shared_ptr<Interaction>& I, *rb->interactions){
-		if(!I->isReal()) continue;
-		shared_ptr<CpmPhys> BC=YADE_PTR_CAST<CpmPhys>(I->interactionPhysics); assert(BC);
-		CpmMat* bpp1(YADE_CAST<CpmMat*>(Body::byId(I->getId1())->physicalParameters.get()));
-		CpmMat* bpp2(YADE_CAST<CpmMat*>(Body::byId(I->getId2())->physicalParameters.get()));
-		Real epsVolAvg=.5*((3./bpp1->numContacts)*bpp1->epsVolumetric+(3./bpp2->numContacts)*bpp2->epsVolumetric);
-		BC->epsTrans=(epsVolAvg-BC->epsN)/2.;
-		//TRVAR5(I->getId1(),I->getId2(),BC->epsTrans,(3./bpp1->numContacts)*bpp1->epsVolumetric,(3./bpp2->numContacts)*bpp2->epsVolumetric);
-		//TRVAR4(bpp1->numContacts,bpp1->epsVolumetric,bpp2->numContacts,bpp2->epsVolumetric);
-	}
-	#if 0
-		FOREACH(const shared_ptr<Body>& b, *rb->bodies){
-			CpmMat* bpp(YADE_PTR_CAST<CpmMat>(b->physicalParameters.get()));
-			bpp->epsVolumeric*=3/bpp->numContacts;
-		}
-	#endif
-}
-
-
-/********************** CpmPhysDamageColorizer ****************************/
-CREATE_LOGGER(CpmPhysDamageColorizer);
-void CpmPhysDamageColorizer::action(MetaBody* rootBody){
-	//vector<pair<short,Real> > bodyDamage; /* number of cohesive interactions per body; cummulative damage of interactions */
-	//vector<pair<short,
-	vector<BodyStats> bodyStats; bodyStats.resize(rootBody->bodies->size());
-	assert(bodyStats[0].nCohLinks==0); // should be initialized by dfault ctor
-	FOREACH(const shared_ptr<Interaction>& I, *rootBody->interactions){
-		shared_ptr<CpmPhys> BC=dynamic_pointer_cast<CpmPhys>(I->interactionPhysics);
-		if(!BC || !BC->isCohesive) continue;
-		const body_id_t id1=I->getId1(), id2=I->getId2();
-		bodyStats[id1].nCohLinks++; bodyStats[id1].dmgSum+=(1-BC->relResidualStrength); bodyStats[id1].epsPlSum+=BC->epsPlSum;
-		bodyStats[id2].nCohLinks++; bodyStats[id2].dmgSum+=(1-BC->relResidualStrength); bodyStats[id2].epsPlSum+=BC->epsPlSum;
-		maxOmega=max(maxOmega,BC->omega);
-	}
-	FOREACH(shared_ptr<Body> B, *rootBody->bodies){
-		const body_id_t& id=B->getId();
-		// add damaged contacts that have already been deleted
-		CpmMat* bpp=dynamic_cast<CpmMat*>(B->physicalParameters.get());
-		if(!bpp) continue;
-		int cohLinksWhenever=bodyStats[id].nCohLinks+bpp->numBrokenCohesive;
-		if(cohLinksWhenever>0){
-			bpp->normDmg=(bodyStats[id].dmgSum+bpp->numBrokenCohesive)/cohLinksWhenever;
-			bpp->normEpsPl=(bodyStats[id].epsPlSum+bpp->epsPlBroken)/cohLinksWhenever;
-			if(bpp->normDmg>1){
-				LOG_WARN("#"<<id<<" normDmg="<<bpp->normDmg<<" nCohLinks="<<bodyStats[id].nCohLinks<<", numBrokenCohesive="<<bpp->numBrokenCohesive<<", dmgSum="<<bodyStats[id].dmgSum<<", numAllCohLinks"<<cohLinksWhenever);
-			}
-		}
-		else { bpp->normDmg=0; bpp->normEpsPl=0;}
-		B->geometricalModel->diffuseColor=Vector3r(bpp->normDmg,1-bpp->normDmg,B->isDynamic?0:1);
-	}
-}
-

Deleted: trunk/pkg/dem/ConcretePM.hpp
===================================================================
--- trunk/pkg/dem/ConcretePM.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/ConcretePM.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,320 +0,0 @@
-// 2008 © Václav Šmilauer <eudoxos@xxxxxxxx> 
-
-/*
-
-=== HIGH LEVEL OVERVIEW OF CPM ===
-
-Concrete Particle Model (ConcretePM, Cpm) is a set of classes for modelling
-mechanical behavior of concrete. Several classes are needed for Cpm.
-
-1. CpmMat (Cpm material) deriving from BodyMacroParameters, which additionally has
-   some information about damage on the body, cummulative plastic strain etc.
-
-2.	Ip2_CpmMat_CpmMat_CpmPhys is 2-ary functor for creating CpmPhys from CpmMat's of
-	2 bodies that collide. Some parameters of the CpmPhys created are computed from
-	CpmMat's, others are passed as parameters of the functor.
-
-3. CpmPhys (Cpm (interaction)Physics) holds various parameters as well as internal
-   variables of the contact that can change as result of plasticity, damage, viscosity.
-
-4. Law2_Dem3Dof_CpmPhys_Cpm is constitutive law that takes geometry of the interaction
-	(Dem3Dof, which can be either Dem3Dof_SphereSphere or Dem3Dof_FacetSphere) and
-	CpmPhys, computing forces on both bodies and updating contact variables.
-
-	The model itself is defined in the macro CPM_MATERIAL_MODEL, but due to 
-	commercial reasons, those about 30 lines of code cannot be disclosed now and the macro
-	is defined in an external file. The model will be, however, described in enough detail
-	in my thesis (once it is written), along
-	with calibration procedures; it features damage, plasticity and viscosity
-	and is quite tunable (rigidity, poisson's	ratio, compressive/tensile strength
-	ratio, fracture energy, behavior under confinement, rate-dependence).
-
-There are other classes, which are not strictly necessary:
-
- * CpmGlobalCharacteristics computes a few information about individual bodies based on
-   interactions they are involved in. It is probably quite useless now since volumetricStrain
-	is not used in the constitutive law anymore.
-
- * GLDrawCpmPhys draws interaction physics (color for damage and a few other); rarely used, though.
-
- * CpmPhysDamageColorizer changes bodies' colors depending on average damage of their interactions
-   and number of interactions that were already fully broken and have disappeared. This engine
-	contains its own loop (2 loops, more precisely) over all bodies and is run periodically
-	to update colors.
-
-*/
-
-#pragma once
-
-#include<yade/pkg-common/RigidBodyParameters.hpp>
-#include<yade/pkg-dem/BodyMacroParameters.hpp>
-#include<yade/pkg-common/InteractionPhysicsEngineUnit.hpp>
-#include<yade/pkg-dem/SpheresContactGeometry.hpp>
-#include<yade/pkg-common/PeriodicEngines.hpp>
-#include<yade/pkg-common/NormalShearInteractions.hpp>
-#include<yade/pkg-common/ConstitutiveLaw.hpp>
-
-/* This class holds information associated with each body */
-class CpmMat: public BodyMacroParameters {
-	public:
-		//! volumetric strain around this body
-		Real epsVolumetric;
-		//! number of (cohesive) contacts that damaged completely
-		int numBrokenCohesive;
-		//! number of contacts with this body
-		int numContacts;
-		//! average damage including already deleted contacts (it is really not damage, but 1-relResidualStrength now)
-		Real normDmg;
-		//! plastic strain on contacts already deleted
-		Real epsPlBroken;
-		//! sum of plastic strains normalized by number of contacts
-		Real normEpsPl;
-		CpmMat(): epsVolumetric(0.), numBrokenCohesive(0), numContacts(0), normDmg(0.), epsPlBroken(0.), normEpsPl(0.) {createIndex();};
-		REGISTER_ATTRIBUTES(BodyMacroParameters, (epsVolumetric) (numBrokenCohesive) (numContacts) (normDmg) (epsPlBroken) (normEpsPl));
-		REGISTER_CLASS_AND_BASE(CpmMat,BodyMacroParameters);
-};
-REGISTER_SERIALIZABLE(CpmMat);
-
-
-/*! @brief representation of a single interaction of the CPM type: storage for relevant parameters.
- *
- * Evolution of the contact is governed by Law2_Dem3DofGeom_CpmPhys_Cpm:
- * that includes damage effects and chages of parameters inside CpmPhys.
- *
- */
-class CpmPhys: public NormalShearInteraction {
-	private:
-	public:
-		/*! Fundamental parameters (constants) */
-		Real
-			//! normal modulus (stiffness / crossSection)
-			E,
-			//! shear modulus
-			G,
-			//! tangens of internal friction angle
-			tanFrictionAngle, 
-			//! virgin material cohesion
-			undamagedCohesion,
-			//! equivalent cross-section associated with this contact
-			crossSection,
-			//! strain at which the material starts to behave non-linearly
-			epsCrackOnset,
-			//! strain where the damage-evolution law tangent from the top (epsCrackOnset) touches the axis;
-			/// since the softening law is exponential, this doesn't mean that the contact is fully damaged at this point,
-			/// that happens only asymptotically 
-			epsFracture,
-			//! characteristic time for damage (if non-positive, the law without rate-dependence is used)
-			dmgTau,
-			//! exponent in the rate-dependent damage evolution
-			dmgRateExp,
-			//! damage strain (at previous or current step)
-			dmgStrain,
-			//! damage viscous overstress (at previous step or at current step)
-			dmgOverstress,
-			//! characteristic time for viscoplasticity (if non-positive, no rate-dependence for shear)
-			plTau,
-			//! exponent in the rate-dependent viscoplasticity
-			plRateExp,
-			//! "prestress" of this link (used to simulate isotropic stress)
-			isoPrestress;
-		/*! Up to now maximum normal strain (semi-norm), non-decreasing in time. */
-		Real kappaD;
-		//! normal plastic strain (initially zero)
-		Real epsNPl;
-		/*! Transversal strain (perpendicular to the contact axis) */
-		Real epsTrans;
-		/*! if not cohesive, interaction is deleted when distance is greater than zero. */
-		bool isCohesive;
-		/*! the damage evlution function will always return virgin state */
-		bool neverDamage;
-		/*! cummulative shear plastic strain measure (scalar) on this contact */
-		Real epsPlSum;
-		//! debugging, to see convergence rate
-		static long cummBetaIter, cummBetaCount;
-
-		/*! auxiliary variable for visualization, recalculated in Law2_Dem3DofGeom_CpmPhys_Cpm at every iteration */
-		// Fn and Fs are also stored as Vector3r normalForce, shearForce in NormalShearInteraction 
-		Real omega, Fn, sigmaN, epsN, relResidualStrength; Vector3r epsT, sigmaT, Fs;
-
-
-		static Real solveBeta(const Real c, const Real N);
-		Real computeDmgOverstress(Real dt);
-		Real computeViscoplScalingFactor(Real sigmaTNorm, Real sigmaTYield,Real dt);
-
-
-
-		CpmPhys(): NormalShearInteraction(),E(0), G(0), tanFrictionAngle(0), undamagedCohesion(0), crossSection(0), dmgTau(-1), dmgRateExp(0), dmgStrain(0), plTau(-1), plRateExp(0), isoPrestress(0.), kappaD(0.), epsNPl(0.), epsTrans(0.), epsPlSum(0.) { createIndex(); epsT=Vector3r::ZERO; isCohesive=false; neverDamage=false; omega=0; Fn=0; Fs=Vector3r::ZERO; epsPlSum=0; dmgOverstress=0; }
-		virtual ~CpmPhys();
-
-		REGISTER_ATTRIBUTES(NormalShearInteraction,
-			(E)
-			(G)
-			(tanFrictionAngle)
-			(undamagedCohesion)
-			(crossSection)
-			(epsCrackOnset)
-			(epsFracture)
-			(dmgTau)
-			(dmgRateExp)
-			(dmgStrain)
-			(dmgOverstress)
-			(plTau)
-			(plRateExp)
-			(isoPrestress)
-
-			(cummBetaIter)
-			(cummBetaCount)
-
-			(kappaD)
-			(epsNPl)
-			(neverDamage)
-			(epsT)
-			(epsTrans)
-			(epsPlSum)
-
-			(isCohesive)
-
-			// auxiliary params to make them accessible from python
-			(omega)
-			(Fn)
-			(Fs)
-			(epsN)
-			(sigmaN)
-			(sigmaT)
-			(relResidualStrength)
-		);
-	REGISTER_CLASS_AND_BASE(CpmPhys,NormalShearInteraction);
-	DECLARE_LOGGER;
-};
-REGISTER_SERIALIZABLE(CpmPhys);
-
-
-/*! @brief Convert macroscopic properties to CpmPhys with corresponding parameters.
- *
- * */
-class Ip2_CpmMat_CpmMat_CpmPhys: public InteractionPhysicsEngineUnit{
-	private:
-	public:
-		/* nonelastic material parameters */
-		/* alternatively (and more cleanly), we would have subclass of ElasticBodyParameters,
-		 * which would define just those in addition to the elastic ones.
-		 * This might be done later, for now hardcode that here. */
-		/* uniaxial tension resistance, bending parameter of the damage evolution law, whear weighting constant for epsT in the strain seminorm (kappa) calculation. Default to NaN so that user gets loudly notified it was not set.
-		
-		*/
-		Real sigmaT, epsCrackOnset, relDuctility, G_over_E, tau, expDmgRate, dmgTau, dmgRateExp, plTau, plRateExp, isoPrestress;
-		//! Should new contacts be cohesive? They will before this iter#, they will not be afterwards. If 0, they will never be. If negative, they will always be created as cohesive.
-		long cohesiveThresholdIter;
-		//! Create contacts that don't receive any damage (CpmPhys::neverDamage=true); defaults to false
-		bool neverDamage;
-
-		Ip2_CpmMat_CpmMat_CpmPhys(){
-			// init to signaling_NaN to force crash if not initialized (better than unknowingly using garbage values)
-			sigmaT=epsCrackOnset=relDuctility=G_over_E=std::numeric_limits<Real>::signaling_NaN();
-			neverDamage=false;
-			cohesiveThresholdIter=10;
-			dmgTau=-1; dmgRateExp=0; plTau=-1; plRateExp=-1;
-			isoPrestress=0;
-		}
-
-		virtual void go(const shared_ptr<PhysicalParameters>& pp1, const shared_ptr<PhysicalParameters>& pp2, const shared_ptr<Interaction>& interaction);
-		REGISTER_ATTRIBUTES(InteractionPhysicsEngineUnit,
-			(cohesiveThresholdIter)
-			(G_over_E)
-			(sigmaT)
-			(neverDamage)
-			(epsCrackOnset)
-			(relDuctility)
-			(dmgTau)
-			(dmgRateExp)
-			(plTau)
-			(plRateExp)
-			(isoPrestress)
-		);
-
-		FUNCTOR2D(CpmMat,CpmMat);
-		REGISTER_CLASS_AND_BASE(Ip2_CpmMat_CpmMat_CpmPhys,InteractionPhysicsEngineUnit);
-		DECLARE_LOGGER;
-};
-REGISTER_SERIALIZABLE(Ip2_CpmMat_CpmMat_CpmPhys);
-
-
-
-class Law2_Dem3DofGeom_CpmPhys_Cpm: public ConstitutiveLaw{
-	public:
-	/*! Damage evolution law */
-	static Real funcG(const Real& kappaD, const Real& epsCrackOnset, const Real& epsFracture, const bool& neverDamage) {
-		if(kappaD<epsCrackOnset || neverDamage) return 0;
-		return 1.-(epsCrackOnset/kappaD)*exp(-(kappaD-epsCrackOnset)/epsFracture);
-	}
-		//! yield function: 0: mohr-coulomb (original); 1: parabolic; 2: logarithmic, 3: log+lin_tension, 4: elliptic, 5: elliptic+log
-		static int yieldSurfType;
-		//! scaling in the logarithmic yield surface (should be <1 for realistic results; >=0 for meaningful results)
-		static Real yieldLogSpeed;
-		//! horizontal scaling of the ellipse (shifts on the +x axis as interactions with +y are given)
-		static Real yieldEllipseShift;
-		//! damage after which the contact disappears (<1), since omega reaches 1 only for strain →+∞
-		static Real omegaThreshold;
-		//! Strain at which softening in compression starts (set to 0. (default) or positive value to deactivate)
-		static Real epsSoft;
-		//! Relative rigidity of the softening branch in compression (0=perfect elastic-plastic, 1=no softening, >1=hardening)
-		static Real relKnSoft;
-		Law2_Dem3DofGeom_CpmPhys_Cpm() { }
-		void go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, MetaBody* rootBody);
-	FUNCTOR2D(Dem3DofGeom,CpmPhys);
-	REGISTER_CLASS_AND_BASE(Law2_Dem3DofGeom_CpmPhys_Cpm,ConstitutiveLaw);
-	REGISTER_ATTRIBUTES(ConstitutiveLaw,(yieldSurfType)(yieldLogSpeed)(yieldEllipseShift)(omegaThreshold)(epsSoft)(relKnSoft));
-	DECLARE_LOGGER;
-};
-REGISTER_SERIALIZABLE(Law2_Dem3DofGeom_CpmPhys_Cpm);
-
-/* Engine encompassing several computations looping over all bodies/interactions
- *
- * * Compute and store unbalanced force over the whole simulation.
- * * Compute and store volumetric strain for every body.
- *
- * May be extended in the future to compute global stiffness etc as well.
- */
-class CpmGlobalCharacteristics: public PeriodicEngine{
-	public:
-		bool useMaxForce; // use maximum unbalanced force instead of mean unbalanced force
-		Real unbalancedForce;
-		void compute(MetaBody* rb, bool useMax=false);
-		virtual void action(MetaBody* rb){compute(rb,useMaxForce);}
-		CpmGlobalCharacteristics(){};
-	REGISTER_ATTRIBUTES(PeriodicEngine,
-		(unbalancedForce)
-		(useMaxForce)
-	);
-	DECLARE_LOGGER;
-	REGISTER_CLASS_AND_BASE(CpmGlobalCharacteristics,PeriodicEngine);
-};
-REGISTER_SERIALIZABLE(CpmGlobalCharacteristics);
-
-#ifdef YADE_OPENGL
-	#include<yade/pkg-common/GLDrawFunctors.hpp>
-	class GLDrawCpmPhys: public GLDrawInteractionPhysicsFunctor {
-		public: virtual void go(const shared_ptr<InteractionPhysics>&,const shared_ptr<Interaction>&,const shared_ptr<Body>&,const shared_ptr<Body>&,bool wireFrame);
-		virtual ~GLDrawCpmPhys() {};
-		REGISTER_ATTRIBUTES(/*no base*/,(contactLine)(dmgLabel)(dmgPlane)(epsT)(epsTAxes)(normal)(colorStrain)(epsNLabel));
-		RENDERS(CpmPhys);
-		REGISTER_CLASS_AND_BASE(GLDrawCpmPhys,GLDrawInteractionPhysicsFunctor);
-		DECLARE_LOGGER;
-		static bool contactLine,dmgLabel,dmgPlane,epsT,epsTAxes,normal,colorStrain,epsNLabel;
-	};
-	REGISTER_SERIALIZABLE(GLDrawCpmPhys);
-#endif
-
-class CpmPhysDamageColorizer: public PeriodicEngine {
-	struct BodyStats{ int nCohLinks; Real dmgSum; Real epsPlSum; BodyStats(): nCohLinks(0), dmgSum(0.), epsPlSum(0.){} };
-	public:
-		//! maximum damage over all contacts
-		Real maxOmega;
-		CpmPhysDamageColorizer(){maxOmega=0; /* run at the very beginning */ initRun=true;}
-		virtual void action(MetaBody*);
-	DECLARE_LOGGER;
-	REGISTER_ATTRIBUTES(PeriodicEngine,(maxOmega));
-	REGISTER_CLASS_AND_BASE(CpmPhysDamageColorizer,PeriodicEngine);
-};
-REGISTER_SERIALIZABLE(CpmPhysDamageColorizer);
-

Modified: trunk/pkg/dem/DataClass/Clump.cpp
===================================================================
--- trunk/pkg/dem/DataClass/Clump.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/DataClass/Clump.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -332,7 +332,7 @@
  **************************************************************************************/
 
 #include<yade/core/MetaBody.hpp>
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 
 bool ClumpTestGen::generate()
 {

Modified: trunk/pkg/dem/DataClass/InteractingGeometry/InteractingMyTetrahedron.cpp
===================================================================
--- trunk/pkg/dem/DataClass/InteractingGeometry/InteractingMyTetrahedron.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/DataClass/InteractingGeometry/InteractingMyTetrahedron.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -19,4 +19,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingMyTetrahedron");
\ No newline at end of file

Modified: trunk/pkg/dem/DataClass/InteractionGeometry/InteractionOfMyTetrahedron.cpp
===================================================================
--- trunk/pkg/dem/DataClass/InteractionGeometry/InteractionOfMyTetrahedron.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/DataClass/InteractionGeometry/InteractionOfMyTetrahedron.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -18,4 +18,4 @@
 {
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractionOfMyTetrahedron");
\ No newline at end of file

Modified: trunk/pkg/dem/DataClass/InteractionGeometry/SDECLinkGeometry.cpp
===================================================================
--- trunk/pkg/dem/DataClass/InteractionGeometry/SDECLinkGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/DataClass/InteractionGeometry/SDECLinkGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -19,4 +19,4 @@
 {
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("SDECLinkGeometry");
\ No newline at end of file

Modified: trunk/pkg/dem/DataClass/InteractionPhysics/CapillaryParameters.hpp
===================================================================
--- trunk/pkg/dem/DataClass/InteractionPhysics/CapillaryParameters.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/DataClass/InteractionPhysics/CapillaryParameters.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -7,7 +7,7 @@
 *************************************************************************/
 #pragma once
 //#include <yade/core/InteractionPhysics.hpp>
-#include <yade/pkg-dem/ElasticContactInteraction.hpp>
+#include<yade/pkg-dem/ElasticContactInteraction.hpp>
 
 class CapillaryParameters : public ElasticContactInteraction
 {

Modified: trunk/pkg/dem/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.cpp
===================================================================
--- trunk/pkg/dem/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -52,4 +52,4 @@
 // }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("CohesiveFrictionalContactInteraction");
\ No newline at end of file

Modified: trunk/pkg/dem/DataClass/InteractionPhysics/ContactLaw1Interaction.cpp
===================================================================
--- trunk/pkg/dem/DataClass/InteractionPhysics/ContactLaw1Interaction.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/DataClass/InteractionPhysics/ContactLaw1Interaction.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -46,4 +46,4 @@
 // }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("ContactLaw1Interaction");
\ No newline at end of file

Modified: trunk/pkg/dem/DataClass/InteractionPhysics/ElasticContactInteraction.cpp
===================================================================
--- trunk/pkg/dem/DataClass/InteractionPhysics/ElasticContactInteraction.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/DataClass/InteractionPhysics/ElasticContactInteraction.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -10,6 +10,5 @@
 {
 }
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("ElasticContactInteraction");
 //YADE_PLUGIN("ElasticContactInteraction");

Modified: trunk/pkg/dem/DataClass/InteractionPhysics/SDECLinkPhysics.cpp
===================================================================
--- trunk/pkg/dem/DataClass/InteractionPhysics/SDECLinkPhysics.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/DataClass/InteractionPhysics/SDECLinkPhysics.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -30,4 +30,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("SDECLinkPhysics");
\ No newline at end of file

Modified: trunk/pkg/dem/DataClass/InteractionPhysics/ViscoelasticInteraction.cpp
===================================================================
--- trunk/pkg/dem/DataClass/InteractionPhysics/ViscoelasticInteraction.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/DataClass/InteractionPhysics/ViscoelasticInteraction.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -18,4 +18,4 @@
 {
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("ViscoelasticInteraction");
\ No newline at end of file

Modified: trunk/pkg/dem/DataClass/PhysicalParameters/BodyMacroParameters.cpp
===================================================================
--- trunk/pkg/dem/DataClass/PhysicalParameters/BodyMacroParameters.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/DataClass/PhysicalParameters/BodyMacroParameters.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -19,4 +19,4 @@
 {
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("BodyMacroParameters");
\ No newline at end of file

Modified: trunk/pkg/dem/DataClass/PhysicalParameters/CohesiveFrictionalBodyParameters.cpp
===================================================================
--- trunk/pkg/dem/DataClass/PhysicalParameters/CohesiveFrictionalBodyParameters.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/DataClass/PhysicalParameters/CohesiveFrictionalBodyParameters.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -19,4 +19,4 @@
 {
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("CohesiveFrictionalBodyParameters");
\ No newline at end of file

Modified: trunk/pkg/dem/DataClass/PhysicalParameters/SimpleViscoelasticBodyParameters.cpp
===================================================================
--- trunk/pkg/dem/DataClass/PhysicalParameters/SimpleViscoelasticBodyParameters.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/DataClass/PhysicalParameters/SimpleViscoelasticBodyParameters.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -17,5 +17,4 @@
 {
 }
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("SimpleViscoelasticBodyParameters");

Modified: trunk/pkg/dem/Engine/DeusExMachina/CapillaryPressureEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/CapillaryPressureEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/CapillaryPressureEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -48,4 +48,4 @@
 	
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("CapillaryPressureEngine");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/DeusExMachina/CapillaryRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/CapillaryRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/CapillaryRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -106,4 +106,4 @@
 	
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("CapillaryRecorder");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/DeusExMachina/CapillaryStressRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/CapillaryStressRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/CapillaryStressRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -236,4 +236,4 @@
 	
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("CapillaryStressRecorder");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/DeusExMachina/ContactStressRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/ContactStressRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/ContactStressRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -330,4 +330,4 @@
 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("ContactStressRecorder");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/FlowEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -78,4 +78,4 @@
     }
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("FlowEngine");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/HydraulicForceEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -17,7 +17,7 @@
 #include <yade/core/MetaBody.hpp>
 #include <yade/pkg-dem/CohesiveFrictionalBodyParameters.hpp>
 #include <vector>
-#include <yade/extra/Shop.hpp>
+#include <yade/pkg-dem/Shop.hpp>
 #include<yade/pkg-common/InteractingSphere.hpp>
 
 vector<Real> initialPositions;
@@ -176,4 +176,4 @@
     }
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("HydraulicForceEngine");

Modified: trunk/pkg/dem/Engine/DeusExMachina/SampleCapillaryPressureEngine.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/SampleCapillaryPressureEngine.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/SampleCapillaryPressureEngine.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -12,7 +12,7 @@
 #include<yade/core/DeusExMachina.hpp>
 #include <Wm3Vector3.h>
 #include<yade/lib-base/yadeWm3.hpp>
-#include "TriaxialStressController.hpp"
+#include<yade/pkg-dem/TriaxialStressController.hpp>
 #include <string>
 
 /*! \brief Isotropic compression + suction variation test */

Modified: trunk/pkg/dem/Engine/DeusExMachina/StaticSpheresAttractionEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/StaticSpheresAttractionEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/StaticSpheresAttractionEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -52,4 +52,4 @@
 };
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("StaticSpheresAttractionEngine");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/DeusExMachina/ThreeDTriaxialEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/ThreeDTriaxialEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/ThreeDTriaxialEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -14,7 +14,7 @@
 #include<yade/lib-base/yadeWm3Extra.hpp>
 #include<boost/lexical_cast.hpp>
 #include<boost/lambda/lambda.hpp>
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 #include<yade/core/Interaction.hpp>
 #include<yade/pkg-common/Sphere.hpp>
 #include<yade/pkg-common/ParticleParameters.hpp>
@@ -217,5 +217,4 @@
 
  
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("ThreeDTriaxialEngine");

Modified: trunk/pkg/dem/Engine/DeusExMachina/ThreeDTriaxialEngine.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/ThreeDTriaxialEngine.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/ThreeDTriaxialEngine.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -10,10 +10,9 @@
 #pragma once
 
 #include<yade/core/DeusExMachina.hpp>
-#include <Wm3Vector3.h>
 #include<yade/lib-base/yadeWm3.hpp>
-#include "TriaxialStressController.hpp"
-#include <string>
+#include<yade/pkg-dem/TriaxialStressController.hpp>
+#include<string>
 
 
 

Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -13,7 +13,7 @@
 #include<yade/lib-base/yadeWm3Extra.hpp>
 #include<boost/lexical_cast.hpp>
 #include<boost/lambda/lambda.hpp>
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 #include<yade/core/Interaction.hpp>
 #include<yade/pkg-common/Sphere.hpp>
 #include<yade/pkg-common/ParticleParameters.hpp>
@@ -327,5 +327,4 @@
 
  
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("TriaxialCompressionEngine");

Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialCompressionEngine.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -10,10 +10,9 @@
 #pragma once
 
 #include<yade/core/DeusExMachina.hpp>
-#include <Wm3Vector3.h>
 #include<yade/lib-base/yadeWm3.hpp>
-#include "TriaxialStressController.hpp"
-#include <string>
+#include<yade/pkg-dem/TriaxialStressController.hpp>
+#include<string>
 
 
 

Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialStateRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialStateRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialStateRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -297,4 +297,4 @@
 
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("TriaxialStateRecorder");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/TriaxialStressController.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -411,4 +411,4 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("TriaxialStressController");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/DeusExMachina/WallStressRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/DeusExMachina/WallStressRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/DeusExMachina/WallStressRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -90,4 +90,4 @@
 	
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("WallStressRecorder");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/BasicViscoelasticRelationships.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/BasicViscoelasticRelationships.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/BasicViscoelasticRelationships.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -99,4 +99,4 @@
     contactPhysics->prevNormal = Vector3r(0,0,0);
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("BasicViscoelasticRelationships");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/CL1Relationships.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/CL1Relationships.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/CL1Relationships.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -186,4 +186,4 @@
 		}
 	}
 };
-YADE_PLUGIN();
+YADE_PLUGIN("CL1Relationships");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/CohesiveFrictionalRelationships.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/CohesiveFrictionalRelationships.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/CohesiveFrictionalRelationships.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -192,4 +192,4 @@
 		}
 	}
 };
-YADE_PLUGIN();
+YADE_PLUGIN("CohesiveFrictionalRelationships");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/InteractingBox2InteractingSphere4SpheresContactGeometry.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/InteractingBox2InteractingSphere4SpheresContactGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/InteractingBox2InteractingSphere4SpheresContactGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -165,4 +165,4 @@
 	return go(cm2,cm1,se32,se31,c);
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingBox2InteractingSphere4SpheresContactGeometry");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/InteractingFacet2InteractingSphere4SpheresContactGeometry.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/InteractingFacet2InteractingSphere4SpheresContactGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/InteractingFacet2InteractingSphere4SpheresContactGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -128,4 +128,4 @@
 	return go(cm2,cm1,se32,se31,c);
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingFacet2InteractingSphere4SpheresContactGeometry");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/InteractingMyTetrahedron2AABB.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/InteractingMyTetrahedron2AABB.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/InteractingMyTetrahedron2AABB.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -43,4 +43,4 @@
 	aabb->max = max;	
 }
 	
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingMyTetrahedron2AABB");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/InteractingMyTetrahedron2InteractingBox4InteractionOfMyTetrahedron.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/InteractingMyTetrahedron2InteractingBox4InteractionOfMyTetrahedron.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/InteractingMyTetrahedron2InteractingBox4InteractionOfMyTetrahedron.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -130,4 +130,4 @@
 	return isInteracting;
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingMyTetrahedron2InteractingBox4InteractionOfMyTetrahedron");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/InteractingMyTetrahedron2InteractingMyTetrahedron4InteractionOfMyTetrahedron.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/InteractingMyTetrahedron2InteractingMyTetrahedron4InteractionOfMyTetrahedron.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/InteractingMyTetrahedron2InteractingMyTetrahedron4InteractionOfMyTetrahedron.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -90,4 +90,4 @@
 	return isInteracting;
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingMyTetrahedron2InteractingMyTetrahedron4InteractionOfMyTetrahedron");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/InteractingSphere2InteractingSphere4SpheresContactGeometry.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/InteractingSphere2InteractingSphere4SpheresContactGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/InteractingSphere2InteractingSphere4SpheresContactGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -60,4 +60,4 @@
 	return go(cm1,cm2,se31,se32,c);
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingSphere2InteractingSphere4SpheresContactGeometry");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/MacroMicroElasticRelationships.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/MacroMicroElasticRelationships.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/MacroMicroElasticRelationships.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -121,4 +121,4 @@
 		}
 	}
 };
-YADE_PLUGIN();
+YADE_PLUGIN("MacroMicroElasticRelationships");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/SimpleElasticRelationships.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/SimpleElasticRelationships.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/SimpleElasticRelationships.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -82,4 +82,4 @@
 	}
 	throw runtime_error("SimpleElasticRelationships currently fails for non-SpheresContactGeometry geometry!");
 };
-YADE_PLUGIN();
+YADE_PLUGIN("SimpleElasticRelationships");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/SimpleElasticRelationshipsWater.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/SimpleElasticRelationshipsWater.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/SimpleElasticRelationshipsWater.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -110,4 +110,4 @@
 // 		}
 // 	}
 };
-YADE_PLUGIN();
+YADE_PLUGIN("SimpleElasticRelationshipsWater");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/SimpleViscoelasticRelationships.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/SimpleViscoelasticRelationships.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/SimpleViscoelasticRelationships.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -47,4 +47,4 @@
 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("SimpleViscoelasticRelationships");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/EngineUnit/Tetrahedron2InteractingMyTetrahedron.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/Tetrahedron2InteractingMyTetrahedron.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/EngineUnit/Tetrahedron2InteractingMyTetrahedron.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -32,4 +32,4 @@
 	it->r4 = it->c4.Length();
 }
 	
-YADE_PLUGIN();
+YADE_PLUGIN("Tetrahedron2InteractingMyTetrahedron");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/StandAloneEngine/AveragePositionRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/AveragePositionRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/AveragePositionRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -73,4 +73,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("AveragePositionRecorder");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/CohesiveFrictionalContactLaw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -15,7 +15,7 @@
 #include<yade/core/MetaBody.hpp>
 
 
-Vector3r translation_vect (0.10,0,0);
+Vector3r translation_vect_ (0.10,0,0);
 
 
 CohesiveFrictionalContactLaw::CohesiveFrictionalContactLaw() : InteractionSolver()
@@ -362,7 +362,7 @@
                 if ((static_cast<CohesiveFrictionalBodyParameters*> (b->physicalParameters.get()))->isBroken == true)
                 {
                     if (b->isDynamic)
-                        (static_cast<CohesiveFrictionalBodyParameters*> (b->physicalParameters.get()))->se3.position += translation_vect;
+                        (static_cast<CohesiveFrictionalBodyParameters*> (b->physicalParameters.get()))->se3.position += translation_vect_;
                     b->isDynamic = false;
                     b->geometricalModel->diffuseColor= Vector3r(0.5,0.3,0.9);
 
@@ -377,4 +377,4 @@
 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("CohesiveFrictionalContactLaw");

Modified: trunk/pkg/dem/Engine/StandAloneEngine/ContactLaw1.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ContactLaw1.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ContactLaw1.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -310,4 +310,4 @@
 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("ContactLaw1");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/StandAloneEngine/ElasticCohesiveLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ElasticCohesiveLaw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ElasticCohesiveLaw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -37,8 +37,8 @@
 
 /// Permanents Links													///
 
-	InteractionContainer::iterator ii    = ncb->persistentInteractions->begin();
-	InteractionContainer::iterator iiEnd = ncb->persistentInteractions->end();
+	InteractionContainer::iterator ii    = ncb->interactions->begin();
+	InteractionContainer::iterator iiEnd = ncb->interactions->end();
 	for(  ; ii!=iiEnd ; ++ii )
 	{
 		if ((*ii)->isReal())
@@ -230,4 +230,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("ElasticCohesiveLaw");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -15,8 +15,6 @@
 #include<yade/core/Omega.hpp>
 #include<yade/core/MetaBody.hpp>
 
-#include<yade/extra/Shop.hpp>
-
 YADE_PLUGIN("ef2_Spheres_Elastic_ElasticLaw","Law2_Dem3Dof_Elastic_Elastic","ElasticContactLaw");
 
 

Modified: trunk/pkg/dem/Engine/StandAloneEngine/ElasticCriterionTimeStepper.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ElasticCriterionTimeStepper.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ElasticCriterionTimeStepper.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -134,4 +134,4 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("ElasticCriterionTimeStepper");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/StandAloneEngine/ForceRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ForceRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ForceRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -84,4 +84,4 @@
 		
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("ForceRecorder");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/StandAloneEngine/GeometricalModelForceColorizer.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/GeometricalModelForceColorizer.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/GeometricalModelForceColorizer.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -82,4 +82,4 @@
 		
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GeometricalModelForceColorizer");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/StandAloneEngine/MGPRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/MGPRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/MGPRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -87,4 +87,4 @@
 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("MGPRecorder");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/StandAloneEngine/MicroMacroAnalyser.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/MicroMacroAnalyser.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/MicroMacroAnalyser.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -19,10 +19,11 @@
 
 #include "MicroMacroAnalyser.hpp"
 
-#include "TesselationWrapper.h"
+#include<yade/extra/TesselationWrapper.h>
+#include<yade/extra/KinematicLocalisationAnalyser.hpp>
+#include<yade/extra/TriaxialState.h>
 
-#include "KinematicLocalisationAnalyser.hpp"
-#include "TriaxialState.h"
+YADE_REQUIRE_FEATURE(CGAL)
 
 CREATE_LOGGER(MicroMacroAnalyser);
 
@@ -224,4 +225,4 @@
 
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("MicroMacroAnalyser");

Modified: trunk/pkg/dem/Engine/StandAloneEngine/MyTetrahedronLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/MyTetrahedronLaw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/MyTetrahedronLaw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -76,4 +76,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("MyTetrahedronLaw");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/StandAloneEngine/PositionOrientationRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/PositionOrientationRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/PositionOrientationRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -54,4 +54,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("PositionOrientationRecorder");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/StandAloneEngine/RigidBodyRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/RigidBodyRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/RigidBodyRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -97,4 +97,4 @@
     }
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("RigidBodyRecorder");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/StandAloneEngine/SimpleViscoelasticSpheresInteractionRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/SimpleViscoelasticSpheresInteractionRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/SimpleViscoelasticSpheresInteractionRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -93,5 +93,4 @@
     }
 }
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("SimpleViscoelasticSpheresInteractionRecorder");

Modified: trunk/pkg/dem/Engine/StandAloneEngine/UniaxialStrainer.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/UniaxialStrainer.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/UniaxialStrainer.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -2,7 +2,7 @@
 #pragma once
 #include<fstream>
 #include<limits>
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 #include<yade/core/FileGenerator.hpp>
 #include<yade/core/StandAloneEngine.hpp>
 

Modified: trunk/pkg/dem/Engine/StandAloneEngine/VelocityRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/VelocityRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/VelocityRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -73,4 +73,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("VelocityRecorder");
\ No newline at end of file

Modified: trunk/pkg/dem/Engine/StandAloneEngine/ViscousForceDamping.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ViscousForceDamping.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ViscousForceDamping.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -35,6 +35,6 @@
 	REGISTER_BASE_CLASS_NAME(InteractionSolver);
 };
 
-REGISTER_SERIALIZABLE(ViscousForceDamping,false);
+REGISTER_SERIALIZABLE(ViscousForceDamping);
 
 

Modified: trunk/pkg/dem/Engine/StandAloneEngine/VolumicContactLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/VolumicContactLaw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/Engine/StandAloneEngine/VolumicContactLaw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -20,6 +20,9 @@
 #include "/home/jf/YADE/trunk/extra/triangulation/TesselationWrapper.h"
 #include <time.h>
 
+YADE_REQUIRE_FEATURE(NONSENSE__THIS_PLUGIN_WILL_NEVER_BE_BUILT_UNLESS_YOU_REMOVE_ABSOLUTE_PATHS_FROM_INCLUDES!!)
+
+
 //  ../../YADE/trunk/examples/sphere_15.txt
 //  ../../YADE/trunk/examples/sphere_33_mono.txt
 //../../YADE/trunk/examples/sphere_100_poly.txt
@@ -631,4 +634,4 @@
 }
 
  
-YADE_PLUGIN();
+YADE_PLUGIN("VolumicContactLaw");

Modified: trunk/pkg/dem/PreProcessor/CohesiveTriaxialTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/CohesiveTriaxialTest.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/CohesiveTriaxialTest.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -56,7 +56,7 @@
 
 #include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
 
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 
 #include <boost/filesystem/convenience.hpp>
 #include <boost/lexical_cast.hpp>
@@ -77,7 +77,7 @@
 
 typedef pair<Vector3r, Real> BasicSphere;
 //! make a list of spheres non-overlapping sphere
-string GenerateCloud(vector<BasicSphere>& sphere_list, Vector3r lowerCorner, Vector3r upperCorner, long number, Real rad_std_dev, Real porosity);
+string GenerateCloud_cohesive(vector<BasicSphere>& sphere_list, Vector3r lowerCorner, Vector3r upperCorner, long number, Real rad_std_dev, Real porosity);
 
 
 CohesiveTriaxialTest::CohesiveTriaxialTest () : FileGenerator()
@@ -281,7 +281,7 @@
 	
 	vector<BasicSphere> sphere_list;
 	if(importFilename!="") sphere_list=Shop::loadSpheresFromFile(importFilename,lowerCorner,upperCorner);
-	else message=GenerateCloud(sphere_list, lowerCorner, upperCorner, numberOfGrains, radiusDeviation, 0.75);
+	else message=GenerateCloud_cohesive(sphere_list, lowerCorner, upperCorner, numberOfGrains, radiusDeviation, 0.75);
 	
 	vector<BasicSphere>::iterator it = sphere_list.begin();
 	vector<BasicSphere>::iterator it_end = sphere_list.end();
@@ -650,7 +650,7 @@
 
 
 
-string GenerateCloud(vector<BasicSphere>& sphere_list, Vector3r lowerCorner, Vector3r upperCorner, long number, Real rad_std_dev, Real porosity)
+string GenerateCloud_cohesive(vector<BasicSphere>& sphere_list, Vector3r lowerCorner, Vector3r upperCorner, long number, Real rad_std_dev, Real porosity)
 {
 	typedef boost::minstd_rand StdGenerator;
 	static StdGenerator generator;
@@ -697,4 +697,4 @@
 
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("CohesiveTriaxialTest");

Modified: trunk/pkg/dem/PreProcessor/Funnel.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/Funnel.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/Funnel.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -316,4 +316,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("Funnel");
\ No newline at end of file

Modified: trunk/pkg/dem/PreProcessor/HydraulicTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/HydraulicTest.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/HydraulicTest.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -44,7 +44,7 @@
 #include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
 #include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
 
-#include<yade/pkg-common/BodyRedirectionVector.hpp>
+#include<yade/core/BodyRedirectionVector.hpp>
 
 #include<yade/pkg-common/TranslationEngine.hpp>
 
@@ -192,7 +192,7 @@
 
 /////////////////////////////////////
 
-//  rootBody->persistentInteractions->clear();
+//  rootBody->interactions->clear();
 //
 //  shared_ptr<Body> bodyA;
 //
@@ -243,14 +243,14 @@
 //     link->isReal     = true;
 //     link->isNew     = false;
 //
-//     rootBody->persistentInteractions->insert(link);
+//     rootBody->interactions->insert(link);
 //    }*/
 //    }
 //   }
 //  }
 
 	/* message="total number of permament links created: "
-	  + lexical_cast<string>(rootBody->persistentInteractions->size())
+	  + lexical_cast<string>(rootBody->interactions->size())
 	  + "\nWARNING: link bonds are nearly working, but the formulas are waiting for total rewrite!";
 	*/
 	rootBody->engines= metaBodyWithSpheres->engines; //Andrea put his dirty hands here!!
@@ -315,4 +315,4 @@
 	return true;
 };
 
-YADE_PLUGIN();
+YADE_PLUGIN("HydraulicTest");

Modified: trunk/pkg/dem/PreProcessor/MembraneTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/MembraneTest.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/MembraneTest.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -7,7 +7,7 @@
 *************************************************************************/
 
 #include <boost/lexical_cast.hpp>
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 
 #include "MembraneTest.hpp"
 

Modified: trunk/pkg/dem/PreProcessor/ModifiedTriaxialTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/ModifiedTriaxialTest.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/ModifiedTriaxialTest.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -10,6 +10,8 @@
 *  GNU General Public License v2 or later. See file LICENSE for details. *
 *************************************************************************/
 
+YADE_REQUIRE_FEATURE(CGAL)
+
 #include "ModifiedTriaxialTest.hpp"
 
 #include<yade/pkg-dem/ElasticContactLaw.hpp>
@@ -38,7 +40,7 @@
 #include<yade/pkg-common/MetaInteractingGeometry.hpp>
 
 #include<yade/pkg-common/GravityEngines.hpp>
-#include<yade/pkg-common/HydraulicForceEngine.hpp>
+#include<yade/pkg-dem/HydraulicForceEngine.hpp>
 #include<yade/pkg-common/PhysicalActionApplier.hpp>
 #include<yade/pkg-common/PhysicalActionDamper.hpp>
 #include<yade/pkg-common/CundallNonViscousDamping.hpp>
@@ -689,4 +691,4 @@
 
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("ModifiedTriaxialTest");

Modified: trunk/pkg/dem/PreProcessor/SDECImpactTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/SDECImpactTest.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/SDECImpactTest.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -494,4 +494,4 @@
 	
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("SDECImpactTest");
\ No newline at end of file

Modified: trunk/pkg/dem/PreProcessor/SDECLinkedSpheres.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/SDECLinkedSpheres.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/SDECLinkedSpheres.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -123,7 +123,7 @@
 	
 /////////////////////////////////////
 
-	rootBody->persistentInteractions->clear();
+	rootBody->interactions->clear();
 	
 	shared_ptr<Body> bodyA;
 
@@ -170,13 +170,13 @@
 
 				link->interactionGeometry 		= geometry;
 				link->interactionPhysics 		= physics;
-				rootBody->persistentInteractions->insert(link);
+				rootBody->interactions->insert(link);
 			}
 		}
 	}
 	
 	message="total number of permament links created: " 
-		+ lexical_cast<string>(rootBody->persistentInteractions->size()) 
+		+ lexical_cast<string>(rootBody->interactions->size()) 
 		+ "\nWARNING: link bonds are nearly working, but the formulas are waiting for total rewrite!"
 		+"\nWARNING: interactions will not generate any force since we use SpheresContactGeometry instead of SDECLinkGeometry now.";
 	return true;
@@ -367,4 +367,4 @@
 	
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("SDECLinkedSpheres");
\ No newline at end of file

Modified: trunk/pkg/dem/PreProcessor/SDECMovingWall.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/SDECMovingWall.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/SDECMovingWall.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -395,4 +395,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("SDECMovingWall");
\ No newline at end of file

Modified: trunk/pkg/dem/PreProcessor/SDECSpheresPlane.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/SDECSpheresPlane.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/SDECSpheresPlane.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -372,4 +372,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("SDECSpheresPlane");
\ No newline at end of file

Modified: trunk/pkg/dem/PreProcessor/STLImporterTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/STLImporterTest.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/STLImporterTest.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -6,15 +6,17 @@
 *  GNU General Public License v2 or later. See file LICENSE for details. *
 *************************************************************************/
 
-#include "STLImporterTest.hpp"
-#include <yade/pkg-common/SpatialQuickSortCollider.hpp>
-#include <yade/lib-import/STLImporter.hpp>
+#include"STLImporterTest.hpp"
+#include<yade/pkg-common/SpatialQuickSortCollider.hpp>
+#include<yade/lib-import/STLImporter.hpp>
+#include<yade/pkg-common/InteractingFacet.hpp>
+#include<yade/pkg-common/Facet.hpp>
 #include<yade/core/Body.hpp>
 #include<yade/core/Interaction.hpp>
 #include<yade/core/MetaBody.hpp>
 #include<yade/lib-serialization/IOFormatManager.hpp>
 #include<yade/pkg-common/AABB.hpp>
-#include<yade/pkg-common/BodyRedirectionVector.hpp>
+#include<yade/core/BodyRedirectionVector.hpp>
 #include<yade/pkg-common/BoundingVolumeMetaEngine.hpp>
 #include<yade/pkg-common/CundallNonViscousDamping.hpp>
 #include<yade/pkg-common/CundallNonViscousDamping.hpp>
@@ -288,4 +290,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("STLImporterTest");

Modified: trunk/pkg/dem/PreProcessor/SimpleScene.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/SimpleScene.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/SimpleScene.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,5 +1,5 @@
 #include"SimpleScene.hpp"
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 #include<yade/pkg-dem/BodyMacroParameters.hpp>
 #include<yade/pkg-common/InteractingSphere2AABB.hpp>
 #include<yade/pkg-common/InteractingBox2AABB.hpp>

Modified: trunk/pkg/dem/PreProcessor/SimpleScene.hpp
===================================================================
--- trunk/pkg/dem/PreProcessor/SimpleScene.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/SimpleScene.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,6 +1,6 @@
 #pragma once
 #include<yade/core/FileGenerator.hpp>
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 
 
 class SimpleScene: public FileGenerator {

Modified: trunk/pkg/dem/PreProcessor/TestSimpleViscoelastic.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TestSimpleViscoelastic.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/TestSimpleViscoelastic.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -6,14 +6,14 @@
 *  GNU General Public License v2 or later. See file LICENSE for details. *
 *************************************************************************/
 #include "TestSimpleViscoelastic.hpp"
-#include <yade/extra/Shop.hpp>
+#include <yade/pkg-dem/Shop.hpp>
 #include <yade/core/Body.hpp>
 #include <yade/core/MetaBody.hpp>
 #include<yade/core/Body.hpp>
 #include<yade/core/Interaction.hpp>
 #include<yade/core/MetaBody.hpp>
 #include<yade/pkg-common/AABB.hpp>
-#include<yade/pkg-common/BodyRedirectionVector.hpp>
+#include<yade/core/BodyRedirectionVector.hpp>
 #include<yade/pkg-common/BoundingVolumeMetaEngine.hpp>
 #include<yade/pkg-common/InteractingSphere.hpp>
 #include<yade/pkg-common/InteractingBox.hpp>

Copied: trunk/pkg/dem/PreProcessor/TetraTestGen.cpp (from rev 1872, trunk/extra/tetra/TetraTestGen.cpp)
===================================================================
--- trunk/extra/tetra/TetraTestGen.cpp	2009-07-16 14:26:45 UTC (rev 1872)
+++ trunk/pkg/dem/PreProcessor/TetraTestGen.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,69 @@
+
+#include<yade/core/MetaBody.hpp>
+#include<yade/pkg-dem/Shop.hpp>
+
+#include"TetraTestGen.hpp"
+
+#include<yade/pkg-dem/Tetra.hpp>
+
+YADE_PLUGIN("TetraTestGen");
+
+bool TetraTestGen::generate()
+{
+	//Shop::setDefault("param_pythonRunExpr",string("if S.i%50==0 and S.i<1000 and S.i>500:\n\tprint S.i,len(S.sel),B[1].x, B[1].E"));
+
+	rootBody=Shop::rootBody();
+	Shop::rootBodyActors(rootBody);
+	
+	#if 0
+	shared_ptr<MetaBody> oldRootBody=Omega::instance().getRootBody();
+	Omega::instance().setRootBody(rootBody);
+	#endif
+
+	Vector3r v[4];
+
+	v[0]=Vector3r(1,1,0);
+	v[1]=Vector3r(0,-2,0);
+	v[2]=Vector3r(-1,1,0);
+	v[3]=Vector3r(0,0,-2);
+	shared_ptr<Body> ground=Shop::tetra(v);
+	ground->isDynamic=false;
+	rootBody->bodies->insert(ground);
+
+
+	for(size_t i=0; i<gridSize[0]; i++) for(size_t j=0; j<gridSize[1];j++) for(size_t k=0; k<gridSize[2];k++){
+		Vector3r center=(1./std::max(gridSize[0],gridSize[1]))*Vector3r(i-gridSize[0]/2.,j-gridSize[1]/2.,.5+k);
+		double size=.5/std::max(gridSize[0],gridSize[1]);
+		#define __VERTEX(x,y,z) center+size*(Vector3r(x,y,z)+Vector3r(Mathr::IntervalRandom(-.5,.5),Mathr::IntervalRandom(-.5,.5),Mathr::IntervalRandom(-.5,.5)))
+			v[0]=__VERTEX(1,1,0);
+			v[1]=__VERTEX(0,-1,0);
+			v[2]=__VERTEX(-1,0,0);
+			v[3]=__VERTEX(0,0,2);
+		#undef __VERTEX
+		shared_ptr<Body> t=Shop::tetra(v);
+		rootBody->bodies->insert(t);
+	}
+
+	// test inertia calculation
+	#if 1
+		v[0]=Vector3r(8.33220, -11.86875, 0.93355);
+		v[1]=Vector3r(0.75523 ,5.00000, 16.37072);
+		v[2]=Vector3r(52.61236, 5.00000, -5.38580);
+		v[3]=Vector3r(2.00000, 5.00000, 3.00000);
+		vector<Vector3r> vv;
+		for(int i=0;i<4;i++)vv.push_back(v[i]);
+		/* Vector3r cg=(v[0]+v[1]+v[2]+v[3])*.25;
+		cerr<<"Centroid: "<<cg<<endl;
+		v[0]-=cg; v[1]-=cg; v[2]-=cg; v[3]-=cg; */
+		Matrix3r I=TetrahedronCentralInertiaTensor(vv);
+		//cerr<<vv[0][0]<<" "<<vv[0][1]<<" "<<vv[0][2]<<endl;
+		cerr<<I(0,0)<<endl<<I(1,1)<<endl<<I(2,2)<<endl<<-I(1,2)<<endl<<-I(0,1)<<endl<<-I(0,2)<<endl;
+	#endif 
+
+	#if 0
+	Omega::instance().setRootBody(oldRootBody);
+	#endif
+	
+	message="ATTN: this example is not working yet!";
+	return true;
+}


Property changes on: trunk/pkg/dem/PreProcessor/TetraTestGen.cpp
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/pkg/dem/PreProcessor/TetraTestGen.hpp (from rev 1875, trunk/extra/tetra/TetraTestGen.hpp)


Property changes on: trunk/pkg/dem/PreProcessor/TetraTestGen.hpp
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/pkg/dem/PreProcessor/TetrahedronsTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TetrahedronsTest.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/TetrahedronsTest.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -394,4 +394,4 @@
 	tet->v[3]=size*(Mathr::UnitRandom()*0.7+1.0)*Vector3r(0.16,0.93,-0.33);
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("TetrahedronsTest");
\ No newline at end of file

Modified: trunk/pkg/dem/PreProcessor/ThreePointBending.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/ThreePointBending.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/ThreePointBending.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -52,7 +52,7 @@
 #include <boost/filesystem/operations.hpp>
 #include <boost/filesystem/convenience.hpp>
 
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 
 
 ThreePointBending::ThreePointBending () : FileGenerator()
@@ -136,7 +136,7 @@
 	
 /////////////////////////////////////
 
-	rootBody->persistentInteractions->clear();
+	rootBody->interactions->clear();
 	
 	shared_ptr<Body> bodyA;
 
@@ -177,7 +177,7 @@
 
 				link->interactionGeometry 		= geometry;
 				link->interactionPhysics 		= physics;
-				rootBody->persistentInteractions->insert(link);
+				rootBody->interactions->insert(link);
 			}
 		}
 	}
@@ -212,7 +212,7 @@
 
 	
 	message="total number of permament links created: " 
-		+ lexical_cast<string>(rootBody->persistentInteractions->size()) 
+		+ lexical_cast<string>(rootBody->interactions->size()) 
 		+ "\nWARNING: link bonds are nearly working, but the formulas are waiting for total rewrite!"+
 		+"\nWARNING: The results are meaningless, since ElasticCohesiveLaw works only with (unused) SDECLinkGeometry.";
 	return true;
@@ -354,4 +354,4 @@
 	
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("ThreePointBending");

Modified: trunk/pkg/dem/PreProcessor/TriaxialTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTest.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/TriaxialTest.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -58,7 +58,7 @@
 
 #include<yade/pkg-common/InteractionDispatchers.hpp>
 
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 
 
 #include <boost/filesystem/convenience.hpp>
@@ -693,4 +693,4 @@
 
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("TriaxialTest");

Modified: trunk/pkg/dem/PreProcessor/TriaxialTestWater.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTestWater.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/TriaxialTestWater.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -62,7 +62,7 @@
 
 #include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
 
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 
 #include <boost/filesystem/convenience.hpp>
 #include <boost/lexical_cast.hpp>
@@ -84,7 +84,7 @@
 
 typedef pair<Vector3r, Real> BasicSphere;
 //! generate a list of non-overlapping spheres
-string GenerateCloud(vector<BasicSphere>& sphere_list, Vector3r lowerCorner, Vector3r upperCorner, long number, Real rad_std_dev, Real porosity);
+string GenerateCloud_water(vector<BasicSphere>& sphere_list, Vector3r lowerCorner, Vector3r upperCorner, long number, Real rad_std_dev, Real porosity);
 
 
 TriaxialTestWater::TriaxialTestWater () : FileGenerator()
@@ -296,7 +296,7 @@
 	
 	vector<BasicSphere> sphere_list;
 	if(importFilename!="") sphere_list=Shop::loadSpheresFromFile(importFilename,lowerCorner,upperCorner);
-	else message+=GenerateCloud(sphere_list, lowerCorner, upperCorner, numberOfGrains, Rdispersion, 0.75);
+	else message+=GenerateCloud_water(sphere_list, lowerCorner, upperCorner, numberOfGrains, Rdispersion, 0.75);
 	
 	vector<BasicSphere>::iterator it = sphere_list.begin();
 	vector<BasicSphere>::iterator it_end = sphere_list.end();
@@ -628,7 +628,7 @@
 }
 
 
-string GenerateCloud(vector<BasicSphere>& sphere_list, Vector3r lowerCorner, Vector3r upperCorner, long number, Real rad_std_dev, Real porosity)
+string GenerateCloud_water(vector<BasicSphere>& sphere_list, Vector3r lowerCorner, Vector3r upperCorner, long number, Real rad_std_dev, Real porosity)
 {
 	typedef boost::minstd_rand StdGenerator;
 	static StdGenerator generator;
@@ -682,4 +682,4 @@
 
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("TriaxialTestWater");

Modified: trunk/pkg/dem/PreProcessor/UniaxialStrainerGen.hpp
===================================================================
--- trunk/pkg/dem/PreProcessor/UniaxialStrainerGen.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/PreProcessor/UniaxialStrainerGen.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,7 +1,7 @@
 // 2008 © Václav Šmilauer <eudoxos@xxxxxxxx> 
 
 #pragma once
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 #include<yade/core/FileGenerator.hpp>
 #include<yade/pkg-dem/UniaxialStrainer.hpp>
 

Modified: trunk/pkg/dem/RenderingEngine/GLDrawCohesiveFrictionalContactInteraction/GLDrawCohesiveFrictionalContactInteraction.cpp
===================================================================
--- trunk/pkg/dem/RenderingEngine/GLDrawCohesiveFrictionalContactInteraction/GLDrawCohesiveFrictionalContactInteraction.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/RenderingEngine/GLDrawCohesiveFrictionalContactInteraction/GLDrawCohesiveFrictionalContactInteraction.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -245,4 +245,5 @@
 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawCohesiveFrictionalContactInteraction");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/dem/RenderingEngine/GLDrawElasticContactInteraction/GLDrawElasticContactInteraction.cpp
===================================================================
--- trunk/pkg/dem/RenderingEngine/GLDrawElasticContactInteraction/GLDrawElasticContactInteraction.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/RenderingEngine/GLDrawElasticContactInteraction/GLDrawElasticContactInteraction.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -90,4 +90,5 @@
 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawElasticContactInteraction");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/dem/RenderingEngine/GLDrawInteractingMyTetrahedron/GLDrawInteractingMyTetrahedron.cpp
===================================================================
--- trunk/pkg/dem/RenderingEngine/GLDrawInteractingMyTetrahedron/GLDrawInteractingMyTetrahedron.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/RenderingEngine/GLDrawInteractingMyTetrahedron/GLDrawInteractingMyTetrahedron.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -36,4 +36,5 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawInteractingMyTetrahedron");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/dem/RenderingEngine/GLDrawSDECLinkGeometry/GLDrawSDECLinkGeometry.cpp
===================================================================
--- trunk/pkg/dem/RenderingEngine/GLDrawSDECLinkGeometry/GLDrawSDECLinkGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/RenderingEngine/GLDrawSDECLinkGeometry/GLDrawSDECLinkGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -81,4 +81,5 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawSDECLinkGeometry");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/dem/RenderingEngine/GLDrawSpheresContactGeometry/GLDrawSpheresContactGeometry.cpp
===================================================================
--- trunk/pkg/dem/RenderingEngine/GLDrawSpheresContactGeometry/GLDrawSpheresContactGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/RenderingEngine/GLDrawSpheresContactGeometry/GLDrawSpheresContactGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -15,6 +15,7 @@
 #include<yade/lib-opengl/GLUtils.hpp>
 
 YADE_PLUGIN("GLDrawSpheresContactGeometry");
+YADE_REQUIRE_FEATURE(OPENGL)
 CREATE_LOGGER(GLDrawSpheresContactGeometry);
 
 void GLDrawSpheresContactGeometry::go(

Modified: trunk/pkg/dem/RenderingEngine/GLDrawViscoelasticInteraction/GLDrawViscoelasticInteraction.cpp
===================================================================
--- trunk/pkg/dem/RenderingEngine/GLDrawViscoelasticInteraction/GLDrawViscoelasticInteraction.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/RenderingEngine/GLDrawViscoelasticInteraction/GLDrawViscoelasticInteraction.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -35,4 +35,5 @@
 	glPopMatrix();
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawViscoelasticInteraction");
+YADE_REQUIRE_FEATURE(OPENGL)

Deleted: trunk/pkg/dem/RockPM.cpp
===================================================================
--- trunk/pkg/dem/RockPM.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/RockPM.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,163 +0,0 @@
-/*************************************************************************
-*    Copyright (C) 2009 Anton Gladkyy gladky.anton@xxxxxxxxx             *
-*                                                                        *
-*    This program is free software: you can redistribute it and/or modify*
-*    it under the terms of the GNU General Public License as published by*
-*    the Free Software Foundation, either version 3 of the License, or   *
-*    (at your option) any later version.                                 *
-*                                                                        *
-*    This program is distributed in the hope that it will be useful,     *
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of      *
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
-*    GNU General Public License for more details.                        *
-*                                                                        *
-*    You should have received a copy of the GNU General Public License   *
-*    along with this program.  If not, see <http://www.gnu.org/licenses/>*
-**************************************************************************/
-
-#include"RockPM.hpp"
-#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-dem/BodyMacroParameters.hpp>
-#include<yade/pkg-common/Sphere.hpp>
-#include<yade/pkg-dem/DemXDofGeom.hpp>
-#include<yade/extra/Shop.hpp>
-
-
-YADE_PLUGIN("Law2_Dem3DofGeom_RockPMPhys_Rpm", "RpmMat","Ip2_RpmMat_RpmMat_RpmPhys","RpmPhys");
-
-
-
-/********************** Law2_Dem3DofGeom_RockPMPhys_Rpm ****************************/
-CREATE_LOGGER(Law2_Dem3DofGeom_RockPMPhys_Rpm);
-
-void Law2_Dem3DofGeom_RockPMPhys_Rpm::go(shared_ptr<InteractionGeometry>& ig, shared_ptr<InteractionPhysics>& ip, Interaction* contact, MetaBody* rootBody){
-	Dem3DofGeom* geom=static_cast<Dem3DofGeom*>(ig.get());
-	RpmPhys* phys=static_cast<RpmPhys*>(ip.get());
-
-	Real displN=geom->displacementN();
-	const Real& crossSection=phys->crossSection;
-	
-	Real& epsN=phys->epsN;
-	Vector3r& epsT=phys->epsT;
-	
-	Real& sigmaN=phys->sigmaN;
-	Vector3r& sigmaT=phys->sigmaT;
-	
-	const Real& E = phys->E;
-	const Real& G = phys->G;
-	
-	Real& Fn=phys->Fn;
-	Vector3r& Fs=phys->Fs;
-	
-	
-	const shared_ptr<Body>& body1=Body::byId(contact->getId1(),rootBody);
-	const shared_ptr<Body>& body2=Body::byId(contact->getId2(),rootBody);
-	assert(body1);
-	assert(body2);
-	const shared_ptr<RpmMat>& rbp1=YADE_PTR_CAST<RpmMat>(body1->physicalParameters);
-	const shared_ptr<RpmMat>& rbp2=YADE_PTR_CAST<RpmMat>(body2->physicalParameters);
-	
-	//check, whether one of bodies is damaged
-	if ((rbp1->isDamaged) || (rbp2->isDamaged)) {
-		phys->isCohesive = false;
-	}
-
-	if(displN<=0){
-		/*Normal Interaction*/
-		epsN=geom->strainN();
-		epsT=geom->strainT();
-		
-		
-		sigmaN=E*epsN;
-		Fn=sigmaN*crossSection; phys->normalForce=Fn*geom->normal;
-		
-		sigmaT=G*epsT;
-
-		/*Check, whether the shear stress more, than normal force multiplicated to tanFrictionAngle*/
-		
-		Real maxFsSq = phys->normalForce.SquaredLength()*phys->tanFrictionAngle*phys->tanFrictionAngle;
-		if(sigmaT.SquaredLength()>maxFsSq) {
-			sigmaT*=sqrt(maxFsSq/(sigmaT.SquaredLength()));
-		}
-		
-		Fs=sigmaT*crossSection;
-		phys->shearForce = Fs;
-
-		applyForceAtContactPoint(phys->normalForce + phys->shearForce, geom->contactPoint, contact->getId1(), geom->se31.position, contact->getId2(), geom->se32.position, rootBody);
-		/*Normal Interaction_____*/
-		if ((phys->isCohesive)&&(displN<(-phys->lengthMaxCompression))) {
-			//LOG_WARN(displN<<"__COMRESS!!!__");
-			phys->isCohesive = false;
-			rbp1->isDamaged=true;
-			rbp2->isDamaged=true;
-		}
-		return;
-	} else {
-		if (phys->isCohesive) {
-			if (displN>(phys->lengthMaxTension)) {
-				//LOG_WARN(displN<<"__TENSION!!!__");
-				phys->isCohesive = false;
-				rbp1->isDamaged=true;
-				rbp2->isDamaged=true;
-				return; 
-			} else {
-				phys->normalForce=phys->kn*displN*geom->normal;
-				applyForceAtContactPoint(phys->normalForce, geom->contactPoint, contact->getId1(), geom->se31.position, contact->getId2(), geom->se32.position, rootBody);
-				return;
-			}
-		} else {
-			rootBody->interactions->requestErase(contact->getId1(),contact->getId2());
-			return;
-		}
-	}
-}
-
-
-CREATE_LOGGER(Ip2_RpmMat_RpmMat_RpmPhys);
-
-void Ip2_RpmMat_RpmMat_RpmPhys::go(const shared_ptr<PhysicalParameters>& pp1, const shared_ptr<PhysicalParameters>& pp2, const shared_ptr<Interaction>& interaction){
-	if(interaction->interactionPhysics) return; 
-
-	Dem3DofGeom* contGeom=YADE_CAST<Dem3DofGeom*>(interaction->interactionGeometry.get());
-	Omega& OO=Omega::instance();
-	assert(contGeom);
-	//LOG_WARN(Omega::instance().getCurrentIteration());
-	const shared_ptr<RpmMat>& rpm1=YADE_PTR_CAST<RpmMat>(pp1);
-	const shared_ptr<RpmMat>& rpm2=YADE_PTR_CAST<RpmMat>(pp2);
-	
-	const shared_ptr<BodyMacroParameters>& elast1=static_pointer_cast<BodyMacroParameters>(pp1);
-	const shared_ptr<BodyMacroParameters>& elast2=static_pointer_cast<BodyMacroParameters>(pp2);
-	long cohesiveThresholdIter=1000;
-	
-	bool initCohesive = rpm1->initCohesive*rpm2->initCohesive;
-	
-	Real E12=2*elast1->young*elast2->young/(elast1->young+elast2->young);
-	Real minRad=(contGeom->refR1<=0?contGeom->refR2:(contGeom->refR2<=0?contGeom->refR1:min(contGeom->refR1,contGeom->refR2)));
-	Real S12=Mathr::PI*pow(minRad,2);
-	Real G_over_E = (rpm1->G_over_E + rpm2->G_over_E)/2;
-	shared_ptr<RpmPhys> contPhys(new RpmPhys());
-	contPhys->E=E12;
-	contPhys->G=E12*G_over_E;
-	contPhys->tanFrictionAngle=tan(.5*(elast1->frictionAngle+elast2->frictionAngle));
-	contPhys->crossSection=S12;
-	contPhys->kn=contPhys->E*contPhys->crossSection;
-	contPhys->ks=contPhys->G*contPhys->crossSection;
-	
-	contPhys->lengthMaxCompression=S12*(0.5*(rpm1->stressCompressMax+rpm2->stressCompressMax))/(contPhys->kn);
-	contPhys->lengthMaxTension=S12*(0.5*(rpm1->stressCompressMax*rpm1->Brittleness+rpm2->stressCompressMax*rpm2->Brittleness))/(contPhys->kn);
-	
-	initDistance = contGeom->displacementN();
-
-	if ((rpm1->exampleNumber==rpm2->exampleNumber)&&(initDistance<(contPhys->lengthMaxTension))&&(initCohesive)&&(OO.getCurrentIteration()<=cohesiveThresholdIter)) {
-		contPhys->isCohesive=true;
-		//LOG_WARN("InitDistance="<<initDistance<<"  "<<rpm1->exampleNumber<<"  "<<rpm2->exampleNumber<<" "<<OO.getCurrentIteration());
-		//LOG_WARN("lengthMaxCompression="<<contPhys->lengthMaxCompression);
-		//LOG_WARN("lengthMaxTension="<<contPhys->lengthMaxTension);
-	}
-
-	
-	interaction->interactionPhysics=contPhys;
-}
-
-RpmPhys::~RpmPhys(){};
-

Deleted: trunk/pkg/dem/RockPM.hpp
===================================================================
--- trunk/pkg/dem/RockPM.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/RockPM.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,110 +0,0 @@
-/*************************************************************************
-*    Copyright (C) 2009 Anton Gladkyy gladky.anton@xxxxxxxxx             *
-*                                                                        *
-*    This program is free software: you can redistribute it and/or modify*
-*    it under the terms of the GNU General Public License as published by*
-*    the Free Software Foundation, either version 3 of the License, or   *
-*    (at your option) any later version.                                 *
-*                                                                        *
-*    This program is distributed in the hope that it will be useful,     *
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of      *
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
-*    GNU General Public License for more details.                        *
-*                                                                        *
-*    You should have received a copy of the GNU General Public License   *
-*    along with this program.  If not, see <http://www.gnu.org/licenses/>*
-**************************************************************************/
-/*
-
-=== HIGH LEVEL OVERVIEW OF RockPM ===
-
-Rock Particle Model (RockPM) is a set of classes for modelling
-mechanical behavior of mining rocks.
-*/
-
-#pragma once
-
-#include<yade/pkg-common/RigidBodyParameters.hpp>
-#include<yade/pkg-dem/BodyMacroParameters.hpp>
-#include<yade/pkg-common/InteractionPhysicsEngineUnit.hpp>
-#include<yade/pkg-dem/SpheresContactGeometry.hpp>
-#include<yade/pkg-common/PeriodicEngines.hpp>
-#include<yade/pkg-common/NormalShearInteractions.hpp>
-#include<yade/pkg-common/ConstitutiveLaw.hpp>
-
-
-class Law2_Dem3DofGeom_RockPMPhys_Rpm: public ConstitutiveLaw{
-	public:
-		virtual void go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, MetaBody* rootBody);
-		FUNCTOR2D(Dem3DofGeom,RpmPhys);
-		REGISTER_CLASS_AND_BASE(Law2_Dem3DofGeom_RockPMPhys_Rpm,ConstitutiveLaw);
-		REGISTER_ATTRIBUTES(ConstitutiveLaw,/*nothing here*/);
-		DECLARE_LOGGER;	
-};
-REGISTER_SERIALIZABLE(Law2_Dem3DofGeom_RockPMPhys_Rpm);
-
-/* This class holds information associated with each body */
-class RpmMat: public BodyMacroParameters {
-	public:
-		int exampleNumber; //Number of "stone"
-		bool initCohesive, isDamaged;
-		Real stressCompressMax, Brittleness, G_over_E; //Parameters for damaging
-		
-		RpmMat(): exampleNumber(0.), initCohesive(false), isDamaged(false), stressCompressMax(0), Brittleness(0), G_over_E(1) {createIndex();};
-		REGISTER_ATTRIBUTES(BodyMacroParameters, 
-			(exampleNumber)
-			(initCohesive)
-			(isDamaged)
-			(stressCompressMax)
-			(Brittleness)
-			(G_over_E));
-		REGISTER_CLASS_AND_BASE(RpmMat,BodyMacroParameters);
-};
-REGISTER_SERIALIZABLE(RpmMat);
-
-
-class Ip2_RpmMat_RpmMat_RpmPhys: public InteractionPhysicsEngineUnit{
-	private:
-	public:
-		Real initDistance;
-
-		Ip2_RpmMat_RpmMat_RpmPhys(){
-			initDistance = 0;
-		}
-
-		virtual void go(const shared_ptr<PhysicalParameters>& pp1, const shared_ptr<PhysicalParameters>& pp2, const shared_ptr<Interaction>& interaction);
-		REGISTER_ATTRIBUTES(InteractionPhysicsEngineUnit,
-			(initDistance)
-		);
-
-		FUNCTOR2D(RpmMat,RpmMat);
-		REGISTER_CLASS_AND_BASE(Ip2_RpmMat_RpmMat_RpmPhys,InteractionPhysicsEngineUnit);
-		DECLARE_LOGGER;
-};
-REGISTER_SERIALIZABLE(Ip2_RpmMat_RpmMat_RpmPhys);
-
-
-class RpmPhys: public NormalShearInteraction {
-	private:
-	public:
-		Real crossSection,E,G,tanFrictionAngle,lengthMaxCompression,lengthMaxTension;
-		Real omega, Fn, sigmaN, epsN;
-		Vector3r epsT, sigmaT, Fs;
-		 
-
-		bool isCohesive;
-
-		RpmPhys(): NormalShearInteraction(),crossSection(0),E(0),G(0), tanFrictionAngle(0), lengthMaxCompression(0), lengthMaxTension(0), isCohesive(false) { createIndex(); epsT=Vector3r::ZERO; omega=0; Fn=0; Fs=Vector3r::ZERO;}
-		virtual ~RpmPhys();
-
-		REGISTER_ATTRIBUTES(NormalShearInteraction,
-			(E)
-			(G)
-			(tanFrictionAngle)
-			(isCohesive)
-			(lengthMaxCompression)
-			(lengthMaxTension)
-		);
-	REGISTER_CLASS_AND_BASE(RpmPhys,NormalShearInteraction);
-};
-REGISTER_SERIALIZABLE(RpmPhys);

Deleted: trunk/pkg/dem/SConscript
===================================================================
--- trunk/pkg/dem/SConscript	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/dem/SConscript	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,1126 +0,0 @@
-# vim: set filetype=python :
-Import('*')
-
-import os.path,os
-#  Dir('#') expands to the root of the source tree -- that is done by scons
-#if os.path.exists(Dir('#').abspath+'/extra/triangulation/libTesselationWrapper.a'):
-	#print "Will build VolumetricContactLaw since libTesselationWrapper.a was found."
-	#env.Install('$PREFIX/lib/yade$SUFFIX/pkg-dem',[
-		#env.SharedLibrary('VolumicContactLaw',
-			#['Engine/StandAloneEngine/VolumicContactLaw.cpp'],
-			#LIBPATH=env['LIBPATH']+['../extra/triangulation'],
-			#LIBS=env['LIBS']+['SDECLinkPhysics',
-				#'ElasticContactInteraction',
-				#'SDECLinkGeometry',
-				#'SpheresContactGeometry',
-				#'BodyMacroParameters',
-				#'Sphere',
-				#'RigidBodyParameters',
-				#'InteractingSphere',
-				#'TesselationWrapper',
-				#'CGAL'])
-		#])
-
-cpmModel='../brefcom-mm.hh'
-if os.path.exists('../../'+cpmModel):
-	print "Will include local file "+cpmModel
-	cpmInclude=['-include',cpmModel]
-	Depends('ConcretePM.cpp','../../../brefcom-mm.hh')
-else:
-	cpmInclude=['']
-
-
-env.Install('$PREFIX/lib/yade$SUFFIX/pkg-dem',[
-	
-	env.SharedLibrary('RockPM',['RockPM.cpp'],LIBS=env['LIBS']+['ElasticContactInteraction','Dem3DofGeom_SphereSphere','ElasticContactLaw']),
-	env.SharedLibrary('DemXDofGeom',['DataClass/InteractionGeometry/DemXDofGeom.cpp']),
-	env.SharedLibrary('Dem3DofGeom_SphereSphere',['DataClass/InteractionGeometry/Dem3DofGeom_SphereSphere.cpp'],LIBS=env['LIBS']+['EngineUnits','RigidBodyParameters','InteractingSphere','DemXDofGeom','yade-opengl' if 'YADE_OPENGL' in env['CPPDEFINES'] else '']),
-	env.SharedLibrary('Dem3DofGeom_FacetSphere',['DataClass/InteractionGeometry/Dem3DofGeom_FacetSphere.cpp'],LIBS=env['LIBS']+['EngineUnits','RigidBodyParameters','InteractingSphere','InteractingFacet','Dem3DofGeom_SphereSphere','DemXDofGeom','yade-opengl' if 'YADE_OPENGL' in env['CPPDEFINES'] else '']),
-
-	env.SharedLibrary('FacetTopologyAnalyzer',['Engine/StandAloneEngine/FacetTopologyAnalyzer.cpp'],LIBS=env['LIBS']+['InteractingFacet']),
-
-	env.SharedLibrary('UniaxialStrainer',['Engine/StandAloneEngine/UniaxialStrainer.cpp'],LIBS=env['LIBS']+['ParticleParameters','AABB']),
-
-	env.SharedLibrary('ConcretePM',['ConcretePM.cpp'],CXXFLAGS=env['CXXFLAGS']+cpmInclude,LIBS=env['LIBS']+['Shop','DemXDofGeom','$QGLVIEWER_LIB' if 'YADE_OPENGL' in env['CPPDEFINES'] else '']),
-
-	env.SharedLibrary('Clump',['DataClass/Clump.cpp'],LIBS=env['LIBS']+['Shop']),
-
-	env.SharedLibrary('SQLiteRecorder',
-		['Engine/StandAloneEngine/SQLiteRecorder.cpp'],
-		LIBS=env['LIBS']+['sqlite3x']),
-
-	env.SharedLibrary('SimpleScene',['PreProcessor/SimpleScene.cpp'],LIBS=env['LIBS']+['Shop','SimpleElasticRelationships']),
-
-	env.SharedLibrary('UniaxialStrainerGen',['PreProcessor/UniaxialStrainerGen.cpp'],LIBS=env['LIBS']+['Shop','ConstitutiveLawDispatcher','ConcretePM','Dem3DofGeom_SphereSphere','NewtonsDampedLaw','UniaxialStrainer']),
-
-	env.SharedLibrary('InteractingMyTetrahedron',
-		['DataClass/InteractingGeometry/InteractingMyTetrahedron.cpp']),
-
-	env.SharedLibrary('BodyMacroParameters',
-		['DataClass/PhysicalParameters/BodyMacroParameters.cpp'],
-		LIBS=env['LIBS']+['RigidBodyParameters',
-			'ElasticBodyParameters',
-			'yade-serialization',
-			'yade-base',
-			'yade-multimethods']),
-	
-	env.SharedLibrary('CohesiveFrictionalBodyParameters',
-		['DataClass/PhysicalParameters/CohesiveFrictionalBodyParameters.cpp'],
-		LIBS=env['LIBS']+['RigidBodyParameters',
-			'BodyMacroParameters',
-			'yade-serialization',
-			'yade-base',
-			'yade-multimethods']),
-
-	env.SharedLibrary('SpheresContactGeometry',
-		['DataClass/InteractionGeometry/SpheresContactGeometry.cpp'],
-		LIBS=env['LIBS']+['RigidBodyParameters']),
-
-	env.SharedLibrary('SDECLinkGeometry',
-		['DataClass/InteractionGeometry/SDECLinkGeometry.cpp']
-	),
-
-	env.SharedLibrary('InteractionOfMyTetrahedron',
-		['DataClass/InteractionGeometry/InteractionOfMyTetrahedron.cpp'],
-	),
-
-	env.SharedLibrary('ElasticContactInteraction',
-		['DataClass/InteractionPhysics/ElasticContactInteraction.cpp'],
-		LIBS=env['LIBS']+['NormalShearInteractions']),
-		
-	env.SharedLibrary('CohesiveFrictionalContactInteraction',
-		['DataClass/InteractionPhysics/CohesiveFrictionalContactInteraction.cpp'],
-		LIBS=env['LIBS']+['ElasticContactInteraction']),
-
-	env.SharedLibrary('ContactLaw1Interaction',
-		['DataClass/InteractionPhysics/ContactLaw1Interaction.cpp'],
-		LIBS=env['LIBS']+['ElasticContactInteraction']),
-
-
-	env.SharedLibrary('SDECLinkPhysics',
-		['DataClass/InteractionPhysics/SDECLinkPhysics.cpp'],
-		LIBS=env['LIBS']+['NormalShearInteractions']),
-
-	env.SharedLibrary('MacroMicroElasticRelationships',
-		['Engine/EngineUnit/MacroMicroElasticRelationships.cpp'],
-		LIBS=env['LIBS']+['SDECLinkPhysics',
-			'SDECLinkGeometry',
-			'ElasticContactInteraction',
-			'SpheresContactGeometry',
-			'BodyMacroParameters',
-			'RigidBodyParameters',
-			'ParticleParameters',
-			'InteractionPhysicsMetaEngine']),
-
-	env.SharedLibrary('SimpleElasticRelationships',
-		['Engine/EngineUnit/SimpleElasticRelationships.cpp'],
-		LIBS=env['LIBS']+['SDECLinkPhysics',
-			'ElasticContactInteraction',
-			'SpheresContactGeometry',
-			'BodyMacroParameters',
-			'RigidBodyParameters',
-			'ParticleParameters',
-			'DemXDofGeom',
-			'InteractionPhysicsMetaEngine']),
-
-	env.SharedLibrary('InteractingBox2InteractingSphere4SpheresContactGeometry',
-		['Engine/EngineUnit/InteractingBox2InteractingSphere4SpheresContactGeometry.cpp'],
-		LIBS=env['LIBS']+['SpheresContactGeometry',
-			'InteractionGeometryMetaEngine',
-			'yade-base',
-			'yade-multimethods',
-			'InteractingSphere',
-			'InteractingBox']),
-
-        env.SharedLibrary('InteractingSphere2BssSweptSphereLineSegment4SpheresContactGeometry',
-                ['Engine/EngineUnit/InteractingSphere2BssSweptSphereLineSegment4SpheresContactGeometry.cpp'],
-                LIBS=env['LIBS']+['SpheresContactGeometry',
-                        'InteractionGeometryMetaEngine',
-                        'yade-base',
-                        'yade-multimethods',
-                        'InteractingSphere',
-                        'BssSweptSphereLineSegment']),
-
-        #env.SharedLibrary('ElasticBodyParameters2BcpConnection4ElasticContactInteraction',
-                #['Engine/EngineUnit/ElasticBodyParameters2BcpConnection4ElasticContactInteraction.cpp'],
-                #LIBS=env['LIBS']+['ElasticContactInteraction',
-                        #'ElasticBodyParameters',
-                        #'yade-base',
-                        #'yade-multimethods',
-                        #'BcpConnection']),
-
-	env.SharedLibrary('InteractingSphere2InteractingSphere4SpheresContactGeometry',
-		['Engine/EngineUnit/InteractingSphere2InteractingSphere4SpheresContactGeometry.cpp'],
-		LIBS=env['LIBS']+['SDECLinkGeometry',
-			'SpheresContactGeometry',
-			'InteractionGeometryMetaEngine',
-			'yade-base',
-			'yade-multimethods',
-			'InteractingSphere']),
-			
-	env.SharedLibrary('InteractingFacet2InteractingSphere4SpheresContactGeometry'
-	    ,['Engine/EngineUnit/InteractingFacet2InteractingSphere4SpheresContactGeometry.cpp']
-	    ,LIBS=env['LIBS']+['InteractingFacet'
-				,'InteractingSphere'
-				,'InteractionGeometryMetaEngine'
-				,'SpheresContactGeometry']),
-
-	env.SharedLibrary('InteractingMyTetrahedron2AABB',
-		['Engine/EngineUnit/InteractingMyTetrahedron2AABB.cpp'],
-		LIBS=env['LIBS']+['BoundingVolumeMetaEngine',
-			'InteractingMyTetrahedron',
-			'AABB',
-			'yade-base']),
-
-	env.SharedLibrary('InteractingMyTetrahedron2InteractingMyTetrahedron4InteractionOfMyTetrahedron',
-		['Engine/EngineUnit/InteractingMyTetrahedron2InteractingMyTetrahedron4InteractionOfMyTetrahedron.cpp'],
-		LIBS=env['LIBS']+['InteractionOfMyTetrahedron',
-			'InteractionGeometryMetaEngine',
-			'yade-base',
-			'yade-multimethods',
-			'InteractingMyTetrahedron',
-			'yade-base']),
-
-	env.SharedLibrary('InteractingMyTetrahedron2InteractingBox4InteractionOfMyTetrahedron',
-		['Engine/EngineUnit/InteractingMyTetrahedron2InteractingBox4InteractionOfMyTetrahedron.cpp'],
-		LIBS=env['LIBS']+['InteractionOfMyTetrahedron',
-			'InteractionGeometryMetaEngine',
-			'InteractingBox2InteractingSphere4SpheresContactGeometry',
-			'InteractingBox',
-			'InteractingSphere',
-			'SpheresContactGeometry',
-			'yade-base',
-			'yade-multimethods',
-			'InteractingMyTetrahedron']),
-
-	env.SharedLibrary('Tetrahedron2InteractingMyTetrahedron',
-		['Engine/EngineUnit/Tetrahedron2InteractingMyTetrahedron.cpp'],
-		LIBS=env['LIBS']+['InteractingMyTetrahedron', 'InteractingGeometryMetaEngine', 'Tetrahedron']),
-
-	env.SharedLibrary('ElasticCohesiveLaw',
-		['Engine/StandAloneEngine/ElasticCohesiveLaw.cpp'],
-		LIBS=env['LIBS']+['SDECLinkPhysics',
-			'ElasticContactInteraction',
-			'SDECLinkGeometry',
-			'SpheresContactGeometry',
-			'BodyMacroParameters',
-			'yade-base',
-			'yade-multimethods',
-			'Sphere',
-			'RigidBodyParameters']),
-			
-	env.SharedLibrary('CohesiveFrictionalRelationships',
-		['Engine/EngineUnit/CohesiveFrictionalRelationships.cpp'],
-		LIBS=env['LIBS']+['SDECLinkPhysics',
-			'SDECLinkGeometry',
-			'CohesiveFrictionalContactInteraction',
-			'SpheresContactGeometry',
-			'CohesiveFrictionalBodyParameters',
-			'RigidBodyParameters',
-			'ParticleParameters',
-			'InteractionPhysicsMetaEngine']),
-
-	env.SharedLibrary('CL1Relationships',
-		['Engine/EngineUnit/CL1Relationships.cpp'],
-		LIBS=env['LIBS']+['SDECLinkPhysics',
-			'SDECLinkGeometry',
-			'ContactLaw1Interaction',
-			'SpheresContactGeometry',
-			'CohesiveFrictionalBodyParameters',
-			'RigidBodyParameters',
-			'ParticleParameters',
-			'InteractionPhysicsMetaEngine']),
-
-	env.SharedLibrary('ElasticContactLaw',
-		['Engine/StandAloneEngine/ElasticContactLaw.cpp'],
-		LIBS=env['LIBS']+['SDECLinkPhysics',
-			'ElasticContactInteraction',
-			'SDECLinkGeometry',
-			'DemXDofGeom',
-			'SpheresContactGeometry',
-			'BodyMacroParameters',
-			'Sphere',
-			'RigidBodyParameters']),
-	
-
-	env.SharedLibrary('CohesiveFrictionalContactLaw',
-		['Engine/StandAloneEngine/CohesiveFrictionalContactLaw.cpp'],
-		LIBS=env['LIBS']+['SDECLinkPhysics',
-			'CohesiveFrictionalContactInteraction',
-			'SDECLinkGeometry',
-			'SpheresContactGeometry',
-			'CohesiveFrictionalBodyParameters',
-			'yade-serialization',
-			'yade-base',
-			
-			'yade-multimethods',
-			'Sphere',
-			'RigidBodyParameters']),
-
-	env.SharedLibrary('MyTetrahedronLaw',
-		['Engine/StandAloneEngine/MyTetrahedronLaw.cpp'],
-		LIBS=env['LIBS']+['ElasticContactInteraction',
-			'InteractionOfMyTetrahedron',
-			'ElasticBodyParameters',
-			'yade-serialization',
-			'yade-base',
-			'yade-multimethods',
-			'Sphere',
-			'RigidBodyParameters']),
-
-	env.SharedLibrary('ElasticCriterionTimeStepper',
-		['Engine/StandAloneEngine/ElasticCriterionTimeStepper.cpp'],
-		LIBS=env['LIBS']+['ElasticContactInteraction',
-			'SpheresContactGeometry',
-			'MacroMicroElasticRelationships',
-			'Sphere']),
-
-	env.SharedLibrary('AveragePositionRecorder',
-		['Engine/StandAloneEngine/AveragePositionRecorder.cpp'],
-		LIBS=env['LIBS']+['RigidBodyParameters']),
-
-	env.SharedLibrary('PositionRecorder',
-		['Engine/StandAloneEngine/PositionRecorder.cpp'],
-		LIBS=env['LIBS']+['RigidBodyParameters']),
-
-	env.SharedLibrary('ForceRecorder',
-		['Engine/StandAloneEngine/ForceRecorder.cpp'],
-		LIBS=env['LIBS']+['RigidBodyParameters']),
-
-	env.SharedLibrary('PositionOrientationRecorder',
-		['Engine/StandAloneEngine/PositionOrientationRecorder.cpp'],
-		LIBS=env['LIBS']+['RigidBodyParameters']),
-
-	env.SharedLibrary('PositionSnapshot',
-		['Engine/StandAloneEngine/PositionSnapshot.cpp'],
-		LIBS=env['LIBS']+[
-			'RigidBodyParameters'
-			,'Sphere']),
-
-	env.SharedLibrary('ForceSnapshot',
-		['Engine/StandAloneEngine/ForceSnapshot.cpp'],
-		LIBS=env['LIBS']+[
-			'RigidBodyParameters'
-			,'ElasticContactInteraction'
-			,'Sphere']),
-
-	env.SharedLibrary('VelocityRecorder',
-		['Engine/StandAloneEngine/VelocityRecorder.cpp'],
-		LIBS=env['LIBS']+['ParticleParameters']),
-
-	env.SharedLibrary('GlobalStiffnessTimeStepper',
-		['Engine/StandAloneEngine/GlobalStiffnessTimeStepper.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			
-			'ElasticContactInteraction',
-			'SpheresContactGeometry',
-			'Sphere',
-			]),
-
-	env.SharedLibrary('GeometricalModelForceColorizer',
-		['Engine/StandAloneEngine/GeometricalModelForceColorizer.cpp'],
-		LIBS=env['LIBS']+['RigidBodyParameters',]),
-
-	env.SharedLibrary('TriaxialStressController',
-		['Engine/DeusExMachina/TriaxialStressController.cpp'],
-		LIBS=env['LIBS']+[
-			'yade-base',
-			'ParticleParameters',
-			'RigidBodyParameters',
-			'ElasticContactInteraction',
-			'InteractingSphere',
-			'InteractingBox',
-			'SpheresContactGeometry',
-			'Sphere']),
-
-	env.SharedLibrary('TriaxialCompressionEngine',
-		['Engine/DeusExMachina/TriaxialCompressionEngine.cpp'],
-		LIBS=env['LIBS']+[
-			'yade-base',
-			'ParticleParameters',
-			'ElasticContactInteraction',
-			'TriaxialStressController',
-			'Shop']),
-			
-	env.SharedLibrary('ThreeDTriaxialEngine',
-		['Engine/DeusExMachina/ThreeDTriaxialEngine.cpp'],
-		LIBS=env['LIBS']+[
-			'yade-base',
-			#'Force',
-			'ParticleParameters',
-			'ElasticContactInteraction',
-			'TriaxialStressController',
-			'Shop']),
-
-
-	env.SharedLibrary('Funnel',
-		['PreProcessor/Funnel.cpp'],
-		LIBS=env['LIBS']+['SDECLinkGeometry',
-			'ElasticContactLaw',
-			'MacroMicroElasticRelationships',
-			'ElasticCriterionTimeStepper',
-			'InteractingSphere',
-			'InteractingBox',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'yade-serialization',
-			'yade-base',
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'Box',
-			'Sphere',
-			'AABB',
-			'PersistentSAPCollider',
-			'ParticleParameters',
-			'MetaInteractingGeometry2AABB',
-			'yade-multimethods']),
-
-	env.SharedLibrary('SDECImpactTest',
-		['PreProcessor/SDECImpactTest.cpp'],
-		LIBS=env['LIBS']+['SDECLinkGeometry',
-			'ElasticContactLaw',
-			'AveragePositionRecorder',
-			'VelocityRecorder',
-			'ForceRecorder',
-			'MacroMicroElasticRelationships',
-			'ElasticCriterionTimeStepper',
-			'yade-base',
-			'InteractingSphere',
-			'InteractingBox',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'yade-serialization',
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'yade-multimethods',
-			'Box',
-			'Sphere',
-			'AABB',
-			'PersistentSAPCollider',
-			'MetaInteractingGeometry2AABB']),
-
-	env.SharedLibrary('DirectShearCis',
-		['PreProcessor/DirectShearCis.cpp'],
-		LIBS=env['LIBS']+['SDECLinkGeometry',
-			'BodyMacroParameters',
-			'ElasticContactLaw',
-			'MacroMicroElasticRelationships',
-			'SimpleElasticRelationships',
-			'ElasticCriterionTimeStepper',
-			'PositionOrientationRecorder',
-			'PositionRecorder',
-			'PositionSnapshot',
-			'ForceSnapshot',
-			'ForceRecorder',
-			'InteractingSphere',
-			'InteractingBox',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'CinemDNCEngine',
-			'yade-serialization',
-			'yade-base',
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'Box',
-			'Sphere',
-			'AABB',
-			'PersistentSAPCollider',
-			'ParticleParameters',
-			'MetaInteractingGeometry2AABB',
-			'yade-multimethods']),
-
-
-	env.SharedLibrary('SimpleShear',
-		['PreProcessor/SimpleShear.cpp'],
-		LIBS=env['LIBS']+['SDECLinkGeometry',
-			'CohesiveFrictionalBodyParameters',
-			'ContactLaw1',
-			'CL1Relationships',
-			'GlobalStiffnessTimeStepper',
-			'PositionOrientationRecorder',
-			'PositionRecorder',
-			'PositionSnapshot',
-			'ForceSnapshot',
-			'ForceRecorder',
-			'InteractingSphere',
-			'InteractingBox',
-			'NewtonsDampedLaw',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'CinemDNCEngine',
-			'yade-serialization',
-			'yade-base',
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'Box',
-			'Sphere',
-			'AABB',
-			'PersistentSAPCollider',
-			'ParticleParameters',
-			'MetaInteractingGeometry2AABB',
-			'yade-multimethods']),
-
-
-	env.SharedLibrary('SDECLinkedSpheres',
-		['PreProcessor/SDECLinkedSpheres.cpp'],
-		LIBS=env['LIBS']+['SDECLinkGeometry',
-			'ElasticContactLaw',
-			'ElasticCohesiveLaw',
-			'MacroMicroElasticRelationships',
-			'ElasticCriterionTimeStepper',
-			'InteractingSphere',
-			'InteractingBox',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'yade-serialization',
-			'SpheresContactGeometry',
-			'yade-base',
-			
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'Box',
-			'Sphere',
-			'AABB',
-			'PersistentSAPCollider',
-			'ParticleParameters',
-			'MetaInteractingGeometry2AABB',
-			'yade-multimethods']),
-
-	env.SharedLibrary('SDECSpheresPlane',
-		['PreProcessor/SDECSpheresPlane.cpp'],
-		LIBS=env['LIBS']+['SDECLinkGeometry',
-			'ElasticContactLaw',
-			'MacroMicroElasticRelationships',
-			'ElasticCriterionTimeStepper',
-			'PositionOrientationRecorder',
-			'InteractingSphere',
-			'InteractingBox',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'yade-serialization',
-			'yade-base',
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'Box',
-			'Sphere',
-			'AABB',
-			'PersistentSAPCollider',
-			'ParticleParameters',
-			'MetaInteractingGeometry2AABB',
-			'yade-multimethods']),
-
-	env.SharedLibrary('SDECMovingWall',
-		['PreProcessor/SDECMovingWall.cpp'],
-		LIBS=env['LIBS']+['SDECLinkGeometry',
-			'ElasticContactLaw',
-			'MacroMicroElasticRelationships',
-			'ElasticCriterionTimeStepper',
-			'PositionOrientationRecorder',
-			'InteractingSphere',
-			'InteractingBox',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'TranslationEngine',
-			'yade-serialization',
-			'yade-base',
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'Box',
-			'Sphere',
-			'AABB',
-			'PersistentSAPCollider',
-			'ParticleParameters',
-			'MetaInteractingGeometry2AABB',
-			'yade-multimethods']),
-
-	env.SharedLibrary('TetrahedronsTest',
-		['PreProcessor/TetrahedronsTest.cpp'],
-		LIBS=env['LIBS']+['MyTetrahedronLaw',
-			'MacroMicroElasticRelationships',
-			'ElasticCriterionTimeStepper',
-			'InteractingMyTetrahedron',
-			'InteractingSphere',
-			'InteractingBox',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractingGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'Box',
-			'Sphere',
-			'AABB',
-			'PersistentSAPCollider',
-			'ParticleParameters',
-			'MetaInteractingGeometry2AABB',
-			'Tetrahedron',
-			'yade-serialization',
-			'yade-base',
-			'yade-multimethods']),
-
-        env.SharedLibrary('MembraneTest',
-                ['PreProcessor/MembraneTest.cpp'],
-                LIBS=env['LIBS']+['ef2_BshTube_BssSweptSphereLineSegment_makeBssSweptSphereLineSegment',
-                        'Shop',
-                        'ef2_BssSweptSphereLineSegment_AABB_makeAABB',
-                        'BcpConnection',
-                        'BshTube',
-			#'ElasticBodyParameters2BcpConnection4ElasticContactInteraction',
-                        'BssSweptSphereLineSegment',
-			'SimpleViscoelasticRelationships',
-			'ConstitutiveLawDispatcher',
-			'ef2_Spheres_Viscoelastic_SimpleViscoelasticContactLaw',
-			'SimpleViscoelasticBodyParameters',
-			'ViscoelasticInteraction',
-                        'InteractingSphere','InteractingNode', 
-                        'CundallNonViscousDamping',
-                        'CundallNonViscousDamping',
-                        'MetaInteractingGeometry',
-                        'GravityEngines',
-                        'PhysicalActionContainerReseter',
-                        'InteractionGeometryMetaEngine',
-                        'InteractingGeometryMetaEngine',
-                        'InteractionPhysicsMetaEngine',
-                        'PhysicalActionApplier',
-                        'PhysicalParametersMetaEngine',
-                        'BoundingVolumeMetaEngine',
-                        'Sphere',
-                        'AABB',
-                        'PersistentSAPCollider',
-                        'ParticleParameters',
-                        'MetaInteractingGeometry2AABB',
-                        'yade-serialization',
-                        'yade-base',
-                        'yade-multimethods']),
-
-
-
-	env.SharedLibrary('TriaxialTest',
-		['PreProcessor/TriaxialTest.cpp'],
-		LIBS=env['LIBS']+['SDECLinkGeometry',
-			'ElasticContactLaw',
-			'AveragePositionRecorder',
-			'VelocityRecorder',
-			'ForceRecorder',
-#			'MicroMacroAnalyser',
-			'SimpleElasticRelationships',
-			'ElasticCriterionTimeStepper',
-			'InteractingSphere',
-			'InteractingBox',
-			'InteractingFacet',
-			'NewtonsDampedLaw',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'yade-serialization',
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'yade-multimethods',
-			'Box',
-			'Sphere',
-			'Facet',
-			'AABB',
-			'PersistentSAPCollider',
-			'InsertionSortCollider',
-			'MetaInteractingGeometry2AABB',
-			'TriaxialStressController',
-			'TriaxialCompressionEngine',
-			'GlobalStiffnessTimeStepper',
-			'yade-base',
-			'TriaxialStateRecorder',
-			'PositionOrientationRecorder',
-			'Shop',
-			'ConstitutiveLawDispatcher',
-			'InteractionDispatchers',
-			'NewtonsDampedLaw']),
-			
-	env.SharedLibrary('CohesiveTriaxialTest',
-		['PreProcessor/CohesiveTriaxialTest.cpp'],
-		LIBS=env['LIBS']+['SDECLinkGeometry',
-			'CohesiveFrictionalContactLaw',
-			'AveragePositionRecorder',
-			'VelocityRecorder',
-			'ForceRecorder',
-			'CohesiveFrictionalRelationships',
-			'ElasticCriterionTimeStepper',
-			'InteractingSphere',
-			'InteractingBox',
-			'InteractingSphere2InteractingSphere4SpheresContactGeometry',
-			'InteractingBox2InteractingSphere4SpheresContactGeometry',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'yade-serialization',
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'yade-multimethods',
-			'Box',
-			'Sphere',
-			'AABB',
-			'DistantPersistentSAPCollider',
-			'MetaInteractingGeometry2AABB',
-			'TriaxialStressController',
-			'TriaxialCompressionEngine',
-			'GlobalStiffnessTimeStepper',
-			'yade-base',
-			'Shop',
-			'TriaxialStateRecorder',
-			'PositionOrientationRecorder',
-			'HydraulicForceEngine']),
-
-	env.SharedLibrary('ThreePointBending',
-		['PreProcessor/ThreePointBending.cpp'],
-		LIBS=env['LIBS']+['SDECLinkGeometry',
-			'ElasticContactLaw',
-			'ElasticCohesiveLaw',
-			'MacroMicroElasticRelationships',
-			'ElasticCriterionTimeStepper',
-			'InteractingSphere',
-			'InteractingBox',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'yade-serialization',
-			'yade-base',
-			'Shop',
-			
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'Box',
-			'Sphere',
-			'AABB',
-			'PersistentSAPCollider',
-			'ParticleParameters',
-			'MetaInteractingGeometry2AABB',
-			'yade-multimethods',
-			'TranslationEngine']),
-
-
-env.SharedLibrary('WallStressRecorder',
-		['Engine/DeusExMachina/WallStressRecorder.cpp'],
-		LIBS=env['LIBS']+['ParticleParameters',
-			'ElasticContactInteraction',
-			'SpheresContactGeometry',
-			'BodyMacroParameters',
-			'TriaxialStressController',
-			'TriaxialCompressionEngine',
-			'Sphere',
-			'ElasticContactLaw']),
-			
-env.SharedLibrary('TriaxialStateRecorder',
-		['Engine/DeusExMachina/TriaxialStateRecorder.cpp'],
-		LIBS=env['LIBS']+['TriaxialCompressionEngine']),
-
-env.SharedLibrary('CapillaryPressureEngine',
-		['Engine/DeusExMachina/CapillaryPressureEngine.cpp'],
-		LIBS=env['LIBS']+['CapillaryCohesiveLaw']),
-
-
-env.SharedLibrary('CapillaryStressRecorder',
-		['Engine/DeusExMachina/CapillaryStressRecorder.cpp'],
-		LIBS=env['LIBS']+['ParticleParameters',
-			'ElasticContactInteraction',
-			'CapillaryParameters',
-			'TriaxialStressController',
-			'TriaxialCompressionEngine',
-			'CapillaryCohesiveLaw']),
-
-env.SharedLibrary('TriaxialTestWater',
-		['PreProcessor/TriaxialTestWater.cpp'],
-		LIBS=env['LIBS']+Split('''SDECLinkGeometry
-        ElasticContactLaw
-        CapillaryCohesiveLaw
-        AveragePositionRecorder
-        VelocityRecorder
-	PositionOrientationRecorder
-        ForceRecorder
-        TriaxialStateRecorder
-        CapillaryStressRecorder
-        ContactStressRecorder
-        SimpleElasticRelationshipsWater
-        ElasticCriterionTimeStepper
-        InteractingSphere
-        InteractingBox
-	NewtonsDampedLaw
-        CundallNonViscousDamping
-        CundallNonViscousDamping
-        MetaInteractingGeometry
-        GravityEngines
-        yade-serialization
-        PhysicalActionContainerReseter
-        InteractionGeometryMetaEngine
-        InteractionPhysicsMetaEngine
-        InteractingSphere2InteractingSphere4SpheresContactGeometry
-        PhysicalActionApplier
-        PhysicalParametersMetaEngine
-        BoundingVolumeMetaEngine
-        yade-multimethods
-        Box
-        Sphere
-        AABB
-        PersistentSAPCollider
-        MetaInteractingGeometry2AABB
-        InteractingSphere2AABB
-	TriaxialStressController
-	TriaxialCompressionEngine
-	GlobalStiffnessTimeStepper''')),
-
-env.SharedLibrary('ContactStressRecorder',
-		['Engine/DeusExMachina/ContactStressRecorder.cpp'],
-		LIBS=env['LIBS']+['ParticleParameters',
-			'ElasticContactInteraction',
-			'SpheresContactGeometry',
-			'BodyMacroParameters',
-			'TriaxialStressController',
-			'TriaxialCompressionEngine',
-			'Sphere',
-			'ElasticContactLaw',
-			'CapillaryCohesiveLaw']),
-
-env.SharedLibrary('CapillaryCohesiveLaw',
-		['Engine/StandAloneEngine/CapillaryCohesiveLaw.cpp'],
-		LIBS=env['LIBS']+['CapillaryParameters',
-			'ElasticContactInteraction',
-			'SpheresContactGeometry',
-			'BodyMacroParameters',
-			'RigidBodyParameters',
-			'Sphere',
-			'ElasticContactLaw']),
-
-env.SharedLibrary('CapillaryParameters',
-		['DataClass/InteractionPhysics/CapillaryParameters.cpp'],
-		LIBS=env['LIBS']+['ElasticContactInteraction']),
-
-env.SharedLibrary('HydraulicForceEngine',
-		['Engine/DeusExMachina/HydraulicForceEngine.cpp'],
-		LIBS=env['LIBS']+['yade-base',   'ParticleParameters', 'CohesiveFrictionalBodyParameters', 'TriaxialCompressionEngine', 'GravityEngines'],
-		CPPPATH=env['CPPPATH']+['Engine/DeusExMachina',
-			'DataClass/PhysicalAction',
-			'$PREFIX/include',
-			'DataClass/PhysicalParameters']),
-			
-#env.SharedLibrary('FlowEngine',
-		#['Engine/DeusExMachina/FlowEngine.cpp'],
-		#LIBS=env['LIBS']+['yade-base',   'ParticleParameters', 'CohesiveFrictionalBodyParameters', 'TriaxialCompressionEngine', 'GravityEngines'],
-		#CPPPATH=env['CPPPATH']+['Engine/DeusExMachina',
-			#'DataClass/PhysicalAction',
-			#'RigidBodyParameters',
-			#'$PREFIX/include',
-			#'DataClass/PhysicalParameters']),
-			
-env.SharedLibrary('SampleCapillaryPressureEngine',
-		['Engine/DeusExMachina/SampleCapillaryPressureEngine.cpp'],
-		LIBS=env['LIBS']+['yade-factory',
-			'yade-base',
-			'CapillaryCohesiveLaw',
-			'ParticleParameters',
-			'ElasticContactInteraction',
-			'TriaxialStressController']),
-			
-env.SharedLibrary('StaticSpheresAttractionEngine',
-		['Engine/DeusExMachina/StaticSpheresAttractionEngine.cpp'],
-		LIBS=env['LIBS']+['yade-base',  'Sphere', 'StaticAttractionEngine', 'ElasticContactInteraction'],
-		CPPPATH=env['CPPPATH']+['Engine/DeusExMachina',
-			'DataClass/GeometricalModel',
-			'$PREFIX/include']),
-			
-env.SharedLibrary('HydraulicTest',
-		['PreProcessor/HydraulicTest.cpp'],
-		LIBS=env['LIBS']+['SDECLinkGeometry',
-			'CohesiveFrictionalContactLaw',
-			'AveragePositionRecorder',
-			'VelocityRecorder',
-			'ForceRecorder',
-			'CohesiveFrictionalRelationships',
-			'ElasticCriterionTimeStepper',
-			'InteractingSphere',
-			'InteractingBox',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'yade-serialization',
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'yade-multimethods',
-			'Box',
-			'Sphere',
-			'AABB',
-			'DistantPersistentSAPCollider',
-			'MetaInteractingGeometry2AABB',
-			'TriaxialStressController',
-			'TriaxialCompressionEngine',
-			'GlobalStiffnessTimeStepper',
-			'yade-base',
-			'TriaxialStateRecorder',
-			'PositionOrientationRecorder',
-			'HydraulicForceEngine',
-			'TranslationEngine',]),
-
-
-env.SharedLibrary('NewtonsDampedLaw',
-		['Engine/StandAloneEngine/NewtonsDampedLaw.cpp'],
-		LIBS=env['LIBS']+['yade-serialization',
-			'yade-base',		
-			'yade-multimethods',
-			'RigidBodyParameters',
-			'Clump',
-			'VelocityBins'
-			 ]),
-
-	env.SharedLibrary('SimpleViscoelasticBodyParameters'
-		,['DataClass/PhysicalParameters/SimpleViscoelasticBodyParameters.cpp']
-		,LIBS=env['LIBS']+['RigidBodyParameters'])
-
-	,env.SharedLibrary('ViscoelasticInteraction'
-		,['DataClass/InteractionPhysics/ViscoelasticInteraction.cpp']
-	    ,LIBS=env['LIBS']+['ElasticContactInteraction'])
-    
-	,env.SharedLibrary('SimpleViscoelasticRelationships'
-		,['Engine/EngineUnit/SimpleViscoelasticRelationships.cpp']
-		,LIBS=env['LIBS']+['SimpleViscoelasticBodyParameters'
-		    ,'ViscoelasticInteraction'
-		    ,'SpheresContactGeometry',
-			 'EngineUnits'
-		    ])
-
-	,env.SharedLibrary('BasicViscoelasticRelationships'
-		,['Engine/EngineUnit/BasicViscoelasticRelationships.cpp']
-		,LIBS=env['LIBS']+['SimpleViscoelasticBodyParameters'
-		    ,'ViscoelasticInteraction'
-		    ,'SpheresContactGeometry'
-			 ,'EngineUnits',
-		    ])
-
-	,env.SharedLibrary('ContactLaw1',
-		['Engine/StandAloneEngine/ContactLaw1.cpp'],
-		LIBS=env['LIBS']+['SDECLinkPhysics',
-			'ContactLaw1Interaction',
-			'SDECLinkGeometry',
-			'SpheresContactGeometry',
-			'CohesiveFrictionalBodyParameters',
-			'yade-serialization',
-			'yade-base',
-			'yade-multimethods',
-			'Sphere',
-			'RigidBodyParameters'])
-
-
-
-	,env.SharedLibrary('SimpleViscoelasticSpheresInteractionRecorder'
-	    ,['Engine/StandAloneEngine/SimpleViscoelasticSpheresInteractionRecorder.cpp']
-	    ,LIBS=env['LIBS']+['SpheresContactGeometry','ViscoelasticInteraction'])
-
-	,env.SharedLibrary('RigidBodyRecorder'
-	,['Engine/StandAloneEngine/RigidBodyRecorder.cpp']
-	,LIBS=env['LIBS']+['RigidBodyParameters'])
-
-	,env.SharedLibrary('MGPRecorder'
-	,['Engine/StandAloneEngine/MGPRecorder.cpp']
-	,LIBS=env['LIBS']+['RigidBodyParameters','Sphere'])
-
-	,env.SharedLibrary('HistoryRecorder'
-	,['Engine/StandAloneEngine/HistoryRecorder.cpp']
-	,LIBS=env['LIBS']+['RigidBodyParameters','Sphere','Box','SpheresContactGeometry','NormalShearInteractions'])
-
-	,env.SharedLibrary('TestSimpleViscoelastic'
-		,['PreProcessor/TestSimpleViscoelastic.cpp']
-		,LIBS=env['LIBS']+['AABB'
-			    ,'Box'
-                ,'Shop'
-			    ,'InteractingBox'
-			    ,'SimpleViscoelasticRelationships'
-			    ,'ConstitutiveLawDispatcher'
-			    ,'ef2_Spheres_Viscoelastic_SimpleViscoelasticContactLaw'
-			    ,'SimpleViscoelasticBodyParameters'
-			    ,'ViscoelasticInteraction'
-			    ,'SimpleViscoelasticSpheresInteractionRecorder'
-			    ,'GravityEngines'
-			    ,'BoundingVolumeMetaEngine'
-			    ,'InteractingSphere'
-			    ,'InteractionGeometryMetaEngine'
-			    ,'InteractionPhysicsMetaEngine'
-			    ,'MetaInteractingGeometry'
-			    ,'MetaInteractingGeometry2AABB'
-			    ,'ParticleParameters'
-			    ,'RigidBodyRecorder'
-			    ,'PhysicalActionApplier'
-			    ,'PhysicalActionContainerReseter'
-			    ,'PhysicalParametersMetaEngine'
-			    ,'PersistentSAPCollider'
-			    ,'Sphere'
-			    ])
-
-	,env.SharedLibrary('STLImporterTest'
-	    ,['PreProcessor/STLImporterTest.cpp']
-	    ,LIBS=env['LIBS']+['AABB'
-				,'STLImporter'
-				,'BoundingVolumeMetaEngine'
-				,'CundallNonViscousDamping'
-				,'CundallNonViscousDamping'
-				,'ElasticContactLaw'
-				,'ElasticCriterionTimeStepper'
-				,'Facet'
-				,'GravityEngines'
-				,'InteractingFacet'
-				,'InteractingSphere'
-				,'InteractionGeometryMetaEngine'
-				,'InteractionPhysicsMetaEngine'
-				,'MacroMicroElasticRelationships'
-				,'MetaInteractingGeometry'
-				,'MetaInteractingGeometry2AABB'
-				,'ParticleParameters'
-				,'PhysicalActionApplier'
-				,'PhysicalActionContainerReseter'
-				,'PhysicalParametersMetaEngine'
-				,'SpatialQuickSortCollider'
-				,'Sphere'
-				,'RotationEngine'
-				]),
-
-	env.SharedLibrary('ef2_Dem3Dof_NormalShear_ElasticFrictionalLaw',
-		['Engine/EngineUnit/ef2_Dem3Dof_NormalShear_ElasticFrictionalLaw.cpp'],
-		LIBS=env['LIBS']+['ConstitutiveLawDispatcher','NormalShearInteractions','DemXDofGeom']),
-
-	env.SharedLibrary('ef2_Spheres_Viscoelastic_SimpleViscoelasticContactLaw',
-		['Engine/EngineUnit/ef2_Spheres_Viscoelastic_SimpleViscoelasticContactLaw.cpp'],
-		LIBS=env['LIBS']+['ConstitutiveLawDispatcher','ViscoelasticInteraction','SpheresContactGeometry','RigidBodyParameters']),
-				
-	#env.SharedLibrary('MicroMacroAnalyser',
-		#['Engine/StandAloneEngine/MicroMacroAnalyser.cpp'],
-		#LIBS=env['LIBS']+['SDECLinkPhysics',
-			#'ElasticContactInteraction',
-			#'SDECLinkGeometry',
-			#'SpheresContactGeometry',
-			#'BodyMacroParameters',
-			#'yade-serialization',
-			#'yade-base',
-			#'GLDrawInteractingSphere',
-			#'yade-multimethods',
-			#'Sphere',
-			#'RigidBodyParameters',
-			#'InteractingSphere',
-			#'TesselationWrapper',
-			#'TriaxialCompressionEngine',
-			#'CGAL'],
-			#CPPPATH=env['CPPPATH']+['/home/bruno/YADE/trunk_svn/extra/triangulation'],
-			#LIBPATH=env['LIBPATH']+['/home/bruno/YADE/trunk_svn/extra/triangulation']),
-
-	#env.Command('/home/bruno/YADE/trunk_svn/extra/triangulation/libTesselationWrapper.a',
-			#['/home/bruno/YADE/trunk_svn/extra/triangulation/TesselationWrapper.cpp',
-			#'/home/bruno/YADE/trunk_svn/extra/triangulation/KinematicLocalisationAnalyser.cpp',
-			#'/home/bruno/YADE/trunk_svn/extra/triangulation/TriaxialState.cpp'],
-			#"make",
-			#chdir='/home/bruno/YADE/trunk_svn/extra/triangulation')
-			
-	env.SharedLibrary('SimpleElasticRelationshipsWater',
-		['Engine/EngineUnit/SimpleElasticRelationshipsWater.cpp'],
-		LIBS=env['LIBS']+['SDECLinkPhysics',
-			'ElasticContactInteraction',
-			'CapillaryParameters',
-			'SpheresContactGeometry',
-			'BodyMacroParameters',
-			'RigidBodyParameters',
-			'ParticleParameters',
-			'InteractionPhysicsMetaEngine']),
-])
-
-
-
-if 'YADE_OPENGL' in env['CPPDEFINES']:
-	env.Install('$PREFIX/lib/yade$SUFFIX/pkg-dem',[
-
-		env.SharedLibrary('GLDrawInteractingMyTetrahedron',
-			['RenderingEngine/GLDrawInteractingMyTetrahedron/GLDrawInteractingMyTetrahedron.cpp'],
-			LIBS=env['LIBS']+['InteractingMyTetrahedron', 'yade-opengl']),
-
-		env.SharedLibrary('GLDrawCohesiveFrictionalContactInteraction',
-			['RenderingEngine/GLDrawCohesiveFrictionalContactInteraction/GLDrawCohesiveFrictionalContactInteraction.cpp'],
-			LIBS=env['LIBS']+['CohesiveFrictionalContactInteraction','SpheresContactGeometry',
-				'GLDrawElasticContactInteraction',
-				'ElasticContactInteraction',
-				'yade-opengl','$QGLVIEWER_LIB']),
-
-		env.SharedLibrary('GLDrawElasticContactInteraction',
-			['RenderingEngine/GLDrawElasticContactInteraction/GLDrawElasticContactInteraction.cpp'],
-			LIBS=env['LIBS']+['SpheresContactGeometry',
-				'ElasticContactInteraction',
-				'yade-opengl','$QGLVIEWER_LIB']),
-
-		env.SharedLibrary('GLDrawSpheresContactGeometry',
-			['RenderingEngine/GLDrawSpheresContactGeometry/GLDrawSpheresContactGeometry.cpp'],
-			LIBS=env['LIBS']+['SpheresContactGeometry',
-				'ElasticContactInteraction',
-				'yade-opengl','$QGLVIEWER_LIB']),
-
-		env.SharedLibrary('GLDrawSDECLinkGeometry',
-			['RenderingEngine/GLDrawSDECLinkGeometry/GLDrawSDECLinkGeometry.cpp'],
-			LIBS=env['LIBS']+['SDECLinkGeometry',
-				'SDECLinkPhysics',
-				'yade-opengl']),
-		env.SharedLibrary('GLDrawViscoelasticInteraction'
-			 ,['RenderingEngine/GLDrawViscoelasticInteraction/GLDrawViscoelasticInteraction.cpp']
-			 ,LIBS=env['LIBS']+['yade-opengl','ViscoelasticInteraction'])
-	])

Copied: trunk/pkg/dem/meta/ConcretePM.cpp (from rev 1875, trunk/pkg/dem/ConcretePM.cpp)
===================================================================
--- trunk/pkg/dem/ConcretePM.cpp	2009-07-17 21:50:55 UTC (rev 1875)
+++ trunk/pkg/dem/meta/ConcretePM.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,368 @@
+// 2007,2008 © Václav Šmilauer <eudoxos@xxxxxxxx> 
+#include"ConcretePM.hpp"
+#include<yade/core/MetaBody.hpp>
+#include<yade/pkg-dem/BodyMacroParameters.hpp>
+#include<yade/pkg-common/Sphere.hpp>
+#include<yade/pkg-dem/DemXDofGeom.hpp>
+#include<yade/pkg-dem/Shop.hpp>
+
+YADE_PLUGIN("CpmMat","Ip2_CpmMat_CpmMat_CpmPhys","CpmPhys","Law2_Dem3DofGeom_CpmPhys_Cpm","CpmGlobalCharacteristics",
+	#ifdef YADE_OPENGL
+		"GLDrawCpmPhys",
+	#endif	
+		"CpmPhysDamageColorizer");
+
+
+/********************** Ip2_CpmMat_CpmMat_CpmPhys ****************************/
+
+CREATE_LOGGER(Ip2_CpmMat_CpmMat_CpmPhys);
+
+void Ip2_CpmMat_CpmMat_CpmPhys::go(const shared_ptr<PhysicalParameters>& pp1, const shared_ptr<PhysicalParameters>& pp2, const shared_ptr<Interaction>& interaction){
+	if(interaction->interactionPhysics) return; 
+
+	Dem3DofGeom* contGeom=YADE_CAST<Dem3DofGeom*>(interaction->interactionGeometry.get());
+	assert(contGeom);
+
+	const shared_ptr<BodyMacroParameters>& elast1=static_pointer_cast<BodyMacroParameters>(pp1);
+	const shared_ptr<BodyMacroParameters>& elast2=static_pointer_cast<BodyMacroParameters>(pp2);
+
+	Real E12=2*elast1->young*elast2->young/(elast1->young+elast2->young); // harmonic Young's modulus average
+	//Real nu12=2*elast1->poisson*elast2->poisson/(elast1->poisson+elast2->poisson); // dtto for Poisson ratio 
+	Real minRad=(contGeom->refR1<=0?contGeom->refR2:(contGeom->refR2<=0?contGeom->refR1:min(contGeom->refR1,contGeom->refR2)));
+	Real S12=Mathr::PI*pow(minRad,2); // "surface" of interaction
+	//Real E=(E12 /* was here for Kn:  *S12/d0  */)*((1+alpha)/(beta*(1+nu12)+gamma*(1-alpha*nu12)));
+	//Real E=E12; // apply alpha, beta, gamma: garbage values of E !?
+
+	if(!neverDamage) { assert(!isnan(sigmaT)); }
+
+	shared_ptr<CpmPhys> contPhys(new CpmPhys());
+
+	contPhys->E=E12;
+	contPhys->G=E12*G_over_E;
+	contPhys->tanFrictionAngle=tan(.5*(elast1->frictionAngle+elast2->frictionAngle));
+	contPhys->undamagedCohesion=sigmaT;
+	contPhys->crossSection=S12;
+	contPhys->epsCrackOnset=epsCrackOnset;
+	contPhys->epsFracture=relDuctility*epsCrackOnset;
+	// inherited from NormalShearInteracion, used in the timestepper
+	contPhys->kn=contPhys->E*contPhys->crossSection;
+	contPhys->ks=contPhys->G*contPhys->crossSection;
+
+	if(neverDamage) contPhys->neverDamage=true;
+	if(cohesiveThresholdIter<0 || (Omega::instance().getCurrentIteration()<cohesiveThresholdIter)) contPhys->isCohesive=true;
+	else contPhys->isCohesive=false;
+	contPhys->dmgTau=dmgTau;
+	contPhys->dmgRateExp=dmgRateExp;
+	contPhys->plTau=plTau;
+	contPhys->plRateExp=plRateExp;
+	contPhys->isoPrestress=isoPrestress;
+
+	interaction->interactionPhysics=contPhys;
+}
+
+
+
+
+/********************** CpmPhys ****************************/
+CREATE_LOGGER(CpmPhys);
+
+// !! at least one virtual function in the .cpp file
+CpmPhys::~CpmPhys(){};
+
+CREATE_LOGGER(Law2_Dem3DofGeom_CpmPhys_Cpm);
+
+long CpmPhys::cummBetaIter=0, CpmPhys::cummBetaCount=0;
+
+Real CpmPhys::solveBeta(const Real c, const Real N){
+	#ifdef YADE_DEBUG
+		cummBetaCount++;
+	#endif
+	const int maxIter=20;
+	const Real maxError=1e-12;
+	Real f, ret=0.;
+	for(int i=0; i<maxIter; i++){
+		#ifdef YADE_DEBUG
+			cummBetaIter++;
+		#endif
+		Real aux=c*exp(N*ret)+exp(ret);
+		f=log(aux);
+		if(fabs(f)<maxError) return ret;
+		Real df=(c*N*exp(N*ret)+exp(ret))/aux;
+		ret-=f/df;
+	}
+	LOG_FATAL("No convergence after "<<maxIter<<" iters; c="<<c<<", N="<<N<<", ret="<<ret<<", f="<<f);
+	throw runtime_error("Law2_Dem3DofGeom_CpmPhys_Cpm::solveBeta failed to converge.");
+}
+
+Real CpmPhys::computeDmgOverstress(Real dt){
+	if(dmgStrain>=epsN*omega){ // unloading, no viscous stress
+		dmgStrain=epsN*omega;
+		LOG_TRACE("Elastic/unloading, no viscous overstress");
+		return 0.;
+	}
+	Real c=epsCrackOnset*(1-omega)*pow(dmgTau/dt,dmgRateExp)*pow(epsN*omega-dmgStrain,dmgRateExp-1.);
+	Real beta=solveBeta(c,dmgRateExp);
+	Real deltaDmgStrain=(epsN*omega-dmgStrain)*exp(beta);
+	dmgStrain+=deltaDmgStrain;
+	LOG_TRACE("deltaDmgStrain="<<deltaDmgStrain<<", viscous overstress "<<(epsN*omega-dmgStrain)*E);
+	/* σN=Kn(εN-εd); dmgOverstress=σN-(1-ω)*Kn*εN=…=Kn(ω*εN-εd) */
+	return (epsN*omega-dmgStrain)*E;
+}
+
+Real CpmPhys::computeViscoplScalingFactor(Real sigmaTNorm, Real sigmaTYield,Real dt){
+	if(sigmaTNorm<sigmaTYield) return 1.;
+	Real c=undamagedCohesion*pow(plTau/(G*dt),plRateExp)*pow(sigmaTNorm-sigmaTYield,plRateExp-1.);
+	Real beta=solveBeta(c,plRateExp);
+	//LOG_DEBUG("scaling factor "<<1.-exp(beta)*(1-sigmaTYield/sigmaTNorm));
+	return 1.-exp(beta)*(1-sigmaTYield/sigmaTNorm);
+}
+
+
+/********************** Law2_Dem3DofGeom_CpmPhys_Cpm ****************************/
+
+/// yield surface parameters
+int  Law2_Dem3DofGeom_CpmPhys_Cpm::yieldSurfType=2;
+Real Law2_Dem3DofGeom_CpmPhys_Cpm::yieldLogSpeed=.1;
+Real Law2_Dem3DofGeom_CpmPhys_Cpm::yieldEllipseShift=0.; // deprecated
+/// compressive plasticity parameters
+// approximates confinement -20MPa precisely, -100MPa a little over, -200 and -400 are OK (secant)
+Real Law2_Dem3DofGeom_CpmPhys_Cpm::epsSoft=-3e-3; // deactivated if >=0
+Real Law2_Dem3DofGeom_CpmPhys_Cpm::relKnSoft=.25;
+// >=1. to deactivate (never delete damaged contacts)
+Real Law2_Dem3DofGeom_CpmPhys_Cpm::omegaThreshold=1.;
+
+void Law2_Dem3DofGeom_CpmPhys_Cpm::go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, MetaBody* rootBody){
+	Dem3DofGeom* contGeom=static_cast<Dem3DofGeom*>(_geom.get());
+	CpmPhys* BC=static_cast<CpmPhys*>(_phys.get());
+
+	// shorthands
+		Real& epsN(BC->epsN); Real& epsNPl(BC->epsNPl); Vector3r& epsT(BC->epsT); Real& kappaD(BC->kappaD); Real& epsPlSum(BC->epsPlSum); const Real& E(BC->E); const Real& undamagedCohesion(BC->undamagedCohesion); const Real& tanFrictionAngle(BC->tanFrictionAngle); const Real& G(BC->G); const Real& crossSection(BC->crossSection); const Real& omegaThreshold(Law2_Dem3DofGeom_CpmPhys_Cpm::omegaThreshold); const Real& epsCrackOnset(BC->epsCrackOnset); Real& relResidualStrength(BC->relResidualStrength); const Real& dt=Omega::instance().getTimeStep();  const Real& epsFracture(BC->epsFracture); const bool& neverDamage(BC->neverDamage); const Real& dmgTau(BC->dmgTau); const Real& plTau(BC->plTau); const bool& isCohesive(BC->isCohesive);
+		Real& omega(BC->omega); Real& sigmaN(BC->sigmaN);  Vector3r& sigmaT(BC->sigmaT); Real& Fn(BC->Fn); Vector3r& Fs(BC->Fs); // for python access
+		const Real& yieldLogSpeed(Law2_Dem3DofGeom_CpmPhys_Cpm::yieldLogSpeed); const int& yieldSurfType(Law2_Dem3DofGeom_CpmPhys_Cpm::yieldSurfType);
+		const Real& yieldEllipseShift(Law2_Dem3DofGeom_CpmPhys_Cpm::yieldEllipseShift); 
+		const Real& epsSoft(Law2_Dem3DofGeom_CpmPhys_Cpm::epsSoft); 
+		const Real& relKnSoft(Law2_Dem3DofGeom_CpmPhys_Cpm::relKnSoft); 
+
+
+	epsN=contGeom->strainN(); epsT=contGeom->strainT();
+	
+	// debugging
+		#define YADE_VERIFY(condition) if(!(condition)){LOG_FATAL("Verification `"<<#condition<<"' failed!"); LOG_FATAL("in interaction #"<<I->getId1()<<"+#"<<I->getId2()); Omega::instance().saveSimulation("/tmp/verificationFailed.xml"); throw;}
+
+		#define NNAN(a) YADE_VERIFY(!isnan(a));
+		#define NNANV(v) YADE_VERIFY(!isnan(v[0])); assert(!isnan(v[1])); assert(!isnan(v[2]));
+		#ifdef YADE_DEBUG
+			if(isnan(epsN)){
+				LOG_FATAL("refLength="<<contGeom->refLength<<"; pos1="<<contGeom->se31.position<<"; pos2="<<contGeom->se32.position<<"; displacementN="<<contGeom->displacementN());
+			throw runtime_error("!! epsN==NaN !!");
+			}
+			NNAN(epsN); NNANV(epsT);
+		#endif
+		NNAN(epsN); NNANV(epsT);
+
+	// constitutive law 
+	#ifdef CPM_MATERIAL_MODEL
+		// complicated version
+		if(epsSoft>=0)	epsN+=BC->isoPrestress/E;
+		else{ // take softening into account for the prestress
+			Real sigmaSoft=E*epsSoft;
+			if(BC->isoPrestress>=sigmaSoft) epsN+=BC->isoPrestress/E; // on the non-softened branch yet
+			// otherwise take the regular and softened branches separately (different moduli)
+			else epsN+=sigmaSoft/E+(BC->isoPrestress-sigmaSoft)/(E*relKnSoft);
+		}
+		CPM_MATERIAL_MODEL
+	#else
+		// simplified public model
+		epsN+=BC->isoPrestress/E;
+		// very simplified version of the constitutive law
+		kappaD=max(max(0.,epsN),kappaD); // internal variable, max positive strain (non-decreasing)
+		omega=isCohesive?funcG(kappaD,epsCrackOnset,epsFracture,neverDamage):1.; // damage variable (non-decreasing, as funcG is also non-decreasing)
+		sigmaN=(1-(epsN>0?omega:0))*E*epsN; // damage taken in account in tension only
+		sigmaT=G*epsT; // trial stress
+		Real yieldSigmaT=max((Real)0.,undamagedCohesion*(1-omega)-sigmaN*tanFrictionAngle); // Mohr-Coulomb law with damage
+		if(sigmaT.SquaredLength()>yieldSigmaT*yieldSigmaT){
+			sigmaT*=yieldSigmaT/sigmaT.Length(); // stress return
+			epsPlSum+=yieldSigmaT*contGeom->slipToStrainTMax(yieldSigmaT/G); // adjust strain
+		}
+		relResidualStrength=isCohesive?(kappaD<epsCrackOnset?1.:(1-omega)*(kappaD)/epsCrackOnset):0;
+	#endif
+	sigmaN-=BC->isoPrestress;
+
+	NNAN(kappaD); NNAN(epsCrackOnset); NNAN(epsFracture); NNAN(omega);
+	NNAN(sigmaN); NNANV(sigmaT); NNAN(crossSection);
+
+	// handle broken contacts
+	if(epsN>0. && ((isCohesive && omega>omegaThreshold) || !isCohesive)){
+		if(isCohesive){
+			const shared_ptr<Body>& body1=Body::byId(I->getId1(),rootBody), body2=Body::byId(I->getId2(),rootBody); assert(body1); assert(body2);
+			const shared_ptr<CpmMat>& rbp1=YADE_PTR_CAST<CpmMat>(body1->physicalParameters), rbp2=YADE_PTR_CAST<CpmMat>(body2->physicalParameters);
+			// nice article about openMP::critical vs. scoped locks: http://www.thinkingparallel.com/2006/08/21/scoped-locking-vs-critical-in-openmp-a-personal-shootout/
+			{ boost::mutex::scoped_lock lock(rbp1->updateMutex); rbp1->numBrokenCohesive+=1; rbp1->epsPlBroken+=epsPlSum; }
+			{ boost::mutex::scoped_lock lock(rbp2->updateMutex); rbp2->numBrokenCohesive+=1; rbp2->epsPlBroken+=epsPlSum; }
+		}
+		rootBody->interactions->requestErase(I->getId1(),I->getId2());
+		return;
+	}
+
+	Fn=sigmaN*crossSection; BC->normalForce=Fn*contGeom->normal;
+	Fs=sigmaT*crossSection; BC->shearForce=Fs;
+
+	applyForceAtContactPoint(BC->normalForce+BC->shearForce, contGeom->contactPoint, I->getId1(), contGeom->se31.position, I->getId2(), contGeom->se32.position, rootBody);
+}
+
+#ifdef YADE_OPENGL
+	/********************** GLDrawCpmPhys ****************************/
+	#include<yade/lib-opengl/OpenGLWrapper.hpp>
+	#include<yade/lib-opengl/GLUtils.hpp>
+
+	CREATE_LOGGER(GLDrawCpmPhys);
+
+	bool GLDrawCpmPhys::contactLine=true;
+	bool GLDrawCpmPhys::dmgLabel=true;
+	bool GLDrawCpmPhys::dmgPlane=false;
+	bool GLDrawCpmPhys::epsNLabel=true;
+	bool GLDrawCpmPhys::epsT=false;
+	bool GLDrawCpmPhys::epsTAxes=false;
+	bool GLDrawCpmPhys::normal=false;
+	bool GLDrawCpmPhys::colorStrain=false;
+
+
+	void GLDrawCpmPhys::go(const shared_ptr<InteractionPhysics>& ip, const shared_ptr<Interaction>& i, const shared_ptr<Body>& b1, const shared_ptr<Body>& b2, bool wireFrame){
+		const shared_ptr<CpmPhys>& BC=static_pointer_cast<CpmPhys>(ip);
+		const shared_ptr<Dem3DofGeom>& geom=YADE_PTR_CAST<Dem3DofGeom>(i->interactionGeometry);
+
+		//Vector3r lineColor(BC->omega,1-BC->omega,0.0); /* damaged links red, undamaged green */
+		Vector3r lineColor=Shop::scalarOnColorScale(1.-BC->relResidualStrength);
+
+		if(colorStrain) lineColor=Vector3r(
+			min((Real)1.,max((Real)0.,-BC->epsTrans/BC->epsCrackOnset)),
+			min((Real)1.,max((Real)0.,BC->epsTrans/BC->epsCrackOnset)),
+			min((Real)1.,max((Real)0.,abs(BC->epsTrans)/BC->epsCrackOnset-1)));
+
+		if(contactLine) GLUtils::GLDrawLine(b1->physicalParameters->dispSe3.position,b2->physicalParameters->dispSe3.position,lineColor);
+		if(dmgLabel){ GLUtils::GLDrawNum(BC->omega,0.5*(b1->physicalParameters->dispSe3.position+b2->physicalParameters->dispSe3.position),lineColor); }
+		else if(epsNLabel){ GLUtils::GLDrawNum(BC->epsN,0.5*(b1->physicalParameters->dispSe3.position+b2->physicalParameters->dispSe3.position),lineColor); }
+		if(BC->omega>0 && dmgPlane){
+			Real halfSize=sqrt(1-BC->relResidualStrength)*.5*.705*sqrt(BC->crossSection);
+			Vector3r midPt=.5*Vector3r(b1->physicalParameters->dispSe3.position+b2->physicalParameters->dispSe3.position);
+			glDisable(GL_CULL_FACE);
+			glPushMatrix();
+				glTranslatev(midPt);
+				Quaternionr q; q.Align(Vector3r::UNIT_Z,geom->normal);
+				Vector3r axis; Real angle; q.ToAxisAngle(axis,angle);
+				glRotatef(angle*Mathr::RAD_TO_DEG,axis[0],axis[1],axis[2]);
+				glBegin(GL_POLYGON);
+					glColor3v(lineColor); 
+					glVertex3d(halfSize,0.,0.);
+					glVertex3d(.5*halfSize,.866*halfSize,0.);
+					glVertex3d(-.5*halfSize,.866*halfSize,0.);
+					glVertex3d(-halfSize,0.,0.);
+					glVertex3d(-.5*halfSize,-.866*halfSize,0.);
+					glVertex3d(.5*halfSize,-.866*halfSize,0.);
+				glEnd();
+			glPopMatrix();
+		}
+
+		const Vector3r& cp=static_pointer_cast<Dem3DofGeom>(i->interactionGeometry)->contactPoint;
+		if(epsT){
+			Real maxShear=(BC->undamagedCohesion-BC->sigmaN*BC->tanFrictionAngle)/BC->G;
+			Real relShear=BC->epsT.Length()/maxShear;
+			Real scale=.5*geom->refLength;
+			Vector3r dirShear=BC->epsT; dirShear.Normalize();
+			if(epsTAxes){
+				GLUtils::GLDrawLine(cp-Vector3r(scale,0,0),cp+Vector3r(scale,0,0));
+				GLUtils::GLDrawLine(cp-Vector3r(0,scale,0),cp+Vector3r(0,scale,0));
+				GLUtils::GLDrawLine(cp-Vector3r(0,0,scale),cp+Vector3r(0,0,scale));
+			}
+			GLUtils::GLDrawArrow(cp,cp+dirShear*relShear*scale,Vector3r(1.,0.,0.));
+			GLUtils::GLDrawLine(cp+dirShear*relShear*scale,cp+dirShear*scale,Vector3r(.3,.3,.3));
+
+			/* normal strain */ GLUtils::GLDrawArrow(cp,cp+geom->normal*(BC->epsN/maxShear),Vector3r(0.,1.,0.));
+		}
+		//if(normal) GLUtils::GLDrawArrow(cp,cp+geom->normal*.5*BC->equilibriumDist,Vector3r(0.,1.,0.));
+	}
+#endif
+
+/********************** CpmGlobalCharacteristics ****************************/
+
+CREATE_LOGGER(CpmGlobalCharacteristics);
+void CpmGlobalCharacteristics::compute(MetaBody* rb, bool useMaxForce){
+	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)
+	Real sumF=0,maxF=0,currF;
+	FOREACH(const shared_ptr<Body>& b, *rb->bodies){
+	CpmMat* bpp(YADE_CAST<CpmMat*>(b->physicalParameters.get()));
+		bpp->epsVolumetric=0;
+		bpp->numContacts=0;
+		currF=rb->bex.getForce(b->id).Length(); maxF=max(currF,maxF); sumF+=currF;
+	}
+	Real meanF=sumF/rb->bodies->size(); 
+
+	// commulate normal strains from contacts
+	// get max force on contacts
+	Real maxContactF=0;
+	FOREACH(const shared_ptr<Interaction>& I, *rb->interactions){
+		if(!I->isReal()) continue;
+		shared_ptr<CpmPhys> BC=YADE_PTR_CAST<CpmPhys>(I->interactionPhysics); assert(BC);
+		maxContactF=max(maxContactF,max(BC->Fn,BC->Fs.Length()));
+		CpmMat* bpp1(YADE_CAST<CpmMat*>(Body::byId(I->getId1())->physicalParameters.get()));
+		CpmMat* bpp2(YADE_CAST<CpmMat*>(Body::byId(I->getId2())->physicalParameters.get()));
+		bpp1->epsVolumetric+=BC->epsN; bpp1->numContacts+=1;
+		bpp2->epsVolumetric+=BC->epsN; bpp2->numContacts+=1;
+	}
+	unbalancedForce=(useMaxForce?maxF:meanF)/maxContactF;
+
+	FOREACH(const shared_ptr<Interaction>& I, *rb->interactions){
+		if(!I->isReal()) continue;
+		shared_ptr<CpmPhys> BC=YADE_PTR_CAST<CpmPhys>(I->interactionPhysics); assert(BC);
+		CpmMat* bpp1(YADE_CAST<CpmMat*>(Body::byId(I->getId1())->physicalParameters.get()));
+		CpmMat* bpp2(YADE_CAST<CpmMat*>(Body::byId(I->getId2())->physicalParameters.get()));
+		Real epsVolAvg=.5*((3./bpp1->numContacts)*bpp1->epsVolumetric+(3./bpp2->numContacts)*bpp2->epsVolumetric);
+		BC->epsTrans=(epsVolAvg-BC->epsN)/2.;
+		//TRVAR5(I->getId1(),I->getId2(),BC->epsTrans,(3./bpp1->numContacts)*bpp1->epsVolumetric,(3./bpp2->numContacts)*bpp2->epsVolumetric);
+		//TRVAR4(bpp1->numContacts,bpp1->epsVolumetric,bpp2->numContacts,bpp2->epsVolumetric);
+	}
+	#if 0
+		FOREACH(const shared_ptr<Body>& b, *rb->bodies){
+			CpmMat* bpp(YADE_PTR_CAST<CpmMat>(b->physicalParameters.get()));
+			bpp->epsVolumeric*=3/bpp->numContacts;
+		}
+	#endif
+}
+
+
+/********************** CpmPhysDamageColorizer ****************************/
+CREATE_LOGGER(CpmPhysDamageColorizer);
+void CpmPhysDamageColorizer::action(MetaBody* rootBody){
+	//vector<pair<short,Real> > bodyDamage; /* number of cohesive interactions per body; cummulative damage of interactions */
+	//vector<pair<short,
+	vector<BodyStats> bodyStats; bodyStats.resize(rootBody->bodies->size());
+	assert(bodyStats[0].nCohLinks==0); // should be initialized by dfault ctor
+	FOREACH(const shared_ptr<Interaction>& I, *rootBody->interactions){
+		shared_ptr<CpmPhys> BC=dynamic_pointer_cast<CpmPhys>(I->interactionPhysics);
+		if(!BC || !BC->isCohesive) continue;
+		const body_id_t id1=I->getId1(), id2=I->getId2();
+		bodyStats[id1].nCohLinks++; bodyStats[id1].dmgSum+=(1-BC->relResidualStrength); bodyStats[id1].epsPlSum+=BC->epsPlSum;
+		bodyStats[id2].nCohLinks++; bodyStats[id2].dmgSum+=(1-BC->relResidualStrength); bodyStats[id2].epsPlSum+=BC->epsPlSum;
+		maxOmega=max(maxOmega,BC->omega);
+	}
+	FOREACH(shared_ptr<Body> B, *rootBody->bodies){
+		const body_id_t& id=B->getId();
+		// add damaged contacts that have already been deleted
+		CpmMat* bpp=dynamic_cast<CpmMat*>(B->physicalParameters.get());
+		if(!bpp) continue;
+		int cohLinksWhenever=bodyStats[id].nCohLinks+bpp->numBrokenCohesive;
+		if(cohLinksWhenever>0){
+			bpp->normDmg=(bodyStats[id].dmgSum+bpp->numBrokenCohesive)/cohLinksWhenever;
+			bpp->normEpsPl=(bodyStats[id].epsPlSum+bpp->epsPlBroken)/cohLinksWhenever;
+			if(bpp->normDmg>1){
+				LOG_WARN("#"<<id<<" normDmg="<<bpp->normDmg<<" nCohLinks="<<bodyStats[id].nCohLinks<<", numBrokenCohesive="<<bpp->numBrokenCohesive<<", dmgSum="<<bodyStats[id].dmgSum<<", numAllCohLinks"<<cohLinksWhenever);
+			}
+		}
+		else { bpp->normDmg=0; bpp->normEpsPl=0;}
+		B->geometricalModel->diffuseColor=Vector3r(bpp->normDmg,1-bpp->normDmg,B->isDynamic?0:1);
+	}
+}
+

Copied: trunk/pkg/dem/meta/ConcretePM.hpp (from rev 1872, trunk/pkg/dem/ConcretePM.hpp)

Copied: trunk/pkg/dem/meta/RockPM.cpp (from rev 1872, trunk/pkg/dem/RockPM.cpp)
===================================================================
--- trunk/pkg/dem/RockPM.cpp	2009-07-16 14:26:45 UTC (rev 1872)
+++ trunk/pkg/dem/meta/RockPM.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,132 @@
+/*************************************************************************
+*    Copyright (C) 2009 Anton Gladkyy gladky.anton@xxxxxxxxx             *
+*                                                                        *
+*    This program is free software: you can redistribute it and/or modify*
+*    it under the terms of the GNU General Public License as published by*
+*    the Free Software Foundation, either version 3 of the License, or   *
+*    (at your option) any later version.                                 *
+*                                                                        *
+*    This program is distributed in the hope that it will be useful,     *
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of      *
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
+*    GNU General Public License for more details.                        *
+*                                                                        *
+*    You should have received a copy of the GNU General Public License   *
+*    along with this program.  If not, see <http://www.gnu.org/licenses/>*
+**************************************************************************/
+
+#include"RockPM.hpp"
+#include<yade/core/MetaBody.hpp>
+#include<yade/pkg-dem/BodyMacroParameters.hpp>
+#include<yade/pkg-common/Sphere.hpp>
+#include<yade/pkg-dem/DemXDofGeom.hpp>
+#include<yade/pkg-dem/Shop.hpp>
+
+
+YADE_PLUGIN("Law2_Dem3DofGeom_RockPMPhys_Rpm", "RpmMat","Ip2_RpmMat_RpmMat_RpmPhys","RpmPhys");
+
+
+
+/********************** Law2_Dem3DofGeom_RockPMPhys_Rpm ****************************/
+CREATE_LOGGER(Law2_Dem3DofGeom_RockPMPhys_Rpm);
+
+void Law2_Dem3DofGeom_RockPMPhys_Rpm::go(shared_ptr<InteractionGeometry>& ig, shared_ptr<InteractionPhysics>& ip, Interaction* contact, MetaBody* rootBody){
+	Dem3DofGeom* geom=static_cast<Dem3DofGeom*>(ig.get());
+	RpmPhys* phys=static_cast<RpmPhys*>(ip.get());
+
+	Real displN=geom->displacementN();	
+	const shared_ptr<Body>& body1=Body::byId(contact->getId1(),rootBody);
+	const shared_ptr<Body>& body2=Body::byId(contact->getId2(),rootBody);
+	assert(body1);
+	assert(body2);
+	const shared_ptr<RpmMat>& rbp1=YADE_PTR_CAST<RpmMat>(body1->physicalParameters);
+	const shared_ptr<RpmMat>& rbp2=YADE_PTR_CAST<RpmMat>(body2->physicalParameters);
+
+	//check, whether one of bodies is damaged
+	if ((rbp1->isDamaged) || (rbp2->isDamaged)) {
+		phys->isCohesive = false;
+	}
+				
+				
+	if(displN<=0){
+		/*Normal Interaction*/
+		phys->normalForce=phys->kn*displN*geom->normal;
+		Real maxFsSq=phys->normalForce.SquaredLength()*pow(phys->tanFrictionAngle,2);
+		Vector3r trialFs=phys->ks*geom->displacementT();
+		if(trialFs.SquaredLength()>maxFsSq){ geom->slipToDisplacementTMax(sqrt(maxFsSq)); trialFs*=sqrt(maxFsSq/(trialFs.SquaredLength()));} 
+		applyForceAtContactPoint(phys->normalForce+trialFs,geom->contactPoint,contact->getId1(),geom->se31.position,contact->getId2(),geom->se32.position,rootBody);
+		/*Normal Interaction_____*/
+		
+		if ((phys->isCohesive)&&(displN<(-phys->lengthMaxCompression))) {
+			//LOG_WARN(displN<<"__COMRESS!!!__");
+			phys->isCohesive = false;
+			rbp1->isDamaged=true;
+			rbp2->isDamaged=true;
+		}
+	} else {
+		if (phys->isCohesive) {
+			phys->normalForce=phys->kn*displN*geom->normal;
+			if (displN>(phys->lengthMaxTension)) {
+				//LOG_WARN(displN<<"__TENSION!!!__");
+				phys->isCohesive = false;
+				rbp1->isDamaged=true;
+				rbp2->isDamaged=true;
+			} else {
+				applyForceAtContactPoint(phys->normalForce,geom->contactPoint,contact->getId1(),geom->se31.position,contact->getId2(),geom->se32.position,rootBody);
+			}
+			return;
+		} else {
+			rootBody->interactions->requestErase(contact->getId1(),contact->getId2());
+			return;
+		}
+	}
+	
+}
+
+
+CREATE_LOGGER(Ip2_RpmMat_RpmMat_RpmPhys);
+
+void Ip2_RpmMat_RpmMat_RpmPhys::go(const shared_ptr<PhysicalParameters>& pp1, const shared_ptr<PhysicalParameters>& pp2, const shared_ptr<Interaction>& interaction){
+	if(interaction->interactionPhysics) return; 
+
+	Dem3DofGeom* contGeom=YADE_CAST<Dem3DofGeom*>(interaction->interactionGeometry.get());
+	
+	assert(contGeom);
+	//LOG_WARN(Omega::instance().getCurrentIteration());
+	const shared_ptr<RpmMat>& rpm1=YADE_PTR_CAST<RpmMat>(pp1);
+	const shared_ptr<RpmMat>& rpm2=YADE_PTR_CAST<RpmMat>(pp2);
+	
+	const shared_ptr<BodyMacroParameters>& elast1=static_pointer_cast<BodyMacroParameters>(pp1);
+	const shared_ptr<BodyMacroParameters>& elast2=static_pointer_cast<BodyMacroParameters>(pp2);
+
+	bool initCohesive = rpm1->initCohesive*rpm2->initCohesive;
+	
+	Real E12=2*elast1->young*elast2->young/(elast1->young+elast2->young);
+	Real minRad=(contGeom->refR1<=0?contGeom->refR2:(contGeom->refR2<=0?contGeom->refR1:min(contGeom->refR1,contGeom->refR2)));
+	Real S12=Mathr::PI*pow(minRad,2);
+	shared_ptr<RpmPhys> contPhys(new RpmPhys());
+	contPhys->E=E12;
+	contPhys->G=E12;
+	contPhys->tanFrictionAngle=tan(.5*(elast1->frictionAngle+elast2->frictionAngle));
+	contPhys->crossSection=S12;
+	contPhys->kn=contPhys->E*contPhys->crossSection;
+	contPhys->ks=contPhys->G*contPhys->crossSection;
+	
+	contPhys->lengthMaxCompression=S12*(0.5*(rpm1->stressCompressMax+rpm2->stressCompressMax))/(contPhys->kn);
+	contPhys->lengthMaxTension=S12*(0.5*(rpm1->stressTensionMax+rpm2->stressTensionMax))/(contPhys->kn);
+	
+	initDistance = contGeom->displacementN();
+
+	if ((rpm1->exampleNumber==rpm2->exampleNumber)&&(initDistance<(contPhys->lengthMaxTension))&&(initCohesive)) {
+		contPhys->isCohesive=true;
+		//LOG_WARN("InitDistance="<<initDistance);
+		//LOG_WARN("lengthMaxCompression="<<contPhys->lengthMaxCompression);
+		//LOG_WARN("lengthMaxTension="<<contPhys->lengthMaxTension);
+	}
+
+	
+	interaction->interactionPhysics=contPhys;
+}
+
+RpmPhys::~RpmPhys(){};
+


Property changes on: trunk/pkg/dem/meta/RockPM.cpp
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/pkg/dem/meta/RockPM.hpp (from rev 1872, trunk/pkg/dem/RockPM.hpp)


Property changes on: trunk/pkg/dem/meta/RockPM.hpp
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/pkg/dem/meta/Shop.cpp (from rev 1872, trunk/extra/Shop.cpp)
===================================================================
--- trunk/extra/Shop.cpp	2009-07-16 14:26:45 UTC (rev 1872)
+++ trunk/pkg/dem/meta/Shop.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,1146 @@
+// 2007 © Václav Šmilauer <eudoxos@xxxxxxxx>
+#include"Shop.hpp"
+
+#include<limits>
+
+#include<boost/filesystem/convenience.hpp>
+#include<boost/tokenizer.hpp>
+
+#include<yade/core/MetaBody.hpp>
+#include<yade/core/Body.hpp>
+
+#include<yade/pkg-common/MetaInteractingGeometry2AABB.hpp>
+#include<yade/pkg-common/MetaInteractingGeometry.hpp>
+#include<yade/pkg-common/Box.hpp>
+#include<yade/pkg-common/AABB.hpp>
+#include<yade/pkg-common/Sphere.hpp>
+#include<yade/pkg-common/PersistentSAPCollider.hpp>
+
+#include<yade/pkg-common/InteractingBox.hpp>
+#include<yade/pkg-common/InteractingSphere.hpp>
+
+#include<yade/pkg-common/InteractingSphere2AABB.hpp>
+#include<yade/pkg-common/InteractingBox2AABB.hpp>
+#include<yade/pkg-common/MetaInteractingGeometry.hpp>
+#include<yade/pkg-common/MetaInteractingGeometry2AABB.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-dem/MacroMicroElasticRelationships.hpp>
+#include<yade/pkg-dem/SimpleViscoelasticBodyParameters.hpp>
+
+/*class InteractingSphere2AABB;
+class InteractingBox2AABB;
+class MetaInteractingGeometry;
+class MetaInteractingGeometry2AABB; */
+
+
+#include<yade/pkg-common/PhysicalActionContainerReseter.hpp>
+#include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
+
+#include<yade/pkg-common/InteractionGeometryMetaEngine.hpp>
+#include<yade/pkg-common/InteractionPhysicsMetaEngine.hpp>
+#include<yade/pkg-common/BoundingVolumeMetaEngine.hpp>
+#include<yade/pkg-common/PhysicalActionDamper.hpp>
+#include<yade/pkg-common/PhysicalActionApplier.hpp>
+#include<yade/pkg-common/CundallNonViscousDamping.hpp>
+#include<yade/pkg-common/CundallNonViscousDamping.hpp>
+#include<yade/pkg-common/GravityEngines.hpp>
+
+#include<yade/pkg-dem/BodyMacroParameters.hpp>
+#include<yade/pkg-dem/ElasticCriterionTimeStepper.hpp>
+#include<yade/pkg-dem/ElasticContactLaw.hpp>
+
+#include<yade/pkg-dem/SpheresContactGeometry.hpp>
+#include<yade/pkg-dem/ElasticContactInteraction.hpp>
+
+
+#include<yade/pkg-dem/Tetra.hpp>
+
+
+#define _SPEC_CAST(orig,cast) template<> void Shop::setDefault<orig>(string key, orig val){setDefault(key,cast(val));}
+_SPEC_CAST(const char*,string);
+_SPEC_CAST(char*,string);
+#undef _SPEC_CAST
+
+CREATE_LOGGER(Shop);
+
+map<string,boost::any> Shop::defaults;
+
+/* 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.
+ */
+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){
+	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));
+}
+
+
+Real Shop::unbalancedForce(bool useMaxForce, MetaBody* _rb){
+	MetaBody* rb=_rb ? _rb : Omega::instance().getRootBody().get();
+	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;
+		currF=rb->bex.getForce(b->id).Length(); maxF=max(currF,maxF); sumF+=currF;
+	}
+	Real meanF=sumF/rb->bodies->size(); 
+	// get max force on contacts
+	Real maxContactF=0;
+	FOREACH(const shared_ptr<Interaction>& I, *rb->transientInteractions){
+		if(!I->isReal()) continue;
+		shared_ptr<NormalShearInteraction> nsi=YADE_PTR_CAST<NormalShearInteraction>(I->interactionPhysics); assert(nsi);
+		maxContactF=max(maxContactF,(nsi->normalForce+nsi->shearForce).Length());
+	}
+	return (useMaxForce?maxF:meanF)/maxContactF;
+}
+
+Real Shop::kineticEnergy(MetaBody* _rb){
+	MetaBody* rb=_rb ? _rb : Omega::instance().getRootBody().get();
+	Real ret=0.;
+	FOREACH(const shared_ptr<Body>& b, *rb->bodies){
+		if(!b->isDynamic) continue;
+		shared_ptr<RigidBodyParameters> rbp=YADE_PTR_CAST<RigidBodyParameters>(b->physicalParameters); assert(rbp);
+		// ½(mv²+ωIω)
+		ret+=.5*(rbp->mass*rbp->velocity.SquaredLength()+rbp->angularVelocity.Dot(diagMult(rbp->inertia,rbp->angularVelocity)));
+	}
+	return ret;
+}
+
+
+
+
+
+template <typename valType> valType Shop::getDefault(const string& key) {
+	ensureInit();
+	try{return boost::any_cast<valType>(defaults[key]);}
+	catch(boost::bad_any_cast& e){
+		LOG_FATAL("Cast error while getting key `"<<key<<"' of type `"<<typeid(valType).name()<<"' ("<<e.what()<<").");
+		if(!hasDefault(key) || (defaults[key].type()==typeid(void))){LOG_FATAL("Key `"<<key<<"' not defined in the map.");}
+		else{LOG_INFO("(key `"<<key<<"' exists and if of type `"<<defaults[key].type().name()<<"').");}
+		throw;
+	}
+}
+
+void Shop::init(){
+	//LOG_INFO("Container length is "<<defaults.size()<<endl);
+	/*for(map<string,boost::any>::iterator I=defaults.begin(); I!=defaults.end(); I++){
+		LOG_INFO("Key `"<<I->first<<", type `"<<I->second.type().name()<<"'.");
+	}*/
+
+	defaults["container_is_not_empty"]=boost::any(0); // prevent loops from ensureInit();
+
+	setDefault<int>("body_sdecGroupMask",55);
+	
+	setDefault("phys_density",2e3);
+	setDefault("phys_young",30e9);
+	setDefault("phys_poisson",.3);
+	setDefault("phys_frictionAngle",0.5236); //30˚
+	setDefault("phys_se3_orientation",Quaternionr(Vector3r(0,0,1),0));
+
+	setDefault("aabb_randomColor",false);
+	setDefault("aabb_color",Vector3r(0,1,0));
+
+	setDefault("mold_randomColor",true);
+	setDefault("mold_color",Vector3r(1,0,0));
+
+	setDefault("shape_randomColor",true);
+	setDefault("shape_color",Vector3r(0,0,1));
+
+	setDefault("shape_wire",false);
+	setDefault("shape_shadowCaster",true);
+
+	setDefault("param_damping",.2);
+	setDefault("param_gravity",Vector3r(0,0,-10));
+	setDefault<int>("param_timeStepUpdateInterval",300);
+	setDefault("param_momentRotationLaw",true);
+
+	setDefault("param_pythonInitExpr",string("print 'Hello world!'"));
+	setDefault("param_pythonRunExpr",string(""));
+
+}
+
+/*! Create root body. */
+shared_ptr<MetaBody> Shop::rootBody(){
+	shared_ptr<MetaBody> rootBody = shared_ptr<MetaBody>(new MetaBody);
+	rootBody->isDynamic=false;
+	
+	shared_ptr<ParticleParameters> physics(new ParticleParameters);
+	physics->se3=Se3r(Vector3r(0,0,0),Quaternionr(Vector3r(0,0,1),0));
+	physics->mass=0;
+	physics->velocity=Vector3r::ZERO;
+	physics->acceleration=Vector3r::ZERO;
+	rootBody->physicalParameters=physics;
+
+	shared_ptr<MetaInteractingGeometry> set(new MetaInteractingGeometry());	set->diffuseColor=Vector3r(0,0,1);
+	rootBody->interactingGeometry=YADE_PTR_CAST<InteractingGeometry>(set);	
+	
+	shared_ptr<AABB> aabb(new AABB); aabb->diffuseColor=Vector3r(0,0,1);
+	rootBody->boundingVolume=YADE_PTR_CAST<BoundingVolume>(aabb);
+	
+
+	return rootBody;
+}
+
+
+/*! Assign default set of actors (initializers and engines) to an existing MetaBody.
+ */
+void Shop::rootBodyActors(shared_ptr<MetaBody> rootBody){
+	// initializers	
+	rootBody->initializers.clear();
+
+	shared_ptr<BoundingVolumeMetaEngine> boundingVolumeDispatcher	= shared_ptr<BoundingVolumeMetaEngine>(new BoundingVolumeMetaEngine);
+	boundingVolumeDispatcher->add(new InteractingSphere2AABB);
+	boundingVolumeDispatcher->add(new InteractingBox2AABB);
+	boundingVolumeDispatcher->add(new TetraAABB);
+	boundingVolumeDispatcher->add(new MetaInteractingGeometry2AABB);
+	rootBody->initializers.push_back(boundingVolumeDispatcher);
+
+	//engines
+	rootBody->engines.clear();
+
+	/* big fat FIXME:
+	 * for some */
+	#define GO(type) try{cerr<<"Cast to" #type<<" gives: "<<getDefault<type>("body_sdecGroupMask")<<endl;} catch(boost::bad_any_cast){}
+	/*	GO(unsigned short); GO(short); GO(char);GO(int);GO(unsigned int);GO(long);GO(unsigned long);GO(long long);GO(unsigned long long); */
+	
+	if(getDefault<int>("param_timeStepUpdateInterval")>0){
+		shared_ptr<ElasticCriterionTimeStepper> sdecTimeStepper(new ElasticCriterionTimeStepper);
+		sdecTimeStepper->sdecGroupMask=getDefault<int>("body_sdecGroupMask");
+		sdecTimeStepper->timeStepUpdateInterval=getDefault<int>("param_timeStepUpdateInterval");
+		sdecTimeStepper->timeStepUpdateInterval=300;
+		rootBody->engines.push_back(sdecTimeStepper);
+	}
+
+	rootBody->engines.push_back(shared_ptr<Engine>(new PhysicalActionContainerReseter));
+
+	rootBody->engines.push_back(boundingVolumeDispatcher);
+
+	rootBody->engines.push_back(shared_ptr<Engine>(new PersistentSAPCollider));
+
+	shared_ptr<InteractionGeometryMetaEngine> interactionGeometryDispatcher(new InteractionGeometryMetaEngine);
+	interactionGeometryDispatcher->add(new InteractingSphere2InteractingSphere4SpheresContactGeometry);
+	interactionGeometryDispatcher->add(new InteractingBox2InteractingSphere4SpheresContactGeometry);
+	interactionGeometryDispatcher->add(new Tetra2TetraBang);
+	rootBody->engines.push_back(interactionGeometryDispatcher);
+
+	shared_ptr<InteractionPhysicsMetaEngine> interactionPhysicsDispatcher(new InteractionPhysicsMetaEngine);
+	interactionPhysicsDispatcher->add(new MacroMicroElasticRelationships);
+	rootBody->engines.push_back(interactionPhysicsDispatcher);
+		
+	shared_ptr<ElasticContactLaw> constitutiveLaw(new ElasticContactLaw);
+	constitutiveLaw->sdecGroupMask = getDefault<int>("body_sdecGroupMask");
+	constitutiveLaw->momentRotationLaw = getDefault<bool>("param_momentRotationLaw");
+	rootBody->engines.push_back(constitutiveLaw);
+
+	if(getDefault<Vector3r>("param_gravity")!=Vector3r(0,0,0)){
+		shared_ptr<GravityEngine> gravityCondition(new GravityEngine);
+		gravityCondition->gravity=getDefault<Vector3r>("param_gravity");
+		rootBody->engines.push_back(gravityCondition);
+	}
+	
+	if(getDefault<double>("param_damping")>0){
+		shared_ptr<CundallNonViscousForceDamping> actionForceDamping(new CundallNonViscousForceDamping);
+		actionForceDamping->damping = getDefault<double>("param_damping");
+		shared_ptr<CundallNonViscousMomentumDamping> actionMomentumDamping(new CundallNonViscousMomentumDamping);
+		actionMomentumDamping->damping = getDefault<double>("param_damping");
+		shared_ptr<PhysicalActionDamper> actionDampingDispatcher(new PhysicalActionDamper);
+		actionDampingDispatcher->add(actionForceDamping);
+		actionDampingDispatcher->add(actionMomentumDamping);
+		rootBody->engines.push_back(actionDampingDispatcher);
+	}
+	
+	shared_ptr<PhysicalActionApplier> applyActionDispatcher(new PhysicalActionApplier);
+	applyActionDispatcher->add(new NewtonsForceLaw);
+	applyActionDispatcher->add(new NewtonsMomentumLaw);
+	rootBody->engines.push_back(applyActionDispatcher);
+	
+	shared_ptr<PhysicalParametersMetaEngine> positionIntegrator(new PhysicalParametersMetaEngine);
+	positionIntegrator->add(new LeapFrogPositionIntegrator);
+	rootBody->engines.push_back(positionIntegrator);
+
+	shared_ptr<PhysicalParametersMetaEngine> orientationIntegrator(new PhysicalParametersMetaEngine);
+	orientationIntegrator->add(new LeapFrogOrientationIntegrator);
+	rootBody->engines.push_back(orientationIntegrator);
+}
+
+
+/*! Create body - sphere. */
+shared_ptr<Body> Shop::sphere(Vector3r center, Real radius){
+	// body itself
+	shared_ptr<Body> body=shared_ptr<Body>(new Body(body_id_t(0),getDefault<int>("body_sdecGroupMask")));
+	body->isDynamic=true;
+
+	// physics
+	shared_ptr<BodyMacroParameters> physics(new BodyMacroParameters);
+	physics->angularVelocity=Vector3r(0,0,0);
+	physics->velocity=Vector3r(0,0,0);
+	physics->mass=4.0/3.0*Mathr::PI*radius*radius*radius*getDefault<double>("phys_density");
+	physics->inertia=Vector3r(2.0/5.0*physics->mass*radius*radius,2.0/5.0*physics->mass*radius*radius,2.0/5.0*physics->mass*radius*radius);
+	physics->se3=Se3r(center,Quaternionr(Vector3r(0,0,1),0));
+	physics->young=getDefault<double>("phys_young");
+	physics->poisson=getDefault<double>("phys_poisson");
+	physics->frictionAngle=getDefault<double>("phys_frictionAngle");
+	body->physicalParameters=physics;
+
+	// aabb
+	shared_ptr<AABB> aabb(new AABB);
+	aabb->diffuseColor=getDefault<bool>("aabb_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("aabb_color");
+	body->boundingVolume=aabb;
+
+	// mold
+	shared_ptr<InteractingSphere> mold(new InteractingSphere);
+	mold->radius=radius;
+	mold->diffuseColor=getDefault<bool>("mold_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("mold_color");
+	body->interactingGeometry=mold;
+
+	//shape
+	shared_ptr<Sphere> shape(new Sphere);
+	shape->radius=radius;
+	shape->diffuseColor=getDefault<bool>("shape_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("shape_color");
+	shape->wire=getDefault<bool>("shape_wire");
+	shape->shadowCaster=getDefault<bool>("shape_shadowCaster");
+	body->geometricalModel=shape;
+
+	return body;
+
+}
+
+/*! Create body - box. */
+shared_ptr<Body> Shop::box(Vector3r center, Vector3r extents){
+		shared_ptr<Body> body=shared_ptr<Body>(new Body(body_id_t(0),getDefault<int>("body_sdecGroupMask")));
+		body->isDynamic=true;
+
+		shared_ptr<BodyMacroParameters> physics(new BodyMacroParameters);
+		physics->angularVelocity=Vector3r(0,0,0);
+		physics->velocity=Vector3r(0,0,0);
+		physics->mass=8*extents[0]*extents[1]*extents[2]*getDefault<double>("phys_density");
+		physics->inertia=Vector3r(physics->mass*(4*extents[1]*extents[1]+4*extents[2]*extents[2])/12.,physics->mass*(4*extents[0]*extents[0]+4*extents[2]*extents[2])/12.,physics->mass*(4*extents[0]*extents[0]+4*extents[1]*extents[1])/12.);
+		physics->se3=Se3r(center,Quaternionr(Vector3r(0,0,1),0));
+		physics->young=getDefault<double>("phys_young");
+		physics->poisson=getDefault<double>("phys_poisson");
+		physics->frictionAngle=getDefault<double>("phys_frictionAngle");
+		body->physicalParameters=physics;
+
+		// aabb
+		shared_ptr<AABB> aabb(new AABB);
+		aabb->diffuseColor=getDefault<bool>("aabb_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("aabb_color");
+		body->boundingVolume=aabb;
+
+		//shape
+		shared_ptr<Box> shape(new Box);
+		shape->extents=extents;
+		shape->diffuseColor=getDefault<bool>("shape_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("shape_color");
+		shape->wire=getDefault<bool>("shape_wire");
+		shape->shadowCaster=getDefault<bool>("shape_shadowCaster");
+		body->geometricalModel=shape;
+
+		// mold
+		shared_ptr<InteractingBox> mold(new InteractingBox);
+		mold->extents=extents;
+		mold->diffuseColor=getDefault<bool>("mold_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("mold_color");
+		body->interactingGeometry=mold;
+
+		return body;
+}
+
+/*! Create body - tetrahedron. */
+shared_ptr<Body> Shop::tetra(Vector3r v_global[4]){
+		shared_ptr<Body> body=shared_ptr<Body>(new Body(body_id_t(0),getDefault<int>("body_sdecGroupMask")));
+		body->isDynamic=true;
+
+		Vector3r centroid=(v_global[0]+v_global[1]+v_global[2]+v_global[3])*.25;
+		Vector3r v[4]; for(int i=0; i<4; i++) v[i]=v_global[i]-centroid;
+
+		shared_ptr<BodyMacroParameters> physics(new BodyMacroParameters);
+		physics->angularVelocity=Vector3r(0,0,0);
+		physics->velocity=Vector3r(0,0,0);
+		physics->mass=getDefault<double>("phys_density")*TetrahedronVolume(v);
+		// inertia will be calculated below, by TetrahedronWithLocalAxesPrincipal
+		physics->se3=Se3r(centroid,Quaternionr(Vector3r(0,0,1),0));
+		physics->young=getDefault<double>("phys_young");
+		physics->poisson=getDefault<double>("phys_poisson");
+		physics->frictionAngle=getDefault<double>("phys_frictionAngle");
+		body->physicalParameters=physics;
+
+		// aabb
+		shared_ptr<AABB> aabb(new AABB);
+		aabb->diffuseColor=getDefault<bool>("aabb_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("aabb_color");
+		body->boundingVolume=aabb;
+
+		//shape
+		shared_ptr<Tetrahedron> shape(new Tetrahedron);
+		shape->v[0]=v[0]; shape->v[1]=v[1]; shape->v[2]=v[2]; shape->v[3]=v[3];
+		shape->diffuseColor=getDefault<bool>("shape_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("shape_color");
+		shape->wire=getDefault<bool>("shape_wire");
+		shape->shadowCaster=getDefault<bool>("shape_shadowCaster");
+		body->geometricalModel=shape;
+
+		// mold
+		shared_ptr<TetraMold> mold(new TetraMold(v[0],v[1],v[2],v[3]));
+		mold->diffuseColor=getDefault<bool>("mold_randomColor")?Vector3r(Mathr::UnitRandom(),Mathr::UnitRandom(),Mathr::UnitRandom()):getDefault<Vector3r>("mold_color");
+		body->interactingGeometry=mold;
+
+		// make local axes coincident with principal axes
+		TetrahedronWithLocalAxesPrincipal(body);
+
+		return body;
+}
+
+
+void Shop::saveSpheresToFile(string fname){
+	const shared_ptr<MetaBody>& rootBody=Omega::instance().getRootBody();
+	ofstream f(fname.c_str());
+	if(!f.good()) throw runtime_error("Unable to open file `"+fname+"'");
+
+	FOREACH(shared_ptr<Body> b, *rootBody->bodies){
+		if (!b->isDynamic) continue;
+		shared_ptr<InteractingSphere>	intSph=dynamic_pointer_cast<InteractingSphere>(b->interactingGeometry);
+		if(!intSph) continue;
+		const Vector3r& pos=b->physicalParameters->se3.position;
+		f<<pos[0]<<" "<<pos[1]<<" "<<pos[2]<<" "<<intSph->radius<<endl; // <<" "<<1<<" "<<1<<endl;
+	}
+	f.close();
+}
+
+vector<pair<Vector3r,Real> > Shop::loadSpheresFromFile(string fname, Vector3r& minXYZ, Vector3r& maxXYZ){
+	if(!boost::filesystem::exists(fname)) {
+		throw std::invalid_argument(string("File with spheres `")+fname+"' doesn't exist.");
+	}
+	vector<pair<Vector3r,Real> > spheres;
+	ifstream sphereFile(fname.c_str());
+	if(!sphereFile.good()) throw std::runtime_error("File with spheres `"+fname+"' couldn't be opened.");
+	Vector3r C;
+	Real r=0;
+	string line;
+	size_t lineNo=0;
+	while(std::getline(sphereFile, line, '\n')){
+		lineNo++;
+		boost::tokenizer<boost::char_separator<char> > toks(line,boost::char_separator<char>(" \t"));
+		int i=0;
+		FOREACH(const string& s, toks){
+			if(i<3) C[i]=lexical_cast<Real>(s);
+			if(i==3) r=lexical_cast<Real>(s);
+			i++;
+		}
+		if(i==0) continue; // empty line, skipped (can be the last one)
+		// Wenjie's format: 5 per line are boxes, which should be skipped
+		if(i==5) continue;
+		if((i!=4) and (i!=6)) {
+			LOG_ERROR("Line "+lexical_cast<string>(lineNo)+" in the spheres file "+fname+" has "+lexical_cast<string>(i)+" columns instead of 0,4,5 or 6.");
+			LOG_ERROR("The result may be garbage!");
+		}
+		for(int j=0; j<3; j++) { minXYZ[j]=(spheres.size()>0?min(C[j]-r,minXYZ[j]):C[j]-r); maxXYZ[j]=(spheres.size()>0?max(C[j]+r,maxXYZ[j]):C[j]+r);}
+		spheres.push_back(pair<Vector3r,Real>(C,r));
+	}
+	return spheres;
+}
+
+
+vector<pair<Vector3r,Real> > Shop::loadSpheresSmallSdecXyz(Vector3r& minXYZ, Vector3r& maxXYZ){
+	int i=-1;
+	vector<pair<Vector3r,Real> > spheres;
+	while(Shop::smallSdecXyzData[++i].r>0){
+		Vector3r C(smallSdecXyzData[i].C0,smallSdecXyzData[i].C1,smallSdecXyzData[i].C2); Real r(smallSdecXyzData[i].r);
+		for(int j=0; j<3; j++) { minXYZ[j]=(spheres.size()>0?min(C[j]-r,minXYZ[j]):C[j]-r); maxXYZ[j]=(spheres.size()>0?max(C[j]+r,maxXYZ[j]):C[j]+r);}
+		spheres.push_back(pair<Vector3r,Real>(C,r));
+		//LOG_DEBUG("Loaded sphere with radius "<<r<<" at "<<C);
+	}
+	return spheres;
+}
+
+Real Shop::PWaveTimeStep(shared_ptr<MetaBody> _rb){
+	shared_ptr<MetaBody> rb=_rb;
+	if(!rb)rb=Omega::instance().getRootBody();
+	Real dt=std::numeric_limits<Real>::infinity();
+	FOREACH(const shared_ptr<Body>& b, *rb->bodies){
+		if(!b->physicalParameters || !b->geometricalModel) continue;
+		shared_ptr<ElasticBodyParameters> ebp=dynamic_pointer_cast<ElasticBodyParameters>(b->physicalParameters);
+		shared_ptr<Sphere> s=dynamic_pointer_cast<Sphere>(b->geometricalModel);
+		if(!ebp || !s) continue;
+		Real density=ebp->mass/((4/3.)*Mathr::PI*pow(s->radius,3));
+		dt=min(dt,s->radius/sqrt(ebp->young/density));
+	}
+	return dt;
+}
+
+
+shared_ptr<Interaction> Shop::createExplicitInteraction(body_id_t id1, body_id_t id2){
+	InteractionGeometryMetaEngine* geomMeta=NULL;
+	InteractionPhysicsMetaEngine* physMeta=NULL;
+	shared_ptr<MetaBody> rb=Omega::instance().getRootBody();
+	if(rb->transientInteractions->find(body_id_t(id1),body_id_t(id2))!=0) throw runtime_error(string("transientInteraction already exists between #")+lexical_cast<string>(id1)+" and "+lexical_cast<string>(id2));
+	FOREACH(const shared_ptr<Engine>& e, rb->engines){
+		if(!geomMeta) { geomMeta=dynamic_cast<InteractionGeometryMetaEngine*>(e.get()); if(geomMeta) continue; }
+		if(!physMeta) { physMeta=dynamic_cast<InteractionPhysicsMetaEngine*>(e.get()); if(physMeta) continue; }
+		if(geomMeta&&physMeta){break;}
+	}
+	if(!geomMeta) throw runtime_error("No InteractionGeometryMetaEngine in engines.");
+	if(!physMeta) throw runtime_error("No InteractionPhysicsMetaEngine in engines.");
+	shared_ptr<Body> b1=Body::byId(id1,rb), b2=Body::byId(id2,rb);
+	shared_ptr<Interaction> i=geomMeta->explicitAction(b1,b2);
+	physMeta->explicitAction(b1->physicalParameters,b2->physicalParameters,i);
+	rb->transientInteractions->insert(i);
+	return i;
+}
+
+Shop::sphereGeomStruct Shop::smallSdecXyzData[]={
+	{0.027814,0.028311,0.053055,0.006921},
+	{0.040115,0.039488,0.051634,0.009072},
+	{0.014935,0.042338,0.065370,0.014248},
+	{0.040157,0.020724,0.049777,0.007933},
+	{0.054315,0.030277,0.034105,0.015247},
+	{0.084782,0.035042,0.040466,0.006506},
+	{0.063445,0.049730,0.067288,0.011911},
+	{0.068606,0.025283,0.065262,0.012022},
+	{0.088031,0.014291,0.039471,0.014521},
+	{0.116754,0.037915,0.051292,0.008274},
+	{0.100791,0.035164,0.067461,0.013108},
+	{0.114599,0.012268,0.055589,0.015359},
+	{0.138767,0.018895,0.036148,0.009280},
+	{0.145595,0.044496,0.031125,0.015939},
+	{0.132246,0.042180,0.051209,0.007763},
+	{0.143392,0.023461,0.060496,0.015920},
+	{0.171105,0.022212,0.032836,0.012108},
+	{0.181104,0.037549,0.046727,0.010873},
+	{0.166356,0.047869,0.055943,0.008384},
+	{0.182075,0.018453,0.050915,0.008701},
+	{0.199011,0.025231,0.029222,0.016017},
+	{0.223922,0.034850,0.046495,0.009033},
+	{0.201425,0.039383,0.074087,0.010160},
+	{0.208859,0.020393,0.059165,0.015109},
+	{0.247185,0.029358,0.040632,0.009137},
+	{0.256247,0.054160,0.035898,0.007448},
+	{0.241821,0.048789,0.051785,0.013900},
+	{0.262536,0.027938,0.052724,0.007258},
+	{0.266457,0.015729,0.044737,0.007849},
+	{0.300361,0.040203,0.038619,0.010238},
+	{0.269716,0.038512,0.048249,0.006284},
+	{0.284778,0.015856,0.057268,0.010625},
+	{0.308568,0.015046,0.037486,0.015678},
+	{0.324288,0.040734,0.028459,0.015762},
+	{0.312379,0.037454,0.070796,0.013332},
+	{0.325630,0.017879,0.071709,0.009211},
+	{0.337472,0.021731,0.049983,0.015831},
+	{0.363910,0.040206,0.054198,0.013145},
+	{0.347960,0.050663,0.050631,0.006258},
+	{0.353319,0.027257,0.066410,0.007567},
+	{0.382606,0.035870,0.041879,0.009000},
+	{0.403064,0.040715,0.052848,0.013380},
+	{0.378583,0.049140,0.071144,0.009526},
+	{0.392096,0.013326,0.048449,0.016326},
+	{0.419694,0.020328,0.050734,0.012238},
+	{0.435554,0.040547,0.055823,0.013440},
+	{0.416138,0.032889,0.071377,0.008786},
+	{0.438445,0.022231,0.064865,0.007190},
+	{0.449096,0.034012,0.035415,0.006513},
+	{0.465516,0.041105,0.049831,0.016459},
+	{0.451849,0.034788,0.071794,0.010092},
+	{0.470798,0.014474,0.061308,0.013016},
+	{0.022520,0.051083,0.034275,0.015762},
+	{0.051991,0.077988,0.036367,0.009543},
+	{0.020986,0.077522,0.050688,0.015394},
+	{0.045377,0.061146,0.050244,0.013259},
+	{0.070165,0.058855,0.037378,0.014762},
+	{0.079072,0.088030,0.037625,0.009745},
+	{0.070175,0.083486,0.059729,0.008680},
+	{0.080809,0.052527,0.057405,0.008263},
+	{0.102876,0.053069,0.047621,0.012600},
+	{0.129932,0.071275,0.041493,0.015762},
+	{0.100905,0.082761,0.049471,0.015577},
+	{0.114885,0.069784,0.065561,0.008883},
+	{0.124029,0.048642,0.037433,0.006910},
+	{0.151400,0.072980,0.032672,0.007510},
+	{0.125754,0.087963,0.056533,0.007065},
+	{0.151978,0.057727,0.065740,0.009624},
+	{0.170038,0.050106,0.034273,0.009151},
+	{0.180330,0.067662,0.044758,0.013741},
+	{0.163195,0.080867,0.050099,0.008542},
+	{0.193257,0.052669,0.058994,0.009924},
+	{0.213500,0.053456,0.046639,0.012293},
+	{0.214894,0.078031,0.032394,0.009344},
+	{0.204112,0.073752,0.062427,0.013778},
+	{0.209893,0.055436,0.071207,0.007226},
+	{0.229179,0.063602,0.037779,0.008378},
+	{0.253466,0.070318,0.046778,0.010045},
+	{0.243394,0.085523,0.061896,0.013644},
+	{0.268095,0.055682,0.049778,0.010865},
+	{0.272490,0.056346,0.032166,0.007300},
+	{0.293444,0.075937,0.050821,0.007124},
+	{0.268497,0.087864,0.061002,0.010071},
+	{0.285287,0.053447,0.056283,0.007652},
+	{0.303399,0.065465,0.032905,0.015762},
+	{0.331186,0.075873,0.030308,0.014024},
+	{0.305661,0.077322,0.067721,0.013776},
+	{0.321014,0.057758,0.055215,0.012434},
+	{0.340583,0.055745,0.032542,0.006766},
+	{0.363513,0.081185,0.053753,0.009367},
+	{0.342074,0.072811,0.056793,0.013501},
+	{0.362170,0.061143,0.054690,0.007397},
+	{0.370272,0.074686,0.039972,0.007302},
+	{0.402953,0.071810,0.034403,0.012804},
+	{0.382151,0.086219,0.067255,0.009054},
+	{0.382421,0.059723,0.048574,0.013805},
+	{0.418492,0.059752,0.050291,0.011257},
+	{0.431649,0.077456,0.029368,0.012777},
+	{0.423405,0.082143,0.054675,0.011680},
+	{0.438239,0.060029,0.044749,0.009130},
+	{0.451129,0.062181,0.031179,0.009710},
+	{0.479146,0.076782,0.041030,0.013576},
+	{0.450502,0.080910,0.050514,0.015762},
+	{0.469945,0.064905,0.054090,0.006331},
+	{0.013563,0.097184,0.042932,0.007007},
+	{0.045430,0.112786,0.026860,0.013686},
+	{0.026238,0.108238,0.071820,0.008664},
+	{0.045567,0.084792,0.054663,0.010547},
+	{0.055851,0.098322,0.045255,0.008878},
+	{0.092159,0.113570,0.039595,0.014076},
+	{0.042022,0.114607,0.055621,0.014833},
+	{0.076167,0.098666,0.069346,0.010212},
+	{0.091668,0.095217,0.029729,0.006767},
+	{0.114684,0.116416,0.048755,0.009589},
+	{0.101121,0.106787,0.066807,0.014051},
+	{0.117768,0.092385,0.068330,0.006541},
+	{0.136812,0.102557,0.043292,0.008163},
+	{0.140060,0.121797,0.037341,0.012236},
+	{0.129633,0.101076,0.058761,0.006790},
+	{0.148062,0.103611,0.061993,0.009901},
+	{0.154918,0.097447,0.035701,0.011902},
+	{0.173991,0.107853,0.041188,0.010506},
+	{0.163383,0.113509,0.070590,0.007969},
+	{0.183313,0.096713,0.054555,0.008896},
+	{0.193900,0.091794,0.032836,0.015762},
+	{0.221431,0.105734,0.041347,0.016142},
+	{0.210572,0.112748,0.064643,0.009085},
+	{0.220128,0.094827,0.066506,0.011310},
+	{0.244598,0.102360,0.048021,0.008201},
+	{0.260796,0.107346,0.041782,0.007826},
+	{0.247778,0.114675,0.056955,0.007342},
+	{0.263854,0.105240,0.057300,0.008131},
+	{0.275329,0.080384,0.035952,0.016171},
+	{0.282596,0.108994,0.045510,0.014327},
+	{0.273227,0.123662,0.063561,0.010354},
+	{0.286850,0.088067,0.054854,0.007260},
+	{0.305680,0.088521,0.040830,0.008724},
+	{0.323658,0.122036,0.045958,0.009372},
+	{0.305577,0.108660,0.055999,0.010069},
+	{0.326432,0.092403,0.071328,0.010172},
+	{0.332822,0.094105,0.046980,0.010736},
+	{0.360057,0.114979,0.050602,0.008675},
+	{0.345196,0.113199,0.049286,0.006350},
+	{0.359002,0.099534,0.049942,0.006821},
+	{0.379041,0.093289,0.031702,0.012829},
+	{0.380592,0.110656,0.050707,0.012044},
+	{0.372838,0.103784,0.069441,0.009079},
+	{0.398837,0.089939,0.069654,0.008117},
+	{0.404951,0.099259,0.042662,0.015929},
+	{0.430865,0.122250,0.034910,0.014087},
+	{0.408865,0.117363,0.058603,0.007815},
+	{0.433797,0.100725,0.068087,0.010539},
+	{0.451913,0.097993,0.031985,0.009479},
+	{0.468554,0.117154,0.051922,0.008497},
+	{0.450291,0.108384,0.052179,0.011764},
+	{0.468896,0.094189,0.071862,0.008497},
+	{0.017769,0.123023,0.046288,0.012482},
+	{0.039600,0.152973,0.031490,0.013071},
+	{0.022486,0.159910,0.058277,0.006730},
+	{0.053035,0.135514,0.059822,0.006873},
+	{0.060820,0.135597,0.032391,0.009756},
+	{0.075793,0.140311,0.044451,0.007184},
+	{0.059415,0.151698,0.048706,0.013209},
+	{0.075397,0.146441,0.067826,0.009066},
+	{0.096374,0.134144,0.029818,0.009090},
+	{0.114668,0.150443,0.049586,0.009896},
+	{0.098456,0.146495,0.056580,0.008196},
+	{0.115068,0.135950,0.063642,0.006871},
+	{0.120480,0.129505,0.039205,0.007619},
+	{0.156971,0.148691,0.034191,0.009631},
+	{0.137556,0.146645,0.052913,0.006461},
+	{0.141950,0.131573,0.059911,0.010688},
+	{0.168096,0.130776,0.044977,0.013464},
+	{0.181562,0.156313,0.051610,0.015347},
+	{0.157127,0.150002,0.051947,0.008174},
+	{0.193242,0.120660,0.050909,0.012412},
+	{0.201771,0.131287,0.031430,0.011359},
+	{0.221674,0.149773,0.053281,0.006817},
+	{0.205379,0.141341,0.053543,0.011532},
+	{0.224583,0.129576,0.068306,0.012332},
+	{0.238902,0.136528,0.043920,0.011950},
+	{0.258910,0.151108,0.049705,0.013475},
+	{0.232642,0.144977,0.060278,0.006814},
+	{0.257772,0.129747,0.049843,0.007917},
+	{0.272859,0.130994,0.031434,0.013547},
+	{0.298637,0.152991,0.041282,0.015762},
+	{0.278487,0.158034,0.062419,0.008408},
+	{0.294879,0.136446,0.061848,0.007854},
+	{0.305700,0.128154,0.049784,0.009982},
+	{0.317822,0.154906,0.054591,0.007666},
+	{0.313082,0.139892,0.064913,0.007314},
+	{0.318412,0.124214,0.060868,0.006584},
+	{0.345403,0.128047,0.055609,0.007438},
+	{0.364150,0.139196,0.044629,0.013056},
+	{0.335338,0.144636,0.042778,0.015825},
+	{0.370092,0.124629,0.059323,0.007443},
+	{0.381964,0.126156,0.033148,0.011118},
+	{0.405718,0.145022,0.044830,0.007344},
+	{0.384403,0.150897,0.061572,0.015826},
+	{0.394762,0.130323,0.049303,0.009909},
+	{0.418237,0.126941,0.051554,0.007327},
+	{0.427303,0.148241,0.032287,0.012279},
+	{0.408184,0.153492,0.057158,0.007815},
+	{0.434164,0.125257,0.064771,0.012118},
+	{0.445472,0.139238,0.049416,0.009855},
+	{0.469080,0.147719,0.054616,0.015762},
+	{0.446519,0.149106,0.070188,0.007289},
+	{0.463066,0.128741,0.072069,0.010712},
+	{0.030541,0.171854,0.034568,0.007470},
+	{0.036934,0.187996,0.038951,0.010436},
+	{0.017296,0.187394,0.069932,0.015775},
+	{0.045470,0.171678,0.064724,0.015762},
+	{0.056514,0.169207,0.032678,0.010404},
+	{0.079003,0.186246,0.029530,0.016079},
+	{0.059706,0.192913,0.050156,0.012943},
+	{0.081987,0.176494,0.057278,0.010079},
+	{0.098980,0.166199,0.053356,0.010173},
+	{0.117318,0.178623,0.040798,0.015290},
+	{0.102820,0.182572,0.068939,0.007422},
+	{0.119261,0.172887,0.062372,0.007118},
+	{0.134901,0.165613,0.030499,0.008886},
+	{0.147868,0.177545,0.033698,0.009023},
+	{0.136653,0.175577,0.056404,0.008907},
+	{0.141868,0.158596,0.054271,0.006316},
+	{0.165708,0.172844,0.039254,0.010243},
+	{0.182639,0.183677,0.050062,0.011541},
+	{0.165084,0.185889,0.065932,0.012227},
+	{0.180948,0.173447,0.066522,0.007376},
+	{0.196132,0.172251,0.035240,0.011530},
+	{0.227201,0.182137,0.045706,0.008997},
+	{0.204299,0.184844,0.052950,0.010342},
+	{0.225988,0.175305,0.062124,0.008828},
+	{0.237177,0.160547,0.051402,0.009195},
+	{0.261161,0.186504,0.033019,0.015762},
+	{0.241624,0.187436,0.069292,0.007769},
+	{0.257173,0.165912,0.069549,0.008701},
+	{0.275377,0.158582,0.034952,0.008984},
+	{0.288726,0.191148,0.034408,0.009808},
+	{0.271403,0.185700,0.067431,0.011799},
+	{0.284218,0.172191,0.051535,0.010347},
+	{0.306049,0.174027,0.032682,0.007870},
+	{0.316942,0.179608,0.046528,0.010610},
+	{0.313026,0.194025,0.059273,0.009027},
+	{0.316419,0.168708,0.067588,0.006369},
+	{0.344253,0.166378,0.030810,0.010546},
+	{0.367887,0.186357,0.033459,0.007112},
+	{0.358319,0.179340,0.050728,0.013841},
+	{0.366596,0.160155,0.045909,0.007602},
+	{0.383817,0.160452,0.034727,0.012399},
+	{0.396469,0.185253,0.029237,0.015979},
+	{0.377815,0.185629,0.073245,0.013364},
+	{0.396205,0.166460,0.049105,0.007346},
+	{0.413309,0.167440,0.053605,0.007275},
+	{0.434009,0.184506,0.031699,0.013620},
+	{0.411121,0.187057,0.053929,0.011981},
+	{0.435082,0.168647,0.049551,0.010284},
+	{0.451053,0.158269,0.035414,0.012610},
+	{0.470872,0.191256,0.051955,0.013847},
+	{0.447897,0.178522,0.059981,0.008314},
+	{0.465203,0.170594,0.069944,0.011281},
+	{0.018220,0.199513,0.032480,0.012472},
+	{0.043929,0.213054,0.038912,0.014059},
+	{0.022453,0.225231,0.059937,0.012276},
+	{0.039438,0.194934,0.058858,0.008970},
+	{0.062291,0.203776,0.030515,0.008161},
+	{0.067233,0.212277,0.050888,0.007657},
+	{0.063555,0.218942,0.074236,0.011822},
+	{0.086676,0.195765,0.056391,0.009775},
+	{0.100062,0.203963,0.032083,0.010760},
+	{0.123439,0.223656,0.039869,0.007878},
+	{0.087363,0.218666,0.047798,0.013687},
+	{0.109855,0.201133,0.048087,0.008215},
+	{0.129021,0.205306,0.043706,0.011683},
+	{0.157516,0.221570,0.036912,0.010458},
+	{0.126303,0.227505,0.059162,0.010490},
+	{0.143861,0.194185,0.066210,0.010561},
+	{0.172910,0.201043,0.033978,0.013203},
+	{0.185035,0.221440,0.045513,0.013181},
+	{0.168070,0.220355,0.072675,0.009360},
+	{0.180093,0.198384,0.061991,0.007046},
+	{0.208314,0.209539,0.044961,0.009495},
+	{0.220276,0.226073,0.034315,0.013522},
+	{0.202082,0.218715,0.068875,0.006812},
+	{0.227664,0.201788,0.056524,0.012609},
+	{0.232983,0.200019,0.028712,0.015762},
+	{0.256565,0.219723,0.031699,0.007469},
+	{0.227652,0.224321,0.057241,0.006644},
+	{0.254299,0.203686,0.071224,0.012930},
+	{0.262164,0.203438,0.047374,0.006460},
+	{0.291834,0.224737,0.049349,0.006948},
+	{0.268860,0.219381,0.069067,0.007715},
+	{0.289943,0.200233,0.060624,0.012722},
+	{0.301505,0.208536,0.039247,0.012306},
+	{0.322382,0.217100,0.051740,0.012086},
+	{0.314574,0.219134,0.070936,0.007251},
+	{0.325878,0.206084,0.069072,0.007512},
+	{0.344014,0.201827,0.047775,0.012892},
+	{0.351810,0.217320,0.036368,0.007867},
+	{0.338587,0.227804,0.063659,0.010701},
+	{0.356571,0.197024,0.069754,0.008434},
+	{0.376453,0.200295,0.047115,0.014105},
+	{0.394956,0.226437,0.029396,0.010725},
+	{0.378323,0.226833,0.061314,0.014536},
+	{0.389287,0.205171,0.066511,0.007194},
+	{0.416665,0.206194,0.024533,0.013492},
+	{0.438684,0.208898,0.032405,0.009490},
+	{0.404012,0.213687,0.050773,0.015762},
+	{0.439529,0.206631,0.054037,0.011117},
+	{0.452197,0.194638,0.042409,0.007397},
+	{0.478578,0.218454,0.044278,0.008032},
+	{0.461476,0.216922,0.055979,0.012027},
+	{0.472499,0.206672,0.070146,0.008643},
+	{0.031034,0.238557,0.044665,0.009415},
+	{0.046212,0.247434,0.048494,0.008580},
+	{0.029656,0.251629,0.061475,0.011572},
+	{0.046678,0.229877,0.059527,0.012161},
+	{0.060543,0.228584,0.035366,0.008957},
+	{0.081148,0.255496,0.031889,0.011593},
+	{0.066991,0.258165,0.055249,0.015762},
+	{0.078630,0.234901,0.067187,0.009147},
+	{0.093096,0.239315,0.031956,0.008521},
+	{0.123349,0.260861,0.042759,0.012372},
+	{0.097630,0.259258,0.071577,0.008194},
+	{0.104871,0.242539,0.055778,0.015789},
+	{0.130936,0.239003,0.044952,0.008368},
+	{0.153591,0.241938,0.041655,0.008205},
+	{0.143130,0.253503,0.053056,0.011112},
+	{0.158308,0.235817,0.066131,0.006732},
+	{0.169649,0.237061,0.031901,0.009847},
+	{0.177988,0.267639,0.051141,0.008419},
+	{0.168590,0.251903,0.050804,0.009913},
+	{0.187601,0.240303,0.056261,0.008679},
+	{0.202598,0.238631,0.030252,0.008355},
+	{0.221493,0.253090,0.049019,0.008616},
+	{0.198234,0.260140,0.040252,0.015762},
+	{0.221897,0.228125,0.071226,0.008950},
+	{0.236460,0.237179,0.031506,0.006307},
+	{0.246367,0.254381,0.050248,0.011434},
+	{0.230061,0.245247,0.060087,0.007429},
+	{0.243784,0.239481,0.061145,0.007205},
+	{0.270130,0.238534,0.030357,0.015762},
+	{0.292685,0.259379,0.051551,0.008561},
+	{0.270568,0.256201,0.053461,0.012554},
+	{0.288088,0.246768,0.065776,0.009704},
+	{0.307205,0.228427,0.050927,0.006869},
+	{0.321366,0.246094,0.045009,0.011972},
+	{0.314218,0.248123,0.067437,0.006555},
+	{0.317918,0.234420,0.056996,0.005112},
+	{0.345996,0.237475,0.032189,0.012907},
+	{0.358078,0.266408,0.046713,0.010906},
+	{0.341845,0.249863,0.050455,0.009550},
+	{0.352246,0.244796,0.066207,0.009874},
+	{0.370773,0.231259,0.033624,0.012678},
+	{0.389736,0.252726,0.029076,0.015191},
+	{0.374368,0.254883,0.060882,0.013568},
+	{0.399580,0.236433,0.066670,0.009396},
+	{0.419086,0.229820,0.030486,0.008709},
+	{0.431898,0.253013,0.026908,0.014166},
+	{0.424434,0.259566,0.058997,0.006353},
+	{0.425774,0.238512,0.052362,0.015762},
+	{0.449984,0.229928,0.034152,0.014447},
+	{0.468335,0.247681,0.035305,0.009986},
+	{0.446284,0.265609,0.058199,0.014044},
+	{0.479957,0.238820,0.056505,0.015762},
+	{0.016058,0.272296,0.031907,0.015903},
+	{0.043188,0.296346,0.035622,0.013645},
+	{0.020265,0.293955,0.054775,0.015873},
+	{0.041510,0.268037,0.070523,0.007849},
+	{0.062225,0.280373,0.040949,0.011078},
+	{0.086682,0.281592,0.035069,0.013702},
+	{0.069169,0.284177,0.059909,0.009020},
+	{0.085718,0.266880,0.066273,0.006910},
+	{0.097403,0.266171,0.048894,0.009477},
+	{0.107654,0.281428,0.038660,0.007576},
+	{0.088316,0.284050,0.066490,0.010354},
+	{0.113503,0.280552,0.060462,0.015014},
+	{0.122859,0.278804,0.036141,0.006759},
+	{0.142878,0.297979,0.037101,0.011706},
+	{0.133777,0.283064,0.049774,0.007955},
+	{0.154649,0.263474,0.065692,0.007507},
+	{0.169175,0.273460,0.031813,0.013607},
+	{0.179325,0.294941,0.051789,0.010091},
+	{0.165815,0.277188,0.064486,0.010220},
+	{0.192842,0.268948,0.065506,0.008519},
+	{0.203664,0.282860,0.030067,0.008961},
+	{0.221520,0.290705,0.031569,0.010600},
+	{0.204075,0.289620,0.057034,0.015762},
+	{0.217062,0.273218,0.067345,0.007561},
+	{0.236623,0.274054,0.029708,0.008988},
+	{0.259386,0.293049,0.032016,0.011916},
+	{0.240332,0.286268,0.050913,0.015762},
+	{0.252585,0.269128,0.068044,0.010690},
+	{0.277228,0.263086,0.036137,0.007242},
+	{0.297808,0.298823,0.038507,0.011507},
+	{0.273109,0.288314,0.070360,0.007871},
+	{0.283880,0.280089,0.053191,0.014002},
+	{0.311353,0.272674,0.042400,0.016116},
+	{0.318185,0.295940,0.050900,0.009579},
+	{0.300031,0.294218,0.056245,0.006682},
+	{0.324041,0.283074,0.063804,0.007747},
+	{0.338338,0.274337,0.045421,0.010405},
+	{0.366658,0.294673,0.036475,0.013011},
+	{0.345468,0.300165,0.061263,0.006730},
+	{0.371053,0.276011,0.062724,0.007746},
+	{0.382159,0.266197,0.045056,0.007040},
+	{0.385302,0.283479,0.044022,0.010008},
+	{0.382756,0.291084,0.070614,0.012573},
+	{0.403108,0.264928,0.054184,0.015762},
+	{0.419100,0.274729,0.031563,0.011467},
+	{0.437640,0.289426,0.049922,0.012611},
+	{0.416213,0.289680,0.065434,0.013463},
+	{0.425331,0.272106,0.052713,0.007637},
+	{0.454008,0.282624,0.038875,0.008275},
+	{0.483070,0.298139,0.038400,0.016342},
+	{0.446217,0.292641,0.069129,0.007245},
+	{0.473937,0.269688,0.049149,0.015337},
+	{0.027818,0.310268,0.030259,0.007775},
+	{0.037764,0.320592,0.051731,0.008781},
+	{0.016776,0.324398,0.064621,0.015762},
+	{0.043065,0.304671,0.073634,0.008404},
+	{0.060248,0.307914,0.031150,0.007448},
+	{0.077271,0.327681,0.031663,0.013927},
+	{0.055259,0.322950,0.050938,0.008327},
+	{0.079365,0.305257,0.051792,0.015762},
+	{0.095660,0.308012,0.031429,0.010463},
+	{0.103681,0.332264,0.031625,0.012290},
+	{0.089797,0.330875,0.053651,0.011579},
+	{0.102216,0.307408,0.054272,0.006891},
+	{0.135063,0.305375,0.051629,0.006373},
+	{0.146687,0.332542,0.040487,0.015166},
+	{0.119733,0.321591,0.052005,0.015762},
+	{0.139154,0.311001,0.062753,0.006747},
+	{0.166611,0.304212,0.025702,0.013467},
+	{0.179450,0.331099,0.030605,0.013540},
+	{0.168140,0.316792,0.050046,0.012886},
+	{0.181651,0.308754,0.061301,0.006449},
+	{0.196784,0.307080,0.030792,0.016081},
+	{0.215900,0.329030,0.028037,0.012976},
+	{0.194417,0.327273,0.054083,0.014566},
+	{0.222938,0.309720,0.049824,0.007765},
+	{0.236225,0.315755,0.036277,0.011069},
+	{0.259154,0.323023,0.045475,0.012979},
+	{0.229226,0.318793,0.058722,0.006414},
+	{0.263876,0.304803,0.055229,0.008220},
+	{0.280036,0.308037,0.046953,0.010221},
+	{0.289039,0.323201,0.031727,0.013078},
+	{0.277826,0.320270,0.068751,0.009886},
+	{0.281755,0.301785,0.064415,0.008406},
+	{0.311687,0.313114,0.034665,0.007177},
+	{0.321013,0.324686,0.029636,0.008514},
+	{0.307138,0.327658,0.072817,0.007383},
+	{0.319851,0.313892,0.064538,0.009449},
+	{0.333424,0.313519,0.041662,0.007831},
+	{0.360179,0.317042,0.032555,0.009090},
+	{0.345335,0.325054,0.051853,0.011632},
+	{0.356818,0.307255,0.054092,0.008452},
+	{0.376257,0.314516,0.044839,0.010566},
+	{0.404942,0.322076,0.039531,0.009398},
+	{0.377646,0.330732,0.066428,0.015762},
+	{0.393248,0.303006,0.052180,0.011230},
+	{0.414496,0.303557,0.046583,0.009348},
+	{0.429851,0.323348,0.043622,0.015876},
+	{0.411263,0.319949,0.059797,0.008998},
+	{0.432707,0.308279,0.070597,0.011926},
+	{0.453339,0.305155,0.030681,0.015166},
+	{0.467869,0.322571,0.052192,0.010042},
+	{0.449922,0.317745,0.059766,0.010027},
+	{0.461253,0.304033,0.060778,0.007790},
+	{0.021541,0.332873,0.040513,0.010232},
+	{0.038000,0.356554,0.031870,0.007826},
+	{0.032187,0.360165,0.053724,0.015074},
+	{0.051751,0.340670,0.059341,0.011595},
+	{0.050035,0.338842,0.039691,0.008214},
+	{0.074340,0.355322,0.033149,0.012791},
+	{0.064951,0.354774,0.051051,0.007431},
+	{0.073704,0.344766,0.063534,0.010807},
+	{0.090705,0.345601,0.029750,0.006412},
+	{0.113418,0.360863,0.031428,0.008821},
+	{0.096799,0.362099,0.049082,0.008369},
+	{0.107463,0.341185,0.072071,0.014400},
+	{0.121217,0.345472,0.047617,0.008563},
+	{0.151164,0.358997,0.045262,0.011416},
+	{0.135273,0.360729,0.057086,0.008467},
+	{0.150044,0.351765,0.063675,0.007622},
+	{0.167267,0.337703,0.045162,0.006559},
+	{0.185291,0.357837,0.029177,0.013202},
+	{0.174685,0.353137,0.051201,0.010915},
+	{0.182603,0.341175,0.071944,0.009153},
+	{0.199074,0.341536,0.033569,0.008593},
+	{0.223648,0.364790,0.032933,0.013250},
+	{0.206142,0.359909,0.070232,0.011880},
+	{0.218376,0.338725,0.063741,0.006775},
+	{0.235978,0.341262,0.044598,0.015762},
+	{0.248271,0.357981,0.028623,0.010326},
+	{0.239381,0.361261,0.054185,0.006676},
+	{0.262678,0.342288,0.073448,0.011112},
+	{0.270573,0.339357,0.051890,0.007719},
+	{0.291651,0.365260,0.034029,0.012619},
+	{0.278330,0.357467,0.061963,0.013218},
+	{0.287271,0.340846,0.047013,0.009740},
+	{0.311721,0.350588,0.047719,0.015762},
+	{0.329835,0.361562,0.031124,0.010858},
+	{0.308858,0.362142,0.074170,0.007884},
+	{0.318657,0.331854,0.062466,0.008662},
+	{0.334080,0.339898,0.036091,0.011614},
+	{0.361053,0.363146,0.028462,0.015405},
+	{0.342858,0.361137,0.049372,0.011564},
+	{0.357992,0.345258,0.056926,0.010458},
+	{0.376633,0.335585,0.028650,0.016006},
+	{0.388485,0.356145,0.042465,0.011050},
+	{0.367467,0.367712,0.056170,0.013400},
+	{0.398534,0.339188,0.050584,0.007905},
+	{0.410905,0.345867,0.031138,0.016090},
+	{0.433557,0.364385,0.032172,0.009789},
+	{0.414823,0.362718,0.050261,0.009697},
+	{0.425989,0.342978,0.064208,0.012469},
+	{0.446622,0.347487,0.046030,0.008548},
+	{0.463905,0.355130,0.053326,0.007996},
+	{0.447393,0.368651,0.049700,0.012945},
+	{0.474977,0.341544,0.046688,0.010746},
+	{0.019773,0.386775,0.049869,0.014542},
+	{0.049900,0.390242,0.042917,0.008807},
+	{0.022183,0.402617,0.069178,0.007405},
+	{0.034110,0.379357,0.068905,0.008232},
+	{0.067211,0.383096,0.027225,0.015626},
+	{0.078560,0.396236,0.052905,0.006480},
+	{0.068770,0.402250,0.062282,0.008351},
+	{0.075963,0.374658,0.055577,0.014744},
+	{0.104738,0.376287,0.048997,0.007889},
+	{0.119282,0.396959,0.048600,0.010216},
+	{0.096405,0.402327,0.056212,0.008008},
+	{0.107422,0.388063,0.061078,0.009161},
+	{0.131436,0.376425,0.038024,0.015884},
+	{0.148514,0.406019,0.048436,0.013951},
+	{0.132288,0.405409,0.061120,0.006654},
+	{0.151652,0.388678,0.066685,0.006268},
+	{0.169202,0.379342,0.050424,0.015870},
+	{0.188174,0.396136,0.022829,0.007254},
+	{0.170203,0.400366,0.065913,0.009355},
+	{0.194966,0.372889,0.055640,0.010498},
+	{0.212711,0.382905,0.044145,0.006430},
+	{0.220250,0.394315,0.029698,0.010635},
+	{0.195739,0.397199,0.044541,0.015762},
+	{0.211654,0.377701,0.056428,0.006888},
+	{0.234965,0.382146,0.029519,0.007750},
+	{0.263901,0.397112,0.046806,0.006980},
+	{0.234022,0.391910,0.051822,0.015536},
+	{0.260195,0.374135,0.045281,0.015762},
+	{0.280399,0.376799,0.056025,0.006714},
+	{0.283192,0.402145,0.026391,0.009786},
+	{0.279561,0.389831,0.070096,0.006789},
+	{0.299585,0.373604,0.057431,0.011953},
+	{0.312740,0.372343,0.033714,0.009518},
+	{0.335479,0.387674,0.036866,0.008966},
+	{0.313317,0.390191,0.058539,0.009610},
+	{0.327009,0.381826,0.052052,0.007696},
+	{0.349111,0.381525,0.050691,0.009803},
+	{0.370847,0.389607,0.040148,0.007174},
+	{0.336900,0.404187,0.051731,0.013298},
+	{0.364431,0.386995,0.051672,0.006272},
+	{0.380486,0.372616,0.037016,0.007843},
+	{0.387432,0.394596,0.035861,0.010668},
+	{0.383440,0.392839,0.070329,0.010113},
+	{0.397354,0.378289,0.069987,0.008162},
+	{0.412381,0.379269,0.031555,0.014769},
+	{0.431738,0.399853,0.031097,0.013491},
+	{0.416807,0.388592,0.068089,0.010234},
+	{0.434246,0.385754,0.051562,0.008510},
+	{0.459761,0.377812,0.034232,0.008546},
+	{0.469310,0.399879,0.030659,0.015762},
+	{0.448851,0.389468,0.070969,0.016061},
+	{0.472731,0.373287,0.052274,0.012192},
+	{0.025845,0.411569,0.031706,0.012222},
+	{0.053452,0.432332,0.034575,0.012284},
+	{0.013101,0.425034,0.052342,0.015517},
+	{0.035661,0.409240,0.053396,0.011700},
+	{0.069697,0.410872,0.045637,0.008799},
+	{0.085224,0.435507,0.032725,0.015801},
+	{0.056265,0.422981,0.058037,0.013129},
+	{0.076985,0.417420,0.069616,0.007327},
+	{0.086433,0.412353,0.047787,0.008139},
+	{0.113150,0.426126,0.051781,0.007572},
+	{0.095559,0.431375,0.071602,0.012141},
+	{0.110469,0.407765,0.062669,0.008395},
+	{0.131849,0.404271,0.035325,0.007326},
+	{0.154057,0.433609,0.051576,0.006804},
+	{0.130968,0.431234,0.049111,0.011155},
+	{0.146668,0.411976,0.072037,0.006514},
+	{0.173190,0.416526,0.046090,0.012972},
+	{0.190589,0.427391,0.031914,0.009879},
+	{0.165638,0.431320,0.062630,0.009368},
+	{0.181578,0.418447,0.070458,0.012485},
+	{0.201938,0.420097,0.050532,0.007909},
+	{0.210786,0.430524,0.043687,0.007384},
+	{0.199643,0.440108,0.058556,0.013086},
+	{0.219101,0.413160,0.043518,0.011656},
+	{0.235474,0.419530,0.052019,0.007861},
+	{0.254554,0.428819,0.029869,0.009518},
+	{0.251638,0.431825,0.063212,0.015327},
+	{0.253052,0.411818,0.042596,0.011772},
+	{0.268275,0.411836,0.031385,0.007133},
+	{0.299229,0.425848,0.044101,0.011809},
+	{0.277241,0.422348,0.053397,0.012319},
+	{0.285524,0.396817,0.050771,0.014608},
+	{0.311540,0.402649,0.035156,0.015936},
+	{0.331451,0.434548,0.035449,0.006888},
+	{0.310673,0.434227,0.066608,0.012917},
+	{0.322590,0.420054,0.049005,0.008242},
+	{0.340380,0.414409,0.031798,0.009373},
+	{0.362861,0.429363,0.031830,0.012967},
+	{0.340153,0.437578,0.060896,0.007843},
+	{0.370512,0.415453,0.055970,0.010546},
+	{-1.,-1.,-1.,-1. } /* sentinel: non-positive radius */
+};
+
+Vector3r Shop::inscribedCircleCenter(const Vector3r& v0, const Vector3r& v1, const Vector3r& v2)
+{
+	return v0+((v2-v0)*(v1-v0).Length()+(v1-v0)*(v2-v0).Length())/((v1-v0).Length()+(v2-v1).Length()+(v0-v2).Length());
+}
+
+void Shop::getViscoelasticFromSpheresInteraction( Real m, Real tc, Real en, Real es, shared_ptr<SimpleViscoelasticBodyParameters> b)
+{
+    b->kn = m/tc/tc * ( Mathr::PI*Mathr::PI + Mathr::Pow(Mathr::Log(en),2) );
+    b->cn = -2.0*m/tc * Mathr::Log(en);
+    b->ks = 2.0/7.0 * m/tc/tc * ( Mathr::PI*Mathr::PI + Mathr::Pow(Mathr::Log(es),2) );
+    b->cs = -2.0/7.0 * m/tc * Mathr::Log(es);
+
+    if (Math<Real>::FAbs(b->cn) <= Math<Real>::ZERO_TOLERANCE ) b->cn=0;
+    if (Math<Real>::FAbs(b->cs) <= Math<Real>::ZERO_TOLERANCE ) b->cs=0;
+}
+
+
+/* This function is copied almost verbatim from scientific python, module Visualization, class ColorScale
+ *
+ */
+Vector3r Shop::scalarOnColorScale(Real x, Real xmin, Real xmax){
+	Real xnorm=min((Real)1.,max((x-xmin)/(xmax-xmin),(Real)0.));
+	if(xnorm<.25) return Vector3r(0,.4*xnorm,1);
+	if(xnorm<.5)  return Vector3r(0,1,1.-4.*(xnorm-.25));
+	if(xnorm<.75) return Vector3r(4*(xnorm-.5),1.,0);
+	return Vector3r(1,1-4*(xnorm-.75),0);
+}
+
+/* Wrap floating point number into interval (x0,x1〉such that it is shifted
+ * by integral number of the interval range. If given, *period will hold
+ * this number. The wrapped value is returned.
+ */
+Real Shop::periodicWrap(Real x, Real x0, Real x1, long* period){
+	Real xNorm=(x-x0)/(x1-x0);
+	Real xxNorm=xNorm-floor(xNorm);
+	if(period) *period=(long)floor(xNorm);
+	return x0+xxNorm*(x1-x0);
+}
+

Copied: trunk/pkg/dem/meta/Shop.hpp (from rev 1872, trunk/extra/Shop.hpp)

Copied: trunk/pkg/dem/meta/Tetra.cpp (from rev 1872, trunk/extra/tetra/Tetra.cpp)


Property changes on: trunk/pkg/dem/meta/Tetra.cpp
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/pkg/dem/meta/Tetra.hpp (from rev 1875, trunk/extra/tetra/Tetra.hpp)


Property changes on: trunk/pkg/dem/meta/Tetra.hpp
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/pkg/fem/DataClass/GeometricalModel/FEMSetGeometry.cpp
===================================================================
--- trunk/pkg/fem/DataClass/GeometricalModel/FEMSetGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/fem/DataClass/GeometricalModel/FEMSetGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -21,4 +21,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("FEMSetGeometry");
\ No newline at end of file

Modified: trunk/pkg/fem/DataClass/PhysicalParameters/FEMNodeData.cpp
===================================================================
--- trunk/pkg/fem/DataClass/PhysicalParameters/FEMNodeData.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/fem/DataClass/PhysicalParameters/FEMNodeData.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -21,4 +21,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("FEMNodeData");
\ No newline at end of file

Modified: trunk/pkg/fem/DataClass/PhysicalParameters/FEMSetParameters.cpp
===================================================================
--- trunk/pkg/fem/DataClass/PhysicalParameters/FEMSetParameters.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/fem/DataClass/PhysicalParameters/FEMSetParameters.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -24,4 +24,4 @@
 
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("FEMSetParameters");
\ No newline at end of file

Modified: trunk/pkg/fem/DataClass/PhysicalParameters/FEMTetrahedronData.cpp
===================================================================
--- trunk/pkg/fem/DataClass/PhysicalParameters/FEMTetrahedronData.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/fem/DataClass/PhysicalParameters/FEMTetrahedronData.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -183,4 +183,4 @@
 	damping = Damp * mass ;
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("FEMTetrahedronData");
\ No newline at end of file

Modified: trunk/pkg/fem/DataClass/PhysicalParameters/FEMTetrahedronData.hpp
===================================================================
--- trunk/pkg/fem/DataClass/PhysicalParameters/FEMTetrahedronData.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/fem/DataClass/PhysicalParameters/FEMTetrahedronData.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -12,7 +12,6 @@
 #include<yade/pkg-common/RigidBodyParameters.hpp>
 
 #include <boost/numeric/ublas/matrix.hpp>
-#include <boost/numeric/ublas/vector.hpp>
 
 #include <vector>
 

Modified: trunk/pkg/fem/Engine/EngineUnit/FEMSet2Tetrahedrons.cpp
===================================================================
--- trunk/pkg/fem/Engine/EngineUnit/FEMSet2Tetrahedrons.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/fem/Engine/EngineUnit/FEMSet2Tetrahedrons.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -43,4 +43,4 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("FEMSet2Tetrahedrons");
\ No newline at end of file

Modified: trunk/pkg/fem/Engine/EngineUnit/FEMSetTextLoader.cpp
===================================================================
--- trunk/pkg/fem/Engine/EngineUnit/FEMSetTextLoader.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/fem/Engine/EngineUnit/FEMSetTextLoader.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -128,4 +128,4 @@
 	body->physicalParameters	= physics;
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("FEMSetTextLoader");
\ No newline at end of file

Modified: trunk/pkg/fem/Engine/EngineUnit/FEMTetrahedronStiffness.cpp
===================================================================
--- trunk/pkg/fem/Engine/EngineUnit/FEMTetrahedronStiffness.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/fem/Engine/EngineUnit/FEMTetrahedronStiffness.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -35,4 +35,4 @@
 	}
 	
 }
-YADE_PLUGIN();
+YADE_PLUGIN("FEMTetrahedronStiffness");
\ No newline at end of file

Modified: trunk/pkg/fem/Engine/StandAloneEngine/FEMLaw.cpp
===================================================================
--- trunk/pkg/fem/Engine/StandAloneEngine/FEMLaw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/fem/Engine/StandAloneEngine/FEMLaw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -76,4 +76,4 @@
 
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("FEMLaw");
\ No newline at end of file

Modified: trunk/pkg/fem/PreProcessor/FEMBeam.cpp
===================================================================
--- trunk/pkg/fem/PreProcessor/FEMBeam.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/fem/PreProcessor/FEMBeam.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -238,4 +238,4 @@
 }
 
  
-YADE_PLUGIN();
+YADE_PLUGIN("FEMBeam");
\ No newline at end of file

Modified: trunk/pkg/fem/SConscript
===================================================================
--- trunk/pkg/fem/SConscript	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/fem/SConscript	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,141 +1,12 @@
 Import('*')
 env.Install('$PREFIX/lib/yade$SUFFIX/pkg-fem',[
-
-	env.SharedLibrary('FEMSetGeometry',
-		['DataClass/GeometricalModel/FEMSetGeometry.cpp'],
-		LIBS=env['LIBS']+['yade-base',  'yade-multimethods'],
-		CPPPATH=env['CPPPATH']+['DataClass/GeometricalModel', '$PREFIX/include']),
-
-	env.SharedLibrary('FEMNodeData',
-		['DataClass/PhysicalParameters/FEMNodeData.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			
-			'ParticleParameters',
-			'AABB',
-			'yade-serialization',
-			'yade-base',
-			
-			'yade-multimethods'],
-		CPPPATH=env['CPPPATH']+['$PREFIX/include', 'DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('FEMSetParameters',
-		['DataClass/PhysicalParameters/FEMSetParameters.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			
-			'AABB',
-			'yade-serialization',
-			'yade-base',
-			
-			'yade-multimethods'],
-		CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters', '$PREFIX/include']),
-
-	env.SharedLibrary('FEMTetrahedronData',
-		['DataClass/PhysicalParameters/FEMTetrahedronData.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			
-			'FEMNodeData',
-			'RigidBodyParameters',
-			'AABB',
-			'yade-serialization',
-			'yade-base',
-			
-			'yade-multimethods'],
-		CPPPATH=env['CPPPATH']+['$PREFIX/include',
-			'DataClass/PhysicalParameters',
-			'DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('FEMSet2Tetrahedrons',
-		['Engine/EngineUnit/FEMSet2Tetrahedrons.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			
-			'FEMSetParameters',
-			'FEMTetrahedronData',
-			'ParticleParameters',
-			'GeometricalModelMetaEngine',
-			'Tetrahedron'],
-		CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters',
-			'$PREFIX/include',
-			'Engine/EngineUnit',
-			'DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('FEMSetTextLoader',
-		['Engine/EngineUnit/FEMSetTextLoader.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			
-			'FEMSetParameters',
-			'FEMTetrahedronData',
-			'PhysicalParametersMetaEngine',
-			'ParticleParameters',
-			'RigidBodyParameters',
-			'Sphere',
-			'Tetrahedron'],
-		CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters',
-			'$PREFIX/include',
-			'Engine/EngineUnit',
-			'DataClass/PhysicalParameters',
-			'DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('FEMTetrahedronStiffness',
-		['Engine/EngineUnit/FEMTetrahedronStiffness.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			
-			'FEMSetParameters',
-			'FEMTetrahedronData',
-			'PhysicalParametersMetaEngine',
-			'ParticleParameters'],
-		CPPPATH=env['CPPPATH']+['Engine/EngineUnit',
-			'$PREFIX/include',
-			'DataClass/PhysicalParameters',
-			'DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('FEMLaw',
-		['Engine/StandAloneEngine/FEMLaw.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			
-			'FEMTetrahedronData',
-			'ParticleParameters'],
-		CPPPATH=env['CPPPATH']+['$PREFIX/include',
-			'DataClass/PhysicalParameters',
-			'Engine/StandAloneEngine',
-			'DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('FEMBeam',
-		['PreProcessor/FEMBeam.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			
-			'FEMTetrahedronData',
-			'FEMSetParameters',
-			'FEMLaw',
-			'FEMSetTextLoader',
-			'FEMTetrahedronStiffness',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MetaInteractingGeometry',
-			'GravityEngines',
-			'yade-serialization',
-			'yade-base',
-			
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'GeometricalModelMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'AABB',
-			'Box',
-			'RigidBodyParameters',
-			'Sphere',
-			'Tetrahedron',
-			'TranslationEngine',
-			'yade-multimethods'],
-		CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters',
-			'$PREFIX/include',
-			'DataClass/PhysicalParameters',
-			'Engine/StandAloneEngine',
-			'DataClass/PhysicalParameters',
-			'Engine/EngineUnit',
-			'Engine/EngineUnit',
-			'PreProcessor'])
+	env.SharedLibrary('FEMSetGeometry',['DataClass/GeometricalModel/FEMSetGeometry.cpp']),env.SharedLibrary('FEMNodeData',['DataClass/PhysicalParameters/FEMNodeData.cpp'],LIBS=env['LIBS']+['ParticleParameters','AABB',]),
+	env.SharedLibrary('FEMSetParameters',['DataClass/PhysicalParameters/FEMSetParameters.cpp'],LIBS=env['LIBS']+['AABB',]),
+	env.SharedLibrary('FEMTetrahedronData',['DataClass/PhysicalParameters/FEMTetrahedronData.cpp'],LIBS=env['LIBS']+['FEMNodeData','RigidBodyParameters','AABB']),
+	env.SharedLibrary('FEMSet2Tetrahedrons',['Engine/EngineUnit/FEMSet2Tetrahedrons.cpp'],LIBS=env['LIBS']+['FEMSetParameters','FEMTetrahedronData','ParticleParameters','GeometricalModelMetaEngine','Tetrahedron']),
+	env.SharedLibrary('FEMSetTextLoader',['Engine/EngineUnit/FEMSetTextLoader.cpp'],LIBS=env['LIBS']+['FEMSetParameters','FEMTetrahedronData','PhysicalParametersMetaEngine','ParticleParameters','RigidBodyParameters','Sphere','Tetrahedron'],),
+	env.SharedLibrary('FEMTetrahedronStiffness',['Engine/EngineUnit/FEMTetrahedronStiffness.cpp'],LIBS=env['LIBS']+['FEMSetParameters','FEMTetrahedronData','PhysicalParametersMetaEngine','ParticleParameters']),
+	env.SharedLibrary('FEMLaw',['Engine/StandAloneEngine/FEMLaw.cpp'],LIBS=env['LIBS']+['FEMTetrahedronData','ParticleParameters']),
+	env.SharedLibrary('FEMBeam',['PreProcessor/FEMBeam.cpp'],LIBS=env['LIBS']+['FEMTetrahedronData','FEMSetParameters','FEMLaw','FEMSetTextLoader','FEMTetrahedronStiffness','CundallNonViscousDamping','CundallNonViscousDamping','MetaInteractingGeometry','GravityEngines','PhysicalActionContainerReseter','InteractionGeometryMetaEngine','InteractionPhysicsMetaEngine','GeometricalModelMetaEngine','PhysicalActionApplier','PhysicalParametersMetaEngine','BoundingVolumeMetaEngine','AABB','Box','RigidBodyParameters','Sphere','Tetrahedron','TranslationEngine',],),
 ])
 

Modified: trunk/pkg/lattice/DataClass/GeometricalModel/LatticeSetGeometry.cpp
===================================================================
--- trunk/pkg/lattice/DataClass/GeometricalModel/LatticeSetGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/DataClass/GeometricalModel/LatticeSetGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -21,4 +21,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("LatticeSetGeometry");
\ No newline at end of file

Modified: trunk/pkg/lattice/DataClass/GeometricalModel/LineSegment.cpp
===================================================================
--- trunk/pkg/lattice/DataClass/GeometricalModel/LineSegment.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/DataClass/GeometricalModel/LineSegment.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -18,4 +18,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("LineSegment");
\ No newline at end of file

Modified: trunk/pkg/lattice/DataClass/InteractingGeometry/LatticeInteractingGeometry.cpp
===================================================================
--- trunk/pkg/lattice/DataClass/InteractingGeometry/LatticeInteractingGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/DataClass/InteractingGeometry/LatticeInteractingGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -19,4 +19,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("LatticeInteractingGeometry");
\ No newline at end of file

Modified: trunk/pkg/lattice/DataClass/InteractionPhysics/LatticeBeamAngularSpring.cpp
===================================================================
--- trunk/pkg/lattice/DataClass/InteractionPhysics/LatticeBeamAngularSpring.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/DataClass/InteractionPhysics/LatticeBeamAngularSpring.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -34,4 +34,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("LatticeBeamAngularSpring");
\ No newline at end of file

Modified: trunk/pkg/lattice/DataClass/InteractionPhysics/NonLocalDependency.cpp
===================================================================
--- trunk/pkg/lattice/DataClass/InteractionPhysics/NonLocalDependency.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/DataClass/InteractionPhysics/NonLocalDependency.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -21,4 +21,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("NonLocalDependency");
\ No newline at end of file

Modified: trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeBeamParameters.cpp
===================================================================
--- trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeBeamParameters.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeBeamParameters.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -144,4 +144,4 @@
         }
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("LatticeBeamParameters");
\ No newline at end of file

Modified: trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeNodeParameters.cpp
===================================================================
--- trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeNodeParameters.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeNodeParameters.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -24,4 +24,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("LatticeNodeParameters");
\ No newline at end of file

Modified: trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeSetParameters.cpp
===================================================================
--- trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeSetParameters.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/DataClass/PhysicalParameters/LatticeSetParameters.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -29,4 +29,4 @@
 
 
  
-YADE_PLUGIN();
+YADE_PLUGIN("LatticeSetParameters");
\ No newline at end of file

Modified: trunk/pkg/lattice/Engine/EngineUnit/LatticeSet2LatticeBeams.cpp
===================================================================
--- trunk/pkg/lattice/Engine/EngineUnit/LatticeSet2LatticeBeams.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/Engine/EngineUnit/LatticeSet2LatticeBeams.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -56,4 +56,4 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("LatticeSet2LatticeBeams");
\ No newline at end of file

Modified: trunk/pkg/lattice/Engine/StandAloneEngine/BeamRecorder.cpp
===================================================================
--- trunk/pkg/lattice/Engine/StandAloneEngine/BeamRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/Engine/StandAloneEngine/BeamRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -193,4 +193,4 @@
 	 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("BeamRecorder");
\ No newline at end of file

Modified: trunk/pkg/lattice/Engine/StandAloneEngine/LatticeLaw.cpp
===================================================================
--- trunk/pkg/lattice/Engine/StandAloneEngine/LatticeLaw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/Engine/StandAloneEngine/LatticeLaw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -114,8 +114,8 @@
 
 	BodyContainer* bodies = lattice->bodies.get();
 
-	InteractionContainer::iterator angles     = lattice->persistentInteractions->begin();
-	InteractionContainer::iterator angles_end = lattice->persistentInteractions->end();
+	InteractionContainer::iterator angles     = lattice->interactions->begin();
+	InteractionContainer::iterator angles_end = lattice->interactions->end();
 
 	{ // 'B' calculate how many neighbors each beam currently has
 		for(  ; angles != angles_end; ++angles )
@@ -130,8 +130,8 @@
 		}
 	}
 	{ // calculate new angles between beams
-		angles     = lattice->persistentInteractions->begin();
-		angles_end = lattice->persistentInteractions->end();
+		angles     = lattice->interactions->begin();
+		angles_end = lattice->interactions->end();
 		for(  ; angles != angles_end; ++angles )
 		{
 			if( 	   bodies->exists( (*angles)->getId1() )
@@ -711,4 +711,4 @@
 
 */
 
-YADE_PLUGIN();
+YADE_PLUGIN("LatticeLaw");
\ No newline at end of file

Modified: trunk/pkg/lattice/Engine/StandAloneEngine/MeasurePoisson.cpp
===================================================================
--- trunk/pkg/lattice/Engine/StandAloneEngine/MeasurePoisson.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/Engine/StandAloneEngine/MeasurePoisson.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -100,4 +100,4 @@
 	 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("MeasurePoisson");
\ No newline at end of file

Modified: trunk/pkg/lattice/Engine/StandAloneEngine/MovingSupport.cpp
===================================================================
--- trunk/pkg/lattice/Engine/StandAloneEngine/MovingSupport.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/Engine/StandAloneEngine/MovingSupport.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -210,4 +210,4 @@
 	 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("MovingSupport");
\ No newline at end of file

Modified: trunk/pkg/lattice/Engine/StandAloneEngine/NodeRecorder.cpp
===================================================================
--- trunk/pkg/lattice/Engine/StandAloneEngine/NodeRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/Engine/StandAloneEngine/NodeRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -204,4 +204,4 @@
 	// GLDrawSomething can just put a getClassName()
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("NodeRecorder");
\ No newline at end of file

Modified: trunk/pkg/lattice/Engine/StandAloneEngine/NonLocalInitializer.cpp
===================================================================
--- trunk/pkg/lattice/Engine/StandAloneEngine/NonLocalInitializer.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/Engine/StandAloneEngine/NonLocalInitializer.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -179,4 +179,4 @@
 //	cerr << "number of beams: " << total << "\n";
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("NonLocalInitializer");
\ No newline at end of file

Modified: trunk/pkg/lattice/Engine/StandAloneEngine/StrainRecorder.cpp
===================================================================
--- trunk/pkg/lattice/Engine/StandAloneEngine/StrainRecorder.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/Engine/StandAloneEngine/StrainRecorder.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -118,4 +118,4 @@
 	 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("StrainRecorder");
\ No newline at end of file

Modified: trunk/pkg/lattice/PreProcessor/LatticeExample.cpp
===================================================================
--- trunk/pkg/lattice/PreProcessor/LatticeExample.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/PreProcessor/LatticeExample.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -34,7 +34,7 @@
 
 #include<yade/pkg-common/AABB.hpp>
 
-#include<yade/pkg-common/BodyRedirectionVector.hpp>
+#include<yade/core/BodyRedirectionVector.hpp>
 
 #include<yade/pkg-common/DisplacementEngine.hpp>
 #include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
@@ -600,7 +600,7 @@
 			if( ! ( body->getGroupMask() & beamGroupMask ) )
 				continue; // skip non-beams
 				
-			calcBeamAngles(body,rootBody->bodies.get(),rootBody->persistentInteractions.get());
+			calcBeamAngles(body,rootBody->bodies.get(),rootBody->interactions.get());
                 }
         }
 	
@@ -1915,4 +1915,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("LatticeExample");

Modified: trunk/pkg/lattice/PreProcessor/LatticeExample.hpp
===================================================================
--- trunk/pkg/lattice/PreProcessor/LatticeExample.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/PreProcessor/LatticeExample.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -11,7 +11,7 @@
 #include<yade/core/FileGenerator.hpp>
 #include <Wm3Vector3.h>
 #include<yade/lib-base/yadeWm3.hpp>
-#include<yade/pkg-common/BodyRedirectionVector.hpp>
+#include<yade/core/BodyRedirectionVector.hpp>
 
 class LatticeBeamParameters;
 class StrainRecorder;

Modified: trunk/pkg/lattice/PreProcessor/LatticeExampleCTData.cpp
===================================================================
--- trunk/pkg/lattice/PreProcessor/LatticeExampleCTData.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/PreProcessor/LatticeExampleCTData.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -15,13 +15,13 @@
 #include<yade/pkg-common/AABB.hpp>
 #include<yade/pkg-common/Sphere.hpp>
 #include<yade/pkg-common/DisplacementEngine.hpp>
-#include"LatticeLaw.hpp"
-#include"LatticeSetParameters.hpp"
-#include"LatticeInteractingGeometry.hpp"
-#include"LatticeNodeParameters.hpp"
-#include"LatticeBeamParameters.hpp"
-#include"LineSegment.hpp"
-#include"LatticeBeamAngularSpring.hpp"
+#include<yade/pkg-lattice/LatticeLaw.hpp>
+#include<yade/pkg-lattice/LatticeSetParameters.hpp>
+#include<yade/pkg-lattice/LatticeInteractingGeometry.hpp>
+#include<yade/pkg-lattice/LatticeNodeParameters.hpp>
+#include<yade/pkg-lattice/LatticeBeamParameters.hpp>
+#include<yade/pkg-lattice/LineSegment.hpp>
+#include<yade/pkg-lattice/LatticeBeamAngularSpring.hpp>
 
 // Delaunay
 #ifndef MINIWM3
@@ -287,7 +287,7 @@
 		if( ! ( body->getGroupMask() & beamGroupMask ) )
 			continue; // skip non-beams
 
-		calcBeamAngles(body,rootBody->bodies.get(),rootBody->persistentInteractions.get(),connections);
+		calcBeamAngles(body,rootBody->bodies.get(),rootBody->interactions.get(),connections);
 	}
 }
 
@@ -552,5 +552,4 @@
 	}
 }
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("LatticeExampleCTData");

Modified: trunk/pkg/lattice/PreProcessor/LatticeExampleCTData.hpp
===================================================================
--- trunk/pkg/lattice/PreProcessor/LatticeExampleCTData.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/PreProcessor/LatticeExampleCTData.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -11,7 +11,7 @@
 #include<yade/core/FileGenerator.hpp>
 #include<Wm3Vector3.h>
 #include<yade/lib-base/yadeWm3.hpp>
-#include<yade/pkg-common/BodyRedirectionVector.hpp>
+#include<yade/core/BodyRedirectionVector.hpp>
 
 class LatticeBeamParameters;
 class StrainRecorder;

Modified: trunk/pkg/lattice/PreProcessor/LatticeExampleSimple.cpp
===================================================================
--- trunk/pkg/lattice/PreProcessor/LatticeExampleSimple.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/PreProcessor/LatticeExampleSimple.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -13,13 +13,13 @@
 #include<yade/pkg-common/AABB.hpp>
 #include<yade/pkg-common/Sphere.hpp>
 #include<yade/pkg-common/DisplacementEngine.hpp>
-#include"LatticeLaw.hpp"
-#include"LatticeSetParameters.hpp"
-#include"LatticeInteractingGeometry.hpp"
-#include"LatticeNodeParameters.hpp"
-#include"LatticeBeamParameters.hpp"
-#include"LineSegment.hpp"
-#include"LatticeBeamAngularSpring.hpp"
+#include<yade/pkg-lattice/LatticeLaw.hpp>
+#include<yade/pkg-lattice/LatticeSetParameters.hpp>
+#include<yade/pkg-lattice/LatticeInteractingGeometry.hpp>
+#include<yade/pkg-lattice/LatticeNodeParameters.hpp>
+#include<yade/pkg-lattice/LatticeBeamParameters.hpp>
+#include<yade/pkg-lattice/LineSegment.hpp>
+#include<yade/pkg-lattice/LatticeBeamAngularSpring.hpp>
 
 // Delaunay
 #ifndef MINIWM3
@@ -244,7 +244,7 @@
 		if( ! ( body->getGroupMask() & beamGroupMask ) )
 			continue; // skip non-beams
 
-		calcBeamAngles(body,rootBody->bodies.get(),rootBody->persistentInteractions.get(),connections);
+		calcBeamAngles(body,rootBody->bodies.get(),rootBody->interactions.get(),connections);
 	}
 }
 
@@ -509,5 +509,4 @@
 	}
 }
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("LatticeExampleSimple");

Modified: trunk/pkg/lattice/PreProcessor/LatticeExampleSimple.hpp
===================================================================
--- trunk/pkg/lattice/PreProcessor/LatticeExampleSimple.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/PreProcessor/LatticeExampleSimple.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -11,7 +11,7 @@
 #include<yade/core/FileGenerator.hpp>
 #include<Wm3Vector3.h>
 #include<yade/lib-base/yadeWm3.hpp>
-#include<yade/pkg-common/BodyRedirectionVector.hpp>
+#include<yade/core/BodyRedirectionVector.hpp>
 
 class LatticeBeamParameters;
 class StrainRecorder;

Modified: trunk/pkg/lattice/RenderingEngine/GLDrawLatticeBeamState/GLDrawLatticeBeamState.cpp
===================================================================
--- trunk/pkg/lattice/RenderingEngine/GLDrawLatticeBeamState/GLDrawLatticeBeamState.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/RenderingEngine/GLDrawLatticeBeamState/GLDrawLatticeBeamState.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -67,4 +67,5 @@
 	*/
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawLatticeBeamState");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/lattice/RenderingEngine/GLDrawLatticeInteractingGeometry/GLDrawLatticeInteractingGeometry.cpp
===================================================================
--- trunk/pkg/lattice/RenderingEngine/GLDrawLatticeInteractingGeometry/GLDrawLatticeInteractingGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/RenderingEngine/GLDrawLatticeInteractingGeometry/GLDrawLatticeInteractingGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -93,7 +93,7 @@
 	}
 	int limit = Omega::instance().isoSec;
 
-	InteractionContainer* interactions = Omega::instance().getRootBody()->persistentInteractions.get();
+	InteractionContainer* interactions = Omega::instance().getRootBody()->interactions.get();
 	BodyContainer* bodies = Omega::instance().getRootBody()->bodies.get();
 
 	InteractionContainer::iterator angles     = interactions->begin();
@@ -199,4 +199,5 @@
 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawLatticeInteractingGeometry");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/lattice/RenderingEngine/GLDrawLatticeSetGeometry/GLDrawLatticeSetGeometry.cpp
===================================================================
--- trunk/pkg/lattice/RenderingEngine/GLDrawLatticeSetGeometry/GLDrawLatticeSetGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/RenderingEngine/GLDrawLatticeSetGeometry/GLDrawLatticeSetGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -233,4 +233,5 @@
 //	std::cerr << "GLDrawLatticeSetGeometry\n";
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawLatticeSetGeometry");
+YADE_REQUIRE_FEATURE(OPENGL)

Modified: trunk/pkg/lattice/RenderingEngine/GLDrawLineSegment/GLDrawLineSegment.cpp
===================================================================
--- trunk/pkg/lattice/RenderingEngine/GLDrawLineSegment/GLDrawLineSegment.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/RenderingEngine/GLDrawLineSegment/GLDrawLineSegment.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -65,4 +65,5 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("GLDrawLineSegment");
+YADE_REQUIRE_FEATURE(OPENGL)

Deleted: trunk/pkg/lattice/SConscript
===================================================================
--- trunk/pkg/lattice/SConscript	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/lattice/SConscript	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,261 +0,0 @@
-Import('*')
-env.Install('$PREFIX/lib/yade$SUFFIX/pkg-lattice',[
-
-	env.SharedLibrary('LatticeInteractingGeometry',
-		['DataClass/InteractingGeometry/LatticeInteractingGeometry.cpp'],
-		LIBS=env['LIBS']+['yade-base','MetaInteractingGeometry']),
-
-	env.SharedLibrary('LatticeSetGeometry',
-		['DataClass/GeometricalModel/LatticeSetGeometry.cpp'],
-		LIBS=env['LIBS']+['yade-base','yade-multimethods']),
-
-	env.SharedLibrary('LineSegment',
-		['DataClass/GeometricalModel/LineSegment.cpp'],
-		LIBS=env['LIBS']+['yade-base',  'yade-multimethods']),
-
-	env.SharedLibrary('LatticeBeamParameters',
-		['DataClass/PhysicalParameters/LatticeBeamParameters.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'yade-multimethods',
-			'yade-serialization']),
-
-	env.SharedLibrary('LatticeNodeParameters',
-		['DataClass/PhysicalParameters/LatticeNodeParameters.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'yade-multimethods',
-			'yade-serialization']),
-
-	env.SharedLibrary('LatticeSetParameters',
-		['DataClass/PhysicalParameters/LatticeSetParameters.cpp'],
-		LIBS=env['LIBS']+['yade-base']),
-
-	env.SharedLibrary('LatticeBeamAngularSpring',
-		['DataClass/InteractionPhysics/LatticeBeamAngularSpring.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'yade-multimethods',
-			'yade-serialization']),
-
-	env.SharedLibrary('NonLocalDependency',
-		['DataClass/InteractionPhysics/NonLocalDependency.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'yade-multimethods',
-			'yade-serialization']),
-
-	env.SharedLibrary('LatticeSet2LatticeBeams',
-		['Engine/EngineUnit/LatticeSet2LatticeBeams.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'LineSegment',
-			'LatticeSetParameters',
-			'LatticeBeamParameters',
-			'GeometricalModelMetaEngine',
-			'ParticleParameters'],
-		CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters',
-			'$PREFIX/include',
-			'DataClass/PhysicalParameters',
-			'Engine/EngineUnit',
-			'DataClass/GeometricalModel']),
-
-	env.SharedLibrary('LatticeLaw',
-		['Engine/StandAloneEngine/LatticeLaw.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'LatticeBeamParameters',
-			'LatticeNodeParameters',
-			'LatticeSetParameters',
-			'LatticeBeamAngularSpring',
-			'NonLocalDependency'],
-		CPPPATH=env['CPPPATH']+['DataClass/InteractionPhysics',
-			'DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('NonLocalInitializer',
-		['Engine/StandAloneEngine/NonLocalInitializer.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'LatticeBeamParameters',
-			'LatticeNodeParameters',
-			'LatticeSetParameters',
-			'NonLocalDependency'],
-		CPPPATH=env['CPPPATH']+['DataClass/InteractionPhysics',
-			'DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('MeasurePoisson',
-		['Engine/StandAloneEngine/MeasurePoisson.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'LatticeBeamParameters',
-			'LatticeNodeParameters'],
-		CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('StrainRecorder',
-		['Engine/StandAloneEngine/StrainRecorder.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'LatticeBeamParameters',
-			'LatticeNodeParameters'],
-		CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('NodeRecorder',
-		['Engine/StandAloneEngine/NodeRecorder.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'LatticeBeamParameters',
-			'LatticeNodeParameters'],
-		CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('BeamRecorder',
-		['Engine/StandAloneEngine/BeamRecorder.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'LatticeBeamParameters',
-			'LatticeNodeParameters'],
-		CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('MovingSupport',
-		['Engine/StandAloneEngine/MovingSupport.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'LatticeBeamParameters',
-			'LatticeNodeParameters'],
-		CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('LatticeExampleSimple',
-		['PreProcessor/LatticeExampleSimple.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'LineSegment',
-			'LatticeSetParameters',
-			'LatticeBeamParameters',
-			'LatticeNodeParameters',
-			'NonLocalDependency',
-			'NonLocalInitializer',
-			'StrainRecorder',
-			'NodeRecorder',
-			'BeamRecorder',
-			'MovingSupport',
-			'MeasurePoisson',
-			'LatticeBeamAngularSpring',
-			'MetaInteractingGeometry',
-			'LatticeInteractingGeometry',
-			'GeometricalModelMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'ParticleParameters',
-			'AABB',
-			'Quadrilateral',
-			'ParticleParameters',
-			'Sphere',
-			'DisplacementEngine',
-			'LatticeLaw',
-			'yade-base',
-			],
-		CPPPATH=env['CPPPATH']+['Engine/StandAloneEngine',
-			'DataClass/InteractionPhysics',
-			'DataClass/GeometricalModel',
-			'DataClass/InteractingGeometry',
-			'DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('LatticeExampleCTData',
-		['PreProcessor/LatticeExampleCTData.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'LineSegment',
-			'LatticeSetParameters',
-			'LatticeBeamParameters',
-			'LatticeNodeParameters',
-			'NonLocalDependency',
-			'NonLocalInitializer',
-			'StrainRecorder',
-			'NodeRecorder',
-			'BeamRecorder',
-			'MovingSupport',
-			'MeasurePoisson',
-			'LatticeBeamAngularSpring',
-			'MetaInteractingGeometry',
-			'LatticeInteractingGeometry',
-			'GeometricalModelMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'ParticleParameters',
-			'AABB',
-			'Quadrilateral',
-			'ParticleParameters',
-			'Sphere',
-			'DisplacementEngine',
-			'LatticeLaw',
-			'yade-base',
-			],
-		CPPPATH=env['CPPPATH']+['Engine/StandAloneEngine',
-			'DataClass/InteractionPhysics',
-			'DataClass/GeometricalModel',
-			'DataClass/InteractingGeometry',
-			'DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('LatticeExample',
-		['PreProcessor/LatticeExample.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'LineSegment',
-			'LatticeSetParameters',
-			'LatticeBeamParameters',
-			'LatticeNodeParameters',
-			'NonLocalDependency',
-			'NonLocalInitializer',
-			'StrainRecorder',
-			'NodeRecorder',
-			'BeamRecorder',
-			'MovingSupport',
-			'MeasurePoisson',
-			'LatticeBeamAngularSpring',
-			'MetaInteractingGeometry',
-			'LatticeInteractingGeometry',
-			'GeometricalModelMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'ParticleParameters',
-			'AABB',
-			'Quadrilateral',
-			'ParticleParameters',
-			'Sphere',
-			'DisplacementEngine',
-			'LatticeLaw',
-			'yade-base',
-			],
-		CPPPATH=env['CPPPATH']+['Engine/StandAloneEngine',
-			'DataClass/InteractionPhysics',
-			'DataClass/GeometricalModel',
-			'DataClass/InteractingGeometry',
-			'DataClass/PhysicalParameters'])
-])
-
-if 'YADE_OPENGL' in env['CPPDEFINES']:
-	env.Install('$PREFIX/lib/yade$SUFFIX/pkg-lattice',[
-		env.SharedLibrary('GLDrawLineSegment',
-			['RenderingEngine/GLDrawLineSegment/GLDrawLineSegment.cpp'],
-			LIBS=env['LIBS']+['yade-base',  'LineSegment', 'yade-opengl'],
-			CPPPATH=env['CPPPATH']+['DataClass/GeometricalModel']),
-		env.SharedLibrary('GLDrawLatticeBeamState',
-			['RenderingEngine/GLDrawLatticeBeamState/GLDrawLatticeBeamState.cpp'],
-			LIBS=env['LIBS']+['yade-base',  'LatticeBeamParameters', 'yade-opengl'],
-			CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters']),
-		env.SharedLibrary('GLDrawLatticeSetGeometry',
-			['RenderingEngine/GLDrawLatticeSetGeometry/GLDrawLatticeSetGeometry.cpp'],
-			LIBS=env['LIBS']+['yade-base',
-				'LatticeSetGeometry',
-				'LatticeSetParameters',
-				'LatticeBeamParameters',
-				'LatticeNodeParameters',
-				'yade-opengl',
-				'yade-computational-geometry'],
-			CPPPATH=env['CPPPATH']+['DataClass/GeometricalModel',
-				'DataClass/PhysicalParameters']),
-		env.SharedLibrary('GLDrawLatticeInteractingGeometry',
-			['RenderingEngine/GLDrawLatticeInteractingGeometry/GLDrawLatticeInteractingGeometry.cpp'],
-			LIBS=env['LIBS']+['yade-base',
-				'LatticeSetGeometry',
-				'LatticeSetParameters',
-				'LatticeBeamParameters',
-				'LatticeNodeParameters',
-				'LatticeInteractingGeometry',
-				'yade-opengl',
-				'yade-computational-geometry'],
-			CPPPATH=env['CPPPATH']+['DataClass/GeometricalModel',
-				'DataClass/InteractingGeometry',
-				'DataClass/PhysicalParameters']),
-	])
-

Modified: trunk/pkg/mass-spring/DataClass/InteractionGeometry/SpringGeometry.cpp
===================================================================
--- trunk/pkg/mass-spring/DataClass/InteractionGeometry/SpringGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/mass-spring/DataClass/InteractionGeometry/SpringGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -18,4 +18,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("SpringGeometry");
\ No newline at end of file

Modified: trunk/pkg/mass-spring/DataClass/InteractionPhysics/SpringPhysics.cpp
===================================================================
--- trunk/pkg/mass-spring/DataClass/InteractionPhysics/SpringPhysics.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/mass-spring/DataClass/InteractionPhysics/SpringPhysics.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -18,4 +18,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("SpringPhysics");
\ No newline at end of file

Modified: trunk/pkg/mass-spring/DataClass/PhysicalParameters/ParticleSetParameters.cpp
===================================================================
--- trunk/pkg/mass-spring/DataClass/PhysicalParameters/ParticleSetParameters.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/mass-spring/DataClass/PhysicalParameters/ParticleSetParameters.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -20,4 +20,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("ParticleSetParameters");
\ No newline at end of file

Modified: trunk/pkg/mass-spring/Engine/EngineUnit/ParticleSet2Mesh2D.cpp
===================================================================
--- trunk/pkg/mass-spring/Engine/EngineUnit/ParticleSet2Mesh2D.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/mass-spring/Engine/EngineUnit/ParticleSet2Mesh2D.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -35,4 +35,4 @@
 	}
 }
 	
-YADE_PLUGIN();
+YADE_PLUGIN("ParticleSet2Mesh2D");
\ No newline at end of file

Modified: trunk/pkg/mass-spring/Engine/StandAloneEngine/MassSpringLaw.cpp
===================================================================
--- trunk/pkg/mass-spring/Engine/StandAloneEngine/MassSpringLaw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/mass-spring/Engine/StandAloneEngine/MassSpringLaw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -26,11 +26,11 @@
 void MassSpringLaw::action(MetaBody * massSpring)
 {
 	shared_ptr<BodyContainer>& bodies = massSpring->bodies;
-	shared_ptr<InteractionContainer>& persistentInteractions = massSpring->persistentInteractions;
+	shared_ptr<InteractionContainer>& interactions = massSpring->interactions;
 	
 
-	InteractionContainer::iterator ii    = persistentInteractions->begin();
-	InteractionContainer::iterator iiEnd = persistentInteractions->end();
+	InteractionContainer::iterator ii    = interactions->begin();
+	InteractionContainer::iterator iiEnd = interactions->end();
 	for(  ; ii!=iiEnd ; ++ii )
 	{	
 		shared_ptr<Interaction> spring = *ii;
@@ -68,4 +68,4 @@
 	
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("MassSpringLaw");
\ No newline at end of file

Modified: trunk/pkg/mass-spring/PreProcessor/HangingCloth.cpp
===================================================================
--- trunk/pkg/mass-spring/PreProcessor/HangingCloth.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/mass-spring/PreProcessor/HangingCloth.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -198,7 +198,7 @@
 	rootBody->boundingVolume			= aabb;
 	rootBody->physicalParameters	= physics2;
 
-	rootBody->persistentInteractions->clear();
+	rootBody->interactions->clear();
 
 // make mesh
 	
@@ -251,9 +251,9 @@
 			mesh2d->edges.push_back(Edge(offset(i,j),offset(i,j+1)));
 			mesh2d->edges.push_back(Edge(offset(i,j+1),offset(i+1,j)));
 
-			rootBody->persistentInteractions->insert(createSpring(rootBody,offset(i,j),offset(i+1,j)));
-			rootBody->persistentInteractions->insert(createSpring(rootBody,offset(i,j),offset(i,j+1)));
-			rootBody->persistentInteractions->insert(createSpring(rootBody,offset(i,j+1),offset(i+1,j)));
+			rootBody->interactions->insert(createSpring(rootBody,offset(i,j),offset(i+1,j)));
+			rootBody->interactions->insert(createSpring(rootBody,offset(i,j),offset(i,j+1)));
+			rootBody->interactions->insert(createSpring(rootBody,offset(i,j+1),offset(i+1,j)));
 
 			vector<int> face1,face2;
 			face1.push_back(offset(i,j));
@@ -271,14 +271,14 @@
 	for(int i=0;i<width-1;i++)
 	{
 		mesh2d->edges.push_back(Edge(offset(i,height-1),offset(i+1,height-1)));
-		rootBody->persistentInteractions->insert(createSpring(rootBody,offset(i,height-1),offset(i+1,height-1)));
+		rootBody->interactions->insert(createSpring(rootBody,offset(i,height-1),offset(i+1,height-1)));
 
 	}
 
 	for(int j=0;j<height-1;j++)
 	{
 		mesh2d->edges.push_back(Edge(offset(width-1,j),offset(width-1,j+1)));
-		rootBody->persistentInteractions->insert(createSpring(rootBody,offset(width-1,j),offset(width-1,j+1)));
+		rootBody->interactions->insert(createSpring(rootBody,offset(width-1,j),offset(width-1,j+1)));
 	}
 
 	if (fixPoint1)
@@ -380,7 +380,7 @@
 	
 					link->interactionGeometry 		= geometry;
 					link->interactionPhysics 		= physics;
-					rootBody->persistentInteractions->insert(link);
+					rootBody->interactions->insert(link);
 					++linksNum;
 				}
 			}
@@ -505,4 +505,4 @@
 	body->physicalParameters	= physics;
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("HangingCloth");
\ No newline at end of file

Deleted: trunk/pkg/mass-spring/SConscript
===================================================================
--- trunk/pkg/mass-spring/SConscript	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/mass-spring/SConscript	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,77 +0,0 @@
-Import('*')
-env.Install('$PREFIX/lib/yade$SUFFIX/pkg-mass-spring',[
-
-	env.SharedLibrary('ParticleSetParameters',
-		['DataClass/PhysicalParameters/ParticleSetParameters.cpp'],
-		LIBS=env['LIBS']+['yade-base']),
-
-	env.SharedLibrary('SpringGeometry',
-		['DataClass/InteractionGeometry/SpringGeometry.cpp'],
-		LIBS=env['LIBS']+['yade-base']),
-
-	env.SharedLibrary('SpringPhysics',
-		['DataClass/InteractionPhysics/SpringPhysics.cpp'],
-		LIBS=env['LIBS']+['yade-base']),
-
-	env.SharedLibrary('ParticleSet2Mesh2D',
-		['Engine/EngineUnit/ParticleSet2Mesh2D.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'ParticleSetParameters',
-			'GeometricalModelMetaEngine',
-			'Mesh2D'],
-		CPPPATH=env['CPPPATH']+['DataClass/PhysicalParameters']),
-
-	env.SharedLibrary('MassSpringLaw',
-		['Engine/StandAloneEngine/MassSpringLaw.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'SpringPhysics',
-			'SpringGeometry',
-			'ParticleParameters',
-			'yade-serialization',
-			'yade-multimethods',
-			'Mesh2D'],
-		CPPPATH=env['CPPPATH']+['DataClass/InteractionPhysics',
-			'DataClass/InteractionGeometry']),
-
-	env.SharedLibrary('HangingCloth',
-		['PreProcessor/HangingCloth.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'SpringGeometry',
-			'SpringPhysics',
-			'ParticleSetParameters',
-			'InteractingSphere',
-			'InteractingBox',
-			'SDECLinkPhysics',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MacroMicroElasticRelationships',
-			'yade-serialization',
-			'yade-base',
-			'PhysicalActionContainerReseter',
-			'GravityEngines',
-			'InteractionGeometryMetaEngine',
-			'InteractionPhysicsMetaEngine',
-			'GeometricalModelMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'Mesh2D',
-			'AABB',
-			'Sphere',
-			'ClosestFeatures',
-			'PersistentSAPCollider',
-			'Box',
-			'SDECLinkGeometry',
-			'RigidBodyParameters',
-			'BodyMacroParameters',
-			'MetaInteractingGeometry2AABB',
-			'yade-multimethods',
-			'MassSpringLaw',
-			'ElasticContactLaw'],
-		CPPPATH=env['CPPPATH']+['DataClass/InteractionPhysics',
-			'Engine/StandAloneEngine',
-			'Engine/EngineUnit',
-			'DataClass/PhysicalParameters',
-			'DataClass/InteractionGeometry'])
-])
-

Modified: trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingBox4ClosestFeatures.cpp
===================================================================
--- trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingBox4ClosestFeatures.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingBox4ClosestFeatures.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -466,4 +466,4 @@
 
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingBox2InteractingBox4ClosestFeatures");
\ No newline at end of file

Modified: trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingSphere4ClosestFeatures.cpp
===================================================================
--- trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingSphere4ClosestFeatures.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingSphere4ClosestFeatures.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -128,4 +128,4 @@
 	return isInteracting;
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingBox2InteractingSphere4ClosestFeatures");
\ No newline at end of file

Modified: trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingSphere2InteractingSphere4ClosestFeatures.cpp
===================================================================
--- trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingSphere2InteractingSphere4ClosestFeatures.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingSphere2InteractingSphere4ClosestFeatures.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -48,4 +48,4 @@
 	return go(cm1,cm2,se31,se32,c);
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("InteractingSphere2InteractingSphere4ClosestFeatures");
\ No newline at end of file

Modified: trunk/pkg/realtime-rigidbody/Engine/StandAloneEngine/FrictionLessElasticContactLaw.cpp
===================================================================
--- trunk/pkg/realtime-rigidbody/Engine/StandAloneEngine/FrictionLessElasticContactLaw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/realtime-rigidbody/Engine/StandAloneEngine/FrictionLessElasticContactLaw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -81,4 +81,4 @@
 	}
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("FrictionLessElasticContactLaw");
\ No newline at end of file

Modified: trunk/pkg/realtime-rigidbody/PreProcessor/BoxStack.cpp
===================================================================
--- trunk/pkg/realtime-rigidbody/PreProcessor/BoxStack.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/realtime-rigidbody/PreProcessor/BoxStack.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -296,4 +296,4 @@
 	rootBody->physicalParameters 		= physics;
 }
 
-YADE_PLUGIN();
+YADE_PLUGIN("BoxStack");
\ No newline at end of file

Modified: trunk/pkg/realtime-rigidbody/PreProcessor/RotatingBox.cpp
===================================================================
--- trunk/pkg/realtime-rigidbody/PreProcessor/RotatingBox.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/realtime-rigidbody/PreProcessor/RotatingBox.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -32,7 +32,7 @@
 #include<yade/pkg-common/GravityEngines.hpp>
 #include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
 
-#include<yade/pkg-common/BodyRedirectionVector.hpp>
+#include<yade/core/BodyRedirectionVector.hpp>
 
 #include<yade/pkg-common/PhysicalActionDamper.hpp>
 #include<yade/pkg-common/PhysicalActionApplier.hpp>
@@ -317,4 +317,4 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("RotatingBox");

Deleted: trunk/pkg/realtime-rigidbody/SConscript
===================================================================
--- trunk/pkg/realtime-rigidbody/SConscript	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/realtime-rigidbody/SConscript	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,93 +0,0 @@
-Import('*')
-env.Install('$PREFIX/lib/yade$SUFFIX/pkg-realtime-rigidbody',[
-
-	env.SharedLibrary('InteractingBox2InteractingBox4ClosestFeatures',
-		['Engine/EngineUnit/InteractingBox2InteractingBox4ClosestFeatures.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'InteractionGeometryMetaEngine',
-			'yade-multimethods',
-			'yade-computational-geometry',
-			'InteractingBox',
-			'Box',
-			'ClosestFeatures']),
-
-	env.SharedLibrary('InteractingBox2InteractingSphere4ClosestFeatures',
-		['Engine/EngineUnit/InteractingBox2InteractingSphere4ClosestFeatures.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'InteractionGeometryMetaEngine',
-			'yade-multimethods',
-			'InteractingBox',
-			'InteractingSphere',
-			'Box',
-			'Sphere',
-			'ClosestFeatures']),
-
-	env.SharedLibrary('InteractingSphere2InteractingSphere4ClosestFeatures',
-		['Engine/EngineUnit/InteractingSphere2InteractingSphere4ClosestFeatures.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'InteractionGeometryMetaEngine',
-			'yade-multimethods',
-			'InteractingSphere',
-			'Sphere',
-			'ClosestFeatures']),
-
-	env.SharedLibrary('FrictionLessElasticContactLaw',
-		['Engine/StandAloneEngine/FrictionLessElasticContactLaw.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'yade-serialization',
-			'yade-multimethods',
-			'ClosestFeatures',
-			'RigidBodyParameters']),
-
-	env.SharedLibrary('BoxStack',
-		['PreProcessor/BoxStack.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'FrictionLessElasticContactLaw',
-			'RigidBodyParameters',
-			'InteractingSphere',
-			'InteractingBox',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'GravityEngines',
-			'yade-serialization',
-			'PhysicalActionContainerReseter',
-			'InteractionGeometryMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'Box',
-			'Sphere',
-			'AABB',
-			'PersistentSAPCollider',
-			'MetaInteractingGeometry2AABB',
-			'TranslationEngine',
-			'yade-multimethods'],
-		CPPPATH=env['CPPPATH']+['Engine/StandAloneEngine']),
-
-	env.SharedLibrary('RotatingBox',
-		['PreProcessor/RotatingBox.cpp'],
-		LIBS=env['LIBS']+['yade-base',
-			'FrictionLessElasticContactLaw',
-			'RigidBodyParameters',
-			'InteractingSphere',
-			'InteractingBox',
-			'CundallNonViscousDamping',
-			'CundallNonViscousDamping',
-			'MetaInteractingGeometry',
-			'yade-serialization',
-			'PhysicalActionContainerReseter',
-			'GravityEngines',
-			'InteractionGeometryMetaEngine',
-			'PhysicalActionApplier',
-			'PhysicalParametersMetaEngine',
-			'BoundingVolumeMetaEngine',
-			'AABB',
-			'Box',
-			'Sphere',
-			'PersistentSAPCollider',
-			'MetaInteractingGeometry2AABB',
-			'RotationEngine',
-			'yade-multimethods'],
-		CPPPATH=env['CPPPATH']+['Engine/StandAloneEngine'])
-])
-

Modified: trunk/pkg/snow/DataClass/BssSnowGrain.cpp
===================================================================
--- trunk/pkg/snow/DataClass/BssSnowGrain.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/snow/DataClass/BssSnowGrain.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -58,5 +58,4 @@
 }
 
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("BssSnowGrain");

Modified: trunk/pkg/snow/DataClass/BssSnowGrain.hpp
===================================================================
--- trunk/pkg/snow/DataClass/BssSnowGrain.hpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/snow/DataClass/BssSnowGrain.hpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -7,7 +7,7 @@
 #include<boost/serialization/vector.hpp>
 #include<boost/serialization/shared_ptr.hpp>
 #include<yade/pkg-common/InteractingSphere.hpp>
-#include"BshSnowGrain.hpp"
+#include<yade/pkg-snow/BshSnowGrain.hpp>
 #include<boost/tuple/tuple.hpp>
 
 struct depth_one

Modified: trunk/pkg/snow/Engine/Ef2_BssSnowGrain_AABB_makeAABB.cpp
===================================================================
--- trunk/pkg/snow/Engine/Ef2_BssSnowGrain_AABB_makeAABB.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/snow/Engine/Ef2_BssSnowGrain_AABB_makeAABB.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -63,4 +63,4 @@
 */
 }
 	
-YADE_PLUGIN();
+YADE_PLUGIN("Ef2_BssSnowGrain_AABB_makeAABB");
\ No newline at end of file

Modified: trunk/pkg/snow/Engine/Ef2_BssSnowGrain_BssSnowGrain_makeIstSnowLayersContact.cpp
===================================================================
--- trunk/pkg/snow/Engine/Ef2_BssSnowGrain_BssSnowGrain_makeIstSnowLayersContact.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/snow/Engine/Ef2_BssSnowGrain_BssSnowGrain_makeIstSnowLayersContact.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -450,5 +450,4 @@
 //	return result;
 }
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("Ef2_BssSnowGrain_BssSnowGrain_makeIstSnowLayersContact");

Modified: trunk/pkg/snow/Engine/Ef2_BssSnowGrain_BssSnowGrain_makeSpheresContactGeometry.cpp
===================================================================
--- trunk/pkg/snow/Engine/Ef2_BssSnowGrain_BssSnowGrain_makeSpheresContactGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/snow/Engine/Ef2_BssSnowGrain_BssSnowGrain_makeSpheresContactGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -84,5 +84,4 @@
 	return result;
 }
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("Ef2_BssSnowGrain_BssSnowGrain_makeSpheresContactGeometry");

Modified: trunk/pkg/snow/Engine/Ef2_InteractingBox_BssSnowGrain_makeIstSnowLayersContact.cpp
===================================================================
--- trunk/pkg/snow/Engine/Ef2_InteractingBox_BssSnowGrain_makeIstSnowLayersContact.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/snow/Engine/Ef2_InteractingBox_BssSnowGrain_makeIstSnowLayersContact.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -448,5 +448,4 @@
 
 }
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("Ef2_InteractingBox_BssSnowGrain_makeIstSnowLayersContact");

Modified: trunk/pkg/snow/Engine/Ef2_InteractingBox_BssSnowGrain_makeSpheresContactGeometry.cpp
===================================================================
--- trunk/pkg/snow/Engine/Ef2_InteractingBox_BssSnowGrain_makeSpheresContactGeometry.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/snow/Engine/Ef2_InteractingBox_BssSnowGrain_makeSpheresContactGeometry.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -83,5 +83,4 @@
 	return result;
 }
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("Ef2_InteractingBox_BssSnowGrain_makeSpheresContactGeometry");

Modified: trunk/pkg/snow/Engine/ElawSnowLayersDeformation.cpp
===================================================================
--- trunk/pkg/snow/Engine/ElawSnowLayersDeformation.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/snow/Engine/ElawSnowLayersDeformation.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -172,5 +172,4 @@
 	}
 }
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("ElawSnowLayersDeformation");

Modified: trunk/pkg/snow/PreProcessor/SnowCreepTest.cpp
===================================================================
--- trunk/pkg/snow/PreProcessor/SnowCreepTest.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/snow/PreProcessor/SnowCreepTest.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -56,10 +56,10 @@
 
 #include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
 
-#include<yade/pkg-common/BodyRedirectionVector.hpp>
-#include<yade/pkg-common/InteractionHashMap.hpp>
+#include<yade/core/BodyRedirectionVector.hpp>
+#include<yade/core/InteractionHashMap.hpp>
 
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 
 #include <boost/filesystem/convenience.hpp>
 #include <boost/lexical_cast.hpp>
@@ -80,7 +80,7 @@
 
 typedef pair<Vector3r, Real> BasicSphere;
 //! make a list of spheres non-overlapping sphere
-string GenerateCloud(vector<BasicSphere>& sphere_list, Vector3r lowerCorner, Vector3r upperCorner, long number, Real rad_std_dev, Real porosity);
+string GenerateCloud_snow(vector<BasicSphere>& sphere_list, Vector3r lowerCorner, Vector3r upperCorner, long number, Real rad_std_dev, Real porosity);
 
 
 SnowCreepTest::SnowCreepTest () : FileGenerator()
@@ -289,7 +289,7 @@
 	
 	vector<BasicSphere> sphere_list;
 	if(importFilename!="") sphere_list=Shop::loadSpheresFromFile(importFilename,lowerCorner,upperCorner);
-	else message=GenerateCloud(sphere_list, lowerCorner, upperCorner, numberOfGrains, radiusDeviation, 0.75);
+	else message=GenerateCloud_snow(sphere_list, lowerCorner, upperCorner, numberOfGrains, radiusDeviation, 0.75);
 	
 	vector<BasicSphere>::iterator it = sphere_list.begin();
 	vector<BasicSphere>::iterator it_end = sphere_list.end();
@@ -662,7 +662,7 @@
 
 
 
-string GenerateCloud(vector<BasicSphere>& sphere_list, Vector3r lowerCorner, Vector3r upperCorner, long number, Real rad_std_dev, Real porosity)
+string GenerateCloud_snow(vector<BasicSphere>& sphere_list, Vector3r lowerCorner, Vector3r upperCorner, long number, Real rad_std_dev, Real porosity)
 {
 	typedef boost::minstd_rand StdGenerator;
 	static StdGenerator generator;
@@ -709,4 +709,4 @@
 
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("SnowCreepTest");

Modified: trunk/pkg/snow/PreProcessor/SnowVoxelsLoader.cpp
===================================================================
--- trunk/pkg/snow/PreProcessor/SnowVoxelsLoader.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/snow/PreProcessor/SnowVoxelsLoader.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -49,11 +49,11 @@
 
 #include<yade/pkg-common/PhysicalParametersMetaEngine.hpp>
 
-#include<yade/pkg-common/BodyRedirectionVector.hpp>
-#include<yade/pkg-common/InteractionHashMap.hpp>
+#include<yade/core/BodyRedirectionVector.hpp>
+#include<yade/core/InteractionHashMap.hpp>
 #include<yade/pkg-snow/ElawSnowLayersDeformation.hpp>
 
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 
 #include<boost/filesystem/convenience.hpp>
 #include<boost/lexical_cast.hpp>
@@ -68,8 +68,7 @@
 //#include<yade/pkg-snow/Ef2_BssSnowGrain_BssSnowGrain_makeSpheresContactGeometry.hpp>
 //#include<yade/pkg-snow/Ef2_InteractingBox_BssSnowGrain_makeSpheresContactGeometry.hpp>
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("SnowVoxelsLoader");
 SnowVoxelsLoader::SnowVoxelsLoader() : FileGenerator()
 {
 	voxel_binary_data_file = "/home/janek/32-Snow-white/20-Programy/31-SNOW-read-data/RESULT.bz2";

Modified: trunk/pkg/snow/RenderingEngine/Ef1_BshSnowGrain_glDraw.cpp
===================================================================
--- trunk/pkg/snow/RenderingEngine/Ef1_BshSnowGrain_glDraw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/snow/RenderingEngine/Ef1_BshSnowGrain_glDraw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -15,7 +15,7 @@
 
 inline qglviewer::Vec toQGLViewierVec(Vector3r v){return qglviewer::Vec(v[0],v[1],v[2]);};
 
-void triangle(Vector3r a,Vector3r b, Vector3r c,Vector3r n)
+void triangle_bsh(Vector3r a,Vector3r b, Vector3r c,Vector3r n)
 {
 	glNormal3v(n);
 	glVertex3v(a);
@@ -89,7 +89,7 @@
 				Vector3r c(get<2>(f[i]));
 				Vector3r n(get<3>(f[i]));
 				// plot the triangular face
-				triangle(a,b,c,n);
+				triangle_bsh(a,b,c,n);
 				if(current - 1 == Omega::instance().isoSec && !surface)
 				{
 					// plot the depth tetrahedron
@@ -99,9 +99,9 @@
 					Vector3r N2((Z - c).Cross(c - a));
 					Vector3r N3((Z - b).Cross(b - c));
 					
-					triangle(b,a,Z,N1);
-					triangle(a,c,Z,N2);
-					triangle(c,b,Z,N3);
+					triangle_bsh(b,a,Z,N1);
+					triangle_bsh(a,c,Z,N2);
+					triangle_bsh(c,b,Z,N3);
 					
 					// plot the parallelepiped top-face at the half depth
 					Real depth2 = depth*0.5;
@@ -109,7 +109,7 @@
 					Vector3r A(a+N);
 					Vector3r B(b+N);
 					Vector3r C(c+N);
-					triangle(A,B,C,n);
+					triangle_bsh(A,B,C,n);
 				}
 			}
 		}
@@ -393,5 +393,4 @@
 
 }
 
-YADE_PLUGIN();
-
+YADE_PLUGIN("Ef1_BshSnowGrain_glDraw");

Modified: trunk/pkg/snow/RenderingEngine/Ef1_BssSnowGrain_glDraw.cpp
===================================================================
--- trunk/pkg/snow/RenderingEngine/Ef1_BssSnowGrain_glDraw.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/pkg/snow/RenderingEngine/Ef1_BssSnowGrain_glDraw.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -20,7 +20,7 @@
 	glVertex3v(c);
 }
 
-void quad(Vector3r a,Vector3r b, Vector3r c, Vector3r d,Vector3r n)
+void quad_bsh(Vector3r a,Vector3r b, Vector3r c, Vector3r d,Vector3r n)
 {
 	glNormal3v(n);
 	glVertex3v(a);
@@ -96,9 +96,9 @@
 				Vector3r N2((C - c).Cross(c - a));
 				Vector3r N3((B - b).Cross(b - c));
 				
-				quad(b,a,A,B,N1);
-				quad(a,c,C,A,N2);
-				quad(c,b,B,C,N3);
+				quad_bsh(b,a,A,B,N1);
+				quad_bsh(a,c,C,A,N2);
+				quad_bsh(c,b,B,C,N3);
 			}
 		glEnd();
 		glShadeModel(GL_SMOOTH);
@@ -179,6 +179,5 @@
 }
 
 
-YADE_PLUGIN();
+YADE_PLUGIN("Ef1_BssSnowGrain_glDraw");
 
-

Copied: trunk/py/3rd-party/README (from rev 1875, trunk/lib/py/README)


Property changes on: trunk/py/3rd-party/README
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/py/3rd-party/boost-python-indexing-suite-v2-noSymlinkHeaders (from rev 1875, trunk/lib/py/boost-python-indexing-suite-v2-noSymlinkHeaders)


Property changes on: trunk/py/3rd-party/boost-python-indexing-suite-v2-noSymlinkHeaders
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/py/3rd-party/pygts-0.3.1 (from rev 1872, trunk/lib/py/pygts-0.3.1)


Property changes on: trunk/py/3rd-party/pygts-0.3.1
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/py/SConscript
===================================================================
--- trunk/py/SConscript	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/py/SConscript	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,17 +1,25 @@
 # vim: set filetype=python :
 Import('*')
+linkPlugins=env['linkPlugins']
 import os.path 
 
-if 'EMBED_PYTHON' in env['CPPDEFINES']:
+if 'YADE_PYTHON' in env['CPPDEFINES']:
 	env.Install('$PREFIX/lib/yade$SUFFIX/py/yade',[
-		env.SharedLibrary('_eudoxos',['_eudoxos.cpp'],SHLIBPREFIX='',CXXFLAGS=env['CXXFLAGS']+([] if not os.path.exists('../../brefcom-mm.hh') else ['-include','../brefcom-mm.hh']),LIBS=env['LIBS']+['Shop','ConcretePM']),
+		env.SharedLibrary('WeightedAverage2d',['WeightedAverage2d.cpp'],SHLIBPREFIX=''),
+		env.SharedLibrary('_eudoxos',['_eudoxos.cpp'],SHLIBPREFIX='',CXXFLAGS=env['CXXFLAGS']+([] if not os.path.exists('../../brefcom-mm.hh') else ['-include','../brefcom-mm.hh']),LIBS=env['LIBS']+[
+			linkPlugins(['Shop','ConcretePM']),
+			]),
 		env.SharedLibrary('log',['log.cpp'],SHLIBPREFIX=''),
-		env.SharedLibrary('_utils',['_utils.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+['Shop','ConcretePM']),
+		env.SharedLibrary('_utils',['_utils.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+[
+			linkPlugins(['Shop','ConcretePM']),
+			]),
 		env.SharedLibrary('_packPredicates',['_packPredicates.cpp'],SHLIBPREFIX='',
 			# link to the symlink to the python module (created in lib/SConstruct; see explanation there)
 			LIBS=env['LIBS']+(['_gts__python-module'] if 'GTS' in env['features'] else []),
 			),
-		env.SharedLibrary('_packSpheres',['_packSpheres.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+['Shop']),
+		env.SharedLibrary('_packSpheres',['_packSpheres.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+[
+			linkPlugins(['Shop']),
+			]),
 		env.SharedLibrary('_packObb',['_packObb.cpp'],SHLIBPREFIX=''),
 		env.File('utils.py'),
 		env.File('eudoxos.py'),
@@ -19,18 +27,35 @@
 		env.File('linterpolation.py'),
 		env.File('timing.py'),
 		env.File('pack.py'),
-		env.SharedLibrary('wrapper',['yadeWrapper/yadeWrapper.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+['XMLFormatManager','yade-factory','yade-serialization','Shop','BoundingVolumeMetaEngine','GeometricalModelMetaEngine','InteractingGeometryMetaEngine','InteractionGeometryMetaEngine','InteractionPhysicsMetaEngine','PhysicalParametersMetaEngine','ConstitutiveLawDispatcher','InteractionDispatchers','STLImporter','ParallelEngine','Clump'],),
-		env.SharedLibrary('_customConverters',['yadeWrapper/customConverters.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+['boost_python_indexing_suite_v2'])
+		env.SharedLibrary('wrapper',['yadeWrapper/yadeWrapper.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+['XMLFormatManager','yade-factory','yade-serialization','STLImporter',
+			linkPlugins(['Shop','BoundingVolumeMetaEngine','GeometricalModelMetaEngine','InteractingGeometryMetaEngine','InteractionGeometryMetaEngine','InteractionPhysicsMetaEngine','PhysicalParametersMetaEngine','ConstitutiveLawDispatcher','InteractionDispatchers','ParallelEngine','Clump'])
+			],),
+		env.SharedLibrary('_customConverters',['yadeWrapper/customConverters.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+['boost_python_indexing_suite_v2']+linkPlugins(Split("BoundingVolumeEngineUnit GeometricalModelEngineUnit InteractingGeometryEngineUnit InteractionGeometryEngineUnit InteractionPhysicsEngineUnit PhysicalParametersEngineUnit PhysicalActionDamperUnit PhysicalActionApplierUnit ConstitutiveLaw")))
 	])
 
 	# 3rd party modules:
 	# ==================
 	env.Install('$PREFIX/lib/yade$SUFFIX/py',[
-		env.SharedLibrary('miniWm3Wrap',['miniWm3Wrap/miniWm3Wrap.cpp'],SHLIBPREFIX='',CPPPATH=env['CPPPATH']+['../lib/'])
+		env.SharedLibrary('miniWm3Wrap',['miniWm3Wrap/miniWm3Wrap.cpp'],SHLIBPREFIX='',CPPPATH=env['CPPPATH']+['../lib/']),
+		env.SharedLibrary('boost_python_indexing_suite_v2',['3rd-party/boost-python-indexing-suite-v2-noSymlinkHeaders/indexing_slice.cpp','3rd-party/boost-python-indexing-suite-v2-noSymlinkHeaders/python_iterator.cpp'])
 	])
 
+	if 'GTS' in env['features']:
+		env.Install('$PREFIX/lib/yade$SUFFIX/py/gts',[
+			env.SharedLibrary('_gts',['3rd-party/pygts-0.3.1/cleanup.c','3rd-party/pygts-0.3.1/edge.c','3rd-party/pygts-0.3.1/face.c','3rd-party/pygts-0.3.1/object.c','3rd-party/pygts-0.3.1/point.c','3rd-party/pygts-0.3.1/pygts.c','3rd-party/pygts-0.3.1/segment.c','3rd-party/pygts-0.3.1/surface.c','3rd-party/pygts-0.3.1/triangle.c','3rd-party/pygts-0.3.1/vertex.c'],SHLIBPREFIX='',CPPDEFINES=env['CPPDEFINES']+['PYGTS_HAS_NUMPY']),
+			env.File('3rd-party/pygts-0.3.1/__init__.py'),
+			env.File('3rd-party/pygts-0.3.1/pygts.py')
+		])
+		#
+		# the _packPredicates module needs to link to us, but linker by defaults looks for lib*.so files
+		# Therefore we will create symlink with that name (in lib/ rather than py/gts, so that it is in the RPATH
+		# without further modifications). If the file were copied (installed 2 times), static data would be
+		# created twice and it would break python type identification (among other things).
+		#
+		env.Command('$PREFIX/lib/yade$SUFFIX/lib/lib_gts__python-module.so','$PREFIX/lib/yade$SUFFIX/py/gts/_gts.so','ln -s -f ../py/gts/_gts.so $TARGET')
 
 
 
 
 
+

Copied: trunk/py/WeightedAverage2d.cpp (from rev 1872, trunk/lib/smoothing/WeightedAverage2d.cpp)
===================================================================
--- trunk/lib/smoothing/WeightedAverage2d.cpp	2009-07-16 14:26:45 UTC (rev 1872)
+++ trunk/py/WeightedAverage2d.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,28 @@
+#include<yade/lib-smoothing/WeightedAverage2d.hpp>
+
+/* Tell whether point is inside polygon
+ *
+ * See _utils.cpp: pointInsidePolygon for docs and license.
+ */
+bool pyGaussAverage::pointInsidePolygon(const Vector2r& pt, const vector<Vector2r>& vertices){
+	int i /*current node*/, j/*previous node*/; bool inside=false; int rows=(int)vertices.size();
+	const Real& testx=pt[0],testy=pt[1];
+	for(i=0,j=rows-1; i<rows; j=i++){
+		const Real& vx_i=vertices[i][0], vy_i=vertices[i][1], vx_j=vertices[j][0], vy_j=vertices[j][1];
+		if (((vy_i>testy)!=(vy_j>testy)) && (testx < (vx_j-vx_i) * (testy-vy_i) / (vy_j-vy_i) + vx_i) ) inside=!inside;
+	}
+	return inside;
+}
+
+BOOST_PYTHON_MODULE(WeightedAverage2d)
+{
+	boost::python::class_<pyGaussAverage>("GaussAverage",python::init<python::tuple,python::tuple,python::tuple,Real>())
+		.def("add",&pyGaussAverage::addPt)
+		.def("avg",&pyGaussAverage::avg)
+		.add_property("stDev",&pyGaussAverage::stDev_get,&pyGaussAverage::stDev_set)
+		.add_property("relThreshold",&pyGaussAverage::relThreshold_get,&pyGaussAverage::relThreshold_set)
+		.add_property("clips",&pyGaussAverage::clips_get,&pyGaussAverage::clips_set)
+		.add_property("data",&pyGaussAverage::data_get)
+	;
+};
+


Property changes on: trunk/py/WeightedAverage2d.cpp
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/py/_packPredicates.cpp
===================================================================
--- trunk/py/_packPredicates.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/py/_packPredicates.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -267,7 +267,9 @@
 
 #ifdef YADE_GTS
 extern "C" {
-#include<yade/lib-py/pygts.h>
+// HACK
+#include"3rd-party/pygts-0.3.1/pygts.h"
+
 }
 /* Helper function for inGtsSurface::aabb() */
 static void vertex_aabb(GtsVertex *vertex, pair<Vector3r,Vector3r> *bb)

Modified: trunk/py/_packSpheres.cpp
===================================================================
--- trunk/py/_packSpheres.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/py/_packSpheres.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -11,7 +11,7 @@
 #include<yade/core/MetaBody.hpp>
 #include<yade/pkg-common/InteractingSphere.hpp>
 
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 
 using namespace boost;
 using namespace std;

Modified: trunk/py/_utils.cpp
===================================================================
--- trunk/py/_utils.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/py/_utils.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -1,4 +1,4 @@
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 #include<boost/python.hpp>
 #include<yade/extra/boost_python_len.hpp>
 #include<yade/core/MetaBody.hpp>

Modified: trunk/py/utils.py
===================================================================
--- trunk/py/utils.py	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/py/utils.py	2009-07-27 18:08:23 UTC (rev 1888)
@@ -72,14 +72,14 @@
 	s=Body()
 	if not color: color=randomColor()
 	pp=bodiesPhysDefaults.copy(); pp.update(physParamsAttr);
-	s.shape=GeometricalModel('Sphere',{'radius':radius,'diffuseColor':color,'wire':wire})
-	s.mold=InteractingGeometry('InteractingSphere',{'radius':radius,'diffuseColor':color})
+	s.shape=GeometricalModel('Sphere',radius=radius,diffuseColor=color,wire=wire)
+	s.mold=InteractingGeometry('InteractingSphere',radius=radius,diffuseColor=color)
 	V=(4./3)*math.pi*radius**3
 	inert=(2./5.)*V*density*radius**2
 	pp.update({'se3':[center[0],center[1],center[2],1,0,0,0],'refSe3':[center[0],center[1],center[2],1,0,0,0],'mass':V*density,'inertia':[inert,inert,inert]})
 	s.phys=PhysicalParameters(physParamsClass)
 	s.phys.updateExistingAttrs(pp)
-	s.bound=BoundingVolume('AABB',{'diffuseColor':[0,1,0]})
+	s.bound=BoundingVolume('AABB',diffuseColor=[0,1,0])
 	s['isDynamic']=dynamic
 	return s
 
@@ -88,14 +88,14 @@
 	b=Body()
 	if not color: color=randomColor()
 	pp=bodiesPhysDefaults.copy(); pp.update(physParamsAttr);
-	b.shape=GeometricalModel('Box',{'extents':extents,'diffuseColor':color,'wire':wire})
-	b.mold=InteractingGeometry('InteractingBox',{'extents':extents,'diffuseColor':color})
+	b.shape=GeometricalModel('Box',extents=extents,diffuseColor=color,wire=wire)
+	b.mold=InteractingGeometry('InteractingBox',extents=extents,diffuseColor=color)
 	mass=8*extents[0]*extents[1]*extents[2]*density
 	V=extents[0]*extents[1]*extents[2]
 	pp.update({'se3':[center[0],center[1],center[2],orientation[0],orientation[1],orientation[2],orientation[3]],'refSe3':[center[0],center[1],center[2],orientation[0],orientation[1],orientation[2],orientation[3]],'mass':V*density,'inertia':[mass*4*(extents[1]**2+extents[2]**2),mass*4*(extents[0]**2+extents[2]**2),mass*4*(extents[0]**2+extents[1]**2)]})
 	b.phys=PhysicalParameters(physParamsClass)
 	b.phys.updateExistingAttrs(pp)
-	b.bound=BoundingVolume('AABB',{'diffuseColor':[0,1,0]})
+	b.bound=BoundingVolume('AABB',diffuseColor=[0,1,0])
 	b['isDynamic']=dynamic
 	return b
 
@@ -104,17 +104,17 @@
 	b=Body()
 	if not color: color=randomColor()
 	pp=bodiesPhysDefaults.copy(); pp.update(physParamsAttr);
-	b.shape=GeometricalModel('Facet',{'diffuseColor':color,'wire':wire})
-	b.mold=InteractingGeometry('InteractingFacet',{'diffuseColor':color})
+	b.shape=GeometricalModel('Facet',diffuseColor=color,wire=wire)
+	b.mold=InteractingGeometry('InteractingFacet',diffuseColor=color)
 	center=inscribedCircleCenter(vertices[0],vertices[1],vertices[2])
 	vertices=Vector3(vertices[0])-center,Vector3(vertices[1])-center,Vector3(vertices[2])-center
 	b.shape['vertices']=vertices;	b.mold['vertices']=vertices
 	pp.update({'se3':[center[0],center[1],center[2],1,0,0,0],'refSe3':[center[0],center[1],center[2],1,0,0,0],'inertia':[0,0,0]})
 	b.phys=PhysicalParameters(physParamsClass)
 	b.phys.updateExistingAttrs(pp)
-	b.bound=BoundingVolume('AABB',{'diffuseColor':[0,1,0]})
+	b.bound=BoundingVolume('AABB',diffuseColor=[0,1,0])
 	b['isDynamic']=dynamic
-	b.mold.postProcessAttributes()
+	b.mold.postProcessAttributes(True)
 	return b
 
 def facetBox(center,extents,orientation=[1,0,0,0],wallMask=63,**kw):
@@ -321,7 +321,7 @@
 		b.phys=PhysicalParameters(physParamsClass)
 		b.phys.updateExistingAttrs(pp)
 		if not noBoundingVolume:
-			b.bound=BoundingVolume('AABB',{'diffuseColor':[0,1,0]})
+			b.bound=BoundingVolume('AABB',diffuseColor=[0,1,0])
 		o.bodies.append(b)
 	imp.import_geometry(o.bodies,begin,noInteractingGeometry)
 	imported=range(begin,begin+imp.number_of_facets)
@@ -413,17 +413,17 @@
 	return len(tagsParams)
 
 def ColorizedVelocityFilter(isFilterActivated=True,autoScale=True,minValue=0,maxValue=0,posX=0,posY=0.2,width=0.05,height=0.5,title='Velocity, m/s'):
-    f = DeusExMachina('ColorizedVelocityFilter',{'isFilterActivated':isFilterActivated,'autoScale':autoScale,'minValue':minValue,'maxValue':maxValue,'posX':posX,'posY':posY,'width':width,'height':height,'title':title})
+    f = DeusExMachina('ColorizedVelocityFilter',isFilterActivated=isFilterActivated,autoScale=autoScale,minValue=minValue,maxValue=maxValue,posX=posX,posY=posY,width=width,height=height,title=title)
     O.engines+=[f]
     return f
 
 def ColorizedTimeFilter(point=[0,0,0],normal=[0,1,0],isFilterActivated=True,autoScale=True,minValue=0,maxValue=0,posX=0,posY=0.2,width=0.05,height=0.5,title='Time, m/s'):
-    f = DeusExMachina('ColorizedTimeFilter',{'point':point,'normal':normal,'isFilterActivated':isFilterActivated,'autoScale':autoScale,'minValue':minValue,'maxValue':maxValue,'posX':posX,'posY':posY,'width':width,'height':height,'title':title})
+    f = DeusExMachina('ColorizedTimeFilter',point=point,normal=normal,isFilterActivated=isFilterActivated,autoScale=autoScale,minValue=minValue,maxValue=maxValue,posX=posX,posY=posY,width=width,height=height,title=title)
     O.engines+=[f]
     return f
 
 def PythonRunnerFilter(command='pass',isFilterActivated=True):
-    f = DeusExMachina('PythonRunnerFilter',{'command':command,'isFilterActivated':isFilterActivated})
+    f = DeusExMachina('PythonRunnerFilter',command=command,isFilterActivated=isFilterActivated)
     O.engines+=[f]
     return f
 

Modified: trunk/py/yadeWrapper/customConverters.cpp
===================================================================
--- trunk/py/yadeWrapper/customConverters.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/py/yadeWrapper/customConverters.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -17,8 +17,21 @@
 #include<yade/lib-base/yadeWm3.hpp>
 #include<yade/lib-base/yadeWm3Extra.hpp>
 
+#include<yade/core/Engine.hpp>
 
+#include<yade/pkg-common/BoundingVolumeEngineUnit.hpp>
+#include<yade/pkg-common/GeometricalModelEngineUnit.hpp>
+#include<yade/pkg-common/InteractingGeometryEngineUnit.hpp>
+#include<yade/pkg-common/InteractionGeometryEngineUnit.hpp>
+#include<yade/pkg-common/InteractionPhysicsEngineUnit.hpp>
+#include<yade/pkg-common/PhysicalParametersEngineUnit.hpp>
+#include<yade/pkg-common/PhysicalActionDamperUnit.hpp>
+#include<yade/pkg-common/PhysicalActionApplierUnit.hpp>
+#include<yade/pkg-common/ConstitutiveLaw.hpp>
 
+
+
+
 using namespace boost::python;
 
 struct custom_Vector3r_from_seq{
@@ -39,7 +52,7 @@
 /* two-way se3 handling */
 struct custom_se3_to_tuple{
 	static PyObject* convert(const Se3r& se3){
-		tuple ret=make_tuple(se3.position,se3.orientation);
+		python::tuple ret=python::make_tuple(se3.position,se3.orientation);
 		return incref(ret.ptr());
 	}
 };
@@ -72,19 +85,23 @@
 template<typename containedType>
 struct custom_vector_to_list{
 	static PyObject* convert(const std::vector<containedType>& v){
-		list ret; FOREACH(const containedType& e, v) ret.append(e);
+		python::list ret; FOREACH(const containedType& e, v) ret.append(e);
 		return incref(ret.ptr());
 	}
 };
 template<typename containedType>
 struct custom_vector_from_seq{
 	custom_vector_from_seq(){ converter::registry::push_back(&convertible,&construct,type_id<std::vector<containedType> >()); }
-	static void* convertible(PyObject* obj_ptr){  if(!PySequence_Check(obj_ptr)) return 0; return obj_ptr; }
+	static void* convertible(PyObject* obj_ptr){
+		// the second condition is important, for some reason otherwise there were attempted conversions of Body to list which failed afterwards.
+		if(!PySequence_Check(obj_ptr) || !PyObject_HasAttrString(obj_ptr,"__len__")) return 0;
+		return obj_ptr;
+	}
 	static void construct(PyObject* obj_ptr, converter::rvalue_from_python_stage1_data* data){
 		 void* storage=((converter::rvalue_from_python_storage<std::vector<containedType> >*)(data))->storage.bytes;
 		 new (storage) std::vector<containedType>();
 		 std::vector<containedType>* v=(std::vector<containedType>*)(storage);
-		 int l=PySequence_Size(obj_ptr); v->reserve(l); for(int i=0; i<l; i++) { v->push_back(extract<containedType>(PySequence_GetItem(obj_ptr,i))); }
+		 int l=PySequence_Size(obj_ptr); if(l<0) abort(); /*std::cerr<<"l="<<l<<"; "<<typeid(containedType).name()<<std::endl;*/ v->reserve(l); for(int i=0; i<l; i++) { v->push_back(extract<containedType>(PySequence_GetItem(obj_ptr,i))); }
 		 data->convertible=storage;
 	}
 };
@@ -95,15 +112,29 @@
 using namespace boost::python;
 
 BOOST_PYTHON_MODULE(_customConverters){
-  // class_<std::vector<int> >("vecInt").def(indexing::container_suite<std::vector<int> >());
+	// class_<std::vector<int> >("vecInt").def(indexing::container_suite<std::vector<int> >());
+	custom_Vector3r_from_seq(); // Vector3r is wrapped, it is returned as a Vector3 instance; no to-python converter needed
+	custom_Se3r_from_seq(); to_python_converter<Se3r,custom_se3_to_tuple>();
+	// register from-python converter and to-python converter
+	custom_vector_from_seq<int>(); to_python_converter<std::vector<int>, custom_vector_to_list<int> >();
+	custom_vector_from_seq<Real>(); to_python_converter<std::vector<Real>, custom_vector_to_list<Real> >();
+	custom_vector_from_seq<Vector3r>(); to_python_converter<std::vector<Vector3r>, custom_vector_to_list<Vector3r> >();
+	custom_vector_from_seq<std::string>(); to_python_converter<std::vector<std::string>, custom_vector_to_list<std::string> >();
+	custom_vector_from_seq<shared_ptr<Body> >(); to_python_converter<std::vector<shared_ptr<Body> >, custom_vector_to_list<shared_ptr<Body> > >();
+	custom_vector_from_seq<shared_ptr<Engine> >(); to_python_converter<std::vector<shared_ptr<Engine> >, custom_vector_to_list<shared_ptr<Engine> > >();
+	custom_vector_from_seq<shared_ptr<Serializable> >(); to_python_converter<std::vector<shared_ptr<Serializable> >, custom_vector_to_list<shared_ptr<Serializable> > >();
 
-  custom_Vector3r_from_seq(); // Vector3r is wrapped, it is returned as a Vector3 instance; no to-python converter needed
-  custom_Se3r_from_seq(); to_python_converter<Se3r,custom_se3_to_tuple>();
-  // register from-python converter and to-python converter
-  custom_vector_from_seq<int>(); to_python_converter<std::vector<int>, custom_vector_to_list<int> >();
-  custom_vector_from_seq<Real>(); to_python_converter<std::vector<Real>, custom_vector_to_list<Real> >();
-  custom_vector_from_seq<Vector3r>(); to_python_converter<std::vector<Vector3r>, custom_vector_to_list<Vector3r> >();
-  custom_vector_from_seq<std::string>(); to_python_converter<std::vector<std::string>, custom_vector_to_list<std::string> >();
+  #define VECTOR_ENGINE_UNIT(ENGINE_UNIT) custom_vector_from_seq<shared_ptr<ENGINE_UNIT> >(); to_python_converter<std::vector<shared_ptr<ENGINE_UNIT> >,custom_vector_to_list<shared_ptr<ENGINE_UNIT> > >();
+		VECTOR_ENGINE_UNIT(BoundingVolumeEngineUnit)
+		VECTOR_ENGINE_UNIT(GeometricalModelEngineUnit)
+		VECTOR_ENGINE_UNIT(InteractingGeometryEngineUnit)
+		VECTOR_ENGINE_UNIT(InteractionGeometryEngineUnit)
+		VECTOR_ENGINE_UNIT(InteractionPhysicsEngineUnit)
+		VECTOR_ENGINE_UNIT(PhysicalParametersEngineUnit)
+		VECTOR_ENGINE_UNIT(PhysicalActionDamperUnit)
+		VECTOR_ENGINE_UNIT(PhysicalActionApplierUnit)
+		VECTOR_ENGINE_UNIT(ConstitutiveLaw)
+	#undef VECTOR_ENGINE_UNIT
 }
 
 

Modified: trunk/py/yadeWrapper/yadeWrapper.cpp
===================================================================
--- trunk/py/yadeWrapper/yadeWrapper.cpp	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/py/yadeWrapper/yadeWrapper.cpp	2009-07-27 18:08:23 UTC (rev 1888)
@@ -8,8 +8,10 @@
 
 
 #include<boost/python.hpp>
+#include <boost/python/raw_function.hpp>
 #include<boost/python/suite/indexing/vector_indexing_suite.hpp>
 #include<boost/bind.hpp>
+#include<boost/lambda/bind.hpp>
 #include<boost/thread/thread.hpp>
 #include<boost/filesystem/operations.hpp>
 #include<boost/date_time/posix_time/posix_time.hpp>
@@ -59,13 +61,12 @@
 #include<yade/pkg-common/PhysicalActionApplierUnit.hpp>
 #include<yade/pkg-common/ConstitutiveLaw.hpp>
 
-#include<yade/extra/Shop.hpp>
+#include<yade/pkg-dem/Shop.hpp>
 #include<yade/pkg-dem/Clump.hpp>
 
 using namespace boost;
 using namespace std;
 
-#include<yade/gui-py/pyAttrUtils.hpp>
 #include<yade/extra/boost_python_len.hpp>
 
 class RenderingEngine;
@@ -74,13 +75,13 @@
 	
 	A regular class (not Omega) is instantiated like this:
 
-		RootClass('optional class name as quoted string',{optional dictionary of attributes})
+		RootClass('optional class name as quoted string',attribute1=value1,attribute2=value2,...)
 		
 	if class name is not given, the RootClass itself is instantiated
 
 		p=PhysicalParameters() # p is now instance of PhysicalParameters
 		p=PhysicalParameters('RigidBodyParameters') # p is now instance of RigidBodyParameters, which has PhysicalParameters as the "root" class
-		p=PhysicalParameters('RigidBodyParameters',{'mass':100,'se3':[1,1,2,1,0,0,0]}) # convenience constructor
+		p=PhysicalParameters('RigidBodyParameters',mass=100,se3=(Vector3(1,1,2),Quaternion.IDENTITY)) # convenience constructor
 
 	The last statement is equivalent to:
 
@@ -96,8 +97,8 @@
 	Those attributes that are not fundamental types (strings, numbers, booleans, se3, vectors, quaternions, arrays of numbers, arrays of strings) can be accessed only through explicit python data members, for example:
 		
 		b=Body()
-		b.mold=InteractingGeometry("InteractingSphere",{'radius':1})
-		b.shape=GeometricalModel("Sphere",{'radius':1})
+		b.mold=InteractingGeometry("InteractingSphere",radius=1)
+		b.shape=GeometricalModel("Sphere",radius=1)
 		b.mold # will give you the interactingGeometry of body
 	
 	Instances can be queried about attributes and data members they have:
@@ -114,90 +115,15 @@
 		m=MetaEntine('class name as string')
 		m.functors=[list of engine units]
 
-	It is your responsibility to pass the right engineUnits, otherwise crash will results. There is currently no way I know of to prevent that. 
-
 */
 
-/*
-TODO:
-	1. PhysicalActionContainer (constructor with actionName) with iteration
-	2. from yadeControl import Omega as _Omega, inherit from that and add other convenience functions
-*/
-
 #ifdef LOG4CXX
 	log4cxx::LoggerPtr logger=log4cxx::Logger::getLogger("yade.python");
 #endif
 
-BASIC_PY_PROXY(pyGeneric,Serializable);
 
-BASIC_PY_PROXY(pyInteractionGeometry,InteractionGeometry);
-BASIC_PY_PROXY(pyInteractionPhysics,InteractionPhysics);
-
-BASIC_PY_PROXY(pyGeometricalModel,GeometricalModel);
-BASIC_PY_PROXY_HEAD(pyPhysicalParameters,PhysicalParameters)
-	python::list blockedDOFs_get(){
-		python::list ret;
-		#define _SET_DOF(DOF_ANY,str) if((proxee->blockedDOFs & PhysicalParameters::DOF_ANY)!=0) ret.append(str);
-		_SET_DOF(DOF_X,"x"); _SET_DOF(DOF_Y,"y"); _SET_DOF(DOF_Z,"z"); _SET_DOF(DOF_RX,"rx"); _SET_DOF(DOF_RY,"ry"); _SET_DOF(DOF_RZ,"rz");
-		#undef _SET_DOF
-		return ret;
-	}
-	void blockedDOFs_set(python::list l){
-		proxee->blockedDOFs=PhysicalParameters::DOF_NONE;
-		int len=python::len(l);
-		for(int i=0; i<len; i++){
-			string s=python::extract<string>(l[i])();
-			#define _GET_DOF(DOF_ANY,str) if(s==str) { proxee->blockedDOFs|=PhysicalParameters::DOF_ANY; continue; }
-			_GET_DOF(DOF_X,"x"); _GET_DOF(DOF_Y,"y"); _GET_DOF(DOF_Z,"z"); _GET_DOF(DOF_RX,"rx"); _GET_DOF(DOF_RY,"ry"); _GET_DOF(DOF_RZ,"rz");
-			#undef _GET_DOF
-			throw std::invalid_argument("Invalid  DOF specification `"+s+"', must be ∈{x,y,z,rx,ry,rz}.");
-		}
-	}
-	Vector3r displ_get(){return proxee->se3.position-proxee->refSe3.position;}
-	python::tuple rot_get(){Quaternionr relRot=proxee->refSe3.orientation.Conjugate()*proxee->se3.orientation; Vector3r axis; Real angle; relRot.ToAxisAngle(axis,angle); axis*=angle; return python::make_tuple(axis[0],axis[1],axis[2]); }
-	Vector3r pos_get(){return proxee->se3.position;}
-	Vector3r refPos_get(){return proxee->refSe3.position;}
-	python::tuple ori_get(){Vector3r axis; Real angle; proxee->se3.orientation.ToAxisAngle(axis,angle); return python::make_tuple(axis[0],axis[1],axis[2],angle);}
-	void pos_set(const Vector3r& p){ proxee->se3.position=p; }
-	void refPos_set(const Vector3r& p){ proxee->refSe3.position=p;}
-	void ori_set(python::list l){if(python::len(l)!=4) throw invalid_argument("Wrong number of quaternion elements "+lexical_cast<string>(python::len(l))+", should be 4"); proxee->se3.orientation=Quaternionr(Vector3r(python::extract<double>(l[0])(),python::extract<double>(l[1])(),python::extract<double>(l[2])()),python::extract<double>(l[3])());}
-BASIC_PY_PROXY_TAIL;
-
-BASIC_PY_PROXY_HEAD(pyBoundingVolume,BoundingVolume)
-	Vector3r min_get(){return proxee->min;}
-	Vector3r max_get(){return proxee->max;}
-BASIC_PY_PROXY_TAIL;
-
-BASIC_PY_PROXY(pyInteractingGeometry,InteractingGeometry);
-
-struct pyTimingDeltas{
-	shared_ptr<TimingDeltas> proxee;
-	pyTimingDeltas(shared_ptr<TimingDeltas> td){proxee=td;}
-	python::list data_get(){
-		python::list ret;
-		for(size_t i=0; i<proxee->data.size(); i++){
-			ret.append(python::make_tuple(proxee->labels[i],proxee->data[i].nsec,proxee->data[i].nExec));
-		}
-		return ret;
-	}
-	void reset(){proxee->data.clear(); proxee->labels.clear();}
-};
-
-#define PY_PROXY_TIMING \
-	TimingInfo::delta execTime_get(void){return proxee->timingInfo.nsec;} void execTime_set(TimingInfo::delta t){proxee->timingInfo.nsec=t;} \
-	long execCount_get(void){return proxee->timingInfo.nExec;} void execCount_set(long n){proxee->timingInfo.nExec=n;} \
-	python::object timingDeltas_get(void){return proxee->timingDeltas?python::object(pyTimingDeltas(proxee->timingDeltas)):python::object();}
-
-
-BASIC_PY_PROXY_HEAD(pyDeusExMachina,DeusExMachina)
-	PY_PROXY_TIMING
-BASIC_PY_PROXY_TAIL;
-
-BASIC_PY_PROXY_HEAD(pyStandAloneEngine,StandAloneEngine)
-	PY_PROXY_TIMING
-BASIC_PY_PROXY_TAIL;
-	
-
+#if 0
+BASIC_PY_PROXY(pyGeneric,Serializable);
 python::list anyEngines_get(const vector<shared_ptr<Engine> >&);
 void anyEngines_set(vector<shared_ptr<Engine> >&, python::object);
 
@@ -227,135 +153,31 @@
 		return ret;
 	}
 BASIC_PY_PROXY_TAIL;
+#endif
 
-
-BASIC_PY_PROXY_HEAD(pyEngineUnit,EngineUnit)
-	python::list bases_get(void){ python::list ret; vector<string> t=proxee->getFunctorTypes(); for(size_t i=0; i<t.size(); i++) ret.append(t[i]); return ret; }
-	python::object timingDeltas_get(){return proxee->timingDeltas?python::object(pyTimingDeltas(proxee->timingDeltas)):python::object();}
-BASIC_PY_PROXY_TAIL;
-
-BASIC_PY_PROXY_HEAD(pyMetaEngine,MetaEngine)
-		// additional constructor
-		pyMetaEngine(string clss, python::list functors){init(clss); functors_set(functors);}
-		python::list functors_get(void){
-			shared_ptr<MetaEngine> me=dynamic_pointer_cast<MetaEngine>(proxee); if(!me) throw runtime_error("Proxied class not a MetaEngine (?!)"); python::list ret;
-			/* garbage design: functorArguments are instances of EngineUnits, but they may not be present; therefore, only use them if they exist; our pyMetaEngine, however, will always have both names and EnguneUnit objects in the same count */
-			for(size_t i=0; i<me->functorNames.size(); i++){
-				shared_ptr<EngineUnit> eu;
-				string functorName(*(me->functorNames[i].rbegin()));
-				if(i<=me->functorArguments.size()){ /* count i-th list member */ size_t j=0;
-					for(list<shared_ptr<EngineUnit> >::iterator I=me->functorArguments.begin(); I!=me->functorArguments.end(); I++, j++) { if(j==i) { eu=(*I); break;}}
-				}
-				if(!eu) /* either list was shorter or empty pointer in the functorArguments list */ { eu=dynamic_pointer_cast<EngineUnit>(ClassFactory::instance().createShared(functorName)); if(!eu) throw runtime_error("Unable to construct `"+string(*(me->functorNames[i].rbegin()))+"' EngineUnit"); }
-				assert(eu);
-				ret.append(pyEngineUnit(eu));
-			}
-			return ret;
-		}
-		void functors_set(python::list ftrs){
-			shared_ptr<MetaEngine> me=dynamic_pointer_cast<MetaEngine>(proxee); if(!me) throw runtime_error("Proxied class not a MetaEngine. (?!)");
-			me->clear(); int len=python::len(ftrs);
-			for(int i=0; i<len; i++){
-				python::extract<pyEngineUnit> euEx(ftrs[i]); if(!euEx.check()) throw invalid_argument("Unable to extract type EngineUnit from sequence.");
-				bool ok=false;
-				/* FIXME: casting engine unit to the right type via dynamic_cast doesn't work (always unusuccessful),
-				 * do static_cast and if the EngineUnit is of wrong type, it will crash badly immediately. */
-				// #define TRY_ADD_FUNCTOR(P,Q) {shared_ptr<P> p(dynamic_pointer_cast<P>(me)); shared_ptr<EngineUnit> eu(euEx().proxee); if(p&&eu){p->add(static_pointer_cast<Q>(eu)); ok=true; }}
-				#define TRY_ADD_FUNCTOR(P,Q) {shared_ptr<P> p(dynamic_pointer_cast<P>(me)); shared_ptr<Q> eu(dynamic_pointer_cast<Q>(euEx().proxee)); if(p&&eu){p->add(eu); ok=true; }}
-				// shared_ptr<Q> q(dynamic_pointer_cast<Q>(eu)); cerr<<#P<<" "<<#Q<<":"<<(bool)p<<" "<<(bool)q<<endl;
-				TRY_ADD_FUNCTOR(BoundingVolumeMetaEngine,BoundingVolumeEngineUnit);
-				TRY_ADD_FUNCTOR(GeometricalModelMetaEngine,GeometricalModelEngineUnit);
-				TRY_ADD_FUNCTOR(InteractingGeometryMetaEngine,InteractingGeometryEngineUnit);
-				TRY_ADD_FUNCTOR(InteractionGeometryMetaEngine,InteractionGeometryEngineUnit);
-				TRY_ADD_FUNCTOR(InteractionPhysicsMetaEngine,InteractionPhysicsEngineUnit);
-				TRY_ADD_FUNCTOR(PhysicalParametersMetaEngine,PhysicalParametersEngineUnit);
-				TRY_ADD_FUNCTOR(PhysicalActionDamper,PhysicalActionDamperUnit);
-				TRY_ADD_FUNCTOR(PhysicalActionApplier,PhysicalActionApplierUnit);
-				TRY_ADD_FUNCTOR(ConstitutiveLawDispatcher,ConstitutiveLaw);
-				if(!ok) throw runtime_error(string("Unable to cast to suitable MetaEngine type when adding functor (MetaEngine: ")+me->getClassName()+", functor: "+euEx().proxee->getClassName()+")");
-				#undef TRY_ADD_FUNCTOR
-			}
-		}
-	PY_PROXY_TIMING
-BASIC_PY_PROXY_TAIL;
-
-BASIC_PY_PROXY_HEAD(pyInteractionDispatchers,InteractionDispatchers)
-	pyInteractionDispatchers(python::list geomFunctors, python::list physFunctors, python::list constLawFunctors){
-		init("InteractionDispatchers");
-		pyMetaEngine(proxee->geomDispatcher).functors_set(geomFunctors);
-		pyMetaEngine(proxee->physDispatcher).functors_set(physFunctors);
-		pyMetaEngine(proxee->constLawDispatcher).functors_set(constLawFunctors);
-	}
-	pyMetaEngine geomDispatcher_get(void){ return pyMetaEngine(proxee->geomDispatcher);}
-	pyMetaEngine physDispatcher_get(void){ return pyMetaEngine(proxee->physDispatcher);}
-	pyMetaEngine constLawDispatcher_get(void){ return pyMetaEngine(proxee->constLawDispatcher);}
-	PY_PROXY_TIMING
-BASIC_PY_PROXY_TAIL;
-
-python::list anyEngines_get(const vector<shared_ptr<Engine> >& engContainer){
-	python::list ret; 
-	FOREACH(const shared_ptr<Engine>& eng, engContainer){
-		if(!eng) ret.append(python::object());
-		#define APPEND_ENGINE_IF_POSSIBLE(engineType,pyEngineType) { shared_ptr<engineType> e=dynamic_pointer_cast<engineType>(eng); if(e) { ret.append(pyEngineType(e)); continue; } }
-		APPEND_ENGINE_IF_POSSIBLE(InteractionDispatchers,pyInteractionDispatchers); APPEND_ENGINE_IF_POSSIBLE(MetaEngine,pyMetaEngine); APPEND_ENGINE_IF_POSSIBLE(StandAloneEngine,pyStandAloneEngine); APPEND_ENGINE_IF_POSSIBLE(DeusExMachina,pyDeusExMachina); APPEND_ENGINE_IF_POSSIBLE(ParallelEngine,pyParallelEngine); 
-		throw std::runtime_error("Unknown engine type: `"+eng->getClassName()+"' (only MetaEngine, StandAloneEngine, DeusExMachina and ParallelEngine are supported)");
-	}
-	return ret;
-}
-
-void anyEngines_set(vector<shared_ptr<Engine> >& engContainer, python::object egs){
-	int len=python::len(egs);
-	//const shared_ptr<MetaBody>& rootBody=OMEGA.getRootBody(); rootBody->engines.clear();
-	engContainer.clear();
-	for(int i=0; i<len; i++){
-		#define PUSH_BACK_ENGINE_IF_POSSIBLE(pyEngineType) if(python::extract<pyEngineType>(PySequence_GetItem(egs.ptr(),i)).check()){ pyEngineType e=python::extract<pyEngineType>(PySequence_GetItem(egs.ptr(),i)); engContainer.push_back(e.proxee); /* cerr<<"added "<<e.pyStr()<<", a "<<#pyEngineType<<endl; */ continue; }
-		PUSH_BACK_ENGINE_IF_POSSIBLE(pyStandAloneEngine); PUSH_BACK_ENGINE_IF_POSSIBLE(pyMetaEngine); PUSH_BACK_ENGINE_IF_POSSIBLE(pyDeusExMachina); PUSH_BACK_ENGINE_IF_POSSIBLE(pyParallelEngine); PUSH_BACK_ENGINE_IF_POSSIBLE(pyInteractionDispatchers);
-		throw std::runtime_error("Encountered unknown engine type (unable to extract from python object)");
-	}
-}
-
-
-
-BASIC_PY_PROXY_HEAD(pyInteraction,Interaction)
-	NONPOD_ATTRIBUTE_ACCESS(geom,pyInteractionGeometry,interactionGeometry);
-	NONPOD_ATTRIBUTE_ACCESS(phys,pyInteractionPhysics,interactionPhysics);
-	/* shorthands */ unsigned id1_get(void){ return proxee->getId1();} unsigned id2_get(void){ return proxee->getId2();}
-	bool isReal_get(void){ return proxee->isReal(); }
-BASIC_PY_PROXY_TAIL;
-
-BASIC_PY_PROXY_HEAD(pyBody,Body)
-	NONPOD_ATTRIBUTE_ACCESS(shape,pyGeometricalModel,geometricalModel);
-	NONPOD_ATTRIBUTE_ACCESS(mold,pyInteractingGeometry,interactingGeometry);
-	NONPOD_ATTRIBUTE_ACCESS(bound,pyBoundingVolume,boundingVolume);
-	NONPOD_ATTRIBUTE_ACCESS(phys,pyPhysicalParameters,physicalParameters);
-	unsigned id_get(){ return proxee->getId();}
-	int mask_get(){return proxee->groupMask;}
-	void mask_set(int m){ proxee->groupMask=m;}
-	bool dynamic_get(){ return proxee->isDynamic;} void dynamic_set(bool dyn){ proxee->isDynamic=dyn;}
-	bool isStandalone(){ return proxee->isStandalone();} bool isClumpMember(){ return proxee->isClumpMember();} bool isClump(){ return proxee->isClump();}
-BASIC_PY_PROXY_TAIL;
-
 class pyBodyContainer{
 	public:
 	const shared_ptr<BodyContainer> proxee;
 	pyBodyContainer(const shared_ptr<BodyContainer>& _proxee): proxee(_proxee){}
-	pyBody pyGetitem(unsigned id){
-		if(id>=proxee->size()){ PyErr_SetString(PyExc_IndexError, "Body id out of range."); python::throw_error_already_set(); /* make compiler happy; never reached */ return pyBody(); }
-		else return pyBody(proxee->operator[](id));
+	shared_ptr<Body> pyGetitem(body_id_t id){
+		if((size_t)id>=proxee->size()){ PyErr_SetString(PyExc_IndexError, "Body id out of range."); python::throw_error_already_set(); /* make compiler happy; never reached */ return shared_ptr<Body>(); }
+		else return (*proxee)[id];
 	}
-	body_id_t insert(pyBody b){return proxee->insert(b.proxee);}
-	python::list insertList(python::list bb){python::list ret; for(int i=0; i<len(bb); i++){ret.append(insert(python::extract<pyBody>(bb[i])()));} return ret;}
-		python::tuple insertClump(python::list bb){/*clump: first add constitutents, then add clump, then add constitutents to the clump, then update clump props*/
-		python::list ids=insertList(bb);
+	body_id_t insert(shared_ptr<Body> b){ return proxee->insert(b); }
+	vector<body_id_t> insertList(vector<shared_ptr<Body> > bb){
+		vector<body_id_t> ret; FOREACH(shared_ptr<Body>& b, bb){ret.push_back(insert(b));} return ret;
+	}
+	python::tuple insertClump(vector<shared_ptr<Body> > bb){/*clump: first add constitutents, then add clump, then add constitutents to the clump, then update clump props*/
+		vector<body_id_t> ids(insertList(bb));
 		shared_ptr<Clump> clump=shared_ptr<Clump>(new Clump());
 		shared_ptr<Body> clumpAsBody=static_pointer_cast<Body>(clump);
 		clump->isDynamic=true;
 		proxee->insert(clumpAsBody);
-		for(int i=0; i<len(ids); i++){clump->add(python::extract<body_id_t>(ids[i])());}
+		FOREACH(body_id_t id, ids) clump->add(id);
 		clump->updateProperties(false);
 		return python::make_tuple(clump->getId(),ids);
 	}
-	python::list replace(python::list bb){proxee->clear(); return insertList(bb);}
+	vector<body_id_t> replace(vector<shared_ptr<Body> > bb){proxee->clear(); return insertList(bb);}
 	long length(){return proxee->size();}
 	void clear(){proxee->clear();}
 };
@@ -394,8 +216,8 @@
 	public:
 	pyInteractionIterator(const shared_ptr<InteractionContainer>& ic){ I=ic->begin(); Iend=ic->end(); }
 	pyInteractionIterator pyIter(){return *this;}
-	pyInteraction pyNext(){ if(!(I!=Iend)){ PyErr_SetNone(PyExc_StopIteration); python::throw_error_already_set(); }
-		InteractionContainer::iterator ret=I; ++I; return pyInteraction(*ret); }
+	shared_ptr<Interaction> pyNext(){ if(!(I!=Iend)){ PyErr_SetNone(PyExc_StopIteration); python::throw_error_already_set(); }
+		InteractionContainer::iterator ret=I; ++I; return *ret; }
 };
 
 class pyInteractionContainer{
@@ -403,42 +225,43 @@
 		const shared_ptr<InteractionContainer> proxee;
 		pyInteractionContainer(const shared_ptr<InteractionContainer>& _proxee): proxee(_proxee){}
 		pyInteractionIterator pyIter(){return pyInteractionIterator(proxee);}
-		pyInteraction pyGetitem(python::object id12){
-			if(!PySequence_Check(id12.ptr())) throw invalid_argument("Key must be a tuple");
-			if(python::len(id12)!=2) throw invalid_argument("Key must be a 2-tuple: id1,id2.");
-			python::extract<body_id_t> id1_(PySequence_GetItem(id12.ptr(),0)), id2_(PySequence_GetItem(id12.ptr(),1));
-			if(!id1_.check()) throw invalid_argument("Could not extract id1");
-			if(!id2_.check()) throw invalid_argument("Could not extract id2");
-			shared_ptr<Interaction> i=proxee->find(id1_(),id2_());
-			if(i) return pyInteraction(i); else throw invalid_argument("No such interaction.");
+		shared_ptr<Interaction> pyGetitem(vector<body_id_t> id12){
+			//if(!PySequence_Check(id12.ptr())) throw invalid_argument("Key must be a tuple");
+			//if(python::len(id12)!=2) throw invalid_argument("Key must be a 2-tuple: id1,id2.");
+			if(id12.size()==2){
+				shared_ptr<Interaction> i=proxee->find(id12[0],id12[1]);
+				if(i) return i; else throw invalid_argument("No such interaction.");
+			}
+			else if(id12.size()==1){ return (*proxee)[id12[0]];}
+			else throw invalid_argument("2 integers (id1,id2) or 1 integer (nth) required.");
 		}
 		/* return nth _real_ iteration from the container (0-based index); this is to facilitate picking random interaction */
-		pyInteraction pyNth(long n){
-			long i=0; FOREACH(const shared_ptr<Interaction>& I, *proxee){ if(!I->isReal()) continue; if(i++==n) return pyInteraction(I); }
+		shared_ptr<Interaction> pyNth(long n){
+			long i=0; FOREACH(shared_ptr<Interaction> I, *proxee){ if(!I->isReal()) continue; if(i++==n) return I; }
 			throw invalid_argument(string("Interaction number out of range (")+lexical_cast<string>(n)+">="+lexical_cast<string>(i)+").");
 		}
 		long len(){return proxee->size();}
 		void clear(){proxee->clear();}
-		python::list withBody(long id){ python::list ret; FOREACH(const shared_ptr<Interaction>& I, *proxee){ if(I->isReal() && (I->getId1()==id || I->getId2()==id)) ret.append(pyInteraction(I));} return ret;}
-		python::list withBodyAll(long id){ python::list ret; FOREACH(const shared_ptr<Interaction>& I, *proxee){ if(I->getId1()==id || I->getId2()==id) ret.append(pyInteraction(I));} return ret; }
+		python::list withBody(long id){ python::list ret; FOREACH(const shared_ptr<Interaction>& I, *proxee){ if(I->isReal() && (I->getId1()==id || I->getId2()==id)) ret.append(I);} return ret;}
+		python::list withBodyAll(long id){ python::list ret; FOREACH(const shared_ptr<Interaction>& I, *proxee){ if(I->getId1()==id || I->getId2()==id) ret.append(I);} return ret; }
 		long countReal(){ long ret=0; FOREACH(const shared_ptr<Interaction>& I, *proxee){ if(I->isReal()) ret++; } return ret; }
 		bool serializeSorted_get(){return proxee->serializeSorted;}
 		void serializeSorted_set(bool ss){proxee->serializeSorted=ss;}
 };
 
-Vector3r tuple2vec(const python::tuple& t){return Vector3r(python::extract<double>(t[0])(),python::extract<double>(t[1])(),python::extract<double>(t[2])());}
 
 class pyBexContainer{
+		shared_ptr<MetaBody> rb;
 	public:
-		pyBexContainer(){}
-		python::tuple force_get(long id){  MetaBody* rb=Omega::instance().getRootBody().get(); rb->bex.sync(); Vector3r f=rb->bex.getForce(id); return python::make_tuple(f[0],f[1],f[2]); }
-		python::tuple torque_get(long id){ MetaBody* rb=Omega::instance().getRootBody().get(); rb->bex.sync(); Vector3r m=rb->bex.getTorque(id); return python::make_tuple(m[0],m[1],m[2]);}
-		python::tuple move_get(long id){ MetaBody* rb=Omega::instance().getRootBody().get(); rb->bex.sync(); Vector3r m=rb->bex.getMove(id); return python::make_tuple(m[0],m[1],m[2]);}
-		python::tuple rot_get(long id){ MetaBody* rb=Omega::instance().getRootBody().get(); rb->bex.sync(); Vector3r m=rb->bex.getRot(id); return python::make_tuple(m[0],m[1],m[2]);}
-		void force_add(long id, const Vector3r& f){  MetaBody* rb=Omega::instance().getRootBody().get(); rb->bex.addForce (id,f); }
-		void torque_add(long id, const Vector3r& t){ MetaBody* rb=Omega::instance().getRootBody().get(); rb->bex.addTorque(id,t);}
-		void move_add(long id, const Vector3r& t){ MetaBody* rb=Omega::instance().getRootBody().get(); rb->bex.addMove(id,t);}
-		void rot_add(long id, const Vector3r& t){ MetaBody* rb=Omega::instance().getRootBody().get(); rb->bex.addRot(id,t);}
+		pyBexContainer(){ rb=Omega::instance().getRootBody(); }
+		Vector3r force_get(long id){  rb->bex.sync(); return rb->bex.getForce(id); }
+		Vector3r torque_get(long id){ rb->bex.sync(); return rb->bex.getTorque(id); }
+		Vector3r move_get(long id){   rb->bex.sync(); return rb->bex.getMove(id); }
+		Vector3r rot_get(long id){    rb->bex.sync(); return rb->bex.getRot(id); }
+		void force_add(long id, const Vector3r& f){  rb->bex.addForce (id,f); }
+		void torque_add(long id, const Vector3r& t){ rb->bex.addTorque(id,t);}
+		void move_add(long id, const Vector3r& t){   rb->bex.addMove(id,t);}
+		void rot_add(long id, const Vector3r& t){    rb->bex.addRot(id,t);}
 };
 
 class pyOmega{
@@ -494,7 +317,6 @@
 	long iter(){ return OMEGA.getCurrentIteration();}
 	double simulationTime(){return OMEGA.getSimulationTime();}
 	double realTime(){ return OMEGA.getComputationTime(); }
-	// long realTime(){return OMEGA(get...);}
 	double dt_get(){return OMEGA.getTimeStep();}
 	void dt_set(double dt){OMEGA.skipTimeStepper(true); OMEGA.setTimeStep(dt);}
 
@@ -533,7 +355,7 @@
 	void tmpToFile(string mark, string filename){
 		if(OMEGA.memSavedSimulations.count(":memory:"+mark)==0) throw runtime_error("No memory-saved simulation named "+mark);
 		iostreams::filtering_ostream out;
-		if(boost::algorithm::ends_with(filename,".bz2")) out.push(iostreams::bzip2_compressor());
+		if(algorithm::ends_with(filename,".bz2")) out.push(iostreams::bzip2_compressor());
 		out.push(iostreams::file_sink(filename));
 		if(!out.good()) throw runtime_error("Error while opening file `"+filename+"' for writing.");
 		LOG_INFO("Saving :memory:"<<mark<<" to "<<filename);
@@ -560,40 +382,31 @@
 	python::list miscParams_get(){
 		python::list ret;
 		FOREACH(shared_ptr<Serializable>& s, OMEGA.getRootBody()->miscParams){
-			ret.append(pyGeneric(s));
+			ret.append(s);
 		}
 		return ret;
 	}
 
-	void miscParams_set(python::list l){
-		int len=python::len(l);
+	void miscParams_set(vector<shared_ptr<Serializable> > ss){
 		vector<shared_ptr<Serializable> >& miscParams=OMEGA.getRootBody()->miscParams;
 		miscParams.clear();
-		for(int i=0; i<len; i++){
-			if(python::extract<pyGeneric>(PySequence_GetItem(l.ptr(),i)).check()){ pyGeneric g=python::extract<pyGeneric>(PySequence_GetItem(l.ptr(),i)); miscParams.push_back(g.proxee); }
-			else throw std::invalid_argument("Unable to extract `Generic' from item #"+lexical_cast<string>(i)+".");
+		FOREACH(shared_ptr<Serializable> s, ss){
+			miscParams.push_back(s);
 		}
 	}
 
-	python::list engines_get(void){assertRootBody(); return anyEngines_get(OMEGA.getRootBody()->engines);}
-	void engines_set(python::object egs){assertRootBody(); anyEngines_set(OMEGA.getRootBody()->engines,egs); mapLabeledEntitiesToVariables(); }
-	python::list initializers_get(void){assertRootBody(); return anyEngines_get(OMEGA.getRootBody()->initializers);}
-	void initializers_set(python::object egs){assertRootBody(); anyEngines_set(OMEGA.getRootBody()->initializers,egs); OMEGA.getRootBody()->needsInitializers=true; }
+	vector<shared_ptr<Engine> > engines_get(void){assertRootBody(); return OMEGA.getRootBody()->engines;}
+	void engines_set(const vector<shared_ptr<Engine> >& egs){assertRootBody(); OMEGA.getRootBody()->engines.clear(); FOREACH(const shared_ptr<Engine>& e, egs) OMEGA.getRootBody()->engines.push_back(e); mapLabeledEntitiesToVariables(); }
+	vector<shared_ptr<Engine> > initializers_get(void){assertRootBody(); return OMEGA.getRootBody()->initializers;}
+	void initializers_set(const vector<shared_ptr<Engine> >& egs){assertRootBody(); OMEGA.getRootBody()->initializers.clear(); FOREACH(const shared_ptr<Engine>& e, egs) OMEGA.getRootBody()->initializers.push_back(e); mapLabeledEntitiesToVariables(); OMEGA.getRootBody()->needsInitializers=true; }
 
 	python::object labeled_engine_get(string label){
 		FOREACH(const shared_ptr<Engine>& eng, OMEGA.getRootBody()->engines){
-			if(eng->label==label){
-				#define RETURN_ENGINE_IF_POSSIBLE(engineType,pyEngineType) { shared_ptr<engineType> e=dynamic_pointer_cast<engineType>(eng); if(e) return python::object(pyEngineType(e)); }
-				RETURN_ENGINE_IF_POSSIBLE(MetaEngine,pyMetaEngine);
-				RETURN_ENGINE_IF_POSSIBLE(StandAloneEngine,pyStandAloneEngine);
-				RETURN_ENGINE_IF_POSSIBLE(DeusExMachina,pyDeusExMachina);
-				RETURN_ENGINE_IF_POSSIBLE(ParallelEngine,pyParallelEngine);
-				throw std::runtime_error("Unable to cast engine to MetaEngine, StandAloneEngine, DeusExMachina or ParallelEngine? ??");
-			}
+			if(eng->label==label){ return python::object(eng); }
 			shared_ptr<MetaEngine> me=dynamic_pointer_cast<MetaEngine>(eng);
 			if(me){
 				FOREACH(const shared_ptr<EngineUnit>& eu, me->functorArguments){
-					if(eu->label==label) return python::object(pyEngineUnit(eu));
+					if(eu->label==label) return python::object(eu);
 				}
 			}
 			shared_ptr<InteractionDispatchers> ee=dynamic_pointer_cast<InteractionDispatchers>(eng);
@@ -603,7 +416,7 @@
 				FOREACH(const shared_ptr<EngineUnit>& eu,ee->physDispatcher->functorArguments) eus.push_back(eu);
 				FOREACH(const shared_ptr<EngineUnit>& eu,ee->constLawDispatcher->functorArguments) eus.push_back(eu);
 				FOREACH(const shared_ptr<EngineUnit>& eu,eus){
-					if(eu->label==label) return python::object(pyEngineUnit(eu));
+					if(eu->label==label) return python::object(eu);
 				}
 			}
 		}
@@ -616,8 +429,8 @@
 	pyBexContainer bex_get(void){return pyBexContainer();}
 	
 
-	boost::python::list listChildClasses(const string& base){
-		boost::python::list ret;
+	python::list listChildClasses(const string& base){
+		python::list ret;
 		for(map<string,DynlibDescriptor>::const_iterator di=Omega::instance().getDynlibsDescriptor().begin();di!=Omega::instance().getDynlibsDescriptor().end();++di) if (Omega::instance().isInheritingFrom((*di).first,base)) ret.append(di->first);
 		return ret;
 	}
@@ -626,9 +439,9 @@
 		return (Omega::instance().isInheritingFrom(child,base));
 	}
 
-	boost::python::list plugins_get(){
+	python::list plugins_get(){
 		const map<string,DynlibDescriptor>& plugins=Omega::instance().getDynlibsDescriptor();
-		std::pair<string,DynlibDescriptor> p; boost::python::list ret;
+		std::pair<string,DynlibDescriptor> p; python::list ret;
 		FOREACH(p, plugins) ret.append(p.first);
 		return ret;
 	}
@@ -663,11 +476,6 @@
 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(omega_saveTmp_overloads,saveTmp,0,1);
 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(omega_loadTmp_overloads,loadTmp,0,1);
 
-BASIC_PY_PROXY_HEAD(pyFileGenerator,FileGenerator)
-	void generate(string outFile){ proxee->setFileName(outFile); proxee->setSerializationLibrary("XMLFormatManager"); bool ret=proxee->generateAndSave(); LOG_INFO((ret?"SUCCESS:\n":"FAILURE:\n")<<proxee->message); if(ret==false) throw runtime_error("Generator reported error: "+proxee->message); };
-	void load(){  char tmpnam_str [L_tmpnam]; char* result=tmpnam(tmpnam_str); if(result!=tmpnam_str) throw runtime_error(__FILE__ ": tmpnam(char*) failed!");  string xml(tmpnam_str+string(".xml.bz2")); LOG_DEBUG("Using temp file "<<xml); this->generate(xml); pyOmega().load(xml); }
-BASIC_PY_PROXY_TAIL;
-
 class pySTLImporter : public STLImporter {
     public:
 	void py_import(pyBodyContainer bc, unsigned int begin=0, bool noInteractingGeometry=false) { import(bc.proxee,begin,noInteractingGeometry); }
@@ -676,9 +484,111 @@
 
 
 
+
+/*****************************************************************************
+********** New helper functions 
+****/
+void Serializable_updateAttrs(const shared_ptr<Serializable>& self, const python::dict& d){
+	python::list l=d.items(); size_t ll=python::len(l);
+	for(size_t i=0; i<ll; i++){
+		python::tuple t=python::extract<python::tuple>(l[i]); string key=python::extract<string>(t[0]); self->pySetAttr(key,t[1]);
+	}
+}
+python::list Serializable_updateExistingAttrs(const shared_ptr<Serializable>& self, const python::dict& d){
+	python::list ret; python::list l=d.items(); size_t ll=python::len(l);
+	for(size_t i=0; i<ll; i++){
+		python::tuple t=python::extract<python::tuple>(l[i]); string key=python::extract<string>(t[0]);
+		if(self->pyHasKey(key)) self->pySetAttr(key,t[1]); else ret.append(t[0]);
+	}
+	return ret; 
+}
+
+std::string Serializable_pyStr(const shared_ptr<Serializable>& self) {
+	std::string nameThis=self->getClassName(),nameRoot=self->pyRootClassName();
+	if(nameThis==nameRoot) return "<"+nameRoot+">";
+	else return "<"+nameThis+" "+nameRoot+">";
+}
+
+python::list TimingDeltas_pyData(const shared_ptr<TimingDeltas> self){
+	python::list ret;
+	for(size_t i=0; i<self->data.size(); i++){ ret.append(python::make_tuple(self->labels[i],self->data[i].nsec,self->data[i].nExec));}
+	return ret;
+}
+
+TimingInfo::delta Engine_timingInfo_nsec_get(const shared_ptr<Engine>& e){return e->timingInfo.nsec;}; void Engine_timingInfo_nsec_set(const shared_ptr<Engine>& e, TimingInfo::delta d){ e->timingInfo.nsec=d;}
+long Engine_timingInfo_nExec_get(const shared_ptr<Engine>& e){return e->timingInfo.nExec;}; void Engine_timingInfo_nExec_set(const shared_ptr<Engine>& e, long d){ e->timingInfo.nExec=d;}
+
+template <typename T>
+shared_ptr<T> Serializable_ctor_kwAttrs(const python::tuple& t, const python::dict& d){
+	if(python::len(t)>1) throw runtime_error("Zero or one (and not more) non-keyword string argument required");
+	string clss;
+	if(python::len(t)==1){
+		python::extract<string> clss_(t[0]); if(!clss_.check()) throw runtime_error("First argument (if given) must be a string.");
+		clss=clss_();
+	}
+	shared_ptr<T> instance;
+	if(clss.empty()){ instance=shared_ptr<T>(new T); }
+	else{
+		instance=dynamic_pointer_cast<T>(ClassFactory::instance().createShared(clss));
+		if(!instance) throw runtime_error("Invalid class `"+clss+"': either nonexistent, or unable to cast to type `"+typeid(T).name()+"'");
+	}
+	Serializable_updateAttrs(instance,d);
+	return instance;
+}
+
+// FIXME: those could be moved to the c++ classes themselves, right?
+template<typename DispatcherT, typename functorT>
+shared_ptr<DispatcherT> Dispatcher_ctor_list(const std::vector<shared_ptr<functorT> >& functors){
+	shared_ptr<DispatcherT> instance(new DispatcherT);
+	FOREACH(shared_ptr<functorT> functor,functors) instance->add(functor);
+	return instance;
+}
+
+// FIXME: this one as well
+shared_ptr<InteractionDispatchers> InteractionDispatchers_ctor_lists(const std::vector<shared_ptr<InteractionGeometryEngineUnit> >& gff, const std::vector<shared_ptr<InteractionPhysicsEngineUnit> >& pff, const std::vector<shared_ptr<ConstitutiveLaw> >& cff){
+	shared_ptr<InteractionDispatchers> instance(new InteractionDispatchers);
+	FOREACH(shared_ptr<InteractionGeometryEngineUnit> gf, gff) instance->geomDispatcher->add(gf);
+	FOREACH(shared_ptr<InteractionPhysicsEngineUnit> pf, pff) instance->physDispatcher->add(pf);
+	FOREACH(shared_ptr<ConstitutiveLaw> cf, cff) instance->constLawDispatcher->add(cf);
+	return instance;
+}
+// injected methods
+Vector3r PhysicalParameters_displ_get(const shared_ptr<PhysicalParameters>& pp){return pp->se3.position-pp->refSe3.position;}
+Vector3r PhysicalParameters_rot_get  (const shared_ptr<PhysicalParameters>& pp){Quaternionr relRot=pp->refSe3.orientation.Conjugate()*pp->se3.orientation; Vector3r axis; Real angle; relRot.ToAxisAngle(axis,angle); return axis*angle;  }
+Vector3r PhysicalParameters_pos_get(const shared_ptr<PhysicalParameters>& pp){return pp->se3.position;}
+Quaternionr PhysicalParameters_ori_get(const shared_ptr<PhysicalParameters>& pp){return pp->se3.orientation;}
+Vector3r PhysicalParameters_refPos_get(const shared_ptr<PhysicalParameters>& pp){return pp->refSe3.position;}
+void PhysicalParameters_pos_set(const shared_ptr<PhysicalParameters>& pp, const Vector3r& p){ pp->se3.position=p; }
+void PhysicalParameters_refPos_set(const shared_ptr<PhysicalParameters>& pp, const Vector3r& p){ pp->refSe3.position=p; }
+void PhysicalParameters_ori_set(const shared_ptr<PhysicalParameters>& pp, const Quaternionr& p){ pp->se3.orientation=p; }
+
+long Interaction_getId1(const shared_ptr<Interaction>& i){ return (long)i->getId1(); }
+long Interaction_getId2(const shared_ptr<Interaction>& i){ return (long)i->getId2(); }
+
+void FileGenerator_generate(const shared_ptr<FileGenerator>& fg, string outFile){ fg->setFileName(outFile); fg->setSerializationLibrary("XMLFormatManager"); bool ret=fg->generateAndSave(); LOG_INFO((ret?"SUCCESS:\n":"FAILURE:\n")<<fg->message); if(ret==false) throw runtime_error("Generator reported error: "+fg->message); };
+void FileGenerator_load(const shared_ptr<FileGenerator>& fg){ char tmpnam_str [L_tmpnam]; char* result=tmpnam(tmpnam_str); if(result!=tmpnam_str) throw runtime_error(__FILE__ ": tmpnam(char*) failed!");  string xml(tmpnam_str+string(".xml.bz2")); LOG_DEBUG("Using temp file "<<xml); FileGenerator_generate(fg,xml); pyOmega().load(xml); }
+
+// many thanks to http://markmail.org/message/s4ksg6nfspw2wxwd
+namespace boost { namespace python { namespace detail {
+	template <class F> struct raw_constructor_dispatcher{
+		raw_constructor_dispatcher(F f): f(make_constructor(f)) {}
+		PyObject* operator()(PyObject* args, PyObject* keywords)
+		{
+			 borrowed_reference_t* ra = borrowed_reference(args); object a(ra);
+			 return incref(object(f(object(a[0]),object(a.slice(1,len(a))),keywords ? dict(borrowed_reference(keywords)) : dict())).ptr() );
+		}
+		private: object f;
+	};
+	}
+	template <class F> object raw_constructor(F f, std::size_t min_args = 0){
+		return detail::make_raw_function(objects::py_function(detail::raw_constructor_dispatcher<F>(f),mpl::vector2<void, object>(),min_args+1,(std::numeric_limits<unsigned>::max)()));
+	}
+}} // namespace boost::python
+
+
 BOOST_PYTHON_MODULE(wrapper)
 {
-	boost::python::class_<pyOmega>("Omega")
+	python::class_<pyOmega>("Omega")
 		.add_property("iter",&pyOmega::iter)
 		.add_property("stopAtIter",&pyOmega::stopAtIter_get,&pyOmega::stopAtIter_set)
 		.add_property("time",&pyOmega::simulationTime)
@@ -718,12 +628,12 @@
 		.add_property("bexSyncCount",&pyOmega::bexSyncCount_get,&pyOmega::bexSyncCount_set)
 		.add_property("numThreads",&pyOmega::numThreads_get,&pyOmega::numThreads_set)
 		;
-	boost::python::class_<pyTags>("TagsWrapper",python::init<pyTags&>())
+	python::class_<pyTags>("TagsWrapper",python::init<pyTags&>())
 		.def("__getitem__",&pyTags::getItem)
 		.def("__setitem__",&pyTags::setItem)
 		.def("keys",&pyTags::keys);
 	
-	boost::python::class_<pyBodyContainer>("BodyContainer",python::init<pyBodyContainer&>())
+	python::class_<pyBodyContainer>("BodyContainer",python::init<pyBodyContainer&>())
 		.def("__getitem__",&pyBodyContainer::pyGetitem)
 		.def("__len__",&pyBodyContainer::length)
 		.def("append",&pyBodyContainer::insert)
@@ -731,7 +641,7 @@
 		.def("appendClumped",&pyBodyContainer::insertClump)
 		.def("clear", &pyBodyContainer::clear)
 		.def("replace",&pyBodyContainer::replace);
-	boost::python::class_<pyInteractionContainer>("InteractionContainer",python::init<pyInteractionContainer&>())
+	python::class_<pyInteractionContainer>("InteractionContainer",python::init<pyInteractionContainer&>())
 		.def("__iter__",&pyInteractionContainer::pyIter)
 		.def("__getitem__",&pyInteractionContainer::pyGetitem)
 		.def("__len__",&pyInteractionContainer::len)
@@ -742,11 +652,11 @@
 		.add_property("serializeSorted",&pyInteractionContainer::serializeSorted_get,&pyInteractionContainer::serializeSorted_set)
 		.def("nth",&pyInteractionContainer::pyNth)
 		.def("clear",&pyInteractionContainer::clear);
-	boost::python::class_<pyInteractionIterator>("InteractionIterator",python::init<pyInteractionIterator&>())
+	python::class_<pyInteractionIterator>("InteractionIterator",python::init<pyInteractionIterator&>())
 		.def("__iter__",&pyInteractionIterator::pyIter)
 		.def("next",&pyInteractionIterator::pyNext);
 
-	boost::python::class_<pyBexContainer>("BexContainer",python::init<pyBexContainer&>())
+	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
@@ -757,12 +667,8 @@
 		.def("addMove",&pyBexContainer::move_add)
 		.def("addRot",&pyBexContainer::rot_add);
 
-	boost::python::class_<pyTimingDeltas>("TimingDeltas",python::init<pyTimingDeltas&>())
-		.def("reset",&pyTimingDeltas::reset)
-		.add_property("data",&pyTimingDeltas::data_get);
-
-	#define TIMING_PROPS(class) .add_property("execTime",&class::execTime_get,&class::execTime_set).add_property("execCount",&class::execCount_get,&class::execCount_set).add_property("timingDeltas",&class::timingDeltas_get)
-
+// keep for a while for reference, to make sure everything is wrapped as it was before
+#if 0
 	BASIC_PY_PROXY_WRAPPER(pyStandAloneEngine,"StandAloneEngine")
 		TIMING_PROPS(pyStandAloneEngine);
 	BASIC_PY_PROXY_WRAPPER(pyMetaEngine,"MetaEngine")
@@ -826,12 +732,101 @@
 	BASIC_PY_PROXY_WRAPPER(pyFileGenerator,"Preprocessor")
 		.def("generate",&pyFileGenerator::generate)
 		.def("load",&pyFileGenerator::load);
+#endif
 
-	boost::python::class_<pySTLImporter>("STLImporter")
+	python::class_<pySTLImporter>("STLImporter")
 	    .def("open",&pySTLImporter::open)
 	    .add_property("number_of_facets",&pySTLImporter::number_of_facets)
 	    .def_readwrite("wire",&pySTLImporter::wire)
 	    .def("import_geometry",&pySTLImporter::py_import,STLImporter_import_overloads());
+
+//////////////////////////////////////////////////////////////
+///////////// proxyless wrappers 
+
+	/* TODO: bases for functors; functors for dispatchers; ParallelEngine (?) */
+
+	python::class_<Serializable, shared_ptr<Serializable>, noncopyable >("Serializable")
+		.add_property("name",&Serializable::getClassName).def("__str__",&Serializable_pyStr).def("postProcessAttributes",&Serializable::postProcessAttributes)
+		.def("dict",&Serializable::pyDict).def("__getitem__",&Serializable::pyGetAttr).def("__setitem__",&Serializable::pySetAttr).def("has_key",&Serializable::pyHasKey).def("keys",&Serializable::pyKeys).
+		def("updateAttrs",&Serializable_updateAttrs).def("updateExistingAttrs",&Serializable_updateExistingAttrs)
+		.def("__init__",python::raw_constructor(Serializable_ctor_kwAttrs<Serializable>))
+		;
+	python::class_<Engine, shared_ptr<Engine>, python::bases<Serializable>, noncopyable >("Engine",python::no_init)
+		.add_property("execTime",&Engine_timingInfo_nsec_get,&Engine_timingInfo_nsec_set)
+		.add_property("execCount",&Engine_timingInfo_nExec_get,&Engine_timingInfo_nExec_set)
+		.def_readonly("timingDeltas",&Engine::timingDeltas);
+	python::class_<StandAloneEngine,shared_ptr<StandAloneEngine>, python::bases<Engine>, noncopyable>("StandAloneEngine").def("__init__",python::raw_constructor(Serializable_ctor_kwAttrs<Engine>));
+	python::class_<DeusExMachina,shared_ptr<DeusExMachina>, python::bases<Engine>, noncopyable>("DeusExMachina").def("__init__",python::raw_constructor(Serializable_ctor_kwAttrs<Engine>));
+	python::class_<EngineUnit, shared_ptr<EngineUnit>, python::bases<Serializable>, noncopyable >("EngineUnit")
+		.def_readonly("timingDeltas",&EngineUnit::timingDeltas)
+		.add_property("bases",&EngineUnit::getFunctorTypes);
+	python::class_<TimingDeltas, shared_ptr<TimingDeltas>, noncopyable >("TimingDeltas").add_property("data",&TimingDeltas_pyData).def("reset",&TimingDeltas::reset);
+
+	python::class_<InteractionDispatchers,shared_ptr<InteractionDispatchers>, python::bases<Engine>, noncopyable >("InteractionDispatchers").def("__init__",python::make_constructor(InteractionDispatchers_ctor_lists));
+	#define EXPOSE_DISPATCHER(DispatcherT,functorT) python::class_<DispatcherT, shared_ptr<DispatcherT>, python::bases<Engine>, noncopyable >(#DispatcherT).def("__init__",python::make_constructor(Dispatcher_ctor_list<DispatcherT,functorT>));
+		EXPOSE_DISPATCHER(BoundingVolumeMetaEngine,BoundingVolumeEngineUnit)
+		EXPOSE_DISPATCHER(GeometricalModelMetaEngine,GeometricalModelEngineUnit)
+		EXPOSE_DISPATCHER(InteractingGeometryMetaEngine,InteractingGeometryEngineUnit)
+		EXPOSE_DISPATCHER(InteractionGeometryMetaEngine,InteractionGeometryEngineUnit)
+		EXPOSE_DISPATCHER(InteractionPhysicsMetaEngine,InteractionPhysicsEngineUnit)
+		EXPOSE_DISPATCHER(PhysicalParametersMetaEngine,PhysicalParametersEngineUnit)
+		EXPOSE_DISPATCHER(PhysicalActionDamper,PhysicalActionDamperUnit)
+		EXPOSE_DISPATCHER(PhysicalActionApplier,PhysicalActionApplierUnit)
+		EXPOSE_DISPATCHER(ConstitutiveLawDispatcher,ConstitutiveLaw)
+	#undef EXPOSE_DISPATCHER
+
+	#define EXPOSE_FUNCTOR(FunctorT) python::class_<FunctorT, shared_ptr<FunctorT>, python::bases<EngineUnit>, noncopyable>(#FunctorT).def("__init__",python::raw_constructor(Serializable_ctor_kwAttrs<FunctorT>));
+		EXPOSE_FUNCTOR(BoundingVolumeEngineUnit)
+		EXPOSE_FUNCTOR(GeometricalModelEngineUnit)
+		EXPOSE_FUNCTOR(InteractingGeometryEngineUnit)
+		EXPOSE_FUNCTOR(InteractionGeometryEngineUnit)
+		EXPOSE_FUNCTOR(InteractionPhysicsEngineUnit)
+		EXPOSE_FUNCTOR(PhysicalParametersEngineUnit)
+		EXPOSE_FUNCTOR(PhysicalActionDamperUnit)
+		EXPOSE_FUNCTOR(PhysicalActionApplierUnit)
+		EXPOSE_FUNCTOR(ConstitutiveLaw)
+	#undef EXPOSE_FUNCTOR
+
+		
+	#define EXPOSE_CXX_CLASS_RENAMED(cxxName,pyName) python::class_<cxxName,shared_ptr<cxxName>, python::bases<Serializable>, noncopyable>(#pyName).def("__init__",python::raw_constructor(Serializable_ctor_kwAttrs<cxxName>))
+	#define EXPOSE_CXX_CLASS(className) EXPOSE_CXX_CLASS_RENAMED(className,className)
+
+	EXPOSE_CXX_CLASS(Body)
+		.def_readwrite("shape",&Body::geometricalModel)
+		.def_readwrite("mold",&Body::interactingGeometry)
+		.def_readwrite("bound",&Body::boundingVolume)
+		.def_readwrite("phys",&Body::physicalParameters)
+		.def_readwrite("dynamic",&Body::isDynamic)
+		.def_readonly("id",&Body::id)
+		.def_readwrite("mask",&Body::groupMask)
+		.add_property("isStandalone",&Body::isStandalone)
+		.add_property("isClumpMember",&Body::isClumpMember)
+		.add_property("isClump",&Body::isClump);
+	EXPOSE_CXX_CLASS(InteractingGeometry);
+	EXPOSE_CXX_CLASS(GeometricalModel);
+	EXPOSE_CXX_CLASS(BoundingVolume);
+	EXPOSE_CXX_CLASS(PhysicalParameters)
+		.add_property("blockedDOFs",&PhysicalParameters::blockedDOFs_vec_get,&PhysicalParameters::blockedDOFs_vec_set)
+		.add_property("pos",&PhysicalParameters_pos_get,&PhysicalParameters_pos_set)
+		.add_property("ori",&PhysicalParameters_ori_get,&PhysicalParameters_ori_set)
+		.add_property("refPos",&PhysicalParameters_refPos_get,&PhysicalParameters_refPos_set)
+		.add_property("displ",&PhysicalParameters_displ_get)
+		.add_property("rot",&PhysicalParameters_rot_get);
+	// interaction
+	EXPOSE_CXX_CLASS(Interaction)
+		.def_readwrite("phys",&Interaction::interactionPhysics)
+		.def_readwrite("geom",&Interaction::interactionGeometry)
+		.add_property("id1",&Interaction_getId1)
+		.add_property("id2",&Interaction_getId2)
+		.add_property("isReal",&Interaction::isReal);
+	EXPOSE_CXX_CLASS(InteractionPhysics);
+	EXPOSE_CXX_CLASS(InteractionGeometry);
+	EXPOSE_CXX_CLASS_RENAMED(FileGenerator,Preprocessor)
+		.def("generate",&FileGenerator_generate)
+		.def("load",&FileGenerator_load);
+
+	// containers & iterators
+	// BodyContainer
 	
 }
 

Added: trunk/scripts/fix-plugin-names.py
===================================================================
--- trunk/scripts/fix-plugin-names.py	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/scripts/fix-plugin-names.py	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,22 @@
+import os,re
+for root, dirs, files in os.walk('.'):
+	for name in files:
+		if not name.endswith('.cpp'): continue
+		#if name!='BssSnowGrain.cpp': continue
+		modified=False
+		new=[]
+		for l in open(root+'/'+name):
+			m=re.match('(.*)YADE_PLUGIN\(\)(.*)',l)
+			if m:
+				modified=True
+				plugin=name[:-4] # strip the .cpp
+				new.append(m.group(1)+'YADE_PLUGIN("'+plugin+'")'+m.group(2))
+			else: new.append(l)
+		if modified:
+			print root+'/'+name
+			f=open(root+'/'+name,'w')
+			for l in new: f.write(l)
+			f.close()
+
+
+

Modified: trunk/scripts/linkdeps.py
===================================================================
--- trunk/scripts/linkdeps.py	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/scripts/linkdeps.py	2009-07-27 18:08:23 UTC (rev 1888)
@@ -33,10 +33,10 @@
 		if 'YADE_PLUGIN' in l and getModule(dir) not in ('core',): plugins.add(f.split('.')[0])
 
 maxIncludeLevel=4
-def grepInc(path,f,level=0):
+def grepCpp(path,f,level=0):
 	fullF=path+sep+f; baseName=f.split('.')[0]
-	deps=set()
-	if level==maxIncludeLevel: return set()
+	linkDeps,featureDeps=set(),set()
+	if level==maxIncludeLevel: return set(),set()
 	#print path,f
 	for l in open(fullF):
 		m=re.match('^#include<yade/([^/]*)/(.*)>.*$',l)
@@ -44,7 +44,7 @@
 			incMod=m.group(1); incHead=m.group(2); baseName=incHead.split('.')[0]; assert(len(incHead.split('.'))==2)
 			if incMod=='core': continue
 			#if baseName not in plugins: print f,incHead
-			deps.add(incHead.split('.')[0])
+			linkDeps.add(incHead.split('.')[0])
 			continue
 		m=re.match('^#include\s*"([^/]*)".*$',l)
 		if m:
@@ -54,11 +54,40 @@
 				pass
 			else:
 				if m.group(1).split('.')[0] not in plugins or incBaseName==baseName:
-					deps.update(grepInc(path,m.group(1),level=level+1))
-	return deps
-#for dir,f in [('./pkg/common/Engine/DeusExMachina','JumpChangeSe3.cpp'),]: #sources:
+					linkDeps.update(grepCpp(path,m.group(1),level=level+1)[0])
+			continue
+		m=re.match('^YADE_REQUIRE_FEATURE\((.*)\).*',l)
+		if m:
+			featureDeps.add(m.group(1))
+	return linkDeps,featureDeps
+pluginLinks,pluginFeats,pluginSrcs={},{},{}
 for dir,f in sources:
 	if getModule(dir) in ('core',): continue
-	d=grepInc(dir,f)
-	print f ,' '.join(d)
+	if not getModule(dir).startswith('pkg'): continue
+	link,feats=grepCpp(dir,f)
+	plugin='.'.join(f.split('.')[:-1])
+	pluginLinks[plugin],pluginFeats[plugin],pluginSrcs[plugin]=link,feats,dir+'/'+f
+import shelve
+cache=shelve.open('linkdeps.cache')
+cache['pluginLinks'],cache['pluginFeats'],cache['pluginSrcs']=pluginLinks,pluginFeats,pluginSrcs
+pluginLinks,pluginFeats,pluginSrcs=cache['pluginLinks'],cache['pluginFeats'],cache['pluginSrcs']
+pluginObjs={}
+for p in pluginLinks.keys(): pluginObjs[p]='packages'
+cache.close()
 
+def getPluginLibs(plugin):
+	libs=set()
+	myObj=pluginObjs[plugin]
+	for lib in pluginLinks[plugin]:
+		if pluginObjs[plugin]==myObj: continue
+		try:
+			libs.add(pluginObjs[lib])
+		except KeyError:
+			print 'WARNING: plugin %s, missing lib %s'%(plugin,lib)
+	return libs
+allLibs=set();
+for p in pluginSrcs.keys(): allLibs.update(getPluginLibs(p))
+print "\tenv.SharedLibrary('packages',Split('"+' '.join(pluginSrcs.values())+"'),LIBS=env['LIBS']+Split('"+' '.join(allLibs)+"'),CXXFLAGS=env['CXXFLAGS']+['--combine'])"
+#print plugin,' '.join(feats)
+#print f ,' '.join(feats)
+

Modified: trunk/scripts/test/facet-sphere.py
===================================================================
--- trunk/scripts/test/facet-sphere.py	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/scripts/test/facet-sphere.py	2009-07-27 18:08:23 UTC (rev 1888)
@@ -22,7 +22,7 @@
 for i in range(0,100):
 	O.bodies.append(utils.sphere([random.gauss(0,1),random.gauss(0,1),random.uniform(1,2)],random.uniform(.02,.05),velocity=[random.gauss(0,.1),random.gauss(0,.1),random.gauss(0,.1)]))
 
-O.miscParams=[Generic('GLDrawSphere',{'glutUse':True})]
+O.miscParams=[Generic('GLDrawSphere',glutUse=True)]
 O.dt=1e-4
 O.saveTmp('init')
 

Added: trunk/yadeSCons.py
===================================================================
--- trunk/yadeSCons.py	2009-07-27 15:00:20 UTC (rev 1887)
+++ trunk/yadeSCons.py	2009-07-27 18:08:23 UTC (rev 1888)
@@ -0,0 +1,140 @@
+
+def getRealVersion():
+	"Attempts to get yade version from RELEASE file if it exists or from bzr or svn."
+	import os.path,re,os
+	if os.path.exists('RELEASE'):
+		return file('RELEASE').readline().strip()
+	if os.path.exists('.svn'):
+		for l in os.popen("LC_ALL=C svn info").readlines():
+			m=re.match(r'Revision: ([0-9]+)',l)
+			if m: return 'svn'+m.group(1)
+	if os.path.exists('.bzr'):
+		for l in os.popen("LC_ALL=C bzr version-info 2>/dev/null").readlines():
+			m=re.match(r'revno: ([0-9]+)',l)
+			if m: return 'bzr'+m.group(1)
+	return '<unknown>'
+
+
+class Plugin:
+	def __init__(self,name,src,deps,feats,module):
+		self.name,self.src,self.deps,self.feats,self.module=name,src,deps,feats,module
+	def __str__(self):
+		return '%s/%s [%s] (%s)'%(self.module,self.name,','.join(self.feats),','.join(self.libs))
+
+def grepForIncludes(root,f):
+	import re
+	ret=set()
+	for l in open(root+'/'+f):
+		m=re.match(r'^\s*#include\s*<yade/([^/]*)/(.*)>.*$',l)
+		if m:
+			incMod=m.group(1); baseName=m.group(2).split('.')[0];
+			if incMod=='core' or incMod.startswith('lib-'): continue
+			#print f,baseName
+			ret.add(baseName)
+	return ret
+
+
+def scanAllPlugins(cacheFile):
+	"""Traverse all files in pkg/, recording what plugins they link with and what features they require.
+	Save the result in a cache file and only regenerate the information if the cache file is missing."""
+	import os, os.path, re, shelve
+	if cacheFile:
+		refresh=os.path.exists(cacheFile)
+		plugInfo=shelve.open(cacheFile)
+	else:
+		plugInfo={}; refresh=True
+	if refresh:
+		for root, dirs, files in os.walk('pkg/',topdown=True):
+			for f in files:
+				if not (f.endswith('.cpp') or f.endswith('.cc') or f.endswith('C')): continue
+				ff=root+'/'+f
+				linkDeps,featureDeps=set(),set()
+				isPlugin=True #False
+				for l in open(ff):
+					if re.match(r'\s*YADE_PLUGIN\(.*',l): isPlugin=True
+					m=re.match(r'^\s*#include\s*<yade/([^/]*)/(.*)>.*$',l)
+					if m:
+						incMod=m.group(1); incHead=m.group(2); baseName=incHead.split('.')[0]; assert(len(incHead.split('.'))==2)
+						if incMod=='core' or incMod.startswith('lib-'): continue
+						if os.path.exists(root+'/'+m.group(2)):
+							linkDeps.update(grepForIncludes(root,m.group(2)))
+						linkDeps.add(incHead.split('.')[0])
+						continue
+					m=re.match('^\s*YADE_REQUIRE_FEATURE\((.*)\).*$',l)
+					if m:
+						featureDeps.add(m.group(1).upper())
+					m=re.match('^\s*#include\s*"([^/]*)".*$',l)
+					if m:
+						inc=m.group(1); incBaseName=m.group(1).split('.')[0]
+						if not os.path.exists(root+'/'+m.group(1)):
+							print "WARNING: file %s included from %s doesn't exist"%(m.group(1),fullF)
+						else:
+							linkDeps.update(grepForIncludes(root,m.group(1)))
+							continue
+				if isPlugin:
+					plugin=f.split('.')[0]
+					m=re.match(r'.*pkg/([^/]*)(/.*|)$',root)
+					plugInfo[plugin]=Plugin(plugin,ff,linkDeps,featureDeps,m.group(1))
+	pp={}
+	for p in plugInfo.keys(): pp[p]=plugInfo[p]
+	if cacheFile: plugInfo.close()
+	return pp
+
+def getWantedPlugins(plugInfo,excludes,features,linkStrategy):
+	"""Use pluginInfo (generated by scanAllPlugins) and return only plugins that we should build,
+	based on excludes and available features.
+	
+	Set the plugin object according to linkStrategy and set also other plugins this one should link to."""
+	ret={}
+	feats=set([feat.upper() for feat in features])
+	excludes=set(excludes)
+	for p in plugInfo:
+		plug=plugInfo[p]
+		if plug.module in excludes: continue
+		if not plug.feats<=feats:
+			continue # plugin needs more feature than we have
+		ret[plug.name]=plug
+	for p in plugInfo.values(): p.obj=getPluginObj(p,linkStrategy)
+	for p in plugInfo.values(): p.libs=getPluginLibs(p,plugInfo)
+	return ret
+
+def getPluginObj(plug,linkStrategy):
+	"""Return name of library this plugin will be compiled into, based on current linkStrategy."""
+	if   linkStrategy=='per-class': return plug.name
+	elif linkStrategy=='per-pkg': return plug.module
+	elif linkStrategy=='monolithic': return 'packages'
+	elif linkStrategy=='static': return 'packages'
+
+def getPluginLibs(p,plugInfo):
+	"""Returns library names this plugin should link to, based on current information about other plugins."""
+	ret=set()
+	for dep in p.deps:
+		if dep in plugInfo.keys():
+			ret.add(plugInfo[dep].obj)
+		else:
+			pass
+			#print p.src+':',dep,"not a plugin?"
+	ret.discard(p.obj)
+	return ret
+
+def buildPluginLibs(env,plugInfo):
+	objs={}
+	linkStrategy=env['linkStrategy']
+	for p in plugInfo.values():
+		if not objs.has_key(p.obj): objs[p.obj]=(set(),set())
+		objs[p.obj][0].add(p.src)
+		objs[p.obj][1].update(p.libs)
+	for obj in objs.keys():
+		srcs=list(objs[obj][0])
+		if len(srcs)>1: srcs=env.Combine('$buildDir/'+obj+'.cpp',srcs)
+		if linkStrategy!='static':
+			env.Install('$PREFIX/lib/yade$SUFFIX/plugins',env.SharedLibrary(obj,srcs,LIBS=list(objs[obj][1])))
+		else:
+			env.Install('$PREFIX/lib/yade$SUFFIX/plugins',env.StaticLibrary(obj,srcs,LIBS=list(objs[obj][1])))
+	
+
+	
+
+
+
+




Follow ups