mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add method SegmentState::size()
This commit is contained in:
@@ -55,6 +55,11 @@ bool SegmentState::empty() const {
|
||||
return this->rates.empty();
|
||||
}
|
||||
|
||||
std::size_t SegmentState::size() const {
|
||||
return this->pressure.size();
|
||||
}
|
||||
|
||||
|
||||
void SegmentState::scale_pressure(double bhp) {
|
||||
if (this->empty())
|
||||
throw std::logic_error("Tried to pressure scale empty SegmentState");
|
||||
|
@@ -38,6 +38,7 @@ public:
|
||||
bool empty() const;
|
||||
void scale_pressure(double bhp);
|
||||
const std::vector<int>& segment_number() const;
|
||||
std::size_t size() const;
|
||||
|
||||
std::vector<double> rates;
|
||||
std::vector<double> pressure;
|
||||
|
@@ -530,6 +530,8 @@ BOOST_AUTO_TEST_CASE(TESTSegmentState2) {
|
||||
|
||||
for (std::size_t i=0; i < segments.pressure.size(); i++)
|
||||
BOOST_CHECK_EQUAL(segments.pressure[i], 2*(i+1));
|
||||
|
||||
BOOST_CHECK_EQUAL( segments.size(), well.getSegments().size() );
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user