Use constant grid in output writing

Grid manager returns a const UnstructuredGrid*, and the entire chain
of pointer-passing glory should adhere to this const-ness.
This commit is contained in:
Roland Kaufmann 2013-11-19 14:33:58 +01:00
parent e02f0cd7de
commit 1baf7369ef
6 changed files with 10 additions and 10 deletions

View File

@ -47,7 +47,7 @@ private:
template <typename Format> unique_ptr <OutputWriter>
create (const ParameterGroup& params,
std::shared_ptr <EclipseGridParser> parser,
std::shared_ptr <UnstructuredGrid> grid) {
std::shared_ptr <const UnstructuredGrid> grid) {
return unique_ptr <OutputWriter> (new Format (params, parser, grid));
}
@ -60,7 +60,7 @@ create (const ParameterGroup& params,
typedef map <const char*, unique_ptr <OutputWriter> (*)(
const ParameterGroup&,
std::shared_ptr <EclipseGridParser>,
std::shared_ptr <UnstructuredGrid>)> map_t;
std::shared_ptr <const UnstructuredGrid>)> map_t;
map_t FORMATS = {
{ "output_ecl", &create <EclipseWriter> },
};
@ -70,7 +70,7 @@ map_t FORMATS = {
unique_ptr <OutputWriter>
OutputWriter::create (const ParameterGroup& params,
std::shared_ptr <EclipseGridParser> parser,
std::shared_ptr <UnstructuredGrid> grid) {
std::shared_ptr <const UnstructuredGrid> grid) {
// allocate a list which will be filled with writers. this list
// is initially empty (no output).
MultiWriter::ptr_t list (new MultiWriter::writers_t ());

View File

@ -93,7 +93,7 @@ public:
static std::unique_ptr <OutputWriter>
create (const parameter::ParameterGroup& params,
std::shared_ptr <EclipseGridParser> parser,
std::shared_ptr <UnstructuredGrid> grid);
std::shared_ptr <const UnstructuredGrid> grid);
};
} // namespace Opm

View File

@ -841,7 +841,7 @@ void EclipseWriter::writeTimeStep(
EclipseWriter::EclipseWriter (
const ParameterGroup& params,
std::shared_ptr <EclipseGridParser> parser,
std::shared_ptr <UnstructuredGrid> grid)
std::shared_ptr <const UnstructuredGrid> grid)
: parser_ (parser)
, grid_ (grid)
, uses_ (phaseUsageFromDeck (*parser)) {

View File

@ -62,7 +62,7 @@ public:
*/
EclipseWriter(const parameter::ParameterGroup& params,
std::shared_ptr <EclipseGridParser> parser,
std::shared_ptr <UnstructuredGrid> grid);
std::shared_ptr <const UnstructuredGrid> grid);
/*!
* \brief Write the static eclipse data (grid, PVT curves, etc) to disk
@ -82,7 +82,7 @@ public:
private:
std::shared_ptr <EclipseGridParser> parser_;
std::shared_ptr <UnstructuredGrid> grid_;
std::shared_ptr <const UnstructuredGrid> grid_;
std::string outputDir_;
std::string baseName_;
PhaseUsage uses_; // active phases in the input deck

View File

@ -31,7 +31,7 @@ using namespace Opm;
SimulatorOutputBase::SimulatorOutputBase (
const parameter::ParameterGroup& params,
std::shared_ptr <EclipseGridParser> parser,
std::shared_ptr <UnstructuredGrid> grid,
std::shared_ptr <const UnstructuredGrid> grid,
std::shared_ptr <SimulatorTimer> timer,
std::shared_ptr <BlackoilState> state,
std::shared_ptr <WellState> wellState)

View File

@ -50,7 +50,7 @@ protected:
*/
SimulatorOutputBase (const parameter::ParameterGroup& p,
std::shared_ptr <EclipseGridParser> parser,
std::shared_ptr <UnstructuredGrid> grid,
std::shared_ptr <const UnstructuredGrid> grid,
std::shared_ptr <SimulatorTimer> timer,
std::shared_ptr <BlackoilState> state,
std::shared_ptr <WellState> wellState);
@ -130,7 +130,7 @@ template <typename Simulator>
struct SimulatorOutput : public SimulatorOutputBase {
SimulatorOutput (const parameter::ParameterGroup& params,
std::shared_ptr <EclipseGridParser> parser,
std::shared_ptr <UnstructuredGrid> grid,
std::shared_ptr <const UnstructuredGrid> grid,
std::shared_ptr <SimulatorTimer> timer,
std::shared_ptr <BlackoilState> state,
std::shared_ptr <WellState> wellState,