tPorosities are now written to stdout, not a file - 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 46318ad0230597131e26c3766048dde88cd38796
 (DIR) parent 1847983be9497ba71c1a730e0f56fc1caf9dcb5f
 (HTM) Author: Anders Damsgaard <adc@geo.au.dk>
       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(-)
       ---
 (DIR) 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 ...]\nOptions:\n"
                        << "-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 within\n"
                        << "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]); 
 (DIR) 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_pos, porosity);
       -    //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_pos, porosity);
       +
       +    // 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'; 
       +    }
        
        }