Merge remote-tracking branch 'remotes/opm/master' into updates

Conflicts:
	opm/polymer/fullyimplicit/FullyImplicitBlackoilPolymerSolver_impl.hpp
This commit is contained in:
Liu Ming 2015-03-24 16:56:19 +08:00
commit d791888430
3 changed files with 13 additions and 9 deletions

View File

@ -1310,15 +1310,19 @@ namespace detail {
// Update primary variables, if necessary.
if (bhp_changed) {
ADB::V new_bhp = Eigen::Map<ADB::V>(xw.bhp().data(), nw);
bhp = ADB::function(new_bhp, bhp.derivative());
// Avoiding the copy below would require a value setter method
// in AutoDiffBlock.
std::vector<ADB::M> old_derivs = bhp.derivative();
bhp = ADB::function(std::move(new_bhp), std::move(old_derivs));
}
if (rates_changed) {
// Need to reshuffle well rates, from phase running fastest
// to wells running fastest.
// The transpose() below switches the ordering.
const DataBlock wrates = Eigen::Map<const DataBlock>(xw.wellRates().data(), nw, np).transpose();
const ADB::V new_qs = Eigen::Map<const V>(wrates.data(), nw*np);
well_phase_flow_rate = ADB::function(new_qs, well_phase_flow_rate.derivative());
ADB::V new_qs = Eigen::Map<const V>(wrates.data(), nw*np);
std::vector<ADB::M> old_derivs = well_phase_flow_rate.derivative();
well_phase_flow_rate = ADB::function(std::move(new_qs), std::move(old_derivs));
}
}
@ -2397,7 +2401,7 @@ namespace detail {
fastSparseProduct(dpm_diag, p.derivative()[block], jacs[block]);
}
return ADB::function(std::move(pm), std::move(jacs));
} else {
} else {
return ADB::constant(V::Constant(n, 1.0), p.blockPattern());
}
}

View File

@ -994,7 +994,7 @@ namespace {
for (int block = 0; block < num_blocks; ++block) {
jacs[block] = dpm_diag * p.derivative()[block];
}
return ADB::function(pm, jacs);
return ADB::function(std::move(pm), std::move(jacs));
} else {
return ADB::constant(V::Constant(n, 1.0), p.blockPattern());
}
@ -1021,7 +1021,7 @@ namespace {
for (int block = 0; block < num_blocks; ++block) {
jacs[block] = dtm_diag * p.derivative()[block];
}
return ADB::function(tm, jacs);
return ADB::function(std::move(tm), std::move(jacs));
} else {
return ADB::constant(V::Constant(n, 1.0), p.blockPattern());
}

View File

@ -117,7 +117,7 @@ namespace Opm {
for (int block = 0; block < num_blocks; ++block) {
jacs[block] = dim_diag * c.derivative()[block];
}
return ADB::function(inv_mu_w_eff, jacs);
return ADB::function(std::move(inv_mu_w_eff), std::move(jacs));
}
@ -165,7 +165,7 @@ namespace Opm {
jacs[block] = dmc_diag * c.derivative()[block];
}
return ADB::function(mc, jacs);
return ADB::function(std::move(mc), std::move(jacs));
}
@ -213,7 +213,7 @@ namespace Opm {
jacs[block] = dads_diag * c.derivative()[block];
}
return ADB::function(ads, jacs);
return ADB::function(std::move(ads), std::move(jacs));
}