mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 16:32:12 -05:00
#3608 Temp LGR. Use short name in export due to Eclipse limitations
This commit is contained in:
1 parent
f7375a63ce
commit
95aaa35383
2 files changed
+31
-9
No files matched your search
@@ -257,6 +257,7 @@ void RicExportLgrFeature::exportLgrs(QTextStream& stream, const std::vector<LgrI
|
|||||||
|
|
||||||
{
|
{
|
||||||
RifEclipseDataTableFormatter formatter(stream);
|
RifEclipseDataTableFormatter formatter(stream);
|
||||||
|
formatter.comment(QString("LGR: ") + lgrInfo.name);
|
||||||
formatter.keyword("CARFIN");
|
formatter.keyword("CARFIN");
|
||||||
formatter.header({RifEclipseOutputTableColumn("Name"),
|
formatter.header({RifEclipseOutputTableColumn("Name"),
|
||||||
RifEclipseOutputTableColumn("I1"),
|
RifEclipseOutputTableColumn("I1"),
|
||||||
@@ -269,7 +270,7 @@ void RicExportLgrFeature::exportLgrs(QTextStream& stream, const std::vector<LgrI
|
|||||||
RifEclipseOutputTableColumn("NY"),
|
RifEclipseOutputTableColumn("NY"),
|
||||||
RifEclipseOutputTableColumn("NZ")});
|
RifEclipseOutputTableColumn("NZ")});
|
||||||
|
|
||||||
formatter.add(lgrInfo.name);
|
formatter.add(lgrInfo.shortName);
|
||||||
formatter.addOneBasedCellIndex(lgrInfo.mainGridStartCell.i());
|
formatter.addOneBasedCellIndex(lgrInfo.mainGridStartCell.i());
|
||||||
formatter.addOneBasedCellIndex(lgrInfo.mainGridEndCell.i());
|
formatter.addOneBasedCellIndex(lgrInfo.mainGridEndCell.i());
|
||||||
formatter.addOneBasedCellIndex(lgrInfo.mainGridStartCell.j());
|
formatter.addOneBasedCellIndex(lgrInfo.mainGridStartCell.j());
|
||||||
@@ -313,7 +314,7 @@ void RicExportLgrFeature::exportLgrsForWellPath(const QString& export
|
|||||||
completionTypes,
|
completionTypes,
|
||||||
intersectingOtherLgrs);
|
intersectingOtherLgrs);
|
||||||
|
|
||||||
if (!*intersectingOtherLgrs)
|
if (!*intersectingOtherLgrs && !lgrs.empty())
|
||||||
{
|
{
|
||||||
// Export
|
// Export
|
||||||
QFile file;
|
QFile file;
|
||||||
@@ -356,7 +357,7 @@ std::vector<LgrInfo> RicExportLgrFeature::buildLgrsForWellPath(RimWellPath*
|
|||||||
|
|
||||||
int lgrId = firstAvailableLgrId(eclipseCase->mainGrid());
|
int lgrId = firstAvailableLgrId(eclipseCase->mainGrid());
|
||||||
auto lgrName = createLgrName("", lgrId);
|
auto lgrName = createLgrName("", lgrId);
|
||||||
lgrs.push_back(buildLgr(lgrId, lgrName, eclipseCase, intersectingCells, lgrCellCounts));
|
lgrs.push_back(buildLgr(lgrId, lgrName, lgrName, eclipseCase, intersectingCells, lgrCellCounts));
|
||||||
}
|
}
|
||||||
return lgrs;
|
return lgrs;
|
||||||
}
|
}
|
||||||
@@ -374,7 +375,7 @@ std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerMainCell(RimEclipseCase*
|
|||||||
for (auto intersectionCell : intersectingCells)
|
for (auto intersectionCell : intersectingCells)
|
||||||
{
|
{
|
||||||
auto lgrName = createLgrName("", lgrId);
|
auto lgrName = createLgrName("", lgrId);
|
||||||
lgrs.push_back(buildLgr(lgrId++, lgrName, eclipseCase, {intersectionCell}, lgrSizes));
|
lgrs.push_back(buildLgr(lgrId++, lgrName, lgrName, eclipseCase, {intersectionCell}, lgrSizes));
|
||||||
}
|
}
|
||||||
return lgrs;
|
return lgrs;
|
||||||
}
|
}
|
||||||
@@ -388,12 +389,19 @@ std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerCompletion(
|
|||||||
const caf::VecIjk& lgrSizesPerMainGridCell)
|
const caf::VecIjk& lgrSizesPerMainGridCell)
|
||||||
{
|
{
|
||||||
std::vector<LgrInfo> lgrs;
|
std::vector<LgrInfo> lgrs;
|
||||||
|
std::map<RigCompletionData::CompletionType, std::pair<QString, int>> namesAndCounters =
|
||||||
|
{
|
||||||
|
{RigCompletionData::FRACTURE, {"FRAC", 0}}, {RigCompletionData::FISHBONES, {"FB", 0}}, {RigCompletionData::PERFORATION, {"PERF", 0}}
|
||||||
|
};
|
||||||
|
|
||||||
int lgrId = firstAvailableLgrId(eclipseCase->mainGrid());
|
int lgrId = firstAvailableLgrId(eclipseCase->mainGrid());
|
||||||
for (auto complInfo : completionInfo)
|
for (auto complInfo : completionInfo)
|
||||||
{
|
{
|
||||||
auto lgrName = createLgrName(complInfo.first.name, complInfo.first.number);
|
auto lgrName = createLgrName(complInfo.first.name, complInfo.first.number);
|
||||||
lgrs.push_back(buildLgr(lgrId++, lgrName, eclipseCase, complInfo.second, lgrSizesPerMainGridCell));
|
auto& typeName = namesAndCounters[complInfo.first.type].first;
|
||||||
|
auto& typeCounter = namesAndCounters[complInfo.first.type].second;
|
||||||
|
auto lgrShortName = createShortLgrName(typeName, typeCounter++);
|
||||||
|
lgrs.push_back(buildLgr(lgrId++, lgrName, lgrShortName, eclipseCase, complInfo.second, lgrSizesPerMainGridCell));
|
||||||
}
|
}
|
||||||
return lgrs;
|
return lgrs;
|
||||||
}
|
}
|
||||||
@@ -403,6 +411,7 @@ std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerCompletion(
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
LgrInfo RicExportLgrFeature::buildLgr(int lgrId,
|
LgrInfo RicExportLgrFeature::buildLgr(int lgrId,
|
||||||
const QString& lgrName,
|
const QString& lgrName,
|
||||||
|
const QString& shortLgrName,
|
||||||
RimEclipseCase* eclipseCase,
|
RimEclipseCase* eclipseCase,
|
||||||
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
||||||
const caf::VecIjk& lgrSizesPerMainGridCell)
|
const caf::VecIjk& lgrSizesPerMainGridCell)
|
||||||
@@ -430,7 +439,7 @@ LgrInfo RicExportLgrFeature::buildLgr(int
|
|||||||
caf::VecIjk mainGridStartCell(iRange.first, jRange.first, kRange.first);
|
caf::VecIjk mainGridStartCell(iRange.first, jRange.first, kRange.first);
|
||||||
caf::VecIjk mainGridEndCell(iRange.second, jRange.second, kRange.second);
|
caf::VecIjk mainGridEndCell(iRange.second, jRange.second, kRange.second);
|
||||||
|
|
||||||
return LgrInfo(lgrId, lgrName, lgrSizes, mainGridStartCell, mainGridEndCell);
|
return LgrInfo(lgrId, lgrName, shortLgrName, lgrSizes, mainGridStartCell, mainGridEndCell);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -737,7 +746,7 @@ int RicExportLgrFeature::firstAvailableLgrId(const RigMainGrid* mainGrid)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RicExportLgrFeature::createLgrName(const QString& baseName, int number)
|
QString RicExportLgrFeature::createLgrName(const QString& baseName, int number)
|
||||||
{
|
{
|
||||||
QString lgrName = "LGR";
|
QString lgrName;
|
||||||
|
|
||||||
if (!baseName.isEmpty())
|
if (!baseName.isEmpty())
|
||||||
{
|
{
|
||||||
@@ -750,3 +759,12 @@ QString RicExportLgrFeature::createLgrName(const QString& baseName, int number)
|
|||||||
return lgrName.replace(" ", "_");
|
return lgrName.replace(" ", "_");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RicExportLgrFeature::createShortLgrName(const QString& baseName, int number)
|
||||||
|
{
|
||||||
|
QString lgrName = baseName + "_" + QString::number(number + 1);
|
||||||
|
return lgrName.replace(" ", "_");
|
||||||
|
}
|
||||||
|
|
||||||
@@ -43,11 +43,12 @@ class LgrInfo
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LgrInfo(int id,
|
LgrInfo(int id,
|
||||||
const QString&name,
|
const QString& name,
|
||||||
|
const QString& shortName,
|
||||||
const caf::VecIjk& sizes,
|
const caf::VecIjk& sizes,
|
||||||
const caf::VecIjk& mainGridStartCell,
|
const caf::VecIjk& mainGridStartCell,
|
||||||
const caf::VecIjk& mainGridEndCell)
|
const caf::VecIjk& mainGridEndCell)
|
||||||
: id(id), name(name), sizes(sizes), mainGridStartCell(mainGridStartCell), mainGridEndCell(mainGridEndCell)
|
: id(id), name(name), shortName(shortName), sizes(sizes), mainGridStartCell(mainGridStartCell), mainGridEndCell(mainGridEndCell)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,6 +66,7 @@ public:
|
|||||||
|
|
||||||
int id;
|
int id;
|
||||||
QString name;
|
QString name;
|
||||||
|
QString shortName;
|
||||||
caf::VecIjk sizes;
|
caf::VecIjk sizes;
|
||||||
|
|
||||||
caf::VecIjk mainGridStartCell;
|
caf::VecIjk mainGridStartCell;
|
||||||
@@ -168,6 +170,7 @@ private:
|
|||||||
const caf::VecIjk& lgrSizesPerMainGridCell);
|
const caf::VecIjk& lgrSizesPerMainGridCell);
|
||||||
static LgrInfo buildLgr(int lgrId,
|
static LgrInfo buildLgr(int lgrId,
|
||||||
const QString& lgrName,
|
const QString& lgrName,
|
||||||
|
const QString& shortLgrName,
|
||||||
RimEclipseCase* eclipseCase,
|
RimEclipseCase* eclipseCase,
|
||||||
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
||||||
const caf::VecIjk& lgrSizesPerMainGridCell);
|
const caf::VecIjk& lgrSizesPerMainGridCell);
|
||||||
@@ -186,4 +189,5 @@ private:
|
|||||||
|
|
||||||
static int firstAvailableLgrId(const RigMainGrid* mainGrid);
|
static int firstAvailableLgrId(const RigMainGrid* mainGrid);
|
||||||
static QString createLgrName(const QString& baseName, int number = 0);
|
static QString createLgrName(const QString& baseName, int number = 0);
|
||||||
|
static QString createShortLgrName(const QString& baseName, int number);
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user