Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/opm/master' into updates
Browse files Browse the repository at this point in the history
Conflicts:
	opm/polymer/fullyimplicit/FullyImplicitBlackoilPolymerSolver_impl.hpp
  • Loading branch information
qilicun committed Mar 24, 2015
2 parents cbb1cf2 + b70679a commit d1e7a59
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down Expand Up @@ -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());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand All @@ -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());
}
Expand Down
6 changes: 3 additions & 3 deletions opm/polymer/fullyimplicit/PolymerPropsAd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}


Expand Down Expand Up @@ -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));
}


Expand Down Expand Up @@ -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));
}


Expand Down

0 comments on commit d1e7a59

Please sign in to comment.