tfix dimensions, add missing initTemporal call - sphere - GPU-based 3D discrete… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit ceea3e1b575916a5a5e1a3427795212a1649d7c5 | |
parent f7c44f8a26363e508d1c2c4702980921b2506e1d | |
Author: Anders Damsgaard <[email protected]> | |
Date: Mon, 1 Sep 2014 12:45:28 +0200 | |
fix dimensions, add missing initTemporal call | |
Diffstat: | |
M python/capillary-cohesion2.py | 40 +++++++++++++++++++++++------… | |
1 file changed, 30 insertions(+), 10 deletions(-) | |
--- | |
diff --git a/python/capillary-cohesion2.py b/python/capillary-cohesion2.py | |
t@@ -30,19 +30,37 @@ scale_factor = r_mean/r_mean_old | |
cube.radius *= scale_factor | |
cube.L *= scale_factor | |
cube.x *= scale_factor | |
+cube.x[:,0] += numpy.abs(numpy.min(cube.x[:,0] - cube.radius)) | |
+cube.x[:,1] += numpy.abs(numpy.min(cube.x[:,1] - cube.radius)) | |
+cube.x[:,2] += numpy.abs(numpy.min(cube.x[:,2] - cube.radius)) | |
+cube.L[0] = numpy.max(numpy.max(cube.x[:,0] + cube.radius)) | |
+cube.L[1] = numpy.max(numpy.max(cube.x[:,1] + cube.radius)) | |
+cube.L[2] = numpy.max(numpy.max(cube.x[:,2] + cube.radius)) | |
+cube.writeVTK() | |
# Fill out grid with cubic packages | |
grid = numpy.array(( | |
- [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
- [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
- [ 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], | |
- [ 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], | |
- [ 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0], | |
+ [ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
+ [ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
+ [ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
+ [ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
+ [ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
+ [ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
+ [ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])) | |
# World dimensions and cube grid | |
nx = grid.shape[1] # horizontal cubes | |
t@@ -80,6 +98,8 @@ sim.defaultParams(capillaryCohesion=cohesion) | |
sim.k_n[0] = 1.0e6 | |
sim.k_t[0] = 1.0e6 | |
sim.g[2] = -10.0 | |
+sim.initTemporal(2.0, epsilon=0.07) | |
+sim.writeVTK() | |
sim.run(device=device) | |
sim.writeVTKall() |