Integrate SummaryNode in ESmry (#1642)
This commit is contained in:
@@ -22,7 +22,9 @@
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include <opm/common/utility/FileSystem.hpp>
|
||||
#include <opm/io/eclipse/SummaryNode.hpp>
|
||||
|
||||
namespace Opm { namespace EclIO {
|
||||
|
||||
@@ -38,18 +40,22 @@ public:
|
||||
bool hasKey(const std::string& key) const;
|
||||
|
||||
const std::vector<float>& get(const std::string& name) const;
|
||||
const std::vector<float>& get(const SummaryNode& node) const;
|
||||
|
||||
std::vector<float> get_at_rstep(const std::string& name) const;
|
||||
std::vector<float> get_at_rstep(const SummaryNode& node) const;
|
||||
|
||||
const std::vector<int>& get_startdat() const { return startdat; }
|
||||
|
||||
const std::vector<std::string>& keywordList() const { return keyword; }
|
||||
const std::vector<std::string>& keywordList() const;
|
||||
const std::vector<SummaryNode>& summaryNodeList() const;
|
||||
|
||||
int timestepIdxAtReportstepStart(const int reportStep) const;
|
||||
|
||||
size_t numberOfTimeSteps() const { return param[0].size(); }
|
||||
|
||||
const std::string& get_unit(const std::string& name) const;
|
||||
const std::string& get_unit(const SummaryNode& node) const;
|
||||
|
||||
private:
|
||||
int nVect, nI, nJ, nK;
|
||||
@@ -57,6 +63,7 @@ private:
|
||||
void ijk_from_global_index(int glob, int &i, int &j, int &k) const;
|
||||
std::vector<std::vector<float>> param;
|
||||
std::vector<std::string> keyword;
|
||||
std::vector<SummaryNode> summaryNodes;
|
||||
std::unordered_map<std::string, std::string> kwunits;
|
||||
|
||||
std::vector<int> seqIndex;
|
||||
@@ -74,6 +81,9 @@ private:
|
||||
void updatePathAndRootName(Opm::filesystem::path& dir, Opm::filesystem::path& rootN) const;
|
||||
|
||||
std::string makeKeyString(const std::string& keyword, const std::string& wgname, int num) const;
|
||||
|
||||
std::string unpackNumber(const SummaryNode&) const;
|
||||
std::string lookupKey(const SummaryNode&) const;
|
||||
};
|
||||
|
||||
}} // namespace Opm::EclIO
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_IO_SUMMARYNODE_HPP
|
||||
#define OPM_IO_SUMMARYNODE_HPP
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
|
||||
namespace Opm::EclIO {
|
||||
|
||||
@@ -53,7 +58,15 @@ struct SummaryNode {
|
||||
constexpr static int default_number { std::numeric_limits<int>::min() };
|
||||
|
||||
std::string unique_key() const;
|
||||
|
||||
using number_renderer = std::function<std::string(const SummaryNode&)>;
|
||||
std::string unique_key(number_renderer) const;
|
||||
|
||||
bool is_user_defined() const;
|
||||
|
||||
static Category category_from_keyword(const std::string&, const std::unordered_set<std::string> &miscellaneous_keywords = {});
|
||||
};
|
||||
|
||||
} // namespace Opm::EclIO
|
||||
|
||||
#endif // OPM_IO_SUMMARYNODE_HPP
|
||||
|
||||
Reference in New Issue
Block a user