EclWriter: remove obsolete writeOutput() overload

this has been unused for any simulator for a while. the only code
which called it was the ECL output test, but this one could be easily
ported.
This commit is contained in:
Andreas Lauser
2019-02-06 12:21:08 +01:00
parent dc1b92521a
commit 51b24d33d5
2 changed files with 3 additions and 88 deletions
-83
View File
@@ -238,89 +238,6 @@ public:
}
}
// this method is equivalent to the one above but it does not require to extract the
// data which ought to be written from the proper eWoms objects. this method is thus
// DEPRECATED!
void writeOutput(Opm::data::Wells& localWellData, Scalar curTime, bool isSubStep, Scalar totalSolverTime, Scalar nextStepSize)
{
int episodeIdx = simulator_.episodeIndex() + 1;
const auto& gridView = simulator_.vanguard().gridView();
int numElements = gridView.size(/*codim=*/0);
bool log = collectToIORank_.isIORank();
eclOutputModule_.allocBuffers(numElements, episodeIdx, isSubStep, log);
ElementContext elemCtx(simulator_);
ElementIterator elemIt = gridView.template begin</*codim=*/0>();
const ElementIterator& elemEndIt = gridView.template end</*codim=*/0>();
for (; elemIt != elemEndIt; ++elemIt) {
const Element& elem = *elemIt;
elemCtx.updatePrimaryStencil(elem);
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
eclOutputModule_.processElement(elemCtx);
}
eclOutputModule_.outputErrorLog();
// collect all data to I/O rank and assign to sol
Opm::data::Solution localCellData = {};
if (!isSubStep)
eclOutputModule_.assignToSolution(localCellData);
// add cell data to perforations for Rft output
if (!isSubStep)
eclOutputModule_.addRftDataToWells(localWellData, episodeIdx);
if (collectToIORank_.isParallel())
collectToIORank_.collect(localCellData, eclOutputModule_.getBlockData(), localWellData);
std::map<std::string, double> miscSummaryData;
std::map<std::string, std::vector<double>> regionData;
eclOutputModule_.outputFipLog(miscSummaryData, regionData, isSubStep);
// write output on I/O rank
if (collectToIORank_.isIORank()) {
const auto& eclState = simulator_.vanguard().eclState();
const auto& simConfig = eclState.getSimulationConfig();
// Add TCPU
if (totalSolverTime != 0.0)
miscSummaryData["TCPU"] = totalSolverTime;
bool enableDoublePrecisionOutput = EWOMS_GET_PARAM(TypeTag, bool, EclOutputDoublePrecision);
const Opm::data::Solution& cellData = collectToIORank_.isParallel() ? collectToIORank_.globalCellData() : localCellData;
const Opm::data::Wells& wellData = collectToIORank_.isParallel() ? collectToIORank_.globalWellData() : localWellData;
Opm::RestartValue restartValue(cellData, wellData);
const std::map<std::pair<std::string, int>, double>& blockData
= collectToIORank_.isParallel()
? collectToIORank_.globalBlockData()
: eclOutputModule_.getBlockData();
// Add suggested next timestep to extra data.
if (!isSubStep)
restartValue.addExtra("OPMEXTRA", std::vector<double>(1, nextStepSize));
if (simConfig.useThresholdPressure())
restartValue.addExtra("THRESHPR", Opm::UnitSystem::measure::pressure, simulator_.problem().thresholdPressure().data());
// first, create a tasklet to write the data for the current time step to disk
auto eclWriteTasklet = std::make_shared<EclWriteTasklet>(*eclIO_,
episodeIdx,
isSubStep,
curTime,
restartValue,
miscSummaryData,
regionData,
blockData,
enableDoublePrecisionOutput);
// then, make sure that the previous I/O request has been completed and the
// number of incomplete tasklets does not increase between time steps
taskletRunner_->barrier();
// finally, start a new output writing job
taskletRunner_->dispatch(eclWriteTasklet);
}
}
void restartBegin()
{
bool enableHysteresis = simulator_.problem().materialLawManager()->enableHysteresis();
+3 -5
View File
@@ -132,14 +132,12 @@ void test_summary()
simulator->model().applyInitialSolution();
Opm::data::Wells dw;
bool substep = false;
Scalar totalSolverTime = 0;
Scalar nextstep = 0;
simulator->setEpisodeIndex(0);
eclWriter->writeOutput(dw, 0 * day, substep, totalSolverTime, nextstep);
eclWriter->writeOutput(substep);
simulator->setEpisodeIndex(1);
eclWriter->writeOutput(dw, 1 * day, substep, totalSolverTime, nextstep);
eclWriter->writeOutput(substep);
simulator->setEpisodeIndex(2);
eclWriter->writeOutput(dw, 2 * day, substep, totalSolverTime, nextstep);
eclWriter->writeOutput(substep);
auto res = readsum( casename );
const auto* resp = res.get();