tdo not overwrite 00000 output file if it isn't the first iteration - 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 db378368459b79a351971445588510f7479c9455
(DIR) parent 6953a6e79d6f9b2c89e136d8283b348f332f8415
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Tue, 14 Oct 2014 13:49:05 +0200
do not overwrite 00000 output file if it isn't the first iteration
Diffstat:
M src/device.cu | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/src/device.cu b/src/device.cu
t@@ -704,7 +704,8 @@ __host__ void DEM::startTime()
checkForCudaErrors("Start of startTime()");
// Write initial data to output/<sid>.output00000.bin
- writebin(("output/" + sid + ".output00000.bin").c_str());
+ if (time.step_count == 0)
+ writebin(("output/" + sid + ".output00000.bin").c_str());
// Time variables
clock_t tic, toc;
t@@ -1775,7 +1776,8 @@ __host__ void DEM::startTime()
// Write binary output file
time.step_count += 1;
sprintf(file,"output/%s.output%05d.bin", sid.c_str(),
- time.step_count); writebin(file);
+ time.step_count);
+ writebin(file);
/*std::cout << "\n###### OUTPUT FILE " << time.step_count << " ######"
<< std::endl;