← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1831: BasicPM @ pkg/dem meta

 

Merge authors:
  Václav Šmilauer (eudoxos)
------------------------------------------------------------
revno: 1831 [merge]
committer: CWBoon <booncw@xxxxxxxxxxx>
branch nick: yade
timestamp: Tue 2009-12-01 05:17:57 -0500
message:
  BasicPM @ pkg/dem meta
removed:
  pkg/dem/BasicPM.cpp
  pkg/dem/BasicPM.hpp
  pkg/dem/BasicPMTest.py
added:
  pkg/dem/meta/BasicPM.cpp
  pkg/dem/meta/BasicPM.hpp
  pkg/dem/meta/BasicPMTest.py
modified:
  core/main/main.cpp


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'core/main/main.cpp'
--- core/main/main.cpp	2009-11-29 16:11:36 +0000
+++ core/main/main.cpp	2009-11-30 21:47:29 +0000
@@ -38,15 +38,11 @@
 		log4cxx::LevelPtr debugLevel=log4cxx::Level::DEBUG, infoLevel=log4cxx::Level::INFO, warnLevel=log4cxx::Level::WARN;
 	#endif
 
-	/* initialization of log4cxx for early logging */
-	__attribute__((constructor/* (1000) ::: can be uncommented for gcc>=4.0 */)) void initLog4cxx(){
+	/* initialization of log4cxx */
+	void initLog4cxx(){
 		log4cxx::BasicConfigurator::configure();
 		log4cxx::LoggerPtr localLogger=log4cxx::Logger::getLogger("yade");
-		if(getenv("YADE_DEBUG")){
-			LOG_INFO("YADE_DEBUG environment variable is defined, logging level is DEBUG.");
-			localLogger->setLevel(debugLevel);
-		}
-		else localLogger->setLevel(warnLevel);
+		localLogger->setLevel(warnLevel);
 	}
 #endif
 
@@ -60,7 +56,6 @@
 void
 sigHandler(int sig){
 	#ifdef YADE_DEBUG
-		int res;
 	#endif
 	switch(sig){
 		case SIGINT:
@@ -75,7 +70,7 @@
 		case SIGSEGV:
 			signal(SIGSEGV,SIG_DFL); signal(SIGABRT,SIG_DFL); // prevent loops - default handlers
 			cerr<<"SIGSEGV/SIGABRT handler called; gdb batch file is `"<<Omega::instance().gdbCrashBatch<<"'"<<endl;
-			res=std::system((string("gdb -x ")+Omega::instance().gdbCrashBatch).c_str());
+			{ int res; res=std::system((string("gdb -x ")+Omega::instance().gdbCrashBatch).c_str()); } // braces to create scope for res
 			unlink(Omega::instance().gdbCrashBatch.c_str()); // delete the crash batch file
 			raise(sig); // reemit signal after exiting gdb
 			break;
@@ -132,6 +127,9 @@
 
 int main(int argc, char *argv[])
 {
+	#ifdef YADE_LOG4CXX
+		initLog4cxx();
+	#endif
 	Omega::instance();
 	ClassFactory::instance();
 	SerializableSingleton::instance();
@@ -150,7 +148,13 @@
 
 	bool useGdb=true;
 	
-	int ch; string gui="QtGUI"; string simulationFileName=""; bool setup=false; int verbose=0; bool coreOptions=true; bool explicitUI=false;
+	// default UI
+	#ifdef YADE_OPENGL
+		string gui="QtGUI";
+	#else
+		string gui="PythonUI";
+	#endif
+	int ch; string simulationFileName=""; bool setup=false; int verbose=0; bool coreOptions=true; bool explicitUI=false;
 	while(coreOptions && (ch=getopt(argc,argv,"+hnN:wC:cxvS:"))!=-1)
 		switch(ch){
 			case 'h': printHelp(); return 1;
@@ -175,11 +179,14 @@
 	#ifdef YADE_LOG4CXX
 		// read logging configuration from file and watch it (creates a separate thread)
 		std::string logConf=configPath+"/logging.conf";
+		if(getenv("YADE_DEBUG")){
+			logger->setLevel(debugLevel);
+			LOG_INFO("YADE_DEBUG environment variable is defined, logging level set to DEBUG.");
+		} else logger->setLevel(warnLevel);
 		if(filesystem::exists(logConf)){
 			log4cxx::PropertyConfigurator::configure(logConf);
 			LOG_INFO("Loading "<<logConf);
 		} else { // otherwise use simple console-directed logging
-			logger->setLevel(warnLevel);
 			LOG_INFO("Logger uses basic (console) configuration since `"<<logConf<<"' was not found. INFO and DEBUG messages will be omitted.");
 			LOG_INFO("Look at the file doc/logging.conf.sample in the source distribution as an example on how to customize logging.");
 		}

=== removed file 'pkg/dem/BasicPM.cpp'
--- pkg/dem/BasicPM.cpp	2009-12-01 10:15:34 +0000
+++ pkg/dem/BasicPM.cpp	1970-01-01 00:00:00 +0000
@@ -1,88 +0,0 @@
-/*C.W.Boon @ NOV 2009 */
-
-YADE_REQUIRE_FEATURE(abcd);
-
-#include"BasicPM.hpp"
-#include<yade/core/MetaBody.hpp>
-#include<yade/pkg-dem/BodyMacroParameters.hpp>
-#include<yade/pkg-dem/DemXDofGeom.hpp>
-
-
-
-YADE_PLUGIN((CundallStrackLaw)(Ip2_CSMat_CSMat_CSPhys));
-
-
-/********************** CundallStrackLaw ****************************/
-CREATE_LOGGER(CundallStrackLaw);
-
-void CundallStrackLaw::go(shared_ptr<InteractionGeometry>& ig, shared_ptr<InteractionPhysics>& ip, Interaction* contact, MetaBody* rootBody){
-	
-	Dem3DofGeom* geom=static_cast<Dem3DofGeom*>(ig.get());
-	CSPhys* phys=static_cast<CSPhys*>(ip.get());
-	
-	/*Normal Force */
-	Real displN=geom->displacementN();
-	if(displN>0){rootBody->interactions->requestErase(contact->getId1(),contact->getId2()); return; }
-	phys->normalForce=phys->kn*displN*geom->normal; //normalForce is a vector
-	
-	/*ShearForce*/
-	Real maxFsSq=phys->normalForce.SquaredLength()*pow(phys->tangensOfFrictionAngle,2);
-	Vector3r trialFs=phys->ks*geom->displacementT();
-	if(trialFs.SquaredLength()>maxFsSq){ geom->slipToDisplacementTMax(sqrt(maxFsSq)); trialFs*=sqrt(maxFsSq/(trialFs.SquaredLength()));}
-	phys->shearForce=trialFs;
-	
-	applyForceAtContactPoint(phys->normalForce+trialFs,geom->contactPoint,contact->getId1(),geom->se31.position,contact->getId2(),geom->se32.position,rootBody);
-}
-/********************CundallStrackLaw <end> ************************/
-
-
-
-/*****************************Ip2_CSMat_CSMat_CSPhys********************************/
-CREATE_LOGGER(Ip2_CSMat_CSMat_CSPhys);
-
-void Ip2_CSMat_CSMat_CSPhys::go(const shared_ptr<PhysicalParameters>& b1, const shared_ptr<PhysicalParameters>& b2 , const shared_ptr<Interaction>& interaction)
-{
-
-		
-		if(interaction->interactionPhysics) return;
-		//it could be other interactions by using if-else statements
-		Dem3DofGeom* d3dg=dynamic_cast<Dem3DofGeom*>(interaction->interactionGeometry.get());
-		assert(d3dg);
-
-			//const shared_ptr<CSMat>& csmat1=YADE_PTR_CAST<CSMat>(b1);
-			//const shared_ptr<CSMat>& csmat2=YADE_PTR_CAST<CSMat>(b2);
-
-			const shared_ptr<BodyMacroParameters>& sdec1 = YADE_PTR_CAST<BodyMacroParameters>(b1);
-			const shared_ptr<BodyMacroParameters>& sdec2 = YADE_PTR_CAST<BodyMacroParameters>(b2);
-			
-			shared_ptr<CSPhys> contactPhysics(new CSPhys()); //what if I declared it as constant?
-			
-			/* From interaction physics */
-			Real Ea 	= sdec1->young;
-			Real Eb 	= sdec2->young;
-			Real Va 	= sdec1->poisson;
-			Real Vb 	= sdec2->poisson;
-			Real fa 	= sdec1->frictionAngle;
-			Real fb 	= sdec2->frictionAngle;
-
-			/* From interaction geometry */
-			Real Da=d3dg->refR1>0?d3dg->refR1:d3dg->refR2; 
-			Real Db=d3dg->refR2>0?d3dg->refR2:d3dg->refR1; 
-			Vector3r normal=d3dg->normal;		  			
-			Real Kn = 2*Ea*Da*Eb*Db/(Ea*Da+Eb*Db);//harmonic average of two stiffnesses
-			Real Ks = 2*Ea*Da*Va*Eb*Db*Vb/(Ea*Da*Va+Eb*Db*Va);//harmonic average of two stiffnesses with ks=V*kn for each sphere
-
-			/* Pass values calculated from above to CSPhys */
-			contactPhysics->kn = Kn;
-			contactPhysics->ks = Ks;
-			contactPhysics->frictionAngle			= std::min(fa,fb); 
-			contactPhysics->tangensOfFrictionAngle		= std::tan(contactPhysics->frictionAngle); 
-			contactPhysics->prevNormal 			= normal;
-			
-
-}
-/*****************************Ip2_CSMat_CSMat_CSPhys <end>********************************/
-
-
-
-

=== removed file 'pkg/dem/BasicPM.hpp'
--- pkg/dem/BasicPM.hpp	2009-12-01 10:15:34 +0000
+++ pkg/dem/BasicPM.hpp	1970-01-01 00:00:00 +0000
@@ -1,64 +0,0 @@
-/* C.W.Boon @ NOV 2009 */
-YADE_REQUIRE_FEATURE(abcd);
-#pragma once
-
-#include<yade/pkg-dem/BodyMacroParameters.hpp> //Superclass for body properties
-#include<yade/pkg-common/InteractionPhysicsEngineUnit.hpp> //Superclass to link body and interaction properties
-#include<yade/pkg-common/NormalShearInteractions.hpp> //Superclass for interaction properties 
-#include<yade/pkg-common/ConstitutiveLaw.hpp> //Superclass for contact laws
-
-/* Contact Law */
-class CundallStrackLaw: public ConstitutiveLaw{
-	public:
-		
-		virtual void go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, MetaBody* rootBody);
-		FUNCTOR2D(Dem3DofGeom,CSPhys);
-		REGISTER_CLASS_AND_BASE(CundallStrackLaw,ConstitutiveLaw);
-		REGISTER_ATTRIBUTES(ConstitutiveLaw,/*nothing here*/);
-		DECLARE_LOGGER;	
-};
-REGISTER_SERIALIZABLE(CundallStrackLaw);
-
-/* This class stores body properties */
-/* Superclass:BodyMacroParameters has poisson, frictionAngle; ElasticBodyParameters has young's modulus */
-class CSMat: public BodyMacroParameters {
-	public:
-		CSMat(){createIndex();};
-		REGISTER_ATTRIBUTES(BodyMacroParameters, /*nothing here*/);
-		REGISTER_CLASS_AND_BASE(CSMat,BodyMacroParameters);
-		REGISTER_CLASS_INDEX(CSMat,BodyMacroParameters);
-};
-REGISTER_SERIALIZABLE(CSMat);
-
-/* This class links body and interaction properties */
-/* It does not store variables */
-class Ip2_CSMat_CSMat_CSPhys: public InteractionPhysicsEngineUnit{
-	public:
-		Ip2_CSMat_CSMat_CSPhys(){};
-		virtual void go(const shared_ptr<PhysicalParameters>& b1, const shared_ptr<PhysicalParameters>& b2, const shared_ptr<Interaction>& interaction);
-		REGISTER_ATTRIBUTES(InteractionPhysicsEngineUnit,/*nothing here*/);
-		FUNCTOR2D(CSMat,CSMat);
-		REGISTER_CLASS_AND_BASE(Ip2_CSMat_CSMat_CSPhys,InteractionPhysicsEngineUnit);
-		DECLARE_LOGGER;
-};
-REGISTER_SERIALIZABLE(Ip2_CSMat_CSMat_CSPhys);
-
-
-/* This class stores interaction properties */
-/* Superclass:Normal NormalShearInteraction has kn, <vector> normalForce, ks, <vector> shearForce */
-class CSPhys: public NormalShearInteraction {
-	public:
-		CSPhys(){createIndex();};
-
-		// kn,ks,normal inherited from NormalShearInteraction
-		Real 		frictionAngle 			// angle of friction, according to Coulumb criterion
-				,tangensOfFrictionAngle
-				;	
-		Vector3r	prevNormal;			// unit normal of the contact plane.
-		
-	virtual ~CSPhys(){};
-	REGISTER_ATTRIBUTES(NormalShearInteraction,(frictionAngle)(tangensOfFrictionAngle));
-	REGISTER_CLASS_AND_BASE(CSPhys,NormalShearInteraction);
-	REGISTER_CLASS_INDEX(CSPhys,NormalShearInteraction);
-};
-REGISTER_SERIALIZABLE(CSPhys);

=== removed file 'pkg/dem/BasicPMTest.py'
--- pkg/dem/BasicPMTest.py	2009-12-01 10:15:34 +0000
+++ pkg/dem/BasicPMTest.py	1970-01-01 00:00:00 +0000
@@ -1,65 +0,0 @@
-#! file to test BasicPM.cpp
-# -*- coding: utf-8 -*-
-YADE_REQUIRE_FEATURE(abcd),
-#!/usr/local/bin/yade-trunk -x
-# -*- coding: utf-8 -*-
-# -*- encoding=utf-8 -*-
-
-
-o=Omega()
-o.initializers=[
-	BoundingVolumeMetaEngine([InteractingSphere2AABB(),MetaInteractingGeometry2AABB()])
-]
-
-o.engines=[
-	
-	BexResetter(),
-	
-	BoundingVolumeMetaEngine([
-		InteractingSphere2AABB(),
-		MetaInteractingGeometry2AABB()
-	]),
-	
-	InsertionSortCollider(),
-	
-	InteractionGeometryMetaEngine([
-		ef2_Sphere_Sphere_Dem3DofGeom()
-	]),
-	
-	InteractionPhysicsMetaEngine([Ip2_CSMat_CSMat_CSPhys()]),
-	
-	CundallStrackLaw(),
-
-	
-	GravityEngine(gravity=[0,0,-9.81]),
-	
-	
-	
-	PhysicalActionApplier([
-		NewtonsForceLaw(),
-		NewtonsMomentumLaw(),
-	]),
-
-	PhysicalParametersMetaEngine([LeapFrogPositionIntegrator()]),
-
-	PhysicalParametersMetaEngine([LeapFrogOrientationIntegrator()])
-
-]
-
-
-from yade import utils
-
-for b in o.bodies:
-  b.mask = 1
-
-o.bodies.append(utils.sphere([0,0,2],1,dynamic = False, color=[0,1,0],young=30e9,poisson=.3,density=2400))
-o.bodies.append(utils.sphere([0,0,6],1,color=[0,0,1],young=30e9,poisson=.3,density=2400))
-
-o.dt=.2*utils.PWaveTimeStep()
-
-
-from yade import qt
-qt.Controller()
-qt.View()
-
- 

=== added file 'pkg/dem/meta/BasicPM.cpp'
--- pkg/dem/meta/BasicPM.cpp	1970-01-01 00:00:00 +0000
+++ pkg/dem/meta/BasicPM.cpp	2009-12-01 10:17:57 +0000
@@ -0,0 +1,88 @@
+/*C.W.Boon @ NOV 2009 */
+
+YADE_REQUIRE_FEATURE(abcd);
+
+#include"BasicPM.hpp"
+#include<yade/core/MetaBody.hpp>
+#include<yade/pkg-dem/BodyMacroParameters.hpp>
+#include<yade/pkg-dem/DemXDofGeom.hpp>
+
+
+
+YADE_PLUGIN((CundallStrackLaw)(Ip2_CSMat_CSMat_CSPhys));
+
+
+/********************** CundallStrackLaw ****************************/
+CREATE_LOGGER(CundallStrackLaw);
+
+void CundallStrackLaw::go(shared_ptr<InteractionGeometry>& ig, shared_ptr<InteractionPhysics>& ip, Interaction* contact, MetaBody* rootBody){
+	
+	Dem3DofGeom* geom=static_cast<Dem3DofGeom*>(ig.get());
+	CSPhys* phys=static_cast<CSPhys*>(ip.get());
+	
+	/*Normal Force */
+	Real displN=geom->displacementN();
+	if(displN>0){rootBody->interactions->requestErase(contact->getId1(),contact->getId2()); return; }
+	phys->normalForce=phys->kn*displN*geom->normal; //normalForce is a vector
+	
+	/*ShearForce*/
+	Real maxFsSq=phys->normalForce.SquaredLength()*pow(phys->tangensOfFrictionAngle,2);
+	Vector3r trialFs=phys->ks*geom->displacementT();
+	if(trialFs.SquaredLength()>maxFsSq){ geom->slipToDisplacementTMax(sqrt(maxFsSq)); trialFs*=sqrt(maxFsSq/(trialFs.SquaredLength()));}
+	phys->shearForce=trialFs;
+	
+	applyForceAtContactPoint(phys->normalForce+trialFs,geom->contactPoint,contact->getId1(),geom->se31.position,contact->getId2(),geom->se32.position,rootBody);
+}
+/********************CundallStrackLaw <end> ************************/
+
+
+
+/*****************************Ip2_CSMat_CSMat_CSPhys********************************/
+CREATE_LOGGER(Ip2_CSMat_CSMat_CSPhys);
+
+void Ip2_CSMat_CSMat_CSPhys::go(const shared_ptr<PhysicalParameters>& b1, const shared_ptr<PhysicalParameters>& b2 , const shared_ptr<Interaction>& interaction)
+{
+
+		
+		if(interaction->interactionPhysics) return;
+		//it could be other interactions by using if-else statements
+		Dem3DofGeom* d3dg=dynamic_cast<Dem3DofGeom*>(interaction->interactionGeometry.get());
+		assert(d3dg);
+
+			//const shared_ptr<CSMat>& csmat1=YADE_PTR_CAST<CSMat>(b1);
+			//const shared_ptr<CSMat>& csmat2=YADE_PTR_CAST<CSMat>(b2);
+
+			const shared_ptr<BodyMacroParameters>& sdec1 = YADE_PTR_CAST<BodyMacroParameters>(b1);
+			const shared_ptr<BodyMacroParameters>& sdec2 = YADE_PTR_CAST<BodyMacroParameters>(b2);
+			
+			shared_ptr<CSPhys> contactPhysics(new CSPhys()); //what if I declared it as constant?
+			
+			/* From interaction physics */
+			Real Ea 	= sdec1->young;
+			Real Eb 	= sdec2->young;
+			Real Va 	= sdec1->poisson;
+			Real Vb 	= sdec2->poisson;
+			Real fa 	= sdec1->frictionAngle;
+			Real fb 	= sdec2->frictionAngle;
+
+			/* From interaction geometry */
+			Real Da=d3dg->refR1>0?d3dg->refR1:d3dg->refR2; 
+			Real Db=d3dg->refR2>0?d3dg->refR2:d3dg->refR1; 
+			Vector3r normal=d3dg->normal;		  			
+			Real Kn = 2*Ea*Da*Eb*Db/(Ea*Da+Eb*Db);//harmonic average of two stiffnesses
+			Real Ks = 2*Ea*Da*Va*Eb*Db*Vb/(Ea*Da*Va+Eb*Db*Va);//harmonic average of two stiffnesses with ks=V*kn for each sphere
+
+			/* Pass values calculated from above to CSPhys */
+			contactPhysics->kn = Kn;
+			contactPhysics->ks = Ks;
+			contactPhysics->frictionAngle			= std::min(fa,fb); 
+			contactPhysics->tangensOfFrictionAngle		= std::tan(contactPhysics->frictionAngle); 
+			contactPhysics->prevNormal 			= normal;
+			
+
+}
+/*****************************Ip2_CSMat_CSMat_CSPhys <end>********************************/
+
+
+
+

=== added file 'pkg/dem/meta/BasicPM.hpp'
--- pkg/dem/meta/BasicPM.hpp	1970-01-01 00:00:00 +0000
+++ pkg/dem/meta/BasicPM.hpp	2009-12-01 10:17:57 +0000
@@ -0,0 +1,64 @@
+/* C.W.Boon @ NOV 2009 */
+YADE_REQUIRE_FEATURE(abcd);
+#pragma once
+
+#include<yade/pkg-dem/BodyMacroParameters.hpp> //Superclass for body properties
+#include<yade/pkg-common/InteractionPhysicsEngineUnit.hpp> //Superclass to link body and interaction properties
+#include<yade/pkg-common/NormalShearInteractions.hpp> //Superclass for interaction properties 
+#include<yade/pkg-common/ConstitutiveLaw.hpp> //Superclass for contact laws
+
+/* Contact Law */
+class CundallStrackLaw: public ConstitutiveLaw{
+	public:
+		
+		virtual void go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, MetaBody* rootBody);
+		FUNCTOR2D(Dem3DofGeom,CSPhys);
+		REGISTER_CLASS_AND_BASE(CundallStrackLaw,ConstitutiveLaw);
+		REGISTER_ATTRIBUTES(ConstitutiveLaw,/*nothing here*/);
+		DECLARE_LOGGER;	
+};
+REGISTER_SERIALIZABLE(CundallStrackLaw);
+
+/* This class stores body properties */
+/* Superclass:BodyMacroParameters has poisson, frictionAngle; ElasticBodyParameters has young's modulus */
+class CSMat: public BodyMacroParameters {
+	public:
+		CSMat(){createIndex();};
+		REGISTER_ATTRIBUTES(BodyMacroParameters, /*nothing here*/);
+		REGISTER_CLASS_AND_BASE(CSMat,BodyMacroParameters);
+		REGISTER_CLASS_INDEX(CSMat,BodyMacroParameters);
+};
+REGISTER_SERIALIZABLE(CSMat);
+
+/* This class links body and interaction properties */
+/* It does not store variables */
+class Ip2_CSMat_CSMat_CSPhys: public InteractionPhysicsEngineUnit{
+	public:
+		Ip2_CSMat_CSMat_CSPhys(){};
+		virtual void go(const shared_ptr<PhysicalParameters>& b1, const shared_ptr<PhysicalParameters>& b2, const shared_ptr<Interaction>& interaction);
+		REGISTER_ATTRIBUTES(InteractionPhysicsEngineUnit,/*nothing here*/);
+		FUNCTOR2D(CSMat,CSMat);
+		REGISTER_CLASS_AND_BASE(Ip2_CSMat_CSMat_CSPhys,InteractionPhysicsEngineUnit);
+		DECLARE_LOGGER;
+};
+REGISTER_SERIALIZABLE(Ip2_CSMat_CSMat_CSPhys);
+
+
+/* This class stores interaction properties */
+/* Superclass:Normal NormalShearInteraction has kn, <vector> normalForce, ks, <vector> shearForce */
+class CSPhys: public NormalShearInteraction {
+	public:
+		CSPhys(){createIndex();};
+
+		// kn,ks,normal inherited from NormalShearInteraction
+		Real 		frictionAngle 			// angle of friction, according to Coulumb criterion
+				,tangensOfFrictionAngle
+				;	
+		Vector3r	prevNormal;			// unit normal of the contact plane.
+		
+	virtual ~CSPhys(){};
+	REGISTER_ATTRIBUTES(NormalShearInteraction,(frictionAngle)(tangensOfFrictionAngle));
+	REGISTER_CLASS_AND_BASE(CSPhys,NormalShearInteraction);
+	REGISTER_CLASS_INDEX(CSPhys,NormalShearInteraction);
+};
+REGISTER_SERIALIZABLE(CSPhys);

=== added file 'pkg/dem/meta/BasicPMTest.py'
--- pkg/dem/meta/BasicPMTest.py	1970-01-01 00:00:00 +0000
+++ pkg/dem/meta/BasicPMTest.py	2009-12-01 10:17:57 +0000
@@ -0,0 +1,65 @@
+#! file to test BasicPM.cpp
+# -*- coding: utf-8 -*-
+YADE_REQUIRE_FEATURE(abcd),
+#!/usr/local/bin/yade-trunk -x
+# -*- coding: utf-8 -*-
+# -*- encoding=utf-8 -*-
+
+
+o=Omega()
+o.initializers=[
+	BoundingVolumeMetaEngine([InteractingSphere2AABB(),MetaInteractingGeometry2AABB()])
+]
+
+o.engines=[
+	
+	BexResetter(),
+	
+	BoundingVolumeMetaEngine([
+		InteractingSphere2AABB(),
+		MetaInteractingGeometry2AABB()
+	]),
+	
+	InsertionSortCollider(),
+	
+	InteractionGeometryMetaEngine([
+		ef2_Sphere_Sphere_Dem3DofGeom()
+	]),
+	
+	InteractionPhysicsMetaEngine([Ip2_CSMat_CSMat_CSPhys()]),
+	
+	CundallStrackLaw(),
+
+	
+	GravityEngine(gravity=[0,0,-9.81]),
+	
+	
+	
+	PhysicalActionApplier([
+		NewtonsForceLaw(),
+		NewtonsMomentumLaw(),
+	]),
+
+	PhysicalParametersMetaEngine([LeapFrogPositionIntegrator()]),
+
+	PhysicalParametersMetaEngine([LeapFrogOrientationIntegrator()])
+
+]
+
+
+from yade import utils
+
+for b in o.bodies:
+  b.mask = 1
+
+o.bodies.append(utils.sphere([0,0,2],1,dynamic = False, color=[0,1,0],young=30e9,poisson=.3,density=2400))
+o.bodies.append(utils.sphere([0,0,6],1,color=[0,0,1],young=30e9,poisson=.3,density=2400))
+
+o.dt=.2*utils.PWaveTimeStep()
+
+
+from yade import qt
+qt.Controller()
+qt.View()
+
+