tadd scripts for consolidation curve plot - 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 75f00d3a5b69b8cb76c535aa57bcf66fbcbba7f9
 (DIR) parent 89fc26ac72d9da35930497454992f7a34a1c842a
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Wed, 27 Aug 2014 10:12:10 +0200
       
       add scripts for consolidation curve plot
       
       Diffstat:
         A python/consolidation-curves.py      |      49 +++++++++++++++++++++++++++++++
         A python/consolidation-curves.sh      |      50 +++++++++++++++++++++++++++++++
       
       2 files changed, 99 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/python/consolidation-curves.py b/python/consolidation-curves.py
       t@@ -0,0 +1,49 @@
       +#!/usr/bin/env python
       +import sphere
       +import numpy
       +import sys
       +
       +# launch with:
       +# $ python consolidation-curves <DEVICE> <C_PHI> <C_GRAD_P>
       +
       +# Unique simulation parameters
       +device = int(sys.argv[1])
       +c_phi = float(sys.argv[2])
       +c_grad_p = float(sys.argv[3])
       +
       +sim = sphere.sim('cons-sigma0=' + str(5.0e3) + '-c_phi=' + \
       +            str(c_phi) + '-c_grad_p=' + str(1.0), fluid=True)
       +sim.readlast()
       +
       +sigma0 = 10.0e3
       +sim.sid = 'cons-sigma0=' + str(sigma0) + '-c_phi=' + str(c_phi) + \
       +        '-c_grad_p=' + str(c_grad_p)
       +print('\n###### ' + sim.sid + ' ######')
       +
       +# Checkerboard colors
       +sim.checkerboardColors()
       +sim.cleanup()
       +sim.adjustUpperWall()
       +sim.zeroKinematics()
       +
       +sim.consolidate(normal_stress = sigma0)
       +
       +sim.initFluid(mu = 17.87e-4, p = 1.0e5, hydrostatic = True)
       +sim.setFluidBottomNoFlow()
       +sim.setFluidTopFixedPressure()
       +sim.setDEMstepsPerCFDstep(10)
       +sim.setMaxIterations(2e5)
       +sim.initTemporal(total = 5.0, file_dt = 0.01, epsilon=0.07)
       +sim.c_grad_p[0] = c_grad_p
       +sim.c_phi[0] = c_phi
       +
       +# Fix lowermost particles
       +dz = sim.L[2]/sim.num[2]
       +I = numpy.nonzero(sim.x[:,2] < 1.5*dz)
       +sim.fixvel[I] = 1
       +
       +sim.run(dry=True)
       +sim.run(device=device)
       +#sim.writeVTKall()
       +#sim.visualize('walls')
       +#sim.visualize('fluid-pressure')
 (DIR) diff --git a/python/consolidation-curves.sh b/python/consolidation-curves.sh
       t@@ -0,0 +1,50 @@
       +#!/bin/sh
       +#PBS -N cons-curves
       +#PBS -l nodes=1:ppn=3
       +#PBS -l walltime=19200:00:00
       +#PBS -q qfermi
       +#PBS -M adc@geo.au.dk
       +#PBS -m abe
       +
       +# Grendel CUDA
       +source /com/gcc/4.6.4/load.sh
       +CUDAPATH=/com/cuda/5.5.22
       +export PATH=$HOME/bin:$PATH
       +export PATH=$CUDAPATH/bin:$PATH
       +export LD_LIBRARY_PATH=$CUDAPATH/lib64:$CUDAPATH/lib:$LD_LIBRARY_PATH
       +
       +# Manually installed Python modules
       +export PYTHONPATH=$HOME/.local/lib/python:$PYTHONPATH
       +export PYTHONPATH=$HOME/.local/lib64/python:$PYTHONPATH
       +
       +# Manually installed Python
       +#export PATH=/home/adc/.local/bin:$PATH
       +
       +# Shared Python2.7
       +PYTHON=/com/python/2.7.6
       +export PYTHONPATH=$PYTHON/lib:$PYTHONPATH
       +export PATH=$PYTHON/bin:$PATH
       +
       +echo "`whoami`@`hostname`"
       +echo "Start at `date`"
       +
       +ORIGDIR=/home/adc/code/sphere
       +#WORKDIR=/scratch/$PBS_JOBID
       +WORKDIR=$ORIGDIR
       +
       +#cp -r $ORIGDIR/* $WORKDIR
       +
       +cd $WORKDIR
       +nvidia-smi
       +rm CMakeCache.txt
       +cmake . && make
       +cd python
       +#python consolidation-curves.py 0 1.0 1.00 &
       +python consolidation-curves.py 0 1.0 0.10 &
       +python consolidation-curves.py 1 1.0 0.01 &
       +python consolidation-curves.py 2 1.0 0.001 &
       +wait
       +
       +#cp $WORKDIR/output/* $ORIGDIR/output/
       +
       +echo "End at `date`"