Merge pull request #839 from joakim-hove/summarystate-operator<<

Summarystate operator<<
This commit is contained in:
Joakim Hove 2019-06-21 21:03:31 +02:00 committed by GitHub
commit 260365870a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -24,6 +24,7 @@
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <iosfwd>
#include <ert/ecl/smspec_node.hpp>
@ -110,5 +111,8 @@ private:
std::unordered_set<std::string> m_groups;
};
std::ostream& operator<<(std::ostream& stream, const SummaryState& st);
}
#endif

View File

@ -19,6 +19,8 @@
#include <unordered_map>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
@ -339,4 +341,12 @@ namespace {
}
}
}
std::ostream& operator<<(std::ostream& stream, const SummaryState& st) {
stream << "Simulated seconds: " << st.get_elapsed() << std::endl;
for (const auto& value_pair : st)
stream << std::setw(17) << value_pair.first << ": " << value_pair.second << std::endl;
return stream;
}
}