mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
adapt to the change of the API due to using compressed instead of cartesian indices
This commit is contained in:
parent
a394af6734
commit
0e5d8da66b
@ -251,9 +251,21 @@ try
|
||||
const PhaseUsage pu = Opm::phaseUsageFromDeck(deck);
|
||||
Opm::BlackoilOutputWriter outputWriter(grid, param, eclipseState, pu );
|
||||
|
||||
int numCells = Opm::UgGridHelpers::numCells(grid);
|
||||
const auto& globalCell = Opm::UgGridHelpers::globalCell(grid);
|
||||
std::vector<int> compressedToCartesianIdx(numCells);
|
||||
for (unsigned cellIdx = 0; cellIdx < numCells; ++cellIdx) {
|
||||
if (globalCell) {
|
||||
compressedToCartesianIdx[cellIdx] = globalCell[cellIdx];
|
||||
}
|
||||
else {
|
||||
compressedToCartesianIdx[cellIdx] = cellIdx;
|
||||
}
|
||||
}
|
||||
|
||||
typedef BlackoilPropsAdFromDeck::MaterialLawManager MaterialLawManager;
|
||||
auto materialLawManager = std::make_shared<MaterialLawManager>();
|
||||
materialLawManager->initFromDeck(deck, eclipseState);
|
||||
materialLawManager->initFromDeck(deck, eclipseState, compressedToCartesianIdx);
|
||||
|
||||
// Rock and fluid init
|
||||
BlackoilPropertiesFromDeck props( deck, eclipseState, materialLawManager,
|
||||
|
@ -58,6 +58,47 @@ namespace Opm
|
||||
grid.cell_centroids, grid.dimensions, init_rock);
|
||||
}
|
||||
|
||||
#ifdef HAVE_DUNE_CORNERPOINT
|
||||
/// Constructor wrapping an opm-core black oil interface.
|
||||
BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(Opm::DeckConstPtr deck,
|
||||
Opm::EclipseStateConstPtr eclState,
|
||||
const Dune::CpGrid& grid,
|
||||
const bool init_rock )
|
||||
{
|
||||
auto materialLawManager = std::make_shared<MaterialLawManager>();
|
||||
unsigned number_of_cells = grid.size(0);
|
||||
std::vector<int> compressedToCartesianIdx(number_of_cells);
|
||||
for (unsigned cellIdx = 0; cellIdx < number_of_cells; ++cellIdx) {
|
||||
compressedToCartesianIdx[cellIdx] = grid.globalCell()[cellIdx];
|
||||
}
|
||||
materialLawManager->initFromDeck(deck, eclState, compressedToCartesianIdx);
|
||||
init(deck, eclState, materialLawManager, grid.numCells(), static_cast<const int*>(&grid.globalCell()[0]),
|
||||
static_cast<const int*>(&grid.logicalCartesianSize()[0]),
|
||||
grid.beginCellCentroids(), Dune::CpGrid::dimension, init_rock);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Constructor wrapping an opm-core black oil interface.
|
||||
BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(Opm::DeckConstPtr deck,
|
||||
Opm::EclipseStateConstPtr eclState,
|
||||
const UnstructuredGrid& grid,
|
||||
const bool init_rock)
|
||||
{
|
||||
auto materialLawManager = std::make_shared<MaterialLawManager>();
|
||||
std::vector<int> compressedToCartesianIdx(grid.number_of_cells);
|
||||
for (unsigned cellIdx = 0; cellIdx < grid.number_of_cells; ++cellIdx) {
|
||||
if (grid.global_cell) {
|
||||
compressedToCartesianIdx[cellIdx] = grid.global_cell[cellIdx];
|
||||
}
|
||||
else {
|
||||
compressedToCartesianIdx[cellIdx] = cellIdx;
|
||||
}
|
||||
}
|
||||
materialLawManager->initFromDeck(deck, eclState, compressedToCartesianIdx);
|
||||
init(deck, eclState, materialLawManager, grid.number_of_cells, grid.global_cell, grid.cartdims,
|
||||
grid.cell_centroids, grid.dimensions, init_rock);
|
||||
}
|
||||
|
||||
#ifdef HAVE_DUNE_CORNERPOINT
|
||||
/// Constructor wrapping an opm-core black oil interface.
|
||||
BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(Opm::DeckConstPtr deck,
|
||||
|
@ -77,6 +77,20 @@ namespace Opm
|
||||
const bool init_rock = true );
|
||||
#endif
|
||||
|
||||
/// Constructor wrapping an opm-core black oil interface.
|
||||
BlackoilPropsAdFromDeck(Opm::DeckConstPtr deck,
|
||||
Opm::EclipseStateConstPtr eclState,
|
||||
const UnstructuredGrid& grid,
|
||||
const bool init_rock = true );
|
||||
|
||||
#ifdef HAVE_DUNE_CORNERPOINT
|
||||
/// Constructor wrapping an opm-core black oil interface.
|
||||
BlackoilPropsAdFromDeck(Opm::DeckConstPtr deck,
|
||||
Opm::EclipseStateConstPtr eclState,
|
||||
const Dune::CpGrid& grid,
|
||||
const bool init_rock = true );
|
||||
#endif
|
||||
|
||||
/// \brief Constructor to create properties for a subgrid
|
||||
///
|
||||
/// This copies all properties that are not dependant on the
|
||||
|
Loading…
Reference in New Issue
Block a user