mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Rename, reject update of active cell data if number of cells is not matching
p4#: 20641
This commit is contained in:
parent
df281ccb2b
commit
092974a7fa
@ -396,9 +396,16 @@ bool RifReaderEclipseOutput::open(const QString& fileName, RigEclipseCase* eclip
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderEclipseOutput::openWithoutReadingData(const QString& fileName, RigEclipseCase* eclipseCase)
|
||||
bool RifReaderEclipseOutput::openAndReadActiveCellData(const QString& fileName, RigEclipseCase* eclipseCase)
|
||||
{
|
||||
CVF_ASSERT(eclipseCase);
|
||||
|
||||
// It is required to have a main grid before reading active cell data
|
||||
if (!eclipseCase->mainGrid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
caf::ProgressInfo progInfo(100, "");
|
||||
|
||||
close();
|
||||
@ -417,7 +424,10 @@ bool RifReaderEclipseOutput::openWithoutReadingData(const QString& fileName, Rig
|
||||
progInfo.setNextProgressIncrement(50);
|
||||
progInfo.setProgressDescription("Reading active cell information");
|
||||
|
||||
readActiveCellInfo(eclipseCase);
|
||||
if (!readActiveCellInfo(eclipseCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
progInfo.incrementProgress();
|
||||
|
||||
@ -438,6 +448,7 @@ bool RifReaderEclipseOutput::openWithoutReadingData(const QString& fileName, Rig
|
||||
bool RifReaderEclipseOutput::readActiveCellInfo(RigEclipseCase* eclipseCase)
|
||||
{
|
||||
CVF_ASSERT(eclipseCase);
|
||||
CVF_ASSERT(eclipseCase->mainGrid());
|
||||
|
||||
QString egridFileName = RifEclipseOutputFileTools::fileNameByType(m_fileSet, ECL_EGRID_FILE);
|
||||
if (egridFileName.size() > 0)
|
||||
@ -459,6 +470,12 @@ bool RifReaderEclipseOutput::readActiveCellInfo(RigEclipseCase* eclipseCase)
|
||||
globalCellCount += actnumValuesPerGrid[gridIdx].size();
|
||||
}
|
||||
|
||||
// Check if number of cells is matching
|
||||
if (eclipseCase->mainGrid()->cells().size() != globalCellCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo();
|
||||
|
||||
activeCellInfo->setGlobalCellCount(globalCellCount);
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
virtual ~RifReaderEclipseOutput();
|
||||
|
||||
bool open(const QString& fileName, RigEclipseCase* eclipseCase);
|
||||
virtual bool openWithoutReadingData(const QString& fileName, RigEclipseCase* eclipseCase);
|
||||
virtual bool openAndReadActiveCellData(const QString& fileName, RigEclipseCase* eclipseCase);
|
||||
void close();
|
||||
|
||||
bool staticResult(const QString& result, PorosityModelResultType matrixOrFracture, std::vector<double>* values);
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
virtual ~RifReaderInterface() {}
|
||||
|
||||
virtual bool open(const QString& fileName, RigEclipseCase* eclipseCase) = 0;
|
||||
virtual bool openWithoutReadingData(const QString& fileName, RigEclipseCase* eclipseCase) { return true; };
|
||||
virtual bool openAndReadActiveCellData(const QString& fileName, RigEclipseCase* eclipseCase) { return true; };
|
||||
virtual void close() = 0;
|
||||
|
||||
virtual bool staticResult(const QString& result, PorosityModelResultType matrixOrFracture, std::vector<double>* values) = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user