2019-03-28 08:33:30 -05:00
|
|
|
/*
|
|
|
|
Copyright 2019 Equinor ASA.
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2019-05-02 08:01:20 -05:00
|
|
|
#ifndef OPM_IO_ESMRY_HPP
|
|
|
|
#define OPM_IO_ESMRY_HPP
|
2019-03-28 08:33:30 -05:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2019-05-02 08:01:20 -05:00
|
|
|
|
2019-05-24 08:26:01 -05:00
|
|
|
namespace Opm { namespace EclIO {
|
2019-03-28 08:33:30 -05:00
|
|
|
|
|
|
|
class ESmry
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit ESmry(const std::string& filename, bool loadBaseRunData=false); // filename (smspec file) or file root name
|
|
|
|
|
2019-06-21 07:48:23 -05:00
|
|
|
int numberOfVectors() const { return nVect; }
|
2019-03-28 08:33:30 -05:00
|
|
|
|
|
|
|
bool hasKey(const std::string& key) const;
|
|
|
|
|
|
|
|
const std::vector<float>& get(const std::string& name) const;
|
2019-06-30 10:08:20 -05:00
|
|
|
|
|
|
|
std::vector<float> get_at_rstep(const std::string& name) const;
|
|
|
|
|
2019-03-28 08:33:30 -05:00
|
|
|
const std::vector<std::string>& keywordList() const { return keyword; }
|
|
|
|
|
2019-10-11 01:04:23 -05:00
|
|
|
int timestepIdxAtReportstepStart(const int reportStep) const;
|
|
|
|
|
2019-03-28 08:33:30 -05:00
|
|
|
private:
|
|
|
|
int nVect, nI, nJ, nK;
|
|
|
|
std::string path="";
|
|
|
|
|
2019-06-21 07:48:23 -05:00
|
|
|
void ijk_from_global_index(int glob, int &i, int &j, int &k) const;
|
2019-03-28 08:33:30 -05:00
|
|
|
std::vector<std::vector<float>> param;
|
|
|
|
std::vector<std::string> keyword;
|
|
|
|
|
|
|
|
std::vector<int> seqIndex;
|
|
|
|
std::vector<float> seqTime;
|
|
|
|
|
|
|
|
void getRstString(const std::vector<std::string> &restartArray, std::string &path, std::string &rootN) const;
|
|
|
|
void updatePathAndRootName(std::string &path, std::string &rootN) const;
|
|
|
|
|
2019-06-21 07:48:23 -05:00
|
|
|
std::string makeKeyString(const std::string& keyword, const std::string& wgname, int num) const;
|
2019-03-28 08:33:30 -05:00
|
|
|
};
|
|
|
|
|
2019-05-24 08:26:01 -05:00
|
|
|
}} // namespace Opm::EclIO
|
2019-03-28 08:33:30 -05:00
|
|
|
|
2019-05-02 08:01:20 -05:00
|
|
|
#endif // OPM_IO_ESMRY_HPP
|