Using getInputGrid API from Parser

This commit is contained in:
Pål Grønås Drange
2016-04-19 16:52:40 +02:00
parent 7a75174c1e
commit 40d9a22a5f
5 changed files with 15 additions and 15 deletions

View File

@@ -551,7 +551,7 @@ public:
auto dataField = eclipseState->get3DProperties().getDoubleGridProperty("PORO").getData();
restrictAndReorderToActiveCells(dataField, numCells, compressedToCartesianCellIdx);
auto eclGrid = eclipseState->getEclipseGridCopy();
auto eclGrid = eclipseState->getInputGridCopy();
// update the ACTNUM array using the processed cornerpoint grid
std::vector<int> actnumData(eclGrid->getCartesianSize(), 1);
@@ -1209,7 +1209,7 @@ void EclipseWriter::writeInit(const SimulatorTimerInterface &timer)
/* Create summary object (could not do it at construction time,
since it requires knowledge of the start time). */
{
auto eclGrid = eclipseState_->getEclipseGrid();
auto eclGrid = eclipseState_->getInputGrid();
auto deckUnitType = eclipseState_->getDeckUnitSystem().getType();
bool time_in_days = true;
@@ -1368,7 +1368,7 @@ void EclipseWriter::writeTimeStep(const SimulatorTimerInterface& timer,
std::shared_ptr<EclipseWriterDetails::EclipseWriteRFTHandler> eclipseWriteRFTHandler = std::make_shared<EclipseWriterDetails::EclipseWriteRFTHandler>(
compressedToCartesianCellIdx_,
numCells_,
eclipseState_->getEclipseGrid()->getCartesianSize());
eclipseState_->getInputGrid()->getCartesianSize());
// Write RFT file.
{
@@ -1385,7 +1385,7 @@ void EclipseWriter::writeTimeStep(const SimulatorTimerInterface& timer,
ecl_unit,
timer,
wells,
eclipseState_->getEclipseGrid(),
eclipseState_->getInputGrid(),
pressure,
saturation_water,
saturation_gas);
@@ -1425,7 +1425,7 @@ EclipseWriter::EclipseWriter(const parameter::ParameterGroup& params,
, gridToEclipseIdx_(numCells, int(-1) )
, phaseUsage_(phaseUsage)
{
const auto eclGrid = eclipseState->getEclipseGrid();
const auto eclGrid = eclipseState->getInputGrid();
cartesianSize_[0] = eclGrid->getNX();
cartesianSize_[1] = eclGrid->getNY();
cartesianSize_[2] = eclGrid->getNZ();

View File

@@ -205,7 +205,7 @@ BOOST_AUTO_TEST_CASE(test_EclipseWriterRFTHandler)
std::shared_ptr<Opm::SimulatorTimer> simulatorTimer = std::make_shared<Opm::SimulatorTimer>();
simulatorTimer->init(eclipseState->getSchedule()->getTimeMap());
std::shared_ptr<Opm::GridManager> ourFineGridManagerPtr = std::make_shared<Opm::GridManager>(eclipseState->getEclipseGrid());
std::shared_ptr<Opm::GridManager> ourFineGridManagerPtr = std::make_shared<Opm::GridManager>(eclipseState->getInputGrid());
const UnstructuredGrid &ourFinerUnstructuredGrid = *ourFineGridManagerPtr->c_grid();
const int* compressedToCartesianCellIdx = Opm::UgGridHelpers::globalCell(ourFinerUnstructuredGrid);

View File

@@ -69,7 +69,7 @@ void createEclipseWriter(const char *deckString)
eclipseState.reset(new Opm::EclipseState(deck , parseContext));
auto eclGrid = eclipseState->getEclipseGrid();
auto eclGrid = eclipseState->getInputGrid();
BOOST_CHECK(eclGrid->getNX() == 3);
BOOST_CHECK(eclGrid->getNY() == 3);
BOOST_CHECK(eclGrid->getNZ() == 3);
@@ -212,7 +212,7 @@ void checkEgridFile()
// use ERT directly to inspect the EGRID file produced by EclipseWriter
auto egridFile = fortio_open_reader("FOO.EGRID", /*isFormated=*/0, ECL_ENDIAN_FLIP);
auto eclGrid = eclipseState->getEclipseGrid();
auto eclGrid = eclipseState->getInputGrid();
ecl_kw_type *eclKeyword;
// yes, that's an assignment!

View File

@@ -208,7 +208,7 @@ Opm::EclipseWriterPtr createEclipseWriter(Opm::DeckConstPtr deck,
Opm::EclipseWriterPtr eclWriter(new Opm::EclipseWriter(params,
eclipseState,
phaseUsage,
eclipseState->getEclipseGrid()->getCartesianSize(),
eclipseState->getInputGrid()->getCartesianSize(),
0));
return eclWriter;
}
@@ -265,10 +265,10 @@ BOOST_AUTO_TEST_CASE(EclipseReadWriteWellStateData)
std::shared_ptr<Opm::WellState> wellState(new Opm::WellState());
Opm::PhaseUsage phaseUsage = Opm::phaseUsageFromDeck(deck);
Opm::GridManager gridManager(deck);
Opm::GridManager gridManager(eclipseState->getInputGrid());
Opm::WellsManager wellsManager(eclipseState, 1, *gridManager.c_grid(), NULL);
const Wells* wells = wellsManager.c_wells();
std::shared_ptr<Opm::BlackoilState> blackoilState = createBlackOilState(eclipseState->getEclipseGrid(), phaseUsage);
std::shared_ptr<Opm::BlackoilState> blackoilState = createBlackOilState(eclipseState->getInputGrid(), phaseUsage);
wellState->init(wells, *blackoilState);
//Set test data for pressure
@@ -315,7 +315,7 @@ BOOST_AUTO_TEST_CASE(EclipseReadWriteWellStateData)
wellStateRestored->init(wells, *blackoilState);
//Read and verify OPM XWEL data, and solution data: pressure, temperature, saturation data, rs and rv
std::shared_ptr<Opm::BlackoilState> blackoilStateRestored = createBlackOilState(eclipseState->getEclipseGrid(), phaseUsage);
std::shared_ptr<Opm::BlackoilState> blackoilStateRestored = createBlackOilState(eclipseState->getInputGrid(), phaseUsage);
Opm::init_from_restart_file(eclipseState, Opm::UgGridHelpers::numCells(*gridManager.c_grid()), phaseUsage, *blackoilStateRestored, *wellStateRestored);
BOOST_CHECK_EQUAL_COLLECTIONS(wellState->bhp().begin(), wellState->bhp().end(), wellStateRestored->bhp().begin(), wellStateRestored->bhp().end());

View File

@@ -156,7 +156,7 @@ Opm::EclipseWriterPtr createEclipseWriter(Opm::DeckConstPtr deck,
Opm::EclipseWriterPtr eclWriter(new Opm::EclipseWriter(params,
eclipseState,
phaseUsage,
eclipseState->getEclipseGrid()->getCartesianSize(),
eclipseState->getInputGrid()->getCartesianSize(),
0));
return eclWriter;
}
@@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE(EclipseWriteRestartWellInfo)
eclipseWriter->writeInit(*simTimer);
std::shared_ptr<Opm::WellState> wellState(new Opm::WellState());
std::shared_ptr<Opm::BlackoilState> blackoilState = createBlackOilState(eclipseState->getEclipseGrid());
std::shared_ptr<Opm::BlackoilState> blackoilState = createBlackOilState(eclipseState->getInputGrid());
wellState->init(0, *blackoilState);
int countTimeStep = eclipseState->getSchedule()->getTimeMap()->numTimesteps();
@@ -192,7 +192,7 @@ BOOST_AUTO_TEST_CASE(EclipseWriteRestartWellInfo)
eclipseWriter->writeTimeStep(*simTimer, *blackoilState, *wellState, false);
}
verifyWellState(eclipse_restart_filename, eclipseState->getEclipseGrid(), eclipseState->getSchedule());
verifyWellState(eclipse_restart_filename, eclipseState->getInputGrid(), eclipseState->getSchedule());
test_work_area_free(test_area);
}