From aff6fad661449c4234b31ebbcc62e9246b47c7b0 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Thu, 21 Nov 2013 12:17:54 +0100 Subject: [PATCH] Use more generic simulator state We can dump the state of the two-phase incompressible simulators as well as the blackoil simulators by just using the common interface. --- opm/core/io/OutputWriter.cpp | 2 +- opm/core/io/OutputWriter.hpp | 4 ++-- opm/core/io/eclipse/EclipseWriter.cpp | 6 +++--- opm/core/io/eclipse/EclipseWriter.hpp | 4 ++-- opm/core/simulator/SimulatorOutput.cpp | 2 +- opm/core/simulator/SimulatorOutput.hpp | 10 +++++----- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/opm/core/io/OutputWriter.cpp b/opm/core/io/OutputWriter.cpp index 3da33e07..faf2241b 100644 --- a/opm/core/io/OutputWriter.cpp +++ b/opm/core/io/OutputWriter.cpp @@ -32,7 +32,7 @@ struct MultiWriter : public OutputWriter { } virtual void writeTimeStep(const SimulatorTimer& timer, - const BlackoilState& reservoirState, + const SimulatorState& reservoirState, const WellState& wellState) { for (it_t it = writers_->begin (); it != writers_->end(); ++it) { (*it)->writeTimeStep (timer, reservoirState, wellState); diff --git a/opm/core/io/OutputWriter.hpp b/opm/core/io/OutputWriter.hpp index 4ef7d704..2f9d39bc 100644 --- a/opm/core/io/OutputWriter.hpp +++ b/opm/core/io/OutputWriter.hpp @@ -27,9 +27,9 @@ struct UnstructuredGrid; namespace Opm { // forward declaration -class BlackoilState; class EclipseGridParser; namespace parameter { class ParameterGroup; } +class SimulatorState; class SimulatorTimer; class WellState; @@ -72,7 +72,7 @@ public: * \param[in] wellState The production/injection data for all wells */ virtual void writeTimeStep(const SimulatorTimer& timer, - const BlackoilState& reservoirState, + const SimulatorState& reservoirState, const WellState& wellState) = 0; /*! diff --git a/opm/core/io/eclipse/EclipseWriter.cpp b/opm/core/io/eclipse/EclipseWriter.cpp index 5092f1fd..f2591649 100644 --- a/opm/core/io/eclipse/EclipseWriter.cpp +++ b/opm/core/io/eclipse/EclipseWriter.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -896,7 +896,7 @@ void EclipseWriter::writeInit(const SimulatorTimer &timer) { void EclipseWriter::writeTimeStep( const SimulatorTimer& timer, - const BlackoilState& reservoirState, + const SimulatorState& reservoirState, const WellState& wellState) { // convert the pressures from Pascals to bar because eclipse // seems to write bars @@ -945,7 +945,7 @@ void EclipseWriter::writeInit(const SimulatorTimer &timer) { void EclipseWriter::writeTimeStep( const SimulatorTimer& timer, - const BlackoilState& reservoirState, + const SimulatorState& reservoirState, const WellState& wellState) { OPM_THROW(std::runtime_error, "The ERT libraries are required to write ECLIPSE output files."); diff --git a/opm/core/io/eclipse/EclipseWriter.hpp b/opm/core/io/eclipse/EclipseWriter.hpp index 6ddc54cb..e1f00fe2 100644 --- a/opm/core/io/eclipse/EclipseWriter.hpp +++ b/opm/core/io/eclipse/EclipseWriter.hpp @@ -32,8 +32,8 @@ struct UnstructuredGrid; namespace Opm { // forward declarations -class BlackoilState; class EclipseGridParser; +class SimulatorState; class SimulatorTimer; class WellState; @@ -83,7 +83,7 @@ public: * \param[in] wellState The production/injection data for all wells */ virtual void writeTimeStep(const SimulatorTimer& timer, - const BlackoilState& reservoirState, + const SimulatorState& reservoirState, const WellState& wellState); private: diff --git a/opm/core/simulator/SimulatorOutput.cpp b/opm/core/simulator/SimulatorOutput.cpp index 9008c481..0ee754bc 100644 --- a/opm/core/simulator/SimulatorOutput.cpp +++ b/opm/core/simulator/SimulatorOutput.cpp @@ -33,7 +33,7 @@ SimulatorOutputBase::SimulatorOutputBase ( std::shared_ptr parser, std::shared_ptr grid, std::shared_ptr timer, - std::shared_ptr state, + std::shared_ptr state, std::shared_ptr wellState) // store all parameters passed into the object, making them curried diff --git a/opm/core/simulator/SimulatorOutput.hpp b/opm/core/simulator/SimulatorOutput.hpp index 8037e79d..da9e71e3 100644 --- a/opm/core/simulator/SimulatorOutput.hpp +++ b/opm/core/simulator/SimulatorOutput.hpp @@ -32,10 +32,10 @@ struct UnstructuredGrid; namespace Opm { // forward definitions -class BlackoilState; class EclipseGridParser; class OutputWriter; namespace parameter { class ParameterGroup; } +class SimulatorState; class SimulatorTimer; class WellState; @@ -56,7 +56,7 @@ protected: std::shared_ptr parser, std::shared_ptr grid, std::shared_ptr timer, - std::shared_ptr state, + std::shared_ptr state, std::shared_ptr wellState); /** @@ -75,7 +75,7 @@ protected: /// Just hold a reference to these objects that are owned elsewhere. std::shared_ptr timer_; - std::shared_ptr reservoirState_; + std::shared_ptr reservoirState_; std::shared_ptr wellState_; /// Created locally and destructed together with us @@ -142,7 +142,7 @@ struct SimulatorOutput : public SimulatorOutputBase { std::shared_ptr parser, std::shared_ptr grid, std::shared_ptr timer, - std::shared_ptr state, + std::shared_ptr state, std::shared_ptr wellState, std::shared_ptr sim) // send all other parameters to base class @@ -164,7 +164,7 @@ struct SimulatorOutput : public SimulatorOutputBase { const EclipseGridParser& parser, const UnstructuredGrid& grid, const SimulatorTimer& timer, - const BlackoilState& state, + const SimulatorState& state, const WellState& wellState, Simulator& sim) // send all other parameters to base class