From 158c33eb53821e744f8353a2cf9eb608e5f2ba8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Fri, 10 Aug 2012 10:12:45 +0200 Subject: [PATCH] Constructors of *FromDeck classes now take an UnstructuredGrid. This is a change from taking a vector containing the mapping to deck-consistent logical cartesian indices. The mapping is contained in the UnstructuredGrid::global_cell member, and may be null. The change therefore saves the overhead of constructing a vector as a copy of the data in the grid or (if null) as an identity mapping. --- examples/wells_example.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/examples/wells_example.cpp b/examples/wells_example.cpp index 2da110f3e..1c523420f 100644 --- a/examples/wells_example.cpp +++ b/examples/wells_example.cpp @@ -38,19 +38,8 @@ int main(int argc, char** argv) // Finally handle the wells WellsManager wells(parser, *grid.c_grid(), NULL); - int nc = grid.c_grid()->number_of_cells; - std::vector 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("gravity", 0.0)}; - IncompPropertiesFromDeck incomp_properties(parser, global_cells); + IncompPropertiesFromDeck incomp_properties(parser, *grid.c_grid()); RockCompressibility rock_comp(parser);