tadded template for shear experiments - sphere - GPU-based 3D discrete element … | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 1fcb3abb988953ceb7db153556a3e25b1b9cb080 | |
parent dfece9039322d71d77530a83ae1fb60c6b364ae2 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Fri, 4 Jul 2014 19:15:25 +0200 | |
added template for shear experiments | |
Diffstat: | |
A python/shear-1-2-3.sh | 49 +++++++++++++++++++++++++++++… | |
A python/shear-4-5-6.sh | 49 +++++++++++++++++++++++++++++… | |
A python/shear1.py | 45 +++++++++++++++++++++++++++++… | |
3 files changed, 143 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/python/shear-1-2-3.sh b/python/shear-1-2-3.sh | |
t@@ -0,0 +1,49 @@ | |
+#!/bin/sh | |
+#PBS -N shear-1-2-3 | |
+#PBS -l nodes=1:ppn=3 | |
+#PBS -l walltime=1920:00:00 | |
+#PBS -q qfermi | |
+#PBS -M [email protected] | |
+#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 && make test | |
+cd python | |
+python shear1.py & | |
+python shear2.py & | |
+python shear3.py & | |
+wait | |
+ | |
+#cp $WORKDIR/output/* $ORIGDIR/output/ | |
+ | |
+echo "End at `date`" | |
diff --git a/python/shear-4-5-6.sh b/python/shear-4-5-6.sh | |
t@@ -0,0 +1,49 @@ | |
+#!/bin/sh | |
+#PBS -N shear-4-5-6 | |
+#PBS -l nodes=1:ppn=3 | |
+#PBS -l walltime=1920:00:00 | |
+#PBS -q qfermi | |
+#PBS -M [email protected] | |
+#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 && make test | |
+cd python | |
+python shear4.py & | |
+python shear5.py & | |
+python shear6.py & | |
+wait | |
+ | |
+#cp $WORKDIR/output/* $ORIGDIR/output/ | |
+ | |
+echo "End at `date`" | |
diff --git a/python/shear1.py b/python/shear1.py | |
t@@ -0,0 +1,45 @@ | |
+#!/usr/bin/env python | |
+import sphere | |
+import numpy | |
+ | |
+for sigma0 in [10.0e3, 20.0e3]: | |
+ | |
+ sim = sphere.sim() | |
+ sim.sid = 'diffusivity-sigma0=' + str(sigma0) | |
+ sim.readlast() | |
+ sim.sid = 'shear-sigma0=' + str(sigma0) | |
+ | |
+ # Checkerboard colors | |
+ x_min = numpy.min(sim.x[:,0]) | |
+ x_max = numpy.max(sim.x[:,0]) | |
+ y_min = numpy.min(sim.x[:,1]) | |
+ y_max = numpy.max(sim.x[:,1]) | |
+ z_min = numpy.min(sim.x[:,2]) | |
+ z_max = numpy.max(sim.x[:,2]) | |
+ color_nx = 6 | |
+ color_ny = 6 | |
+ color_nz = 6 | |
+ for i in range(sim.np): | |
+ ix = numpy.floor((sim.x[i,0] - x_min)/(x_max/color_nx)) | |
+ iy = numpy.floor((sim.x[i,1] - y_min)/(y_max/color_ny)) | |
+ iz = numpy.floor((sim.x[i,2] - z_min)/(z_max/color_nz)) | |
+ sim.color[i] = (-1)**ix + (-1)**iy + (-1)**iz | |
+ | |
+ sim.cleanup() | |
+ sim.adjustUpperWall() | |
+ sim.zeroKinematics() | |
+ shear_strain = 1.0 | |
+ total_time = 20.0 | |
+ sim.shear(shear_strain_rate = shear_strain/total_time) | |
+ sim.shear(normal_stress = 10.0e3) | |
+ sim.initFluid(mu = 17.87e-4, p = 1.0e5, hydrostatic = True) | |
+ sim.setFluidBottomNoFlow() | |
+ sim.setFluidTopFixedPressure() | |
+ sim.setDEMstepsPerCFDstep(10) | |
+ sim.initTemporal(total = total_time, file_dt = 0.01, epsilon=0.07) | |
+ sim.run(dry=True) | |
+ sim.run() | |
+ #sim.writeVTKall() | |
+ sim.visualize('walls') | |
+ sim.visualize('shear') | |
+ sim.visualize('fluid-pressure') |