EclipseWriter: stop making UnstructuredGrid think it is special

instead, the same interface as for Dune::CpGrid is now
used. (i.e. pass all relevant information as separate arguments.)
This commit is contained in:
Andreas Lauser
2014-07-14 12:20:10 +02:00
parent 6ac1196859
commit 15ff31f307
3 changed files with 10 additions and 20 deletions

View File

@@ -1,5 +1,6 @@
#include "OutputWriter.hpp"
#include <opm/core/grid.h>
#include <opm/core/io/eclipse/EclipseWriter.hpp>
#include <opm/core/utility/parameters/Parameter.hpp>
#include <opm/core/utility/parameters/ParameterGroup.hpp>
@@ -48,7 +49,11 @@ template <typename Format> unique_ptr <OutputWriter>
create (const ParameterGroup& params,
std::shared_ptr <const Deck> parser,
std::shared_ptr <const UnstructuredGrid> grid) {
return unique_ptr <OutputWriter> (new Format (params, parser, grid));
return unique_ptr <OutputWriter> (new Format (params,
parser,
grid->number_of_cells,
grid->global_cell,
grid->cartdims));
}
/// Map between keyword in configuration and the corresponding

View File

@@ -24,6 +24,8 @@
#include <opm/core/props/BlackoilPhases.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/core/grid.h>
#include <opm/core/grid/cpgpreprocess/preprocess.h>
#include <opm/core/props/phaseUsageFromDeck.hpp>
#include <opm/core/simulator/SimulatorState.hpp>
#include <opm/core/simulator/SimulatorTimer.hpp>
@@ -1159,30 +1161,15 @@ void EclipseWriter::writeTimeStep(
EclipseWriter::EclipseWriter (
const ParameterGroup& params,
Opm::DeckConstPtr deck,
int number_of_cells, const int* global_cell, const int* cart_dims,
int dimensions)
int number_of_cells, const int* global_cell, const int* cart_dims)
: deck_ (deck)
, number_of_cells_(number_of_cells)
, dimensions_(dimensions)
, cart_dims_(cart_dims)
, global_cell_(global_cell)
, uses_ (phaseUsageFromDeck (deck_)) {
init(params);
}
EclipseWriter::EclipseWriter (
const ParameterGroup& params,
Opm::DeckConstPtr deck,
std::shared_ptr<const UnstructuredGrid> grid)
: deck_ (deck)
, grid_(grid)
, number_of_cells_(grid->number_of_cells)
, dimensions_(grid->dimensions)
, cart_dims_(grid->cartdims)
, global_cell_(grid->global_cell)
, uses_ (phaseUsageFromDeck (deck_)) {
init(params);
}
void EclipseWriter::init(const ParameterGroup& params)
{
// get the base name from the name of the deck

View File

@@ -60,8 +60,7 @@ public:
*/
EclipseWriter(const parameter::ParameterGroup& params,
Opm::DeckConstPtr deck,
int number_of_cells, const int* global_cell, const int* cart_dims,
int dimension);
int number_of_cells, const int* global_cell, const int* cart_dims);
/**
* We need a destructor in the compilation unit to avoid the
@@ -95,7 +94,6 @@ public:
private:
Opm::DeckConstPtr deck_;
int number_of_cells_;
int dimensions_;
const int* cart_dims_;
const int* global_cell_;
bool enableOutput_;