← Back to team overview

yade-dev team mailing list archive

[svn] r1822 - in trunk: pkg/dem/Engine/StandAloneEngine scripts scripts/test

 

Author: eudoxos
Date: 2009-06-29 10:55:00 +0200 (Mon, 29 Jun 2009)
New Revision: 1822

Modified:
   trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.hpp
   trunk/scripts/test-sphere-facet.py
   trunk/scripts/test/facet-sphere.py
   trunk/scripts/test/gts.py
   trunk/scripts/test/insertion-sort-collider.py
   trunk/scripts/test/regular-sphere-pack.py
Log:
1. Rename ef2_Dem3Dof_Elastic_ElasticLaw to Law2_Dem3Dof_Elastic_Elastic (in scripts as well)



Modified: trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.cpp	2009-06-29 08:47:31 UTC (rev 1821)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.cpp	2009-06-29 08:55:00 UTC (rev 1822)
@@ -17,7 +17,7 @@
 
 #include<yade/extra/Shop.hpp>
 
-YADE_PLUGIN("ef2_Spheres_Elastic_ElasticLaw","ef2_Dem3Dof_Elastic_ElasticLaw","ElasticContactLaw");
+YADE_PLUGIN("ef2_Spheres_Elastic_ElasticLaw","Law2_Dem3Dof_Elastic_Elastic","ElasticContactLaw");
 
 
 ElasticContactLaw::ElasticContactLaw() : InteractionSolver()
@@ -112,7 +112,7 @@
 }
 
 // same as elasticContactLaw, but using Dem3DofGeom
-void ef2_Dem3Dof_Elastic_ElasticLaw::go(shared_ptr<InteractionGeometry>& ig, shared_ptr<InteractionPhysics>& ip, Interaction* contact, MetaBody* rootBody){
+void Law2_Dem3Dof_Elastic_Elastic::go(shared_ptr<InteractionGeometry>& ig, shared_ptr<InteractionPhysics>& ip, Interaction* contact, MetaBody* rootBody){
 	Dem3DofGeom* geom=static_cast<Dem3DofGeom*>(ig.get());
 	ElasticContactInteraction* phys=static_cast<ElasticContactInteraction*>(ip.get());
 	Real displN=geom->displacementN();
@@ -120,6 +120,6 @@
 	phys->normalForce=phys->kn*displN*geom->normal;
 	Real maxFsSq=phys->normalForce.SquaredLength()*pow(phys->tangensOfFrictionAngle,2);
 	Vector3r trialFs=phys->ks*geom->displacementT();
-	if(trialFs.SquaredLength()>maxFsSq){ geom->slipToDisplacementTMax(sqrt(maxFsSq)); trialFs*=maxFsSq/(trialFs.SquaredLength());} 
+	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);
 }

Modified: trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.hpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.hpp	2009-06-29 08:47:31 UTC (rev 1821)
+++ trunk/pkg/dem/Engine/StandAloneEngine/ElasticContactLaw.hpp	2009-06-29 08:55:00 UTC (rev 1822)
@@ -42,14 +42,20 @@
 };
 REGISTER_SERIALIZABLE(ef2_Spheres_Elastic_ElasticLaw);
 
-class ef2_Dem3Dof_Elastic_ElasticLaw: public ConstitutiveLaw{
+/* Constitutive law for linear compression, no tension, and linear plasticity surface.
+
+This class serves also as tutorial and is documented in detail at
+
+	http://yade.wikia.com/wiki/ConstitutiveLawHowto
+*/
+class Law2_Dem3Dof_Elastic_Elastic: public ConstitutiveLaw{
 	public:
 		virtual void go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, MetaBody* rootBody);
 		FUNCTOR2D(Dem3DofGeom,ElasticContactInteraction);
-		REGISTER_CLASS_AND_BASE(ef2_Dem3Dof_Elastic_ElasticLaw,ConstitutiveLaw);
+		REGISTER_CLASS_AND_BASE(Law2_Dem3Dof_Elastic_Elastic,ConstitutiveLaw);
 		REGISTER_ATTRIBUTES(ConstitutiveLaw,/*nothing here*/);
 };
-REGISTER_SERIALIZABLE(ef2_Dem3Dof_Elastic_ElasticLaw);
+REGISTER_SERIALIZABLE(Law2_Dem3Dof_Elastic_Elastic);
 
 class ElasticContactLaw : public InteractionSolver
 {

Modified: trunk/scripts/test/facet-sphere.py
===================================================================
--- trunk/scripts/test/facet-sphere.py	2009-06-29 08:47:31 UTC (rev 1821)
+++ trunk/scripts/test/facet-sphere.py	2009-06-29 08:55:00 UTC (rev 1822)
@@ -9,7 +9,7 @@
 	InteractionDispatchers(
 		[ef2_Facet_Sphere_Dem3DofGeom()],
 		[SimpleElasticRelationships()],
-		[ef2_Dem3Dof_Elastic_ElasticLaw()],
+		[Law2_Dem3Dof_Elastic_Elastic()],
 	),
 	GravityEngine(gravity=[0,0,-10]),
 	NewtonsDampedLaw(damping=0.01),

Modified: trunk/scripts/test/gts.py
===================================================================
--- trunk/scripts/test/gts.py	2009-06-29 08:47:31 UTC (rev 1821)
+++ trunk/scripts/test/gts.py	2009-06-29 08:55:00 UTC (rev 1822)
@@ -33,7 +33,7 @@
 	InteractionDispatchers(
 		[ef2_Sphere_Sphere_Dem3DofGeom(),ef2_Facet_Sphere_Dem3DofGeom()],
 		[SimpleElasticRelationships()],
-		[ef2_Dem3Dof_Elastic_ElasticLaw()],
+		[Law2_Dem3Dof_Elastic_Elastic()],
 	),
 	GravityEngine(gravity=[0,0,-1e4]),
 	NewtonsDampedLaw(damping=.1)

Modified: trunk/scripts/test/insertion-sort-collider.py
===================================================================
--- trunk/scripts/test/insertion-sort-collider.py	2009-06-29 08:47:31 UTC (rev 1821)
+++ trunk/scripts/test/insertion-sort-collider.py	2009-06-29 08:55:00 UTC (rev 1822)
@@ -4,7 +4,7 @@
 	BexResetter(),
 	BoundingVolumeMetaEngine([InteractingSphere2AABB(),InteractingBox2AABB(),InteractingFacet2AABB(),MetaInteractingGeometry2AABB()]),
 	InsertionSortCollider(),
-	InteractionDispatchers([ef2_Facet_Sphere_Dem3DofGeom()],[SimpleElasticRelationships()],[ef2_Dem3Dof_Elastic_ElasticLaw()],),
+	InteractionDispatchers([ef2_Facet_Sphere_Dem3DofGeom()],[SimpleElasticRelationships()],[Law2_Dem3Dof_Elastic_Elastic()],),
 	GravityEngine(gravity=[0,0,-10]),
 	NewtonsDampedLaw(damping=0.01),
 ]

Modified: trunk/scripts/test/regular-sphere-pack.py
===================================================================
--- trunk/scripts/test/regular-sphere-pack.py	2009-06-29 08:47:31 UTC (rev 1821)
+++ trunk/scripts/test/regular-sphere-pack.py	2009-06-29 08:55:00 UTC (rev 1822)
@@ -50,7 +50,7 @@
 	InteractionDispatchers(
 		[ef2_Sphere_Sphere_Dem3DofGeom(),ef2_Facet_Sphere_Dem3DofGeom()],
 		[SimpleElasticRelationships()],
-		[ef2_Dem3Dof_Elastic_ElasticLaw()],
+		[Law2_Dem3Dof_Elastic_Elastic()],
 	),
 	GravityEngine(gravity=(1e-2,1e-2,-1000)),
 	NewtonsDampedLaw(damping=.1)

Modified: trunk/scripts/test-sphere-facet.py
===================================================================
--- trunk/scripts/test-sphere-facet.py	2009-06-29 08:47:31 UTC (rev 1821)
+++ trunk/scripts/test-sphere-facet.py	2009-06-29 08:55:00 UTC (rev 1822)
@@ -35,11 +35,11 @@
 #	]),
 #	MetaEngine('InteractionPhysicsMetaEngine',[EngineUnit('SimpleElasticRelationships')]),
 #	#StandAloneEngine('ElasticContactLaw'),
-#	ConstitutiveLawDispatcher([ef2_Dem3Dof_Elastic_ElasticLaw()]),
+#	ConstitutiveLawDispatcher([Law2_Dem3Dof_Elastic_Elastic()]),
 	InteractionDispatchers(
 		[ef2_Facet_Sphere_Dem3DofGeom()],
 		[SimpleElasticRelationships()],
-		[ef2_Dem3Dof_Elastic_ElasticLaw()],
+		[Law2_Dem3Dof_Elastic_Elastic()],
 	),
 	DeusExMachina('GravityEngine',{'gravity':[0,0,-sign*500],'label':'gravitator'}),
 	DeusExMachina("NewtonsDampedLaw",{'damping':0.8}),




Follow ups