From cac1dac8933fd4fe5ee5a3de7ec7c80e61413ecf Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Tue, 11 Feb 2020 15:11:31 +0100 Subject: [PATCH] Remove unused bool flag --- .../EclipseState/Schedule/MSW/WellSegments.hpp | 4 ++-- .../EclipseState/Schedule/MSW/WellSegments.cpp | 13 +++++-------- .../eclipse/EclipseState/Schedule/Well/Well.cpp | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp b/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp index 6438c2816..9ef8d821f 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp @@ -93,7 +93,7 @@ namespace Opm { const Segment& operator[](size_t idx) const; void orderSegments(); - void process(bool first_time); + void process(); bool operator==( const WellSegments& ) const; bool operator!=( const WellSegments& ) const; @@ -109,7 +109,7 @@ namespace Opm { private: void processABS(); - void processINC(const bool first_time); + void processINC(); std::string m_well_name; // depth of the nodal point of the top segment diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.cpp index 77e0e6ddb..55af23ac7 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.cpp @@ -244,11 +244,11 @@ namespace Opm { return m_segments[segment_index]; } - void WellSegments::process(bool first_time) { + void WellSegments::process() { if (this->m_length_depth_type == LengthDepth::ABS) this->processABS(); else if (this->m_length_depth_type == LengthDepth::INC) - this->processINC(first_time); + this->processINC(); else throw std::logic_error("Invalid llength/depth/type in segment data structure"); } @@ -337,14 +337,11 @@ namespace Opm { } } - void WellSegments::processINC(const bool first_time) { + void WellSegments::processINC() { // update the information inside the WellSegments to be in ABS way - if (first_time) { - Segment new_top_segment(this->m_segments[0], depthTopSegment(), lengthTopSegment()); - this->addSegment(new_top_segment); - } - + Segment new_top_segment(this->m_segments[0], depthTopSegment(), lengthTopSegment()); + this->addSegment(new_top_segment); orderSegments(); // begin with the second segment diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp index 8ac1d58e7..05686ad5d 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp @@ -761,7 +761,7 @@ bool Well::handleWELSEGS(const DeckKeyword& keyword) { auto new_segmentset = std::make_shared(); new_segmentset->loadWELSEGS(keyword); - new_segmentset->process(true); + new_segmentset->process(); if (new_segmentset != this->segments) { this->segments = new_segmentset; this->ref_depth = new_segmentset->depthTopSegment();