tfixed output display - 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 224dd4470b3dd337c62592719ca54b080a3f5040
(DIR) parent 2211185c76b17259e05ed63ebfe0d74a0d5b953c
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Thu, 22 Aug 2013 09:45:12 +0200
fixed output display
Diffstat:
M src/device.cu | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
---
(DIR) diff --git a/src/device.cu b/src/device.cu
t@@ -620,8 +620,7 @@ __host__ void DEM::startTime()
// Initialize counter variable values
filetimeclock = 0.0;
long iter = 0;
- int stdout_report = 10; // the no of time steps between reporting to stdout
- int stdout_report_counter = stdout_report;
+ const int stdout_report = 10; // the no of time steps between reporting to stdout
// Create first status.dat
//sprintf(file,"output/%s.status.dat", sid);
t@@ -952,13 +951,9 @@ __host__ void DEM::startTime()
++iter;
// Report time to console
- if (verbose == 1) {
- stdout_report_counter--;
- if (stdout_report < 0) {
- cout << "\r Current simulation time: "
- << time.current << " s. ";// << std::flush;
- stdout_report_counter = stdout_report;
- }
+ if (verbose == 1 && (iter % stdout_report == 0)) {
+ cout << "\r Current simulation time: "
+ << time.current << " s. ";// << std::flush;
}