← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3765: Tiny updates of examples of LudingPM.

 

------------------------------------------------------------
revno: 3765
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Wed 2015-12-16 08:49:14 +0100
message:
  Tiny updates of examples of LudingPM.
removed:
  examples/LudingPM.py
added:
  examples/LudingPM/
  examples/LudingPM/LudingPM_1.py
  examples/LudingPM/LudingPM_2.py
  examples/LudingPM/README
modified:
  pkg/dem/LudingPM.hpp


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

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== added directory 'examples/LudingPM'
=== removed file 'examples/LudingPM.py'
--- examples/LudingPM.py	2013-10-11 19:59:57 +0000
+++ examples/LudingPM.py	1970-01-01 00:00:00 +0000
@@ -1,104 +0,0 @@
-#!/usr/bin/env python
-# encoding: utf-8
-from yade import utils, plot
-o = Omega()
-
-fr = 0.5;rho=2000
-
-o.dt = 0.00002
-
-r1 = 2.0e-1
-r2 = 2.0e-1
-#=======================================
-k1 = 105.0
-kp = 5.0*k1
-kc = k1
-
-DeltaPMax = 0.031
-Chi1 = 0.34
-Chi2 = 0.69
-Chi3 = 1.1
-Chi4 = 1.39
-#=======================================
-
-particleMass = 4.0/3.0*math.pi*r1*r1*r1*rho
-Vi1 = math.sqrt(k1/particleMass)*DeltaPMax*Chi1
-Vi2 = math.sqrt(k1/particleMass)*DeltaPMax*Chi2
-Vi3 = math.sqrt(k1/particleMass)*DeltaPMax*Chi3
-Vi4 = math.sqrt(k1/particleMass)*DeltaPMax*Chi4
-
-PhiF1 = DeltaPMax*(kp-k1)*(r1+r2)/(kp*2*r1*r2)
-PhiF2 = DeltaPMax*(kp-k1)*(r1+r2)/(kp*2*r1*r2)
-PhiF3 = DeltaPMax*(kp-k1)*(r1+r2)/(kp*2*r1*r2)
-PhiF4 = DeltaPMax*(kp-k1)*(r1+r2)/(kp*2*r1*r2)
-
-#=======================================
-
-mat1 = O.materials.append(LudingMat(frictionAngle=fr,density=rho,k1=k1, kp=kp, kc=kc, PhiF=PhiF1, G0 = 0.0))
-mat2 = O.materials.append(LudingMat(frictionAngle=fr,density=rho,k1=k1, kp=kp, kc=kc, PhiF=PhiF2, G0 = 0.0))
-mat3 = O.materials.append(LudingMat(frictionAngle=fr,density=rho,k1=k1, kp=kp, kc=kc, PhiF=PhiF3, G0 = 0.0))
-mat4 = O.materials.append(LudingMat(frictionAngle=fr,density=rho,k1=k1, kp=kp, kc=kc, PhiF=PhiF4, G0 = 0.0))
-
-id11 = O.bodies.append(sphere(center=[0,0,0],radius=r1,material=mat1,fixed=True))
-id12 = O.bodies.append(sphere(center=[0,0,(r1 + r2)],radius=r2,material=mat1,fixed=False))
-
-id21 = O.bodies.append(sphere(center=[0,3.0*r1,0],radius=r1,material=mat2,fixed=True))
-id22 = O.bodies.append(sphere(center=[0,3.0*r1,(r1 + r2)],radius=r2,material=mat2,fixed=False))
-
-id31 = O.bodies.append(sphere(center=[0,6.0*r1,0],radius=r1,material=mat3,fixed=True))
-id32 = O.bodies.append(sphere(center=[0,6.0*r1,(r1 + r2)],radius=r2,material=mat3,fixed=False))
-
-id41 = O.bodies.append(sphere(center=[0,9.0*r1,0],radius=r1,material=mat4,fixed=True))
-id42 = O.bodies.append(sphere(center=[0,9.0*r1,(r1 + r2)],radius=r2,material=mat4,fixed=False))
-
-
-o.engines = [
-  ForceResetter(),
-  InsertionSortCollider([Bo1_Sphere_Aabb()]),
-  InteractionLoop(
-    [Ig2_Sphere_Sphere_ScGeom()],
-    [Ip2_LudingMat_LudingMat_LudingPhys()],
-    [Law2_ScGeom_LudingPhys_Basic()],
-  ),
-  NewtonIntegrator(damping=0,gravity=[0,0,0]),
-  PyRunner(command='addPlotData()',iterPeriod=1000),
-]
-
-O.bodies[id12].state.vel=[0,0,-Vi1]
-O.bodies[id22].state.vel=[0,0,-Vi2]
-O.bodies[id32].state.vel=[0,0,-Vi3]
-O.bodies[id42].state.vel=[0,0,-Vi4]
-
-def addPlotData(): 
-  f1 = [0,0,0]
-  f2 = [0,0,0]
-  f3 = [0,0,0]
-  f4 = [0,0,0]
-  
-  try:
-    f1=O.forces.f(id12)
-    f2=O.forces.f(id22)
-    f3=O.forces.f(id32)
-    f4=O.forces.f(id42)
-  except:
-    f1 = [0,0,0]
-    f2 = [0,0,0]
-    f3 = [0,0,0]
-    f4 = [0,0,0]
-  
-  s1 = (O.bodies[id12].state.pos[2]-O.bodies[id11].state.pos[2])-(r1 + r2)
-  s2 = (O.bodies[id22].state.pos[2]-O.bodies[id21].state.pos[2])-(r1 + r2)
-  s3 = (O.bodies[id32].state.pos[2]-O.bodies[id31].state.pos[2])-(r1 + r2)
-  s4 = (O.bodies[id42].state.pos[2]-O.bodies[id41].state.pos[2])-(r1 + r2)
-  
-    
-  plot.addData(fc1=f1[2], sc1=-s1, fc2=f2[2], sc2=-s2, fc3=f3[2], sc3=-s3, fc4=f4[2], sc4=-s4)
-
-plot.plots={'sc1':('fc1'), 'sc2':('fc2'), 'sc3':('fc3'), 'sc4':('fc4')}; plot.plot()
-
-from yade import qt
-qt.View()
-
-O.run(320000)
-O.wait()
-plot.saveGnuplot('sim-data_LudigPM')

=== added file 'examples/LudingPM/LudingPM_1.py'
--- examples/LudingPM/LudingPM_1.py	1970-01-01 00:00:00 +0000
+++ examples/LudingPM/LudingPM_1.py	2015-12-16 07:49:14 +0000
@@ -0,0 +1,104 @@
+#!/usr/bin/env python
+# encoding: utf-8
+from yade import utils, plot
+o = Omega()
+
+fr = 0.5;rho=2000
+
+o.dt = 0.00002
+
+r1 = 2.0e-1
+r2 = 2.0e-1
+#=======================================
+k1 = 105.0
+kp = 5.0*k1
+kc = k1
+
+DeltaPMax = 0.031
+Chi1 = 0.34
+Chi2 = 0.69
+Chi3 = 1.1
+Chi4 = 1.39
+#=======================================
+
+particleMass = 4.0/3.0*math.pi*r1*r1*r1*rho
+Vi1 = math.sqrt(k1/particleMass)*DeltaPMax*Chi1
+Vi2 = math.sqrt(k1/particleMass)*DeltaPMax*Chi2
+Vi3 = math.sqrt(k1/particleMass)*DeltaPMax*Chi3
+Vi4 = math.sqrt(k1/particleMass)*DeltaPMax*Chi4
+
+PhiF1 = DeltaPMax*(kp-k1)*(r1+r2)/(kp*2*r1*r2)
+PhiF2 = DeltaPMax*(kp-k1)*(r1+r2)/(kp*2*r1*r2)
+PhiF3 = DeltaPMax*(kp-k1)*(r1+r2)/(kp*2*r1*r2)
+PhiF4 = DeltaPMax*(kp-k1)*(r1+r2)/(kp*2*r1*r2)
+
+#=======================================
+
+mat1 = O.materials.append(LudingMat(frictionAngle=fr,density=rho,k1=k1, kp=kp, kc=kc, PhiF=PhiF1, G0 = 0.0))
+mat2 = O.materials.append(LudingMat(frictionAngle=fr,density=rho,k1=k1, kp=kp, kc=kc, PhiF=PhiF2, G0 = 0.0))
+mat3 = O.materials.append(LudingMat(frictionAngle=fr,density=rho,k1=k1, kp=kp, kc=kc, PhiF=PhiF3, G0 = 0.0))
+mat4 = O.materials.append(LudingMat(frictionAngle=fr,density=rho,k1=k1, kp=kp, kc=kc, PhiF=PhiF4, G0 = 0.0))
+
+id11 = O.bodies.append(sphere(center=[0,0,0],radius=r1,material=mat1,fixed=True))
+id12 = O.bodies.append(sphere(center=[0,0,(r1 + r2)],radius=r2,material=mat1,fixed=False))
+
+id21 = O.bodies.append(sphere(center=[0,3.0*r1,0],radius=r1,material=mat2,fixed=True))
+id22 = O.bodies.append(sphere(center=[0,3.0*r1,(r1 + r2)],radius=r2,material=mat2,fixed=False))
+
+id31 = O.bodies.append(sphere(center=[0,6.0*r1,0],radius=r1,material=mat3,fixed=True))
+id32 = O.bodies.append(sphere(center=[0,6.0*r1,(r1 + r2)],radius=r2,material=mat3,fixed=False))
+
+id41 = O.bodies.append(sphere(center=[0,9.0*r1,0],radius=r1,material=mat4,fixed=True))
+id42 = O.bodies.append(sphere(center=[0,9.0*r1,(r1 + r2)],radius=r2,material=mat4,fixed=False))
+
+
+o.engines = [
+  ForceResetter(),
+  InsertionSortCollider([Bo1_Sphere_Aabb()]),
+  InteractionLoop(
+    [Ig2_Sphere_Sphere_ScGeom()],
+    [Ip2_LudingMat_LudingMat_LudingPhys()],
+    [Law2_ScGeom_LudingPhys_Basic()],
+  ),
+  NewtonIntegrator(damping=0,gravity=[0,0,0]),
+  PyRunner(command='addPlotData()',iterPeriod=1000),
+]
+
+O.bodies[id12].state.vel=[0,0,-Vi1]
+O.bodies[id22].state.vel=[0,0,-Vi2]
+O.bodies[id32].state.vel=[0,0,-Vi3]
+O.bodies[id42].state.vel=[0,0,-Vi4]
+
+def addPlotData(): 
+  f1 = [0,0,0]
+  f2 = [0,0,0]
+  f3 = [0,0,0]
+  f4 = [0,0,0]
+  
+  try:
+    f1=O.forces.f(id12)
+    f2=O.forces.f(id22)
+    f3=O.forces.f(id32)
+    f4=O.forces.f(id42)
+  except:
+    f1 = [0,0,0]
+    f2 = [0,0,0]
+    f3 = [0,0,0]
+    f4 = [0,0,0]
+  
+  s1 = (O.bodies[id12].state.pos[2]-O.bodies[id11].state.pos[2])-(r1 + r2)
+  s2 = (O.bodies[id22].state.pos[2]-O.bodies[id21].state.pos[2])-(r1 + r2)
+  s3 = (O.bodies[id32].state.pos[2]-O.bodies[id31].state.pos[2])-(r1 + r2)
+  s4 = (O.bodies[id42].state.pos[2]-O.bodies[id41].state.pos[2])-(r1 + r2)
+  
+    
+  plot.addData(fc1=f1[2], sc1=-s1, fc2=f2[2], sc2=-s2, fc3=f3[2], sc3=-s3, fc4=f4[2], sc4=-s4)
+
+plot.plots={'sc1':('fc1'), 'sc2':('fc2'), 'sc3':('fc3'), 'sc4':('fc4')}; plot.plot()
+
+from yade import qt
+qt.View()
+
+O.run(320000)
+O.wait()
+plot.saveGnuplot('sim-data_LudigPM')

=== added file 'examples/LudingPM/LudingPM_2.py'
--- examples/LudingPM/LudingPM_2.py	1970-01-01 00:00:00 +0000
+++ examples/LudingPM/LudingPM_2.py	2015-12-16 07:49:14 +0000
@@ -0,0 +1,73 @@
+#!/usr/bin/env python
+# encoding: utf-8
+from yade import utils, plot
+o = Omega()
+
+fr = 0.5;rho=2000
+
+o.dt = 0.00002
+
+r1 = 2.0e-1
+r2 = 2.0e-1
+#=======================================
+k1 = 105.0
+kp = 5.0*k1
+kc = k1
+
+DeltaPMax = 0.031
+Chi1 = 0.34
+#=======================================
+
+particleMass = 4.0/3.0*math.pi*r1*r1*r1*rho
+Vi1 = math.sqrt(k1/particleMass)*DeltaPMax*Chi1
+
+PhiF1 = DeltaPMax*(kp-k1)*(r1+r2)/(kp*2*r1*r2)
+
+#=======================================
+
+mat1 = O.materials.append(LudingMat(frictionAngle=fr,density=rho,k1=k1, kp=kp, kc=kc, PhiF=PhiF1, G0 = 0.0))
+
+id11 = O.bodies.append(sphere(center=[0,0,0],radius=r1,material=mat1,fixed=True))
+id12 = O.bodies.append(sphere(center=[0,0,(r1 + r2)],radius=r2,material=mat1,fixed=False))
+
+
+
+o.engines = [
+  ForceResetter(),
+  InsertionSortCollider([Bo1_Sphere_Aabb()]),
+  InteractionLoop(
+    [Ig2_Sphere_Sphere_ScGeom()],
+    [Ip2_LudingMat_LudingMat_LudingPhys()],
+    [Law2_ScGeom_LudingPhys_Basic()],
+  ),
+  NewtonIntegrator(damping=0,gravity=[0,0,0]),
+  PyRunner(command='changeVelDir()',iterPeriod=6000,label='Cvel'),
+  PyRunner(command='addPlotData()',iterPeriod=300),
+]
+
+O.bodies[id12].state.vel=[0,0,-Vi1]
+
+def changeVelDir():
+  O.bodies[id12].state.vel*=-1
+  Cvel.iterPeriod = int(Cvel.iterPeriod*1.5)
+  
+def addPlotData(): 
+  f1 = [0,0,0]
+  
+  try:
+    f1=O.forces.f(id12)
+  except:
+    f1 = [0,0,0]
+  
+  s1 = (O.bodies[id12].state.pos[2]-O.bodies[id11].state.pos[2])-(r1 + r2)  
+    
+  plot.addData(fc1=f1[2], sc1=-s1)
+
+plot.plots={'sc1':('fc1')}; plot.plot()
+
+from yade import qt
+qt.View()
+
+O.run(150000)
+O.wait()
+plot.saveGnuplot('sim-data_LudigPM')

=== added file 'examples/LudingPM/README'
--- examples/LudingPM/README	1970-01-01 00:00:00 +0000
+++ examples/LudingPM/README	2015-12-16 07:49:14 +0000
@@ -0,0 +1,2 @@
+Simple scripts to test LudingPM.
+See [Luding2008]_ ,[Singh2013]_ for more details.

=== modified file 'pkg/dem/LudingPM.hpp'
--- pkg/dem/LudingPM.hpp	2014-10-15 06:44:01 +0000
+++ pkg/dem/LudingPM.hpp	2015-12-16 07:49:14 +0000
@@ -9,7 +9,7 @@
 class LudingMat : public Material {
   public:
     virtual ~LudingMat();
-  YADE_CLASS_BASE_DOC_ATTRS_CTOR(LudingMat,Material,"Material for simple Ludning`s model of contact.\n",
+  YADE_CLASS_BASE_DOC_ATTRS_CTOR(LudingMat,Material,"Material for simple Luding`s model of contact [Luding2008]_ ,[Singh2013]_ .\n",
     ((Real,k1,NaN,,"Slope of loading plastic branch"))
     ((Real,kp,NaN,,"Slope of unloading and reloading limit elastic branch"))
     ((Real,kc,NaN,,"Slope of irreversible, tensile adhesive branch"))
@@ -63,6 +63,6 @@
   private:
     Real calculateCapillarForce(const ScGeom& geom, LudingPhys& phys);
   FUNCTOR2D(ScGeom,LudingPhys);
-  YADE_CLASS_BASE_DOC(Law2_ScGeom_LudingPhys_Basic,LawFunctor,"Linear viscoelastic model operating on :yref:`ScGeom` and :yref:`LudingPhys`.");
+  YADE_CLASS_BASE_DOC(Law2_ScGeom_LudingPhys_Basic,LawFunctor,"Linear viscoelastic model operating on :yref:`ScGeom` and :yref:`LudingPhys`. See [Luding2008]_ ,[Singh2013]_ for more details.");
 };
 REGISTER_SERIALIZABLE(Law2_ScGeom_LudingPhys_Basic);