tfix IO of dphi values - 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 e00575a0c51ed0d98599781875be8f9e83f66bc1
(DIR) parent 33e2dbe8443809b1a869c94a1d6546e2b7a4c1fc
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
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(-)
---
(DIR) 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))
(DIR) 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();