mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Reduce Aquifer Data Copying
This commit switches to using 'map<>::insert_or_assign()' as the primary interface for collecting dynamic aquifer data. In turn, this activates move semantics for the substructures and reduces the number of times the data is copied. Insert_or_assign requires the key, so provide this value--i.e., the aquifer ID--as part of the AquiferInterface.
This commit is contained in:
@@ -237,23 +237,20 @@ template<typename TypeTag>
|
||||
data::Aquifers BlackoilAquiferModel<TypeTag>::aquiferData() const {
|
||||
data::Aquifers data;
|
||||
if (this->aquiferCarterTracyActive()) {
|
||||
for (const auto& aqu : aquifers_CarterTracy) {
|
||||
data::AquiferData aqu_data = aqu.aquiferData();
|
||||
data[aqu_data.aquiferID] = aqu_data;
|
||||
for (const auto& aqu : this->aquifers_CarterTracy) {
|
||||
data.insert_or_assign(aqu.aquiferID(), aqu.aquiferData());
|
||||
}
|
||||
}
|
||||
|
||||
if (this->aquiferFetkovichActive()) {
|
||||
for (const auto& aqu : aquifers_Fetkovich) {
|
||||
data::AquiferData aqu_data = aqu.aquiferData();
|
||||
data[aqu_data.aquiferID] = aqu_data;
|
||||
for (const auto& aqu : this->aquifers_Fetkovich) {
|
||||
data.insert_or_assign(aqu.aquiferID(), aqu.aquiferData());
|
||||
}
|
||||
}
|
||||
|
||||
if (this->aquiferNumericalActive()) {
|
||||
for (const auto& aqu : this->aquifers_numerical) {
|
||||
data::AquiferData aqu_data = aqu.aquiferData();
|
||||
data[aqu_data.aquiferID] = aqu_data;
|
||||
data.insert_or_assign(aqu.aquiferID(), aqu.aquiferData());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user