tonly read Zdisplacement in new version - sphere - GPU-based 3D discrete elemen… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 1ed93090cb9bf53d18d614d01b1a107faa38589c | |
parent 51d90ea606adf26fc6e796a38d547269df9b985a | |
Author: Anders Damsgaard <[email protected]> | |
Date: Sun, 22 Jun 2014 09:35:16 +0200 | |
only read Zdisplacement in new version | |
Diffstat: | |
M python/sphere.py | 10 +++++++--- | |
M src/constants.h | 2 +- | |
2 files changed, 8 insertions(+), 4 deletions(-) | |
--- | |
diff --git a/python/sphere.py b/python/sphere.py | |
t@@ -12,7 +12,7 @@ numpy.seterr(all='warn', over='raise') | |
# Sphere version number. This field should correspond to the value in | |
# `../src/constants.h`. | |
-VERSION=1.02 | |
+VERSION=1.03 | |
class sim: | |
''' | |
t@@ -777,8 +777,12 @@ class sim: | |
self.radius[i] =\ | |
numpy.fromfile(fh, dtype=numpy.float64, count=1) | |
- self.xyzsum = numpy.fromfile(fh, dtype=numpy.float64,\ | |
- count=self.np*3).reshape(self.np,3) | |
+ if (self.version >= 1.03): | |
+ self.xyzsum = numpy.fromfile(fh, dtype=numpy.float64,\ | |
+ count=self.np*3).reshape(self.np,3) | |
+ else: | |
+ self.xyzsum = numpy.fromfile(fh, dtype=numpy.float64,\ | |
+ count=self.np*2).reshape(self.np,2) | |
for i in range(self.np): | |
self.vel[i,:] =\ | |
diff --git a/src/constants.h b/src/constants.h | |
t@@ -16,7 +16,7 @@ const Float PI = 3.14159265358979; | |
const unsigned int ND = 3; | |
// Define source code version | |
-const double VERSION = 1.02; | |
+const double VERSION = 1.03; | |
// Max. number of contacts per particle | |
//const int NC = 16; |