tMerge branch 'master' of github.com:anders-dc/sphere - 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 fd7f267cd159723da6b96f8218bdd28d95ac5c89
 (DIR) parent a808934c7deab9bc3447e0d23579214efa8dcd09
 (HTM) Author: Anders Damsgaard Christensen <adc@geo.au.dk>
       Date:   Sat,  4 Jun 2016 08:11:29 -0700
       
       Merge branch 'master' of github.com:anders-dc/sphere
       
       Diffstat:
         A python/init-1e4.py                  |      50 +++++++++++++++++++++++++++++++
       
       1 file changed, 50 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/python/init-1e4.py b/python/init-1e4.py
       t@@ -0,0 +1,50 @@
       +#!/usr/bin/env python
       +
       +# Import sphere functionality
       +import sphere
       +
       +initialization = True
       +plots = True
       +
       +# CUDA device to use
       +device = 0
       +
       +# Number of particles
       +np = 1e4
       +
       +# Common simulation id
       +sim_id = 'init-1e4'
       +
       +init = sphere.sim(np=np, nd=3, nw=0, sid=sim_id)
       +
       +# Save radii
       +init.generateRadii(mean=0.01)
       +
       +# Use default params
       +init.defaultParams(gamma_n=100.0, mu_s=0.6, mu_d=0.6)
       +init.setStiffnessNormal(1.16e7)
       +init.setStiffnessTangential(1.16e7)
       +
       +# Add gravity
       +init.g[2] = -9.81
       +
       +# Periodic x and y boundaries
       +init.periodicBoundariesXY()
       +
       +# Initialize positions in random grid (also sets world size)
       +hcells = np**(1.0/3.0)
       +init.initRandomGridPos(gridnum=[hcells, hcells, 1e9])
       +
       +# Set duration of simulation
       +init.initTemporal(total=10.0, epsilon=0.07)
       +
       +if (initialization):
       +
       +    # Run sphere
       +    init.run(dry=True)
       +    init.run(device=device)
       +
       +    if (plots):
       +        init.visualize('energy')
       +
       +    init.writeVTKall()