mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-13 17:32:03 -05:00
Use std::partial_sum to calculate displacements.
This commit is contained in:
1 parent
b97385c963
commit
1d9d04161d
1 file changed
+1
-2
@@ -339,8 +339,7 @@ namespace Opm
|
||||
|
||||
if (comm.rank()==0){
|
||||
displ.resize(comm.size()+1, 0);
|
||||
std::transform(displ.begin(), displ.end()-1, sizes.begin(), displ.begin()+1,
|
||||
std::plus<int>());
|
||||
std::partial_sum(sizes.begin(), sizes.end(), displ.begin()+1);
|
||||
to_connections.resize(displ.back());
|
||||
}
|
||||
comm.gatherv(from_connections.data(), size, to_connections.data(),
|
||||
|
||||
Reference in new issue
Block a user