Reorder loops to resemble future processing

We will look at the presence of keywords first, and then for each
keyword determine which wells it applies to.
This commit is contained in:
Roland Kaufmann 2013-11-07 13:49:08 +01:00
parent 441fd2825b
commit c630220e6f

View File

@ -685,16 +685,16 @@ void BlackoilEclipseOutputWriter::writeInit(const SimulatorTimer &timer) {
// (e.g. "WOPR") in the input files, and only for those wells that are // (e.g. "WOPR") in the input files, and only for those wells that are
// mentioned in those keywords // mentioned in those keywords
const int numWells = eclipseParser_.getWELSPECS().welspecs.size(); const int numWells = eclipseParser_.getWELSPECS().welspecs.size();
for (int whichWell = 0; whichWell != numWells; ++whichWell) { for (int phaseCounter = 0;
for (int phaseCounter = 0; phaseCounter != BlackoilPhases::MaxNumPhases;
phaseCounter != BlackoilPhases::MaxNumPhases; ++phaseCounter) {
++phaseCounter) { const BlackoilPhases::PhaseIndex phase =
const BlackoilPhases::PhaseIndex phase = static_cast <BlackoilPhases::PhaseIndex> (phaseCounter);
static_cast <BlackoilPhases::PhaseIndex> (phaseCounter); for (size_t typeIndex = 0;
for (size_t typeIndex = 0; typeIndex < sizeof (WELL_TYPES) / sizeof (WELL_TYPES[0]);
typeIndex < sizeof (WELL_TYPES) / sizeof (WELL_TYPES[0]); ++typeIndex) {
++typeIndex) { const WellType type = WELL_TYPES[typeIndex];
const WellType type = WELL_TYPES[typeIndex]; for (int whichWell = 0; whichWell != numWells; ++whichWell) {
// W{O,G,W}{I,P}R // W{O,G,W}{I,P}R
sum_->add (std::unique_ptr <EclipseWellReport> ( sum_->add (std::unique_ptr <EclipseWellReport> (
new EclipseWellRate (*sum_, new EclipseWellRate (*sum_,