Whitespace

This commit is contained in:
Magne Sjaastad 2018-09-07 13:06:28 +02:00
parent dcdd8cce2a
commit 8afc30d6f8

View File

@ -19,9 +19,9 @@
#include "RicWellPathExportCompletionDataFeatureImpl.h"
#include "RiaApplication.h"
#include "RiaFilePathTools.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiaFilePathTools.h"
#include "RicExportCompletionDataSettingsUi.h"
#include "RicExportFeatureImpl.h"
@ -48,13 +48,13 @@
#include "RimFractureTemplate.h"
#include "RimPerforationCollection.h"
#include "RimPerforationInterval.h"
#include "RimProject.h"
#include "RimSimWellInView.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimWellPathCompletions.h"
#include "RimWellPathFracture.h"
#include "RimWellPathFractureCollection.h"
#include "RimProject.h"
#include "RiuMainWindow.h"
@ -80,7 +80,10 @@ const RimWellPath* findWellPathFromExportName(const QString& wellNameForExport);
class OpenFileException
{
public:
OpenFileException(const QString &message) : message(message) {}
OpenFileException(const QString& message)
: message(message)
{
}
QString message;
};
@ -110,7 +113,8 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
else
{
int caseId = exportSettings.caseToApply->caseId();
QString format = QString("Unit systems for well path \"%1\" must match unit system of chosen eclipse case \"%2\"");
QString format =
QString("Unit systems for well path \"%1\" must match unit system of chosen eclipse case \"%2\"");
QString errMsg = format.arg(wellPath->name()).arg(caseId);
RiaLogging::error(errMsg);
}
@ -144,7 +148,8 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
}
}
size_t maxProgress = usedWellPaths.size() * 3 + simWells.size() +
size_t maxProgress =
usedWellPaths.size() * 3 + simWells.size() +
(exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL
? usedWellPaths.size()
: exportSettings.fileSplit == RicExportCompletionDataSettingsUi::SPLIT_ON_WELL_AND_COMPLETION_TYPE
@ -198,7 +203,10 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
std::vector<RigCompletionData> fractureCompletionData =
RicExportFractureCompletionsImpl::generateCompdatValuesForWellPath(
wellPath, exportSettings.caseToApply(), reportItems, fractureTransmissibilityExportInformationStream.get());
wellPath,
exportSettings.caseToApply(),
reportItems,
fractureTransmissibilityExportInformationStream.get());
appendCompletionData(&completionsPerEclipseCellAllCompletionTypes, fractureCompletionData);
appendCompletionData(&completionsPerEclipseCellFracture, fractureCompletionData);
@ -236,7 +244,8 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
{
std::map<RigCompletionDataGridCell, std::vector<RigCompletionData>> completionsPerEclipseCell;
std::vector<RigCompletionData> fractureCompletionData = RicExportFractureCompletionsImpl::generateCompdatValuesForSimWell(
std::vector<RigCompletionData> fractureCompletionData =
RicExportFractureCompletionsImpl::generateCompdatValuesForSimWell(
exportSettings.caseToApply(), simWell, fractureTransmissibilityExportInformationStream.get());
appendCompletionData(&completionsPerEclipseCell, fractureCompletionData);
@ -370,9 +379,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
for (const auto wellPath : wellPaths)
{
auto fractures = wellPath->fractureCollection()->fractures();
exportWellSegments(exportSettings.caseToApply,
exportFile,
wellPath, fractures);
exportWellSegments(exportSettings.caseToApply, exportFile, wellPath, fractures);
}
exportFile->close();
}
@ -385,9 +392,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
for (const auto wellPath : wellPaths)
{
auto fishbones = wellPath->fishbonesCollection()->activeFishbonesSubs();
exportWellSegments(exportSettings.caseToApply,
exportFile,
wellPath, fishbones);
exportWellSegments(exportSettings.caseToApply, exportFile, wellPath, fishbones);
}
exportFile->close();
@ -401,9 +406,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve
for (const auto wellPath : wellPaths)
{
auto perforations = wellPath->perforationIntervalCollection()->perforations();
exportWellSegments(exportSettings.caseToApply,
exportFile,
wellPath, perforations);
exportWellSegments(exportSettings.caseToApply, exportFile, wellPath, perforations);
}
exportFile->close();
}
@ -740,8 +743,7 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompsegTable(
formatter.add(intersection.gridName());
}
cvf::Vec3st ijk = intersection.gridLocalCellIJK();
formatter.addOneBasedCellIndex(ijk.x()).addOneBasedCellIndex(ijk.y()).addOneBasedCellIndex(
ijk.z());
formatter.addOneBasedCellIndex(ijk.x()).addOneBasedCellIndex(ijk.y()).addOneBasedCellIndex(ijk.z());
formatter.add(completion.branchNumber());
double startLength = segment.startMD();
@ -1010,7 +1012,7 @@ QFilePtr RicWellPathExportCompletionDataFeatureImpl::openFileForExport(const QSt
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData>
RicWellPathExportCompletionDataFeatureImpl::mainGridCompletions(std::vector<RigCompletionData>& allCompletions)
RicWellPathExportCompletionDataFeatureImpl::mainGridCompletions(std::vector<RigCompletionData>& allCompletions)
{
std::vector<RigCompletionData> completions;
@ -1029,7 +1031,7 @@ RicWellPathExportCompletionDataFeatureImpl::mainGridCompletions(std::vector<RigC
///
//--------------------------------------------------------------------------------------------------
std::map<QString, std::vector<RigCompletionData>>
RicWellPathExportCompletionDataFeatureImpl::subGridsCompletions(std::vector<RigCompletionData>& allCompletions)
RicWellPathExportCompletionDataFeatureImpl::subGridsCompletions(std::vector<RigCompletionData>& allCompletions)
{
std::map<QString, std::vector<RigCompletionData>> completions;
@ -1041,8 +1043,7 @@ RicWellPathExportCompletionDataFeatureImpl::subGridsCompletions(std::vector<RigC
auto it = completions.find(gridName);
if (it == completions.end())
{
completions.insert(
std::pair<QString, std::vector<RigCompletionData>>(gridName, {completion}));
completions.insert(std::pair<QString, std::vector<RigCompletionData>>(gridName, {completion}));
}
else
{
@ -1056,7 +1057,8 @@ RicWellPathExportCompletionDataFeatureImpl::subGridsCompletions(std::vector<RigC
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeatureImpl::exportWellPathFractureReport(RimEclipseCase* sourceCase,
void RicWellPathExportCompletionDataFeatureImpl::exportWellPathFractureReport(
RimEclipseCase* sourceCase,
QFilePtr exportFile,
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems)
{
@ -1104,14 +1106,12 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspecsToFile(RimEclipse
RifEclipseDataTableFormatter formatter(stream);
formatter.setColumnSpacing(3);
std::vector<RifEclipseOutputTableColumn> header = {
RifEclipseOutputTableColumn("Well"),
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn("Well"),
RifEclipseOutputTableColumn("Grp"),
RifEclipseOutputTableColumn("I"),
RifEclipseOutputTableColumn("J"),
RifEclipseOutputTableColumn("RefDepth"),
RifEclipseOutputTableColumn("WellType")
};
RifEclipseOutputTableColumn("WellType")};
formatter.keyword("WELSPECS");
formatter.header(header);
@ -1134,8 +1134,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspecsToFile(RimEclipse
auto completions = wellPath->completions();
cvf::Vec2i ijIntersection = wellPathUpperGridIntersectionIJ(gridCase, wellPath);
formatter
.add(completions->wellNameForExport())
formatter.add(completions->wellNameForExport())
.add(completions->wellGroupNameForExport())
.addOneBasedCellIndex(ijIntersection.x())
.addOneBasedCellIndex(ijIntersection.y())
@ -1150,7 +1149,8 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspecsToFile(RimEclipse
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile(RimEclipseCase* gridCase,
void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile(
RimEclipseCase* gridCase,
QFilePtr exportFile,
const std::map<QString, std::vector<RigCompletionData>>& completions)
{
@ -1159,15 +1159,13 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile(RimEclipse
RifEclipseDataTableFormatter formatter(stream);
formatter.setColumnSpacing(3);
std::vector<RifEclipseOutputTableColumn> header = {
RifEclipseOutputTableColumn("Well"),
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn("Well"),
RifEclipseOutputTableColumn("Grp"),
RifEclipseOutputTableColumn("LGR"),
RifEclipseOutputTableColumn("I"),
RifEclipseOutputTableColumn("J"),
RifEclipseOutputTableColumn("RefDepth"),
RifEclipseOutputTableColumn("WellType")
};
RifEclipseOutputTableColumn("WellType")};
formatter.keyword("WELSPECL");
formatter.header(header);
@ -1199,8 +1197,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile(RimEclipse
auto completions = wellPath->completions();
cvf::Vec2i ijIntersection = wellPathUpperGridIntersectionIJ(gridCase, wellPath, lgrName);
formatter
.add(completions->wellNameForExport())
formatter.add(completions->wellNameForExport())
.add(completions->wellGroupNameForExport())
.add(lgrName)
.addOneBasedCellIndex(ijIntersection.x())
@ -1242,8 +1239,9 @@ void RicWellPathExportCompletionDataFeatureImpl::sortAndExportCompletionsToFile(
exportWelspecsToFile(eclipseCase, exportFile, completionsForMainGrid);
exportCompdatAndWpimultTables(eclipseCase, exportFile, completionsForGrid, exportType);
}
catch(OpenFileException)
{ }
catch (OpenFileException)
{
}
}
if (!completionsForSubGrids.empty())
@ -1257,8 +1255,9 @@ void RicWellPathExportCompletionDataFeatureImpl::sortAndExportCompletionsToFile(
exportWelspeclToFile(eclipseCase, exportFile, completionsForSubGrids);
exportCompdatAndWpimultTables(eclipseCase, exportFile, completionsForSubGrids, exportType);
}
catch(OpenFileException)
{ }
catch (OpenFileException)
{
}
}
}
@ -1310,7 +1309,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatTableUsingFormatte
if (gridName.isEmpty())
{
header = { RifEclipseOutputTableColumn("Well"),
header = {RifEclipseOutputTableColumn("Well"),
RifEclipseOutputTableColumn("I"),
RifEclipseOutputTableColumn("J"),
RifEclipseOutputTableColumn("K1"),
@ -1325,7 +1324,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatTableUsingFormatte
RifEclipseOutputTableColumn("S"),
RifEclipseOutputTableColumn(
"Df", RifEclipseOutputTableDoubleFormatting(RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC)),
RifEclipseOutputTableColumn("DIR") };
RifEclipseOutputTableColumn("DIR")};
formatter.keyword("COMPDAT");
}
@ -1347,7 +1346,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatTableUsingFormatte
RifEclipseOutputTableColumn("S"),
RifEclipseOutputTableColumn(
"Df", RifEclipseOutputTableDoubleFormatting(RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC)),
RifEclipseOutputTableColumn("DIR") };
RifEclipseOutputTableColumn("DIR")};
formatter.keyword("COMPDATL");
}
@ -1761,12 +1760,11 @@ RicMswExportInfo
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswExportInfo RicWellPathExportCompletionDataFeatureImpl::generatePerforationsMswExportInfo(RimEclipseCase* caseToApply,
RicMswExportInfo RicWellPathExportCompletionDataFeatureImpl::generatePerforationsMswExportInfo(
RimEclipseCase* caseToApply,
const RimWellPath* wellPath,
const std::vector<const RimPerforationInterval*>& perforationIntervals)
{
return RicMswExportInfo(wellPath, RiaEclipseUnitTools::UNITS_METRIC, 0, "LENdep", "pRES");
}
@ -2213,7 +2211,8 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWellSegments(RimEclipseCa
return;
}
RicMswExportInfo exportInfo = RicWellPathExportCompletionDataFeatureImpl::generateFracturesMswExportInfo(eclipseCase, wellPath, fractures);
RicMswExportInfo exportInfo =
RicWellPathExportCompletionDataFeatureImpl::generateFracturesMswExportInfo(eclipseCase, wellPath, fractures);
QTextStream stream(exportFile.get());
RifEclipseDataTableFormatter formatter(stream);
@ -2235,7 +2234,8 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWellSegments(RimEclipseCa
return;
}
RicMswExportInfo exportInfo = RicWellPathExportCompletionDataFeatureImpl::generateFishbonesMswExportInfo(eclipseCase, wellPath, fishbonesSubs);
RicMswExportInfo exportInfo =
RicWellPathExportCompletionDataFeatureImpl::generateFishbonesMswExportInfo(eclipseCase, wellPath, fishbonesSubs);
QTextStream stream(exportFile.get());
RifEclipseDataTableFormatter formatter(stream);
@ -2244,11 +2244,11 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWellSegments(RimEclipseCa
RicWellPathExportCompletionDataFeatureImpl::generateWsegvalvTable(formatter, exportInfo);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeatureImpl::exportWellSegments(RimEclipseCase* eclipseCase,
void RicWellPathExportCompletionDataFeatureImpl::exportWellSegments(
RimEclipseCase* eclipseCase,
QFilePtr exportFile,
const RimWellPath* wellPath,
const std::vector<const RimPerforationInterval*>& perforationIntervals)
@ -2259,7 +2259,8 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWellSegments(RimEclipseCa
return;
}
RicMswExportInfo exportInfo = RicWellPathExportCompletionDataFeatureImpl::generatePerforationsMswExportInfo(eclipseCase, wellPath, perforationIntervals);
RicMswExportInfo exportInfo = RicWellPathExportCompletionDataFeatureImpl::generatePerforationsMswExportInfo(
eclipseCase, wellPath, perforationIntervals);
QTextStream stream(exportFile.get());
RifEclipseDataTableFormatter formatter(stream);