Adapt to possibility for Cartesian grids from deck input.
Now we may have a grid generated from deck input using the keywords DXV, DYV, DZV, which will have a null pointer for the global_cell mapping. We check if this pointer is null, and create an identity mapping in this case. The mapping is needed by the *PropertiesFromDeck classes (and helpers).
This commit is contained in:
parent
1de03f017c
commit
193d4d3921
@ -81,8 +81,16 @@ main(int argc, char** argv)
|
|||||||
// Grid init
|
// Grid init
|
||||||
grid.reset(new GridManager(*deck));
|
grid.reset(new GridManager(*deck));
|
||||||
// Rock and fluid init
|
// Rock and fluid init
|
||||||
|
int nc = grid->c_grid()->number_of_cells;
|
||||||
|
std::vector<int> global_cell(nc);
|
||||||
const int* gc = grid->c_grid()->global_cell;
|
const int* gc = grid->c_grid()->global_cell;
|
||||||
std::vector<int> global_cell(gc, gc + grid->c_grid()->number_of_cells);
|
if (gc != 0) {
|
||||||
|
std::copy(gc, gc + nc, global_cell.begin());
|
||||||
|
} else {
|
||||||
|
for (int cell = 0; cell < nc; ++cell) {
|
||||||
|
global_cell[cell] = cell;
|
||||||
|
}
|
||||||
|
}
|
||||||
props.reset(new IncompPropertiesFromDeck(*deck, global_cell));
|
props.reset(new IncompPropertiesFromDeck(*deck, global_cell));
|
||||||
// check_well_controls = param.getDefault("check_well_controls", false);
|
// check_well_controls = param.getDefault("check_well_controls", false);
|
||||||
// max_well_control_iterations = param.getDefault("max_well_control_iterations", 10);
|
// max_well_control_iterations = param.getDefault("max_well_control_iterations", 10);
|
||||||
|
@ -178,8 +178,16 @@ main(int argc, char** argv)
|
|||||||
// Grid init
|
// Grid init
|
||||||
grid.reset(new Opm::GridManager(deck));
|
grid.reset(new Opm::GridManager(deck));
|
||||||
// Rock and fluid init
|
// Rock and fluid init
|
||||||
|
int nc = grid->c_grid()->number_of_cells;
|
||||||
|
std::vector<int> global_cell(nc);
|
||||||
const int* gc = grid->c_grid()->global_cell;
|
const int* gc = grid->c_grid()->global_cell;
|
||||||
std::vector<int> global_cell(gc, gc + grid->c_grid()->number_of_cells);
|
if (gc != 0) {
|
||||||
|
std::copy(gc, gc + nc, global_cell.begin());
|
||||||
|
} else {
|
||||||
|
for (int cell = 0; cell < nc; ++cell) {
|
||||||
|
global_cell[cell] = cell;
|
||||||
|
}
|
||||||
|
}
|
||||||
props.reset(new Opm::BlackoilPropertiesFromDeck(deck, global_cell));
|
props.reset(new Opm::BlackoilPropertiesFromDeck(deck, global_cell));
|
||||||
// Wells init.
|
// Wells init.
|
||||||
wells.reset(new Opm::WellsManager(deck, *grid->c_grid(), props->permeability()));
|
wells.reset(new Opm::WellsManager(deck, *grid->c_grid(), props->permeability()));
|
||||||
|
@ -309,8 +309,16 @@ main(int argc, char** argv)
|
|||||||
// Grid init
|
// Grid init
|
||||||
grid.reset(new Opm::GridManager(deck));
|
grid.reset(new Opm::GridManager(deck));
|
||||||
// Rock and fluid init
|
// Rock and fluid init
|
||||||
|
int nc = grid->c_grid()->number_of_cells;
|
||||||
|
std::vector<int> global_cell(nc);
|
||||||
const int* gc = grid->c_grid()->global_cell;
|
const int* gc = grid->c_grid()->global_cell;
|
||||||
std::vector<int> global_cell(gc, gc + grid->c_grid()->number_of_cells);
|
if (gc != 0) {
|
||||||
|
std::copy(gc, gc + nc, global_cell.begin());
|
||||||
|
} else {
|
||||||
|
for (int cell = 0; cell < nc; ++cell) {
|
||||||
|
global_cell[cell] = cell;
|
||||||
|
}
|
||||||
|
}
|
||||||
props.reset(new Opm::IncompPropertiesFromDeck(deck, global_cell));
|
props.reset(new Opm::IncompPropertiesFromDeck(deck, global_cell));
|
||||||
// Wells init.
|
// Wells init.
|
||||||
wells.reset(new Opm::WellsManager(deck, *grid->c_grid(), props->permeability()));
|
wells.reset(new Opm::WellsManager(deck, *grid->c_grid(), props->permeability()));
|
||||||
|
@ -38,7 +38,16 @@ int main(int argc, char** argv)
|
|||||||
// Finally handle the wells
|
// Finally handle the wells
|
||||||
WellsManager wells(parser, *grid.c_grid(), NULL);
|
WellsManager wells(parser, *grid.c_grid(), NULL);
|
||||||
|
|
||||||
std::vector<int> global_cells(grid.c_grid()->global_cell, grid.c_grid()->global_cell + grid.c_grid()->number_of_cells);
|
int nc = grid.c_grid()->number_of_cells;
|
||||||
|
std::vector<int> global_cells(nc);
|
||||||
|
const int* gc = grid.c_grid()->global_cell;
|
||||||
|
if (gc != 0) {
|
||||||
|
std::copy(gc, gc + nc, global_cells.begin());
|
||||||
|
} else {
|
||||||
|
for (int cell = 0; cell < nc; ++cell) {
|
||||||
|
global_cells[cell] = cell;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
double gravity[3] = {0.0, 0.0, parameters.getDefault<double>("gravity", 0.0)};
|
double gravity[3] = {0.0, 0.0, parameters.getDefault<double>("gravity", 0.0)};
|
||||||
IncompPropertiesFromDeck incomp_properties(parser, global_cells);
|
IncompPropertiesFromDeck incomp_properties(parser, global_cells);
|
||||||
|
Loading…
Reference in New Issue
Block a user