Removing unused block patterns and using std::move.

This commit is contained in:
Kai Bao 2015-05-07 15:36:15 +02:00
parent 3ef3c53889
commit 3bd0ff1885

View File

@ -584,21 +584,20 @@ namespace detail {
// Pressure. // Pressure.
int nextvar = 0; int nextvar = 0;
state.pressure = vars[ nextvar++ ]; state.pressure = std::move(vars[ nextvar++ ]);
// temperature // temperature
const V temp = Eigen::Map<const V>(& x.temperature()[0], x.temperature().size()); const V temp = Eigen::Map<const V>(& x.temperature()[0], x.temperature().size());
state.temperature = ADB::constant(temp); state.temperature = ADB::constant(temp);
// Saturations // Saturations
const std::vector<int>& bpat = vars[0].blockPattern();
{ {
ADB so = ADB::constant(V::Ones(nc, 1), bpat); ADB so = ADB::constant(V::Ones(nc, 1));
if (active_[ Water ]) { if (active_[ Water ]) {
ADB& sw = vars[ nextvar++ ]; state.saturation[pu.phase_pos[ Water ]] = std::move(vars[ nextvar++ ]);
state.saturation[pu.phase_pos[ Water ]] = sw; const ADB& sw = state.saturation[pu.phase_pos[ Water ]];
so -= sw; so -= sw;
} }
@ -614,7 +613,7 @@ namespace detail {
// RS and RV is only defined if both oil and gas phase are active. // RS and RV is only defined if both oil and gas phase are active.
const ADB& sw = (active_[ Water ] const ADB& sw = (active_[ Water ]
? state.saturation[ pu.phase_pos[ Water ] ] ? state.saturation[ pu.phase_pos[ Water ] ]
: ADB::constant(V::Zero(nc, 1), bpat)); : ADB::constant(V::Zero(nc, 1)));
state.canonical_phase_pressures = computePressures(state.pressure, sw, so, sg); state.canonical_phase_pressures = computePressures(state.pressure, sw, so, sg);
const ADB rsSat = fluidRsSat(state.canonical_phase_pressures[ Oil ], so , cells_); const ADB rsSat = fluidRsSat(state.canonical_phase_pressures[ Oil ], so , cells_);
if (has_disgas_) { if (has_disgas_) {
@ -633,20 +632,20 @@ namespace detail {
if (active_[ Oil ]) { if (active_[ Oil ]) {
// Note that so is never a primary variable. // Note that so is never a primary variable.
state.saturation[pu.phase_pos[ Oil ]] = so; state.saturation[pu.phase_pos[ Oil ]] = std::move(so);
} }
} }
// Concentration. // Concentration.
if (has_polymer_) { if (has_polymer_) {
state.concentration = vars[nextvar++]; state.concentration = std::move(vars[ nextvar++ ]);
} }
// Qs. // Qs.
state.qs = vars[ nextvar++ ]; state.qs = std::move(vars[ nextvar++ ]);
// Bhp. // Bhp.
state.bhp = vars[ nextvar++ ]; state.bhp = std::move(vars[ nextvar++ ]);
assert(nextvar == int(vars.size())); assert(nextvar == int(vars.size()));