tAdded missing [j] in sizeof operation during write - 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 6f1f3e6b4a43e5c8e502aeb9508045b8754402da
(DIR) parent 6c10a18995e2fbfac7bd59977d36e0eb68193475
(HTM) Author: Anders Damsgaard <adc@geo.au.dk>
Date: Thu, 6 Sep 2012 14:22:13 +0200
Added missing [j] in sizeof operation during write
Diffstat:
M src/Makefile | 4 ++--
M src/file_io.cpp | 4 +++-
M src/main.cpp | 8 --------
3 files changed, 5 insertions(+), 11 deletions(-)
---
(DIR) diff --git a/src/Makefile b/src/Makefile
t@@ -96,6 +96,6 @@ clean:
clear:
# Remove all output data and images
- $(RM) -f ../img_out/*.{ppm,png}
- $(RM) -f ../output/*.{dat,bin}
+ $(RM) ../img_out/*.{ppm,png}
+ $(RM) ../output/*.{dat,bin}
(DIR) diff --git a/src/file_io.cpp b/src/file_io.cpp
t@@ -37,6 +37,8 @@ int fwritebin(char *target,
// If double precision: Values can be written directly
if (sizeof(Float) == sizeof(double)) {
+ printf("double precision; good.\n");
+
// World dimensions
fwrite(&grid->nd, sizeof(grid->nd), 1, fp);
t@@ -122,7 +124,7 @@ int fwritebin(char *target,
// Walls
fwrite(¶ms->nw, sizeof(params->nw), 1, fp); // No. of walls
for (j=0; j<params->nw; ++j) {
- fwrite(¶ms->wmode[j], sizeof(params->wmode), 1, fp);
+ fwrite(¶ms->wmode[j], sizeof(params->wmode[j]), 1, fp);
// Wall normal
fwrite(&host_w_nx[j].x, sizeof(Float), 1, fp);
fwrite(&host_w_nx[j].y, sizeof(Float), 1, fp);
(DIR) diff --git a/src/main.cpp b/src/main.cpp
t@@ -424,15 +424,7 @@ int main(int argc, char *argv[])
exit(1); // Return unsuccessful exit status
}
- // For debugging purposes: Print data to terminal
- //printf("\nhost_x data, pre-copy:\n");
- //for(i=0; i<p.np; ++i) {
- // printf("%f \t %f \t %f \n", host_x[i].x, host_x[i].y, host_x[i].z);
- //}
-
-
cout << "\nEntering the CUDA environment...\n";
-
gpuMain(host_x,
host_vel,
host_acc,