mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-03 21:16:54 -06:00
Merge pull request #4039 from akva2/small_comm_reduce
avoid two communication calls
This commit is contained in:
commit
a322a3062f
@ -1854,8 +1854,8 @@ namespace Opm {
|
|||||||
connpos += well_perf_data_[i].size();
|
connpos += well_perf_data_[i].size();
|
||||||
}
|
}
|
||||||
connpos *= np;
|
connpos *= np;
|
||||||
double weighted_temperature = 0.0;
|
std::array<double,2> weighted{0.0,0.0};
|
||||||
double total_weight = 0.0;
|
auto& [weighted_temperature, total_weight] = weighted;
|
||||||
|
|
||||||
auto& well_info = local_parallel_well_info_[wellID].get();
|
auto& well_info = local_parallel_well_info_[wellID].get();
|
||||||
const int num_perf_this_well = well_info.communication().sum(well_perf_data_[wellID].size());
|
const int num_perf_this_well = well_info.communication().sum(well_perf_data_[wellID].size());
|
||||||
@ -1886,8 +1886,7 @@ namespace Opm {
|
|||||||
total_weight += weight_factor;
|
total_weight += weight_factor;
|
||||||
weighted_temperature += weight_factor * cellTemperatures;
|
weighted_temperature += weight_factor * cellTemperatures;
|
||||||
}
|
}
|
||||||
weighted_temperature = well_info.communication().sum(weighted_temperature);
|
well_info.communication().sum(weighted.data(), 2);
|
||||||
total_weight = well_info.communication().sum(total_weight);
|
|
||||||
this->wellState().well(wellID).temperature = weighted_temperature/total_weight;
|
this->wellState().well(wellID).temperature = weighted_temperature/total_weight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user