mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4827 Completion Data : Support Eclipse input text files as data source
This commit is contained in:
@@ -148,15 +148,22 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
return fractureCompletions;
|
||||
}
|
||||
|
||||
auto cellResultsData = caseToApply->results( RiaDefines::MATRIX_MODEL );
|
||||
if ( !cellResultsData )
|
||||
{
|
||||
return fractureCompletions;
|
||||
}
|
||||
|
||||
{
|
||||
// Load the data required by computations to be able to use const access only inside OpenMP loop
|
||||
|
||||
std::vector<QString> resultNames = RigEclipseToStimPlanCellTransmissibilityCalculator::requiredResultNames();
|
||||
|
||||
if ( !caseToApply->loadStaticResultsByName( resultNames ) )
|
||||
bool loadingSucceeded = RicExportFractureCompletionsImpl::loadResultsByName( cellResultsData, resultNames );
|
||||
if ( !loadingSucceeded )
|
||||
{
|
||||
QString msg;
|
||||
msg += "Compdat Export : Required data missing. Required results ";
|
||||
msg += "Compdat Export : One or more of the following required data missing :";
|
||||
|
||||
for ( const auto& r : resultNames )
|
||||
{
|
||||
@@ -173,15 +180,13 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
||||
// Load the data required by fracture summary header
|
||||
|
||||
std::vector<QString> resultNames{"TRANX", "TRANY", "TRANZ"};
|
||||
|
||||
caseToApply->loadStaticResultsByName( resultNames );
|
||||
RicExportFractureCompletionsImpl::loadResultsByName( cellResultsData, resultNames );
|
||||
}
|
||||
|
||||
{
|
||||
// Optional results
|
||||
std::vector<QString> resultNames = RigEclipseToStimPlanCellTransmissibilityCalculator::optionalResultNames();
|
||||
|
||||
caseToApply->loadStaticResultsByName( resultNames );
|
||||
RicExportFractureCompletionsImpl::loadResultsByName( cellResultsData, resultNames );
|
||||
}
|
||||
|
||||
if ( pdParams.performScaling )
|
||||
@@ -812,3 +817,29 @@ void RicExportFractureCompletionsImpl::outputIntermediateResultsText( QTextStrea
|
||||
|
||||
( *outputStreamForIntermediateResultsText ) << "\n";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicExportFractureCompletionsImpl::loadResultsByName( RigCaseCellResultsData* cellResultsData,
|
||||
const std::vector<QString>& resultNames )
|
||||
{
|
||||
const std::vector<RiaDefines::ResultCatType> resultCategorySearchOrder = {RiaDefines::STATIC_NATIVE,
|
||||
RiaDefines::INPUT_PROPERTY,
|
||||
RiaDefines::GENERATED};
|
||||
|
||||
bool foundDataForAllResults = true;
|
||||
|
||||
if ( cellResultsData )
|
||||
{
|
||||
for ( const auto& resultName : resultNames )
|
||||
{
|
||||
if ( !cellResultsData->findAndLoadResultByName( resultName, resultCategorySearchOrder ) )
|
||||
{
|
||||
foundDataForAllResults = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return foundDataForAllResults;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ class RicWellPathFractureReportItem;
|
||||
class RigWellPath;
|
||||
class RigTransmissibilityCondenser;
|
||||
class RigEclipseToStimPlanCalculator;
|
||||
class RigCaseCellResultsData;
|
||||
|
||||
class RimEclipseCase;
|
||||
class RimFracture;
|
||||
@@ -147,4 +148,6 @@ private:
|
||||
RigTransmissibilityCondenser& transCondenser,
|
||||
const RigMainGrid* mainGrid,
|
||||
const RigFractureGrid* fractureGrid );
|
||||
|
||||
static bool loadResultsByName( RigCaseCellResultsData* cellResultsData, const std::vector<QString>& resultNames );
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user