tadd more information to dampening function output - sphere - GPU-based 3D disc… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit e21cfdcd81fcb08ebbad7d66e51bcb8df840524e | |
parent 2ab7999778e52cdc6d2f2de30200439705627042 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Fri, 20 Jun 2014 14:02:03 +0200 | |
add more information to dampening function output | |
Diffstat: | |
M python/shortening.py | 4 ++-- | |
M python/sphere.py | 28 ++++++++++++++++++++++------ | |
2 files changed, 24 insertions(+), 8 deletions(-) | |
--- | |
diff --git a/python/shortening.py b/python/shortening.py | |
t@@ -82,8 +82,8 @@ sim.g[0] = 0 | |
sim.g[1] = -9.81 | |
sim.g[2] = 0 | |
-sim.setDampingNormal(1.0e4) | |
-sim.setDampingTangential(1.0e4) | |
+sim.setDampingNormal(1.0e1) | |
+sim.setDampingTangential(1.0e1) | |
sim.periodicBoundariesX() | |
sim.uniaxialStrainRate(wvel = 0.0) | |
diff --git a/python/sphere.py b/python/sphere.py | |
t@@ -2621,9 +2621,17 @@ class sim: | |
:see also:`func:setDampingTangential(gamma)` | |
''' | |
self.gamma_n[0] = gamma | |
- gamma_crit = 2.0*numpy.sqrt(self.smallestMass() * self.k_n[0]) | |
- print('Info: The chosen normal damping is ' + str(gamma/gamma_crit) | |
- + ' the critical damping value.') | |
+ damping_ratio = gamma/(2.0*numpy.sqrt(self.smallestMass()*self.k_n[0])) | |
+ if (damping_ratio < 1.0): | |
+ print('Info: The system is under-dampened (ratio = ' | |
+ + str(damping_ratio) | |
+ + ') in the normal component. This is ok.') | |
+ elif (damping_ratio > 1.0): | |
+ print('Warning: The system is over-dampened (ratio = ' | |
+ + str(damping_ratio) + ') in the normal component.') | |
+ else: | |
+ print('Warning: The system is critically dampened (ratio = ' | |
+ + str(damping_ratio) + ') in the normal component.') | |
def setDampingTangential(self, gamma): | |
''' | |
t@@ -2637,9 +2645,17 @@ class sim: | |
:see also:`func:setDampingNormal(gamma)` | |
''' | |
self.gamma_t[0] = gamma | |
- gamma_crit = 2.0*numpy.sqrt(self.smallestMass() * self.k_t[0]) | |
- print('Info: The chosen tangential damping is ' + str(gamma/gamma_crit) | |
- + ' the critical damping value.') | |
+ damping_ratio = gamma/(2.0*numpy.sqrt(self.smallestMass()*self.k_t[0])) | |
+ if (damping_ratio < 1.0): | |
+ print('Info: The system is under-dampened (ratio = ' | |
+ + str(damping_ratio) | |
+ + ') in the tangential component. This is ok.') | |
+ elif (damping_ratio > 1.0): | |
+ print('Warning: The system is over-dampened (ratio = ' | |
+ + str(damping_ratio) + ') in the tangential component.') | |
+ else: | |
+ print('Warning: The system is critically dampened (ratio = ' | |
+ + str(damping_ratio) + ') in the tangential component.') | |
def bond(self, i, j): | |
''' |