corrections to handle the use of network or not and degenrate case

This commit is contained in:
Jostein Alvestad
2021-02-12 13:59:42 +01:00
parent cece11c727
commit b403e2ae48
2 changed files with 6 additions and 4 deletions

View File

@@ -517,10 +517,10 @@ Opm::RestartIO::Helpers::WindowedArray<int>
allocate(const std::vector<int>& inteHead)
{
using WV = Opm::RestartIO::Helpers::WindowedArray<int>;
int nitPrWin = std::max(static_cast<int>(entriesPerInobr(inteHead)), 1);
return WV {
WV::NumWindows{ 1 },
WV::WindowSize{ entriesPerInobr(inteHead) }
WV::WindowSize{ static_cast<std::size_t>(nitPrWin) }
};
}

View File

@@ -438,8 +438,10 @@ namespace {
{
writeGroup(sim_step, units, schedule, sumState, inteHD, rstFile);
//write network data
writeNetwork(es, sim_step, units, schedule, sumState, inteHD, rstFile);
//write network data if the network option is used
if (es.runspec().networkDimensions().maxNONodes() >= 1) {
writeNetwork(es, sim_step, units, schedule, sumState, inteHD, rstFile);
}
// Write well and MSW data only when applicable (i.e., when present)
const auto& wells = schedule.wellNames(sim_step);