mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-28 17:14:39 -06:00
Use swap() and move() to reduce copying in formEllipticSystem().
This commit is contained in:
parent
5ff65b40e1
commit
f0ba4a5797
@ -396,7 +396,7 @@ namespace Opm
|
||||
// A concession to MRST, to obtain more similar behaviour:
|
||||
// swap the first two equations, so that oil is first, then water.
|
||||
auto eqs = eqs_in;
|
||||
std::swap(eqs[0], eqs[1]);
|
||||
eqs[0].swap(eqs[1]);
|
||||
|
||||
// Characterize the material balance equations.
|
||||
const int n = eqs[0].size();
|
||||
@ -463,7 +463,7 @@ namespace Opm
|
||||
L.setFromTriplets(t.begin(), t.end());
|
||||
|
||||
// Combine in single block.
|
||||
ADB total_residual = eqs[0];
|
||||
ADB total_residual = std::move(eqs[0]);
|
||||
for (int phase = 1; phase < num_phases; ++phase) {
|
||||
total_residual = vertcat(total_residual, eqs[phase]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user