Convert to enum class

This commit is contained in:
Magne Sjaastad
2020-04-24 07:13:33 +02:00
parent 83914006fd
commit f89dcf4e52
63 changed files with 513 additions and 450 deletions

View File

@@ -1724,8 +1724,8 @@ void RigCaseCellResultsData::testAndComputeSgasForTimeStep( size_t timeStepIndex
if ( m_readerInterface.isNull() ) return;
std::set<RiaDefines::PhaseType> phases = m_readerInterface->availablePhases();
if ( phases.count( RiaDefines::GAS_PHASE ) == 0 ) return;
if ( phases.count( RiaDefines::OIL_PHASE ) > 0 ) return;
if ( phases.count( RiaDefines::PhaseType::GAS_PHASE ) == 0 ) return;
if ( phases.count( RiaDefines::PhaseType::OIL_PHASE ) > 0 ) return;
// Simulation type is gas and water. No SGAS is present, compute SGAS based on SWAT

View File

@@ -178,44 +178,53 @@ public:
const RigWellLogCurveData* firstCurveData = curveDataForFirstCurve();
if ( firstCurveData->depthUnit() == RiaDefines::UNIT_METER )
if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_METER )
{
lasFile->AddLog( "DEPTH", "M", "Depth in meters", firstCurveData->depths( RiaDefines::MEASURED_DEPTH ) );
lasFile->AddLog( "DEPTH",
"M",
"Depth in meters",
firstCurveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) );
}
else if ( firstCurveData->depthUnit() == RiaDefines::UNIT_FEET )
else if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_FEET )
{
lasFile->AddLog( "DEPTH", "FT", "Depth in feet", firstCurveData->depths( RiaDefines::MEASURED_DEPTH ) );
lasFile->AddLog( "DEPTH",
"FT",
"Depth in feet",
firstCurveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) );
}
else if ( firstCurveData->depthUnit() == RiaDefines::UNIT_NONE )
else if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_NONE )
{
lasFile->AddLog( "DEPTH", "", "Depth in Connection number", firstCurveData->depths( RiaDefines::MEASURED_DEPTH ) );
lasFile->AddLog( "DEPTH",
"",
"Depth in Connection number",
firstCurveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) );
}
if ( firstCurveData->depths( RiaDefines::TRUE_VERTICAL_DEPTH ).size() )
if ( firstCurveData->depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ).size() )
{
lasFile->AddLog( "TVDMSL",
"M",
"True vertical depth in meters",
firstCurveData->depths( RiaDefines::TRUE_VERTICAL_DEPTH ) );
firstCurveData->depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ) );
if ( m_exportTvdrkb && m_rkbDiff != -1.0 )
{
// Export True Vertical Depth Rotary Kelly Bushing - TVDRKB
std::vector<double> tvdrkbValues = firstCurveData->depths( RiaDefines::TRUE_VERTICAL_DEPTH );
std::vector<double> tvdrkbValues = firstCurveData->depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH );
for ( auto& value : tvdrkbValues )
{
value += m_rkbDiff;
}
if ( firstCurveData->depthUnit() == RiaDefines::UNIT_METER )
if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_METER )
{
lasFile->AddLog( "TVDRKB", "M", "True vertical depth (Rotary Kelly Bushing)", tvdrkbValues );
}
else if ( firstCurveData->depthUnit() == RiaDefines::UNIT_FEET )
else if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_FEET )
{
lasFile->AddLog( "TVDRKB", "FT", "True vertical depth (Rotary Kelly Bushing)", tvdrkbValues );
}
else if ( firstCurveData->depthUnit() == RiaDefines::UNIT_NONE )
else if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_NONE )
{
CVF_ASSERT( false );
lasFile->AddLog( "TVDRKB", "", "", tvdrkbValues );
@@ -225,16 +234,19 @@ public:
double minDepth = 0.0;
double maxDepth = 0.0;
firstCurveData->calculateDepthRange( RiaDefines::MEASURED_DEPTH, firstCurveData->depthUnit(), &minDepth, &maxDepth );
firstCurveData->calculateDepthRange( RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
firstCurveData->depthUnit(),
&minDepth,
&maxDepth );
lasFile->setStartDepth( minDepth );
lasFile->setStopDepth( maxDepth );
if ( firstCurveData->depthUnit() == RiaDefines::UNIT_METER )
if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_METER )
{
lasFile->setDepthUnit( "M" );
}
else if ( firstCurveData->depthUnit() == RiaDefines::UNIT_FEET )
else if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_FEET )
{
lasFile->setDepthUnit( "FT" );
}

View File

@@ -70,11 +70,11 @@ RigTofWellDistributionCalculator::RigTofWellDistributionCalculator( RimEclipseRe
}
QString phaseResultName;
if ( phase == RiaDefines::WATER_PHASE )
if ( phase == RiaDefines::PhaseType::WATER_PHASE )
phaseResultName = "SWAT";
else if ( phase == RiaDefines::OIL_PHASE )
else if ( phase == RiaDefines::PhaseType::OIL_PHASE )
phaseResultName = "SOIL";
else if ( phase == RiaDefines::GAS_PHASE )
else if ( phase == RiaDefines::PhaseType::GAS_PHASE )
phaseResultName = "SGAS";
const std::vector<double>* phaseResults = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL,
RiaDefines::ResultCatType::DYNAMIC_NATIVE,

View File

@@ -34,7 +34,7 @@
RigWellLogCurveData::RigWellLogCurveData()
{
m_isExtractionCurve = false;
m_depthUnit = RiaDefines::UNIT_METER;
m_depthUnit = RiaDefines::DepthUnitType::UNIT_METER;
m_xUnitString = RiaWellLogUnitTools<double>::noUnitString();
}
@@ -117,11 +117,12 @@ std::vector<double> RigWellLogCurveData::xValues() const
std::vector<double> RigWellLogCurveData::xValues( const QString& units ) const
{
std::vector<double> convertedValues;
if ( units != m_xUnitString && RiaWellLogUnitTools<double>::convertValues( depths( RiaDefines::TRUE_VERTICAL_DEPTH_RKB ),
m_xValues,
&convertedValues,
m_xUnitString,
units ) )
if ( units != m_xUnitString &&
RiaWellLogUnitTools<double>::convertValues( depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB ),
m_xValues,
&convertedValues,
m_xUnitString,
units ) )
{
return convertedValues;
}
@@ -149,18 +150,20 @@ std::vector<double> RigWellLogCurveData::depths( RiaDefines::DepthTypeEnum depth
if ( m_rkbDiff != 0.0 )
{
if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB && m_depths.count( RiaDefines::TRUE_VERTICAL_DEPTH ) )
if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB &&
m_depths.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ) )
{
std::vector<double> tvds = depths( RiaDefines::TRUE_VERTICAL_DEPTH );
std::vector<double> tvds = depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH );
for ( double& tvdValue : tvds )
{
tvdValue += m_rkbDiff;
}
return tvds;
}
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH && m_depths.count( RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) )
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH &&
m_depths.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB ) )
{
std::vector<double> tvds = depths( RiaDefines::TRUE_VERTICAL_DEPTH_RKB );
std::vector<double> tvds = depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB );
for ( double& tvdValue : tvds )
{
tvdValue -= m_rkbDiff;
@@ -185,14 +188,15 @@ std::set<RiaDefines::DepthTypeEnum> RigWellLogCurveData::availableDepthTypes() c
if ( m_rkbDiff != 0.0 )
{
if ( depthTypes.count( RiaDefines::TRUE_VERTICAL_DEPTH ) && !depthTypes.count( RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) )
if ( depthTypes.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ) &&
!depthTypes.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB ) )
{
depthTypes.insert( RiaDefines::TRUE_VERTICAL_DEPTH_RKB );
depthTypes.insert( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB );
}
else if ( depthTypes.count( RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) &&
!depthTypes.count( RiaDefines::TRUE_VERTICAL_DEPTH ) )
else if ( depthTypes.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB ) &&
!depthTypes.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ) )
{
depthTypes.insert( RiaDefines::TRUE_VERTICAL_DEPTH );
depthTypes.insert( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH );
}
}
@@ -255,8 +259,8 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
bool isTVDAvailable = false;
std::vector<double> tvDepths;
auto mdIt = m_depths.find( RiaDefines::MEASURED_DEPTH );
auto tvdIt = m_depths.find( RiaDefines::TRUE_VERTICAL_DEPTH );
auto mdIt = m_depths.find( RiaDefines::DepthTypeEnum::MEASURED_DEPTH );
auto tvdIt = m_depths.find( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH );
if ( tvdIt != m_depths.end() && !tvdIt->second.empty() ) isTVDAvailable = true;
@@ -306,12 +310,18 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
if ( isTVDAvailable )
{
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> resampledDepths =
{{RiaDefines::TRUE_VERTICAL_DEPTH, tvDepths}, {RiaDefines::MEASURED_DEPTH, measuredDepths}};
{{RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, tvDepths},
{RiaDefines::DepthTypeEnum::MEASURED_DEPTH, measuredDepths}};
reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true );
}
else
{
reSampledData->setValuesAndDepths( xValues, measuredDepths, RiaDefines::MEASURED_DEPTH, 0.0, m_depthUnit, m_isExtractionCurve );
reSampledData->setValuesAndDepths( xValues,
measuredDepths,
RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
0.0,
m_depthUnit,
m_isExtractionCurve );
}
return reSampledData;
@@ -337,7 +347,7 @@ void RigWellLogCurveData::calculateIntervalsOfContinousValidValues()
for ( size_t intIdx = 0; intIdx < intervalsCount; intIdx++ )
{
std::vector<std::pair<size_t, size_t>> depthValuesIntervals;
splitIntervalAtEmptySpace( m_depths[RiaDefines::MEASURED_DEPTH],
splitIntervalAtEmptySpace( m_depths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH],
intervalsOfValidValues[intIdx].first,
intervalsOfValidValues[intIdx].second,
&depthValuesIntervals );

View File

@@ -241,15 +241,15 @@ QString RigWellLogFile::wellLogChannelUnitString( const QString& well
{
if ( displayDepthUnit != depthUnit() )
{
if ( displayDepthUnit == RiaDefines::UNIT_METER )
if ( displayDepthUnit == RiaDefines::DepthUnitType::UNIT_METER )
{
return "M";
}
else if ( displayDepthUnit == RiaDefines::UNIT_FEET )
else if ( displayDepthUnit == RiaDefines::DepthUnitType::UNIT_FEET )
{
return "FT";
}
else if ( displayDepthUnit == RiaDefines::UNIT_NONE )
else if ( displayDepthUnit == RiaDefines::DepthUnitType::UNIT_NONE )
{
CVF_ASSERT( false );
return "";
@@ -296,11 +296,11 @@ bool RigWellLogFile::hasTvdRkbChannel() const
//--------------------------------------------------------------------------------------------------
RiaDefines::DepthUnitType RigWellLogFile::depthUnit() const
{
RiaDefines::DepthUnitType unitType = RiaDefines::UNIT_METER;
RiaDefines::DepthUnitType unitType = RiaDefines::DepthUnitType::UNIT_METER;
if ( depthUnitString().toUpper() == "F" || depthUnitString().toUpper() == "FT" )
{
unitType = RiaDefines::UNIT_FEET;
unitType = RiaDefines::DepthUnitType::UNIT_FEET;
}
return unitType;

View File

@@ -55,7 +55,7 @@ void RigWellPathFormations::depthAndFormationNamesWithoutDuplicatesOnDepth( std:
{
std::map<double, bool, DepthComp> tempMakeVectorUniqueOnMeasuredDepth;
if ( depthType == RiaDefines::MEASURED_DEPTH )
if ( depthType == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
{
for ( const std::pair<RigWellPathFormation, FormationLevel>& formation : m_formations )
{
@@ -77,7 +77,7 @@ void RigWellPathFormations::depthAndFormationNamesWithoutDuplicatesOnDepth( std:
}
}
}
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH )
{
for ( const std::pair<RigWellPathFormation, FormationLevel>& formation : m_formations )
{
@@ -169,7 +169,7 @@ void RigWellPathFormations::evaluateFormationsForOnePosition(
{
double depth;
if ( depthType == RiaDefines::MEASURED_DEPTH )
if ( depthType == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
{
if ( position == TOP )
{
@@ -180,7 +180,7 @@ void RigWellPathFormations::evaluateFormationsForOnePosition(
depth = formation.first.mdBase;
}
}
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH )
{
if ( position == TOP )
{
@@ -237,11 +237,11 @@ void RigWellPathFormations::evaluateFluids( const std::vector<RigWellPathFormati
for ( const RigWellPathFormation& formation : fluidFormations )
{
double depthBase;
if ( depthType == RiaDefines::MEASURED_DEPTH )
if ( depthType == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
{
depthBase = formation.mdBase;
}
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH )
{
depthBase = formation.tvdBase;
}
@@ -254,11 +254,11 @@ void RigWellPathFormations::evaluateFluids( const std::vector<RigWellPathFormati
for ( const RigWellPathFormation& formation : fluidFormations )
{
double depthTop;
if ( depthType == RiaDefines::MEASURED_DEPTH )
if ( depthType == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
{
depthTop = formation.mdTop;
}
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH )
{
depthTop = formation.tvdTop;
}