mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add support for explicit guiderate for injection groups
With this commit the guiderate logic used for the production groups is also used for injectors This allows for setting guiderates explicit at different group levels Only RATE, NETV and VOID guiderate type is suppored.
This commit is contained in:
@@ -260,16 +260,24 @@ public:
|
||||
(*this)(d);
|
||||
};
|
||||
|
||||
auto keyHandle = [&](auto& d)
|
||||
{
|
||||
if constexpr (is_pair<Key>::value)
|
||||
pair(d);
|
||||
else
|
||||
(*this)(d);
|
||||
};
|
||||
|
||||
if (m_op == Operation::PACKSIZE) {
|
||||
m_packSize += Mpi::packSize(data.size(), m_comm);
|
||||
for (auto& it : data) {
|
||||
m_packSize += Mpi::packSize(it.first, m_comm);
|
||||
keyHandle(it.first);
|
||||
handle(it.second);
|
||||
}
|
||||
} else if (m_op == Operation::PACK) {
|
||||
Mpi::pack(data.size(), m_buffer, m_position, m_comm);
|
||||
for (auto& it : data) {
|
||||
Mpi::pack(it.first, m_buffer, m_position, m_comm);
|
||||
keyHandle(it.first);
|
||||
handle(it.second);
|
||||
}
|
||||
} else if (m_op == Operation::UNPACK) {
|
||||
@@ -277,7 +285,7 @@ public:
|
||||
Mpi::unpack(size, m_buffer, m_position, m_comm);
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
Key key;
|
||||
Mpi::unpack(key, m_buffer, m_position, m_comm);
|
||||
keyHandle(key);
|
||||
Data entry;
|
||||
handle(entry);
|
||||
data.insert(std::make_pair(key, entry));
|
||||
|
||||
Reference in New Issue
Block a user