19 #ifndef OPM_IO_ExtESmry_HPP 20 #define OPM_IO_ExtESmry_HPP 22 #include <opm/common/utility/TimeService.hpp> 30 #include <unordered_map> 31 #include <unordered_set> 34 namespace Opm {
namespace EclIO {
36 using ArrSourceEntry = std::tuple<std::string, std::string, int, std::uint64_t>;
37 using TimeStepEntry = std::tuple<int, int, std::uint64_t>;
38 using RstEntry = std::tuple<std::string, int>;
41 using ExtSmryHeadType = std::tuple<time_point, RstEntry, std::vector<std::string>, std::vector<std::string>,
42 std::vector<int>, std::vector<int>>;
49 explicit ExtESmry(
const std::string& filename,
bool loadBaseRunData=
false);
51 const std::vector<float>&
get(
const std::string& name);
52 std::vector<float> get_at_rstep(
const std::string& name);
53 std::string& get_unit(
const std::string& name);
56 void loadData(
const std::vector<std::string>& stringVect);
58 time_point startdate()
const {
return m_startdat; }
59 const std::vector<int>& start_v()
const {
return m_start_vect; }
61 bool hasKey(
const std::string& key)
const;
63 std::size_t numberOfTimeSteps()
const {
return m_nTstep; }
64 std::size_t numberOfVectors()
const {
return m_nVect; }
66 const std::vector<std::string>& keywordList()
const {
return m_keyword;}
67 std::vector<std::string> keywordList(
const std::string& pattern)
const;
69 std::vector<time_point> dates();
71 bool all_steps_available();
72 std::string rootname() {
return m_inputFileName.stem().generic_string(); }
73 std::tuple<double, double> get_io_elapsed()
const;
76 std::filesystem::path m_inputFileName;
77 std::vector<std::filesystem::path> m_esmry_files;
80 std::vector<std::map<std::string, int>> m_keyword_index;
81 std::vector<std::tuple<int,int>> m_tstep_range;
82 std::vector<std::string> m_keyword;
83 std::unordered_set<std::string> m_keyword_set;
84 std::vector<int> m_rstep;
85 std::vector<int> m_tstep;
86 std::vector<std::vector<int>> m_rstep_v;
87 std::vector<std::vector<int>> m_tstep_v;
88 std::vector<std::vector<float>> m_vectorData;
89 std::vector<bool> m_vectorLoaded;
90 std::unordered_map<std::string, std::string> kwunits;
93 std::vector<std::size_t> m_nTstep_v;
95 std::vector<int> m_seqIndex;
97 std::vector<std::uint64_t> m_rstep_offset;
99 time_point m_startdat;
100 std::vector<int> m_start_vect;
105 bool open_esmry(
const std::filesystem::path& inputFileName, ExtSmryHeadType& ext_smry_head, std::uint64_t& rstep_offset);
107 bool load_esmry(
const std::vector<std::string>& stringVect,
const std::vector<int>& keyIndexVect,
108 const std::vector<int>& loadKeyIndex,
int ind,
int to_ind );
110 void updatePathAndRootName(std::filesystem::path& dir, std::filesystem::path& rootN);
115 #endif // OPM_IO_ExtESmry_HPP This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: ExtESmry.hpp:44