Add basic operator<< for SummaryState

This commit is contained in:
Joakim Hove 2019-06-21 19:16:37 +02:00
parent 3d7bcb19ee
commit 2ecfa6e7b2
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;
}
}