[cig-commits] [commit] master: Add section name to statistics (4eef8fe)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Mon Nov 10 12:10:42 PST 2014
Repository : https://github.com/geodynamics/vq
On branch : master
Link : https://github.com/geodynamics/vq/compare/197914f4e03e55d321cae45161deafb1a5ade706...9ebb976b0ec90f56c8c1abfcd43d67ae38f64e87
>---------------------------------------------------------------
commit 4eef8fef67d4f50092d21798ded81c2f2b568a25
Author: Eric Heien <emheien at ucdavis.edu>
Date: Tue Nov 4 10:02:22 2014 -0800
Add section name to statistics
>---------------------------------------------------------------
4eef8fef67d4f50092d21798ded81c2f2b568a25
src/mesher.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/mesher.cpp b/src/mesher.cpp
index 169a9ca..0ce4069 100644
--- a/src/mesher.cpp
+++ b/src/mesher.cpp
@@ -59,7 +59,8 @@ void print_statistics(quakelib::ModelWorld &world, const std::string &file_name)
quakelib::eiterator eit;
std::vector<double> rake_vals, slip_rate_vals;
std::ofstream out_file;
- int section_field_width, elem_field_width, vert_field_width, val_field_width;
+ int section_field_width, section_name_width;
+ int elem_field_width, vert_field_width, val_field_width;
double mem_req;
quakelib::Conversion c;
@@ -74,10 +75,12 @@ void print_statistics(quakelib::ModelWorld &world, const std::string &file_name)
out_file << "Expected memory requirement: " << mem_string(mem_req) << "\n";
section_field_width = fmax(5, log10(world.num_sections())+1);
+ section_name_width = 10;
elem_field_width = fmax(5, log10(world.num_elements())+1);
vert_field_width = fmax(5, log10(world.num_vertices())+1);
val_field_width = 5;
out_file << std::setw(section_field_width) << "Section\t";
+ out_file << std::setw(section_name_width) << "Name\t";
out_file << std::setw(elem_field_width) << "Elems\t";
out_file << std::setw(vert_field_width) << "Verts\t";
out_file << std::setw(val_field_width) << "\t";
@@ -89,6 +92,7 @@ void print_statistics(quakelib::ModelWorld &world, const std::string &file_name)
out_file << "\n";
out_file << std::setw(section_field_width) << "\t";
+ out_file << std::setw(section_name_width) << "\t";
out_file << std::setw(elem_field_width) << "\t";
out_file << std::setw(vert_field_width) << "\t";
out_file << std::setw(val_field_width) << "Min\t";
@@ -120,6 +124,7 @@ void print_statistics(quakelib::ModelWorld &world, const std::string &file_name)
std::sort(slip_rate_vals.begin(), slip_rate_vals.end());
out_file << std::setw(section_field_width) << sit->id() << "\t";
+ out_file << std::setw(section_name_width) << sit->name().substr(0, section_name_width-1) << "\t";
out_file << std::setw(elem_field_width) << num_elements << "\t";
out_file << std::setw(vert_field_width) << num_vertices << "\t";
More information about the CIG-COMMITS
mailing list