tfix IO of dphi values - sphere - GPU-based 3D discrete element method algorith… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit e00575a0c51ed0d98599781875be8f9e83f66bc1 | |
parent 33e2dbe8443809b1a869c94a1d6546e2b7a4c1fc | |
Author: Anders Damsgaard <[email protected]> | |
Date: Wed, 12 Nov 2014 14:03:20 +0100 | |
fix IO of dphi values | |
Diffstat: | |
M python/sphere.py | 5 +++-- | |
M src/device.cu | 2 +- | |
2 files changed, 4 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/python/sphere.py b/python/sphere.py | |
t@@ -1096,7 +1096,7 @@ class sim: | |
count=1) | |
self.dphi[x,y,z] = \ | |
numpy.fromfile(fh, dtype=numpy.float64,\ | |
- count=1) | |
+ count=1)/(self.time_dt*self.ndem) | |
if self.version >= 0.36: | |
self.rho_f =\ | |
t@@ -1341,7 +1341,8 @@ class sim: | |
fh.write(self.v_f[x,y,z,2].astype(numpy.float64)) | |
fh.write(self.p_f[x,y,z].astype(numpy.float64)) | |
fh.write(self.phi[x,y,z].astype(numpy.float64)) | |
- fh.write(self.dphi[x,y,z].astype(numpy.float64)) | |
+ fh.write(self.dphi[x,y,z].astype(numpy.float64)* | |
+ self.time_dt*self.ndem) | |
fh.write(self.rho_f.astype(numpy.float64)) | |
fh.write(self.p_mod_A.astype(numpy.float64)) | |
diff --git a/src/device.cu b/src/device.cu | |
t@@ -2066,7 +2066,7 @@ __host__ void DEM::startTime() | |
// Zero all dphi values right after they are used in fluid | |
// solution, unless a file is written in this step. | |
- if (filetimeclock < time.file_dt) { | |
+ if (filetimeclock + time.dt < time.file_dt) { | |
setDarcyZeros<Float> <<<dimGridFluid, dimBlockFluid>>> | |
(dev_darcy_dphi); | |
cudaThreadSynchronize(); |