tPorosities are now written to stdout, not a file - sphere - GPU-based 3D discr… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 46318ad0230597131e26c3766048dde88cd38796 | |
parent 1847983be9497ba71c1a730e0f56fc1caf9dcb5f | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 18 Dec 2012 10:39:41 +0100 | |
Porosities are now written to stdout, not a file | |
Diffstat: | |
M src/porosity.cpp | 8 ++++---- | |
M src/sphere.cpp | 17 +++++++---------- | |
2 files changed, 11 insertions(+), 14 deletions(-) | |
--- | |
diff --git a/src/porosity.cpp b/src/porosity.cpp | |
t@@ -27,7 +27,7 @@ | |
int main(const int argc, const char *argv[]) | |
{ | |
// Default values | |
- int verbose = 1; | |
+ int verbose = 0; | |
int nfiles = 0; // number of input files | |
int slices = 10; // number of vertical slices | |
t@@ -43,7 +43,7 @@ int main(const int argc, const char *argv[]) | |
<< "Usage: " << argv[0] << " [OPTION[S]]... [FILE1 ...]\nOptio… | |
<< "-h, --help\t\tprint help\n" | |
<< "-V, --version\t\tprint version information and exit\n" | |
- << "-q, --quiet\t\tdo not display in-/output file names\n" | |
+ << "-v, --verbose\t\tdisplay in-/output file names\n" | |
<< "-s. --slices\t\tnumber of vertical slices to find porosity… | |
<< "The porosity values are stored in the output/ folder" | |
<< std::endl; | |
t@@ -57,8 +57,8 @@ int main(const int argc, const char *argv[]) | |
return 0; | |
} | |
- else if (argvi == "-q" || argvi == "--quiet") | |
- verbose = 0; | |
+ else if (argvi == "-v" || argvi == "--verbose") | |
+ verbose = 1; | |
else if (argvi == "-s" || argvi == "--slices") { | |
slices = atoi(argv[++i]); | |
diff --git a/src/sphere.cpp b/src/sphere.cpp | |
t@@ -407,19 +407,16 @@ void DEM::porosity(const int z_slices) | |
// Save the porosity | |
porosity[iz] = V_void / V_slice; | |
- // Report values to stdout | |
- /* | |
- std::cout << iz << ": V_void = " << V_void | |
- << "\tV_slice = " << V_slice | |
- << "\tporosity = " << V_void/V_slice | |
- << '\n' << std::endl; | |
- */ | |
} | |
// Save results to text file | |
- writePorosities(("output/" + sid + "-porosity.txt").c_str(), z_slices, z_p… | |
- //for (int i=z_slices-1; i>=0; --i) | |
- //std::cout << porosity[i] << std::endl; | |
+ //writePorosities(("output/" + sid + "-porosity.txt").c_str(), z_slices, z… | |
+ | |
+ // Report values to stdout | |
+ std::cout << "z-pos" << '\t' << "porosity" << '\n'; | |
+ for (int i = 0; i<z_slices; ++i) { | |
+ std::cout << z_pos[i] << '\t' << porosity[i] << '\n'; | |
+ } | |
} | |