tcorrect constructor call, add error message - sphere - GPU-based 3D discrete e… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit b1524662d66a4c90fb6a539b4da4fee656403cb0 | |
parent a34e13cce992c03f6a112b758c3550f37f6a2e52 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Mon, 28 Jul 2014 11:00:33 +0200 | |
correct constructor call, add error message | |
Diffstat: | |
M python/diffusivity1.py | 2 +- | |
M python/diffusivity2.py | 2 +- | |
M python/diffusivity3.py | 2 +- | |
M python/permeability1.py | 2 +- | |
M python/permeability2.py | 2 +- | |
M python/permeability3.py | 2 +- | |
M src/main.cpp | 9 +++++++-- | |
7 files changed, 13 insertions(+), 8 deletions(-) | |
--- | |
diff --git a/python/diffusivity1.py b/python/diffusivity1.py | |
t@@ -36,7 +36,7 @@ for sigma0 in [10.0e3, 20.0e3]: | |
sim.setMaxIterations(2e5) | |
sim.initTemporal(total = 5.0, file_dt = 0.01, epsilon=0.07) | |
sim.run(dry=True) | |
- sim.run(exclusive_mode=True) | |
+ sim.run(device=0) | |
#sim.writeVTKall() | |
sim.visualize('walls') | |
sim.visualize('fluid-pressure') | |
diff --git a/python/diffusivity2.py b/python/diffusivity2.py | |
t@@ -36,7 +36,7 @@ for sigma0 in [40.0e3, 60.0e3]: | |
sim.setMaxIterations(2e5) | |
sim.initTemporal(total = 5.0, file_dt = 0.01, epsilon=0.07) | |
sim.run(dry=True) | |
- sim.run(exclusive_mode=True) | |
+ sim.run(device=1) | |
#sim.writeVTKall() | |
sim.visualize('walls') | |
sim.visualize('fluid-pressure') | |
diff --git a/python/diffusivity3.py b/python/diffusivity3.py | |
t@@ -36,7 +36,7 @@ for sigma0 in [80.0e3, 120.0e3]: | |
sim.setMaxIterations(2e5) | |
sim.initTemporal(total = 5.0, file_dt = 0.01, epsilon=0.07) | |
sim.run(dry=True) | |
- sim.run(exclusive_mode=True) | |
+ sim.run(device=2) | |
#sim.writeVTKall() | |
sim.visualize('walls') | |
sim.visualize('fluid-pressure') | |
diff --git a/python/permeability1.py b/python/permeability1.py | |
t@@ -33,5 +33,5 @@ for dp in [1.0e3, 2.0e3]: | |
sim.initTemporal(total = 2.0, file_dt = 0.01, epsilon=0.07) | |
sim.run(dry=True) | |
- sim.run(exclusive_mode=True) | |
+ sim.run(device=0) | |
#sim.writeVTKall() | |
diff --git a/python/permeability2.py b/python/permeability2.py | |
t@@ -33,5 +33,5 @@ for dp in [4.0e3, 10.0e3]: | |
sim.initTemporal(total = 2.0, file_dt = 0.01, epsilon=0.07) | |
sim.run(dry=True) | |
- sim.run(exclusive_mode=True) | |
+ sim.run(device=1) | |
#sim.writeVTKall() | |
diff --git a/python/permeability3.py b/python/permeability3.py | |
t@@ -33,5 +33,5 @@ for dp in [20.0e3, 40.0e3]: | |
sim.initTemporal(total = 2.0, file_dt = 0.01, epsilon=0.07) | |
sim.run(dry=True) | |
- sim.run(exclusive_mode=True) | |
+ sim.run(device=2) | |
#sim.writeVTKall() | |
diff --git a/src/main.cpp b/src/main.cpp | |
t@@ -108,6 +108,11 @@ int main(const int argc, const char *argv[]) | |
else if (argvi == "-d") { | |
device = atoi(argv[i+1]); | |
+ if (device < -1) { | |
+ std::cerr << "Error: The device id must be 0 or larger." | |
+ << std::endl; | |
+ exit(1); | |
+ } | |
i++; // skip ahead | |
} | |
t@@ -163,7 +168,7 @@ int main(const int argc, const char *argv[]) | |
// Create DEM class, read data from input binary, check values, | |
// init cuda, transfer const mem | |
- DEM dem(argvi, verbose, checkVals, dry, 1, 1, fluid, exclusive… | |
+ DEM dem(argvi, verbose, checkVals, dry, 1, 1, fluid, device); | |
// Render image if requested | |
if (render == 1) | |
dem.render(method, max_val, lower_cutoff); | |
t@@ -175,7 +180,7 @@ int main(const int argc, const char *argv[]) | |
} else { | |
// Do not transfer to const. mem after the first file | |
- DEM dem(argvi, verbose, checkVals, dry, 1, 0, fluid, exclusive… | |
+ DEM dem(argvi, verbose, checkVals, dry, 1, 0, fluid, device); | |
// Render image if requested | |
if (render == 1) |