My Project
EclipseIOUtil.hpp
1 #ifndef ECLIPSE_IO_UTIL_HPP
2 #define ECLIPSE_IO_UTIL_HPP
3 
4 #include <vector>
5 #include <string>
6 #include <iostream>
7 
8 
9 namespace Opm
10 {
11 namespace EclipseIOUtil
12 {
13 
14  template <typename T>
15  void addToStripedData(const std::vector<T>& data, std::vector<T>& result, size_t offset, size_t stride) {
16  int dataindex = 0;
17  for (size_t index = offset; index < result.size(); index += stride) {
18  result[index] = data[dataindex];
19  ++dataindex;
20  }
21  }
22 
23 
24  template <typename T>
25  void extractFromStripedData(const std::vector<T>& data, std::vector<T>& result, size_t offset, size_t stride) {
26  for (size_t index = offset; index < data.size(); index += stride) {
27  result.push_back(data[index]);
28  }
29  }
30 
31 
32 } //namespace EclipseIOUtil
33 } //namespace Opm
34 
35 #endif //ECLIPSE_IO_UTIL_HPP
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29