2013-10-29 08:20:36 -05:00
|
|
|
#include "BlackoilState.hpp"
|
2016-02-05 11:29:04 -06:00
|
|
|
#include <opm/common/util/numeric/cmp.hpp>
|
2013-10-29 08:20:36 -05:00
|
|
|
#include <opm/core/props/BlackoilPropertiesInterface.hpp>
|
|
|
|
|
2016-02-05 11:29:04 -06:00
|
|
|
|
2013-10-29 08:20:36 -05:00
|
|
|
using namespace Opm;
|
|
|
|
|
2015-07-03 09:26:59 -05:00
|
|
|
|
2016-02-25 14:47:47 -06:00
|
|
|
const std::string BlackoilState::GASOILRATIO = "GASOILRATIO";
|
|
|
|
const std::string BlackoilState::RV = "RV";
|
|
|
|
const std::string BlackoilState::SURFACEVOL = "SURFACEVOL";
|
2015-07-03 09:26:59 -05:00
|
|
|
|
2013-10-29 08:20:36 -05:00
|
|
|
|
2016-02-25 14:47:47 -06:00
|
|
|
BlackoilState::BlackoilState( size_t num_cells , size_t num_faces , size_t num_phases)
|
|
|
|
: SimulationDataContainer( num_cells , num_faces , num_phases)
|
2014-02-17 06:23:01 -06:00
|
|
|
{
|
2016-02-25 14:47:47 -06:00
|
|
|
registerCellData( GASOILRATIO , 1 );
|
|
|
|
registerCellData( RV, 1 );
|
|
|
|
registerCellData( SURFACEVOL, num_phases );
|
2016-03-29 03:33:37 -05:00
|
|
|
setBlackoilStateReferencePointers();
|
|
|
|
}
|
|
|
|
|
|
|
|
BlackoilState::BlackoilState( const BlackoilState& other )
|
|
|
|
: SimulationDataContainer(other)
|
|
|
|
{
|
|
|
|
setBlackoilStateReferencePointers();
|
2016-05-12 03:32:39 -05:00
|
|
|
hydrocarbonstate_ = other.hydroCarbonState();
|
2016-03-29 03:33:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
BlackoilState& BlackoilState::operator=( const BlackoilState& other )
|
|
|
|
{
|
|
|
|
SimulationDataContainer::operator=(other);
|
|
|
|
setBlackoilStateReferencePointers();
|
2016-05-12 03:32:39 -05:00
|
|
|
hydrocarbonstate_ = other.hydroCarbonState();
|
2016-03-29 03:33:37 -05:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BlackoilState::setBlackoilStateReferencePointers()
|
|
|
|
{
|
|
|
|
// This sets the reference pointers for the fast
|
|
|
|
// accessors, the fields must have been created first.
|
|
|
|
gasoilratio_ref_ = &getCellData(GASOILRATIO);
|
|
|
|
rv_ref_ = &getCellData(RV);
|
|
|
|
surfacevol_ref_ = &getCellData(SURFACEVOL);
|
2013-10-29 08:20:36 -05:00
|
|
|
}
|