Removed numCells parameter

This commit is contained in:
Kjell W. Kongsvik
2016-04-12 15:33:51 +02:00
parent 8b5d067f64
commit c6bfcef5e6
7 changed files with 5 additions and 11 deletions

View File

@@ -54,7 +54,6 @@ create (const ParameterGroup& params,
return unique_ptr <OutputWriter> (new Format (params,
eclipseState,
phaseUsage,
grid->number_of_cells,
grid->global_cell));
}

View File

@@ -71,7 +71,6 @@ public:
EclipseWriter(const parameter::ParameterGroup& params,
Opm::EclipseStateConstPtr eclipseState,
const Opm::PhaseUsage &phaseUsage,
int numCells,
const int* compressedToCartesianCellIdx);
/**

View File

@@ -1417,12 +1417,9 @@ void EclipseWriter::writeTimeStep(const SimulatorTimerInterface& timer,
EclipseWriter::EclipseWriter(const parameter::ParameterGroup& params,
Opm::EclipseStateConstPtr eclipseState,
const Opm::PhaseUsage &phaseUsage,
int numCells,
const int* compressedToCartesianCellIdx)
: eclipseState_(eclipseState)
, numCells_(numCells)
, compressedToCartesianCellIdx_(compressedToCartesianCellIdx)
, gridToEclipseIdx_(numCells, int(-1) )
, phaseUsage_(phaseUsage)
{
const auto eclGrid = eclipseState->getInputGrid();
@@ -1430,11 +1427,14 @@ EclipseWriter::EclipseWriter(const parameter::ParameterGroup& params,
cartesianSize_[1] = eclGrid->getNY();
cartesianSize_[2] = eclGrid->getNZ();
numCells_ = eclGrid->getNumActive();
gridToEclipseIdx_ = std::vector<int>(numCells_, int(-1) );
if( compressedToCartesianCellIdx ) {
// if compressedToCartesianCellIdx available then
// compute mapping to eclipse order
std::map< int , int > indexMap;
for (int cellIdx = 0; cellIdx < numCells; ++cellIdx) {
for (int cellIdx = 0; cellIdx < numCells_; ++cellIdx) {
int cartesianCellIdx = compressedToCartesianCellIdx[cellIdx];
indexMap[ cartesianCellIdx ] = cellIdx;
}
@@ -1446,7 +1446,7 @@ EclipseWriter::EclipseWriter(const parameter::ParameterGroup& params,
}
else {
// if not compressedToCartesianCellIdx was given use identity
for (int cellIdx = 0; cellIdx < numCells; ++cellIdx) {
for (int cellIdx = 0; cellIdx < numCells_; ++cellIdx) {
gridToEclipseIdx_[ cellIdx ] = cellIdx;
}
}

View File

@@ -137,7 +137,6 @@ std::shared_ptr<Opm::EclipseWriter> createEclipseWriter(std::shared_ptr<const Op
std::shared_ptr<Opm::EclipseWriter> eclipseWriter = std::make_shared<Opm::EclipseWriter>(params,
eclipseState,
phaseUsage,
ourFinerUnstructuredGrid.number_of_cells,
compressedToCartesianCellIdx);
return eclipseWriter;

View File

@@ -93,7 +93,6 @@ void createEclipseWriter(const char *deckString)
eclWriter.reset(new Opm::EclipseWriter(params,
eclipseState,
phaseUsage,
ourFinerUnstructuredGrid.number_of_cells,
0));
// this check is disabled so far, because UnstructuredGrid uses some weird definition

View File

@@ -208,7 +208,6 @@ Opm::EclipseWriterPtr createEclipseWriter(Opm::DeckConstPtr deck,
Opm::EclipseWriterPtr eclWriter(new Opm::EclipseWriter(params,
eclipseState,
phaseUsage,
eclipseState->getInputGrid()->getCartesianSize(),
0));
return eclWriter;
}

View File

@@ -156,7 +156,6 @@ Opm::EclipseWriterPtr createEclipseWriter(Opm::DeckConstPtr deck,
Opm::EclipseWriterPtr eclWriter(new Opm::EclipseWriter(params,
eclipseState,
phaseUsage,
eclipseState->getInputGrid()->getCartesianSize(),
0));
return eclWriter;
}