EclipseWriter: Store the Cartesian sizes internally

because it this array can be deleted after calling the
constructor. TODO (?): Do the same for the compressed-to-Cartesian
cell index map.
This commit is contained in:
Andreas Lauser 2014-07-14 16:11:00 +02:00
parent 1a1920e5a4
commit 89cbfac621
2 changed files with 6 additions and 3 deletions

View File

@ -1003,10 +1003,12 @@ EclipseWriter::EclipseWriter(const parameter::ParameterGroup& params,
const int* cartesianSize) const int* cartesianSize)
: deck_ (deck) : deck_ (deck)
, numCells_(numCells) , numCells_(numCells)
, cartesianSize_(cartesianSize)
, compressedToCartesianCellIdx_(compressedToCartesianCellIdx) , compressedToCartesianCellIdx_(compressedToCartesianCellIdx)
, phaseUsage_(phaseUsageFromDeck(deck_)) , phaseUsage_(phaseUsageFromDeck(deck_))
{ {
for (int i = 0; i < 3; ++i)
cartesianSize_[i] = cartesianSize[i];
init(params); init(params);
} }

View File

@ -28,7 +28,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <memory> // std::unique_ptr #include <array>
#include <memory>
struct UnstructuredGrid; struct UnstructuredGrid;
@ -99,7 +100,7 @@ public:
private: private:
Opm::DeckConstPtr deck_; Opm::DeckConstPtr deck_;
int numCells_; int numCells_;
const int* cartesianSize_; std::array<int, 3> cartesianSize_;
const int* compressedToCartesianCellIdx_; const int* compressedToCartesianCellIdx_;
bool enableOutput_; bool enableOutput_;
int outputInterval_; int outputInterval_;