Add basic operator<< for SummaryState
This commit is contained in:
parent
3d7bcb19ee
commit
5604c4c3ba
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user