Simply return thpres_ vector as restart vector

This commit is contained in:
Vegard Kippe 2024-11-28 18:40:16 +01:00
parent 2b4e09bc51
commit 4bb50eb1d8

View File

@ -226,30 +226,7 @@ getRestartVector() const
if (!enableThresholdPressure_)
return {};
std::vector<Scalar> result(numEquilRegions_ * numEquilRegions_, 0.0);
if (this->restart_) {
result = this->thpres_;
return result;
}
const auto& simConfig = eclState_.getSimulationConfig();
const auto& thpres = simConfig.getThresholdPressure();
std::size_t idx = 0;
for (unsigned j = 1; j <= numEquilRegions_; ++j) {
for (unsigned i = 1; i <= numEquilRegions_; ++i, ++idx) {
if (thpres.hasRegionBarrier(i, j)) {
if (thpres.hasThresholdPressure(i, j)) {
result[idx] = thpres.getThresholdPressure(i, j);
} else {
result[idx] = this->thpresDefault_[idx];
}
}
}
}
return result;
return this->thpres_;
}
template<class Grid, class GridView, class ElementMapper, class Scalar>