19#ifndef OPM_IO_ECLUTIL_HPP
20#define OPM_IO_ECLUTIL_HPP
22#include <opm/io/eclipse/EclIOdata.hpp>
29namespace Opm {
namespace EclIO {
31 int flipEndianInt(
int num);
32 int64_t flipEndianLongInt(int64_t num);
33 float flipEndianFloat(
float num);
34 double flipEndianDouble(
double num);
35 bool isEOF(std::fstream* fileH);
36 bool fileExists(
const std::string& filename);
37 bool isFormatted(
const std::string& filename);
38 bool is_number(
const std::string& numstr);
45 int combineSummaryNumbers(
const int n1,
const int n2);
49 std::tuple<int,int> splitSummaryNumber(
const int n);
51 std::tuple<int, int> block_size_data_binary(eclArrType arrType);
52 std::tuple<int, int, int> block_size_data_formatted(eclArrType arrType);
54 std::string trimr(
const std::string &str1);
56 uint64_t sizeOnDiskBinary(int64_t num, Opm::EclIO::eclArrType arrType,
int elementSize);
57 uint64_t sizeOnDiskFormatted(
const int64_t num, Opm::EclIO::eclArrType arrType,
int elementSize);
59 void readBinaryHeader(std::fstream& fileH, std::string& tmpStrName,
60 int& tmpSize, std::string& tmpStrType);
62 void readBinaryHeader(std::fstream& fileH, std::string& arrName,
63 int64_t& size, Opm::EclIO::eclArrType &arrType,
int& elementSize);
65 void readFormattedHeader(std::fstream& fileH, std::string& arrName,
66 int64_t &num, Opm::EclIO::eclArrType &arrType,
int& elementSize);
68 template<
typename T,
typename T2>
69 std::vector<T> readBinaryArray(std::fstream& fileH,
const int64_t size, Opm::EclIO::eclArrType type,
70 std::function<T(T2)>& flip,
int elementSize);
72 std::vector<int> readBinaryInteArray(std::fstream &fileH,
const int64_t size);
73 std::vector<float> readBinaryRealArray(std::fstream& fileH,
const int64_t size);
74 std::vector<double> readBinaryDoubArray(std::fstream& fileH,
const int64_t size);
75 std::vector<bool> readBinaryLogiArray(std::fstream &fileH,
const int64_t size);
76 std::vector<unsigned int> readBinaryRawLogiArray(std::fstream &fileH,
const int64_t size);
77 std::vector<std::string> readBinaryCharArray(std::fstream& fileH,
const int64_t size);
78 std::vector<std::string> readBinaryC0nnArray(std::fstream& fileH,
const int64_t size,
int elementSize);
81 std::vector<T> readFormattedArray(
const std::string& file_str,
const int size, int64_t fromPos,
82 std::function<T(
const std::string&)>& process);
84 std::vector<int> readFormattedInteArray(
const std::string& file_str,
const int64_t size, int64_t fromPos);
86 std::vector<std::string> readFormattedCharArray(
const std::string& file_str,
const int64_t size,
87 int64_t fromPos,
int elementSize);
89 std::vector<float> readFormattedRealArray(
const std::string& file_str,
const int64_t size, int64_t fromPos);
90 std::vector<std::string> readFormattedRealRawStrings(
const std::string& file_str,
const int64_t size, int64_t fromPos);
92 std::vector<bool> readFormattedLogiArray(
const std::string& file_str,
const int64_t size, int64_t fromPos);
93 std::vector<double> readFormattedDoubArray(
const std::string& file_str,
const int64_t size, int64_t fromPos);
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29