Compare commits
3 Commits
release/20
...
release/20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63b663228a | ||
|
|
bf475b73b4 | ||
|
|
1e734020f1 |
2
debian/changelog
vendored
2
debian/changelog
vendored
@@ -1,4 +1,4 @@
|
||||
opm-common (2019.04-pre~xenial) xenial; urgency=medium
|
||||
opm-common (2020.04-rc2-1~xenial) xenial; urgency=medium
|
||||
|
||||
* New release
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
Module: opm-common
|
||||
Description: Open Porous Media Initiative shared infrastructure
|
||||
Version: 2020.04-pre
|
||||
Label: 2020.04-pre
|
||||
Version: 2020.04-rc2
|
||||
Label: 2020.04-rc2
|
||||
Maintainer: opm@opm-project.org
|
||||
MaintainerName: OPM community
|
||||
Url: http://opm-project.org
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# spec file for package opm-common
|
||||
#
|
||||
|
||||
%define tag final
|
||||
%define tag rc2
|
||||
|
||||
Name: opm-common
|
||||
Version: 2018.10
|
||||
Version: 2020.04
|
||||
Release: 0
|
||||
Summary: Open Porous Media - common helpers and buildsystem
|
||||
License: GPL-3.0
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <iterator>
|
||||
#include <unordered_set>
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -479,16 +480,19 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::size_t head_index = 0;
|
||||
while (head_index < segments.size()) {
|
||||
auto head_iter = std::find_if(segments.begin() + head_index, segments.end(),
|
||||
[&segment_set] (const Segment& segment) { return (segment_set.count(segment.outletSegment()) == 0); });
|
||||
const auto& head_segment = segments[head_index];
|
||||
if (segment_set.count(head_segment.outletSegment()) != 0) {
|
||||
auto head_iter = std::find_if(std::next(segments.begin(), head_index), segments.end(),
|
||||
[&segment_set] (const Segment& segment) { return (segment_set.count(segment.outletSegment()) == 0); });
|
||||
|
||||
if (head_iter == segments.end())
|
||||
throw std::logic_error("Loop detected in branch/segment structure");
|
||||
|
||||
segment_set.erase( head_iter->segmentNumber() );
|
||||
std::swap( segments[head_index], *head_iter);
|
||||
if (head_iter == segments.end())
|
||||
throw std::logic_error("Loop detected in branch/segment structure");
|
||||
std::swap( segments[head_index], *head_iter);
|
||||
}
|
||||
segment_set.erase( segments[head_index].segmentNumber() );
|
||||
head_index++;
|
||||
}
|
||||
|
||||
|
||||
@@ -628,7 +628,7 @@ bool Well::updateConnections(std::shared_ptr<WellConnections> connections_arg) {
|
||||
|
||||
bool Well::updateConnections(std::shared_ptr<WellConnections> connections_arg, const EclipseGrid& grid, const std::vector<int>& pvtnum) {
|
||||
bool update = this->updateConnections(connections_arg);
|
||||
if (this->pvt_table == 0) {
|
||||
if (this->pvt_table == 0 && this->connections->size() > 0) {
|
||||
const auto& lowest = this->connections->lowest();
|
||||
auto active_index = grid.activeIndex(lowest.global_index());
|
||||
this->pvt_table = pvtnum[active_index];
|
||||
|
||||
@@ -431,12 +431,16 @@ inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction
|
||||
|
||||
|
||||
const Connection& WellConnections::lowest() const {
|
||||
if (this->m_connections.empty())
|
||||
throw std::logic_error("Tried to get lowest connection from empty set");
|
||||
|
||||
const auto max_iter = std::max_element(this->m_connections.begin(),
|
||||
this->m_connections.end(),
|
||||
[](const Connection& c1, const Connection& c2)
|
||||
{
|
||||
return c1.depth() < c2.depth();
|
||||
});
|
||||
|
||||
return *max_iter;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user