tChanged tests to new digit format of bin files - 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 de937c7ef7b26ad0befaea97dab04c59075edd64
(DIR) parent e99f67a88ac006ee17fb3945b30a5349cb3e7fc5
(HTM) Author: Anders Damsgaard <adc@geo.au.dk>
Date: Wed, 14 Nov 2012 12:49:06 +0100
Changed tests to new digit format of bin files
Diffstat:
M python/tests.py | 58 +++++++++++++++---------------
1 file changed, 29 insertions(+), 29 deletions(-)
---
(DIR) diff --git a/python/tests.py b/python/tests.py
t@@ -13,35 +13,35 @@ def compare(first, second, string):
print("### Input/output tests ###")
# Generate data in python
-for N in [1, 2, 10, 1e2, 1e3, 1e4]:
- print("{} particle(s)".format(int(N)))
- orig = Spherebin(np = int(N), nw = 0, sid = "test")
- orig.generateRadii(histogram = False)
- orig.defaultParams()
- orig.initRandomGridPos(g = numpy.zeros(orig.nd), gridnum=numpy.array([N*N+3,N*N+3,N*N+3]))
- orig.initTemporal(current = 0.0, total = 0.0)
- orig.time_total = 2.0*orig.time_dt;
- orig.time_file_dt = orig.time_dt;
- orig.writebin(verbose=False)
-
- # Test Python IO routines
- py = Spherebin()
- py.readbin("../input/test.bin", verbose=False)
- compare(orig, py, "Python IO:")
-
- # Test C++ IO routines
- orig.run(verbose=False, hideinputfile=True)
- cpp = Spherebin()
- cpp.readbin("../output/test.output0.bin", verbose=False)
- compare(orig, cpp, "C++ IO: ")
-
- # Test CUDA IO routines
- cuda = Spherebin()
- cuda.readbin("../output/test.output1.bin", verbose=False)
- cuda.time_current = orig.time_current
- cuda.time_step_count = orig.time_step_count
- compare(orig, cuda, "CUDA IO: ")
+orig = Spherebin(np = 100, nw = 0, sid = "test")
+orig.generateRadii(histogram = False)
+orig.defaultParams()
+orig.initRandomGridPos(g = numpy.zeros(orig.nd))
+orig.initTemporal(current = 0.0, total = 0.0)
+orig.time_total = 2.0*orig.time_dt;
+orig.time_file_dt = orig.time_dt;
+orig.writebin(verbose=False)
+
+# Test Python IO routines
+py = Spherebin()
+py.readbin("../input/test.bin", verbose=False)
+compare(orig, py, "Python IO:")
+
+# Test C++ IO routines
+orig.run(verbose=False, hideinputfile=True)
+#orig.run()
+cpp = Spherebin()
+cpp.readbin("../output/test.output00000.bin", verbose=False)
+compare(orig, cpp, "C++ IO: ")
+
+# Test CUDA IO routines
+cuda = Spherebin()
+cuda.readbin("../output/test.output00001.bin", verbose=False)
+cuda.time_current = orig.time_current
+cuda.time_step_count = orig.time_step_count
+compare(orig, cuda, "CUDA IO: ")
# Remove temporary files
-subprocess.call("rm ../{input,output}/test*bin", shell=True)
+subprocess.call("rm ../input/" + orig.sid + ".bin", shell=True)
+subprocess.call("rm ../output/" + orig.sid + ".*.bin", shell=True)