Added reading of grid dimensions

p4#: 21154
This commit is contained in:
Magne Sjaastad 2013-04-07 16:33:45 +02:00
parent 1b07630239
commit 6c9f5d1978
2 changed files with 20 additions and 0 deletions

View File

@ -21,6 +21,7 @@
#include "util.h"
#include "ecl_file.h"
#include "ecl_kw_magic.h"
#include "ecl_grid.h"
#include <QFileInfo>
#include <QDebug>
@ -301,3 +302,20 @@ void RifEclipseOutputFileTools::findKeywordsAndDataItemCounts(ecl_file_type* ecl
info.setProgress(i);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseOutputFileTools::readGridDimensions(const QString& gridFileName, std::vector< std::vector<int> >& gridDimensions)
{
int gridDims[3];
bool ret = ecl_grid_file_dims(gridFileName.toAscii().data(), NULL, gridDims);
if (ret)
{
gridDimensions.resize(1);
gridDimensions[0].push_back(gridDims[0]);
gridDimensions[0].push_back(gridDims[1]);
gridDimensions[0].push_back(gridDims[2]);
}
}

View File

@ -54,4 +54,6 @@ public:
static QString fileNameByType(const QStringList& fileSet, ecl_file_enum fileType);
static QStringList fileNamesByType(const QStringList& fileSet, ecl_file_enum fileType);
static void readGridDimensions(const QString& gridFileName, std::vector< std::vector<int> >& gridDimensions);
};