diff --git a/opm/core/simulator/BlackoilState.cpp b/opm/core/simulator/BlackoilState.cpp index 1f51dabba..c274136a9 100644 --- a/opm/core/simulator/BlackoilState.cpp +++ b/opm/core/simulator/BlackoilState.cpp @@ -24,12 +24,14 @@ BlackoilState::BlackoilState( const BlackoilState& other ) : SimulationDataContainer(other) { setBlackoilStateReferencePointers(); + hydrocarbonstate_ = other.hydroCarbonState(); } BlackoilState& BlackoilState::operator=( const BlackoilState& other ) { SimulationDataContainer::operator=(other); setBlackoilStateReferencePointers(); + hydrocarbonstate_ = other.hydroCarbonState(); return *this; } diff --git a/opm/core/simulator/BlackoilState.hpp b/opm/core/simulator/BlackoilState.hpp index 7f45e029f..51c6c21cb 100644 --- a/opm/core/simulator/BlackoilState.hpp +++ b/opm/core/simulator/BlackoilState.hpp @@ -62,10 +62,12 @@ namespace Opm std::vector& surfacevol () { return *surfacevol_ref_; } std::vector& gasoilratio () { return *gasoilratio_ref_; } std::vector& rv () { return *rv_ref_; } + std::vector& hydroCarbonState() { return hydrocarbonstate_; } const std::vector& surfacevol () const { return *surfacevol_ref_; } const std::vector& gasoilratio () const { return *gasoilratio_ref_; } const std::vector& rv () const { return *rv_ref_; } + const std::vector& hydroCarbonState() const { return hydrocarbonstate_; } private: void setBlackoilStateReferencePointers(); @@ -73,6 +75,9 @@ namespace Opm std::vector* gasoilratio_ref_; std::vector* rv_ref_; + // A vector storing the hydro carbon state. + std::vector hydrocarbonstate_; + }; } // namespace Opm