adapt for the fact that field vectors of scalars cannot be assigned to field vectors of Evaluations anymore

the reason why this is needed now probably is because
std::is_convertible<Scalar, Evaluation> is false. While strictly
speaking, scalars can be converted to Evaluations by assuming them to
be evaluations of the constant function, this patch is IMO beneficial
anyway because it makes such conversions more visible.
This commit is contained in:
Andreas Lauser 2016-04-15 13:19:25 +02:00
parent f7f2c1b89d
commit eeecdf8438
2 changed files with 8 additions and 4 deletions

View File

@ -417,14 +417,16 @@ public:
computeVolumetricDofRates_(resvRates, actualBottomHolePressure_ + eps, dofVariables_[gridDofIdx]);
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
modelRate.setVolumetricRate(fluidState, phaseIdx, resvRates[phaseIdx]);
q += modelRate;
for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
q[compIdx] += modelRate[compIdx];
}
// then, we subtract the source rates for a undisturbed well.
computeVolumetricDofRates_(resvRates, actualBottomHolePressure_, dofVariables_[gridDofIdx]);
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
modelRate.setVolumetricRate(fluidState, phaseIdx, resvRates[phaseIdx]);
q -= modelRate;
for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
q[compIdx] -= modelRate[compIdx];
}
// and finally, we divide by the epsilon to get the derivative
@ -1107,7 +1109,8 @@ public:
const auto &intQuants = context.intensiveQuantities(dofIdx, timeIdx);
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
modelRate.setVolumetricRate(intQuants.fluidState(), phaseIdx, volumetricRates[phaseIdx]);
q += modelRate;
for (unsigned eqIdx = 0; eqIdx < q.size(); ++eqIdx)
q[eqIdx] += modelRate[eqIdx];
}
Valgrind::CheckDefined(q);

View File

@ -531,7 +531,8 @@ public:
for (size_t wellIdx = 0; wellIdx < wellSize; ++wellIdx) {
wellRate = 0.0;
wells_[wellIdx]->computeTotalRatesForDof(wellRate, context, dofIdx, timeIdx);
q += wellRate;
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx)
q[eqIdx] += wellRate[eqIdx];
}
}