Introduction
Introduction Statistics Contact Development Disclaimer Help
tAdded legacy read mode for old data files - sphere - GPU-based 3D discrete ele…
git clone git://src.adamsgaard.dk/sphere
Log
Files
Refs
LICENSE
---
commit 5f80feadeeb6d2409daf56d63ee53a442b82e44f
parent 0ae0f4649f84b60f1d8f195594629b346ca4f7af
Author: Anders Damsgaard <[email protected]>
Date: Tue, 12 Mar 2013 22:09:14 +0100
Added legacy read mode for old data files
Diffstat:
M python/sphere.py | 37 ++++++++++++++++-------------…
1 file changed, 19 insertions(+), 18 deletions(-)
---
diff --git a/python/sphere.py b/python/sphere.py
t@@ -179,7 +179,7 @@ class Spherebin:
- def readbin(self, targetbin, verbose = True):
+ def readbin(self, targetbin, verbose = True, bonds = True):
'Reads a target SPHERE binary file'
fh = None
t@@ -286,23 +286,24 @@ class Spherebin:
self.w_force[i] = numpy.fromfile(fh, dtype=numpy.float64, coun…
self.w_devs[i] = numpy.fromfile(fh, dtype=numpy.float64, coun…
- # Inter-particle bonds
- self.lambda_bar = numpy.fromfile(fh, dtype=numpy.float64, count=1)
- self.nb0 = numpy.fromfile(fh, dtype=numpy.uint32, count=1)
- self.sigma_b = numpy.fromfile(fh, dtype=numpy.float64, count=1)
- self.tau_b = numpy.fromfile(fh, dtype=numpy.float64, count=1)
- self.bonds = numpy.zeros((self.nb0, 2), dtype=numpy.uint32)
- for i in range(self.nb0):
- self.bonds[i,0] = numpy.fromfile(fh, dtype=numpy.uint32, count…
- self.bonds[i,1] = numpy.fromfile(fh, dtype=numpy.uint32, count…
- #self.bonds_delta_n = numpy.zeros(self.nb0, dtype=numpy.float64)
- #self.bonds_delta_t = numpy.zeros((self.nb0, seld.nd), dtype=numpy…
- #self.bonds_omega_n = numpy.zeros(self.nb0, dtype=numpy.float64)
- #self.bonds_omega_t = numpy.zeros((self.nb0, seld.nd), dtype=numpy…
- self.bonds_delta_n = numpy.fromfile(fh, dtype=numpy.float64, count…
- self.bonds_delta_t = numpy.fromfile(fh, dtype=numpy.float64, count…
- self.bonds_omega_n = numpy.fromfile(fh, dtype=numpy.float64, count…
- self.bonds_omega_t = numpy.fromfile(fh, dtype=numpy.float64, count…
+ if (bonds == True):
+ # Inter-particle bonds
+ self.lambda_bar = numpy.fromfile(fh, dtype=numpy.float64, coun…
+ self.nb0 = numpy.fromfile(fh, dtype=numpy.uint32, count=1)
+ self.sigma_b = numpy.fromfile(fh, dtype=numpy.float64, count=1)
+ self.tau_b = numpy.fromfile(fh, dtype=numpy.float64, count=1)
+ self.bonds = numpy.zeros((self.nb0, 2), dtype=numpy.uint32)
+ for i in range(self.nb0):
+ self.bonds[i,0] = numpy.fromfile(fh, dtype=numpy.uint32, c…
+ self.bonds[i,1] = numpy.fromfile(fh, dtype=numpy.uint32, c…
+ #self.bonds_delta_n = numpy.zeros(self.nb0, dtype=numpy.float6…
+ #self.bonds_delta_t = numpy.zeros((self.nb0, seld.nd), dtype=n…
+ #self.bonds_omega_n = numpy.zeros(self.nb0, dtype=numpy.float6…
+ #self.bonds_omega_t = numpy.zeros((self.nb0, seld.nd), dtype=n…
+ self.bonds_delta_n = numpy.fromfile(fh, dtype=numpy.float64, c…
+ self.bonds_delta_t = numpy.fromfile(fh, dtype=numpy.float64, c…
+ self.bonds_omega_n = numpy.fromfile(fh, dtype=numpy.float64, c…
+ self.bonds_omega_t = numpy.fromfile(fh, dtype=numpy.float64, c…
finally:
if fh is not None:
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.