mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Make more use of move semantics in AD code.
This makes some API changes to AutoDiffBlock. - Add overload for the constant() constructor taking rvalue ref. - Add overload for the variable() constructor taking rvalue ref. - Make the function() constructor *require* rvalue refs. - Add a swap() function. The remaining changes in this commit are follow-ups especially to the third change (adding std::move in many places), and some removal of unnecessary block pattern arguments from calls to the constant() static method.
This commit is contained in:
@@ -90,8 +90,8 @@ phaseMobility(const Opm::IncompPropertiesInterface& props,
|
||||
std::vector<M> dmw = { krwjac/mu[0] };
|
||||
std::vector<M> dmo = { krojac/mu[1] };
|
||||
|
||||
std::vector<ADB> pmobc = { ADB::function(krw / mu[0], dmw) ,
|
||||
ADB::function(kro / mu[1], dmo) };
|
||||
std::vector<ADB> pmobc = { ADB::function(krw / mu[0], std::move(dmw)) ,
|
||||
ADB::function(kro / mu[1], std::move(dmo)) };
|
||||
return pmobc;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user