mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
EclInterRegFlows: rename to InterRegFlows
This commit is contained in:
@@ -23,13 +23,13 @@
|
||||
#include "config.h"
|
||||
#endif // HAVE_CONFIG_H
|
||||
|
||||
#include <opm/simulators/flow/EclInterRegFlows.hpp>
|
||||
#include <opm/simulators/flow/InterRegFlows.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <stdexcept>
|
||||
|
||||
Opm::EclInterRegFlowMapSingleFIP::
|
||||
EclInterRegFlowMapSingleFIP(const std::vector<int>& region)
|
||||
Opm::InterRegFlowMapSingleFIP::
|
||||
InterRegFlowMapSingleFIP(const std::vector<int>& region)
|
||||
: region_(region.size(), 0)
|
||||
{
|
||||
if (! region.empty()) {
|
||||
@@ -43,7 +43,7 @@ EclInterRegFlowMapSingleFIP(const std::vector<int>& region)
|
||||
}
|
||||
|
||||
void
|
||||
Opm::EclInterRegFlowMapSingleFIP::
|
||||
Opm::InterRegFlowMapSingleFIP::
|
||||
addConnection(const Cell& source,
|
||||
const Cell& destination,
|
||||
const data::InterRegFlowMap::FlowRates& rates)
|
||||
@@ -75,30 +75,30 @@ addConnection(const Cell& source,
|
||||
this->iregFlow_.addConnection(r1, r2, rates);
|
||||
}
|
||||
|
||||
void Opm::EclInterRegFlowMapSingleFIP::compress()
|
||||
void Opm::InterRegFlowMapSingleFIP::compress()
|
||||
{
|
||||
this->iregFlow_.compress(this->maxGlobalRegionID_);
|
||||
}
|
||||
|
||||
void Opm::EclInterRegFlowMapSingleFIP::clear()
|
||||
void Opm::InterRegFlowMapSingleFIP::clear()
|
||||
{
|
||||
this->iregFlow_.clear();
|
||||
this->isReadFromStream_ = false;
|
||||
}
|
||||
|
||||
const Opm::data::InterRegFlowMap&
|
||||
Opm::EclInterRegFlowMapSingleFIP::getInterRegFlows() const
|
||||
Opm::InterRegFlowMapSingleFIP::getInterRegFlows() const
|
||||
{
|
||||
return this->iregFlow_;
|
||||
}
|
||||
|
||||
std::size_t Opm::EclInterRegFlowMapSingleFIP::getLocalMaxRegionID() const
|
||||
std::size_t Opm::InterRegFlowMapSingleFIP::getLocalMaxRegionID() const
|
||||
{
|
||||
return this->maxLocalRegionID_;
|
||||
}
|
||||
|
||||
bool
|
||||
Opm::EclInterRegFlowMapSingleFIP::
|
||||
Opm::InterRegFlowMapSingleFIP::
|
||||
assignGlobalMaxRegionID(const std::size_t regID)
|
||||
{
|
||||
if (regID < this->maxLocalRegionID_) {
|
||||
@@ -118,21 +118,21 @@ assignGlobalMaxRegionID(const std::size_t regID)
|
||||
//
|
||||
// =====================================================================
|
||||
|
||||
Opm::EclInterRegFlowMap
|
||||
Opm::EclInterRegFlowMap::createMapFromNames(std::vector<std::string> names)
|
||||
Opm::InterRegFlowMap
|
||||
Opm::InterRegFlowMap::createMapFromNames(std::vector<std::string> names)
|
||||
{
|
||||
auto map = EclInterRegFlowMap{};
|
||||
auto map = InterRegFlowMap{};
|
||||
|
||||
map.names_ = std::move(names);
|
||||
map.regionMaps_.resize(map.names_.size(), EclInterRegFlowMapSingleFIP{});
|
||||
map.regionMaps_.resize(map.names_.size(), InterRegFlowMapSingleFIP{});
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
Opm::EclInterRegFlowMap::
|
||||
EclInterRegFlowMap(const std::size_t numCells,
|
||||
const std::vector<SingleRegion>& regions,
|
||||
const std::size_t declaredMaxRegID)
|
||||
Opm::InterRegFlowMap::
|
||||
InterRegFlowMap(const std::size_t numCells,
|
||||
const std::vector<SingleRegion>& regions,
|
||||
const std::size_t declaredMaxRegID)
|
||||
{
|
||||
this->regionMaps_.reserve(regions.size());
|
||||
this->names_.reserve(regions.size());
|
||||
@@ -152,7 +152,7 @@ EclInterRegFlowMap(const std::size_t numCells,
|
||||
}
|
||||
|
||||
void
|
||||
Opm::EclInterRegFlowMap::
|
||||
Opm::InterRegFlowMap::
|
||||
addConnection(const Cell& source,
|
||||
const Cell& destination,
|
||||
const data::InterRegFlowMap::FlowRates& rates)
|
||||
@@ -162,14 +162,14 @@ addConnection(const Cell& source,
|
||||
}
|
||||
}
|
||||
|
||||
void Opm::EclInterRegFlowMap::compress()
|
||||
void Opm::InterRegFlowMap::compress()
|
||||
{
|
||||
for (auto& regionMap : this->regionMaps_) {
|
||||
regionMap.compress();
|
||||
}
|
||||
}
|
||||
|
||||
void Opm::EclInterRegFlowMap::clear()
|
||||
void Opm::InterRegFlowMap::clear()
|
||||
{
|
||||
for (auto& regionMap : this->regionMaps_) {
|
||||
regionMap.clear();
|
||||
@@ -179,13 +179,13 @@ void Opm::EclInterRegFlowMap::clear()
|
||||
}
|
||||
|
||||
const std::vector<std::string>&
|
||||
Opm::EclInterRegFlowMap::names() const
|
||||
Opm::InterRegFlowMap::names() const
|
||||
{
|
||||
return this->names_;
|
||||
}
|
||||
|
||||
std::vector<Opm::data::InterRegFlowMap>
|
||||
Opm::EclInterRegFlowMap::getInterRegFlows() const
|
||||
Opm::InterRegFlowMap::getInterRegFlows() const
|
||||
{
|
||||
auto maps = std::vector<data::InterRegFlowMap>{};
|
||||
maps.reserve(this->regionMaps_.size());
|
||||
@@ -198,7 +198,7 @@ Opm::EclInterRegFlowMap::getInterRegFlows() const
|
||||
}
|
||||
|
||||
std::vector<std::size_t>
|
||||
Opm::EclInterRegFlowMap::getLocalMaxRegionID() const
|
||||
Opm::InterRegFlowMap::getLocalMaxRegionID() const
|
||||
{
|
||||
auto maxLocalRegionID = std::vector<std::size_t>{};
|
||||
maxLocalRegionID.reserve(this->regionMaps_.size());
|
||||
@@ -211,7 +211,7 @@ Opm::EclInterRegFlowMap::getLocalMaxRegionID() const
|
||||
}
|
||||
|
||||
bool
|
||||
Opm::EclInterRegFlowMap::
|
||||
Opm::InterRegFlowMap::
|
||||
assignGlobalMaxRegionID(const std::vector<std::size_t>& regID)
|
||||
{
|
||||
if (regID.size() != this->regionMaps_.size()) {
|
||||
@@ -231,7 +231,7 @@ assignGlobalMaxRegionID(const std::vector<std::size_t>& regID)
|
||||
return assignmentOK;
|
||||
}
|
||||
|
||||
bool Opm::EclInterRegFlowMap::readIsConsistent() const
|
||||
bool Opm::InterRegFlowMap::readIsConsistent() const
|
||||
{
|
||||
return this->readIsConsistent_;
|
||||
}
|
||||
@@ -19,8 +19,8 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ECL_INTERREG_FLOWS_MODULE_HPP
|
||||
#define ECL_INTERREG_FLOWS_MODULE_HPP
|
||||
#ifndef OPM_INTERREG_FLOWS_MODULE_HPP
|
||||
#define OPM_INTERREG_FLOWS_MODULE_HPP
|
||||
|
||||
#include <opm/output/data/InterRegFlowMap.hpp>
|
||||
|
||||
@@ -38,12 +38,12 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class EclInterRegFlowMap;
|
||||
class InterRegFlowMap;
|
||||
|
||||
/// Form CSR adjacency matrix representation of inter-region flow rate
|
||||
/// graph provided as a list of connections between regions on local MPI
|
||||
/// rank. Pertains to a single FIP definition array (e.g., FIPNUM).
|
||||
class EclInterRegFlowMapSingleFIP
|
||||
class InterRegFlowMapSingleFIP
|
||||
{
|
||||
public:
|
||||
/// Minimal characteristics of a cell from a simulation grid.
|
||||
@@ -58,12 +58,12 @@ namespace Opm {
|
||||
bool isInterior{true};
|
||||
};
|
||||
|
||||
friend class EclInterRegFlowMap;
|
||||
friend class InterRegFlowMap;
|
||||
|
||||
/// Constructor
|
||||
///
|
||||
/// \param[in] region Local rank's FIP region definition array.
|
||||
explicit EclInterRegFlowMapSingleFIP(const std::vector<int>& region);
|
||||
explicit InterRegFlowMapSingleFIP(const std::vector<int>& region);
|
||||
|
||||
/// Add flow rate connection between regions.
|
||||
///
|
||||
@@ -171,11 +171,11 @@ namespace Opm {
|
||||
bool isReadFromStream_{false};
|
||||
|
||||
/// Default constructor.
|
||||
EclInterRegFlowMapSingleFIP() = default;
|
||||
InterRegFlowMapSingleFIP() = default;
|
||||
};
|
||||
|
||||
/// Inter-region flow accumulation maps for all region definition arrays
|
||||
class EclInterRegFlowMap
|
||||
class InterRegFlowMap
|
||||
{
|
||||
public:
|
||||
/// Minimal representation of a single named region defintion.
|
||||
@@ -190,10 +190,10 @@ namespace Opm {
|
||||
};
|
||||
|
||||
/// Characteristics of a cell from a simulation grid.
|
||||
using Cell = EclInterRegFlowMapSingleFIP::Cell;
|
||||
using Cell = InterRegFlowMapSingleFIP::Cell;
|
||||
|
||||
/// Default constructor.
|
||||
EclInterRegFlowMap() = default;
|
||||
InterRegFlowMap() = default;
|
||||
|
||||
/// Special purpose constructor for global object being collected on
|
||||
/// the I/O rank.
|
||||
@@ -201,7 +201,7 @@ namespace Opm {
|
||||
/// Only knows about the FIP region set names.
|
||||
///
|
||||
/// \param[in] names Sorted sequence of FIP region names.
|
||||
static EclInterRegFlowMap
|
||||
static InterRegFlowMap
|
||||
createMapFromNames(std::vector<std::string> names);
|
||||
|
||||
/// Constructor.
|
||||
@@ -214,15 +214,15 @@ namespace Opm {
|
||||
/// \param[in] declaredMaxRegID Declared maximum region ID in the
|
||||
/// run-typically from the TABDIMS and/or REGDIMS keywords. Used
|
||||
/// for sizing internal data structures if greater than zero.
|
||||
explicit EclInterRegFlowMap(const std::size_t numCells,
|
||||
const std::vector<SingleRegion>& regions,
|
||||
const std::size_t declaredMaxRegID = 0);
|
||||
explicit InterRegFlowMap(const std::size_t numCells,
|
||||
const std::vector<SingleRegion>& regions,
|
||||
const std::size_t declaredMaxRegID = 0);
|
||||
|
||||
EclInterRegFlowMap(const EclInterRegFlowMap& rhs) = default;
|
||||
EclInterRegFlowMap(EclInterRegFlowMap&& rhs) noexcept = default;
|
||||
InterRegFlowMap(const InterRegFlowMap& rhs) = default;
|
||||
InterRegFlowMap(InterRegFlowMap&& rhs) noexcept = default;
|
||||
|
||||
EclInterRegFlowMap& operator=(const EclInterRegFlowMap& rhs) = default;
|
||||
EclInterRegFlowMap& operator=(EclInterRegFlowMap&& rhs) noexcept = default;
|
||||
InterRegFlowMap& operator=(const InterRegFlowMap& rhs) = default;
|
||||
InterRegFlowMap& operator=(InterRegFlowMap&& rhs) noexcept = default;
|
||||
|
||||
/// Add flow rate connection between regions for all region
|
||||
/// definitions.
|
||||
@@ -336,7 +336,7 @@ namespace Opm {
|
||||
// different number of maps). Unexpected. Read the values
|
||||
// from the input stream, but do not merge with internal
|
||||
// values.
|
||||
auto map = EclInterRegFlowMapSingleFIP {
|
||||
auto map = InterRegFlowMapSingleFIP {
|
||||
std::vector<int>(this->numCells_, 1)
|
||||
};
|
||||
|
||||
@@ -352,7 +352,7 @@ namespace Opm {
|
||||
private:
|
||||
/// Inter-region flow accumulators. One accumulator map for each
|
||||
/// region definition array.
|
||||
std::vector<EclInterRegFlowMapSingleFIP> regionMaps_{};
|
||||
std::vector<InterRegFlowMapSingleFIP> regionMaps_{};
|
||||
|
||||
/// Names of region definition arrays. Typically "FIPNUM" and other
|
||||
/// "FIPXYZ" array names.
|
||||
@@ -385,4 +385,4 @@ namespace Opm {
|
||||
};
|
||||
} // namespace Opm
|
||||
|
||||
#endif // ECL_INTERREG_FLOWS_MODULE_HPP
|
||||
#endif // OPM_INTERREG_FLOWS_MODULE_HPP
|
||||
Reference in New Issue
Block a user