LinearSolverISTLAMG() { Opm::parameter::ParameterGroup params; params.insertParameter("linsolver_tolerance", boost::lexical_cast<std::string>(5.0e-9)); params.insertParameter("linsoler_verbosity", boost::lexical_cast<std::string>(1)); params.insertParameter("linsolver_type", boost::lexical_cast<std::string>(1)); ls_.init(params); }
Opm::EclipseWriterPtr createEclipseWriter(Opm::DeckConstPtr deck, Opm::EclipseStatePtr eclipseState, std::string& eclipse_data_filename) { Opm::parameter::ParameterGroup params; params.insertParameter("deck_filename", eclipse_data_filename); const Opm::PhaseUsage phaseUsage = Opm::phaseUsageFromDeck(deck); Opm::EclipseWriterPtr eclWriter(new Opm::EclipseWriter(params, eclipseState, phaseUsage, eclipseState->getEclipseGrid()->getCartesianSize(), 0)); return eclWriter; }
void createEclipseWriter(const char *deckString) { Opm::ParseContext parseContext; Opm::ParserConstPtr parser(new Opm::Parser()); deck = parser->parseString(deckString, parseContext); Opm::parameter::ParameterGroup params; params.insertParameter("deck_filename", "foo.data"); eclipseState.reset(new Opm::EclipseState(deck , parseContext)); auto eclGrid = eclipseState->getEclipseGrid(); BOOST_CHECK(eclGrid->getNX() == 3); BOOST_CHECK(eclGrid->getNY() == 3); BOOST_CHECK(eclGrid->getNZ() == 3); BOOST_CHECK(eclGrid->getCartesianSize() == 3*3*3); simTimer.reset(new Opm::SimulatorTimer()); simTimer->init(eclipseState->getSchedule()->getTimeMap()); // also create an UnstructuredGrid (required to create a BlackoilState) Opm::EclipseGridConstPtr constEclGrid(eclGrid); ourFineGridManagerPtr.reset(new Opm::GridManager(constEclGrid)); const UnstructuredGrid &ourFinerUnstructuredGrid = *ourFineGridManagerPtr->c_grid(); BOOST_CHECK(ourFinerUnstructuredGrid.cartdims[0] == 3); BOOST_CHECK(ourFinerUnstructuredGrid.cartdims[1] == 3); BOOST_CHECK(ourFinerUnstructuredGrid.cartdims[2] == 3); BOOST_CHECK(ourFinerUnstructuredGrid.number_of_cells == 3*3*3); Opm::PhaseUsage phaseUsage = Opm::phaseUsageFromDeck(deck); 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 // of the term "face". For this grid, "number_of_faces" is 108 which is // 2*6*numCells... //BOOST_CHECK(ourFinerUnstructuredGrid.number_of_faces == 4*4*4); int numCells = ourFinerUnstructuredGrid.number_of_cells; for (int cellIdx = 0; cellIdx < numCells; ++cellIdx) BOOST_CHECK(ourFinerUnstructuredGrid.global_cell[cellIdx] == cellIdx); }