tSome triaxial bugfixes - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
(HTM) git clone git://src.adamsgaard.dk/sphere
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 49ebae25c8c553bd2e18b70e8d2f97fc35a5fead
(DIR) parent 7e87969a61a5a8ce5f636d5d777a33e6cefed427
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Thu, 22 Aug 2013 09:34:52 +0200
Some triaxial bugfixes
Diffstat:
M python/sphere.py | 40 ++++++++++++++++++++-----------
M python/triaxial.py | 4 +---
2 files changed, 27 insertions(+), 17 deletions(-)
---
(DIR) diff --git a/python/sphere.py b/python/sphere.py
t@@ -891,7 +891,21 @@ class Spherebin:
'Included for legacy purposes, calls adjustWall with idx=0'
self.adjustWall(idx=0, adjust = z_adjust)
- def adjustWall(self, idx, adjust):
+ # Initialize upper wall
+ self.nw = numpy.ones(1)
+ self.wmode = numpy.zeros(1) # fixed BC
+ self.w_n = numpy.zeros(self.nw*self.nd, dtype=numpy.float64).reshape(self.nw,self.nd)
+ self.w_n[0,2] = -1.0
+ if (idx == 0 or idx == 1 or idx == 3):
+ self.w_x = numpy.array([xmax])
+ else:
+ self.w_x = numpy.array([xmin])
+ self.w_m = numpy.array([self.rho[0] * self.np * math.pi * (cellsize/2.0)**3])
+ self.w_vel = numpy.zeros(1)
+ self.w_force = numpy.zeros(1)
+ self.w_devs = numpy.zeros(1)
+
+ def adjustWall(self, idx, adjust = 1.1):
'Adjust grid and dynamic wall to max. particle position'
if (idx == 0):
t@@ -912,18 +926,11 @@ class Spherebin:
self.L[dim] = (xmax-xmin)*adjust + xmin
# Initialize upper wall
- self.nw = numpy.ones(1)
- self.wmode = numpy.zeros(1) # fixed BC
- self.w_n = numpy.zeros(self.nw*self.nd, dtype=numpy.float64).reshape(self.nw,self.nd)
- self.w_n[0,2] = -1.0
if (idx == 0 or idx == 1 or idx == 3):
- self.w_x = numpy.array([xmax])
+ self.w_x[idx] = numpy.array([xmax])
else:
- self.w_x = numpy.array([xmin])
- self.w_m = numpy.array([self.rho[0] * self.np * math.pi * (cellsize/2.0)**3])
- self.w_vel = numpy.zeros(1)
- self.w_force = numpy.zeros(1)
- self.w_devs = numpy.zeros(1)
+ self.w_x[idx] = numpy.array([xmin])
+ self.w_m[idx] = numpy.array([self.rho[0] * self.np * math.pi * (cellsize/2.0)**3])
def consolidate(self, deviatoric_stress = 10e3,
t@@ -967,12 +974,17 @@ class Spherebin:
# Initialize walls
self.nw[0] = 5 # five dynamic walls
- for i in range(5):
- self.adjustWall(i)
- self.w_m[:] = numpy.array([self.rho[0] * self.np * math.pi * (cellsize/2.0)**3])
self.wmode = numpy.array([2,1,1,1,1]) # define BCs (vel, stress, stress, ...)
self.w_vel = numpy.array([1,0,0,0,0]) * wvel
self.w_devs = numpy.array([0,1,1,1,1]) * deviatoric_stress
+ self.w_n = numpy.array(([0,0,-1], [-1,0,0], [1,0,0], [0,-1,0], [0,1,0]),
+ dtype=numpy.float64)
+ self.w_x = numpy.zeros(5)
+ self.w_m = numpy.zeros(5)
+ self.w_force = numpy.zeros(5)
+ for i in range(5):
+ self.adjustWall(idx=i)
+
def shear(self,
(DIR) diff --git a/python/triaxial.py b/python/triaxial.py
t@@ -4,7 +4,7 @@
from sphere import *
### EXPERIMENT SETUP ###
-initialization = True
+initialization = False
consolidation = True
rendering = True
plots = True
t@@ -69,8 +69,6 @@ cons.initTemporal(total = 5.0)
cons.w_m[:] *= 0.001
-
-
if (consolidation == True):
# Write input file for sphere
cons.writebin()