mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Update clang-format.yml (#10068)
* Update to clang-format-15 Removed two custom .clang-format files in subfolders of AppFwk * Fixes by clang-format
This commit is contained in:
@@ -369,8 +369,8 @@ void RimWellAllocationOverTimePlot::updateFromWell()
|
||||
const QBrush fillBrush( fillColor, Qt::BrushStyle::SolidPattern );
|
||||
auto interpolationType = m_flowValueType == FlowValueType::ACCUMULATED_FLOW_VOLUME ||
|
||||
m_flowValueType == FlowValueType::ACCUMULATED_FLOW_VOLUME_PERCENTAGE
|
||||
? RiuQwtPlotCurveDefines::CurveInterpolationEnum::INTERPOLATION_POINT_TO_POINT
|
||||
: RiuQwtPlotCurveDefines::CurveInterpolationEnum::INTERPOLATION_STEP_LEFT;
|
||||
? RiuQwtPlotCurveDefines::CurveInterpolationEnum::INTERPOLATION_POINT_TO_POINT
|
||||
: RiuQwtPlotCurveDefines::CurveInterpolationEnum::INTERPOLATION_STEP_LEFT;
|
||||
|
||||
RiuPlotCurve* curve = m_plotWidget->createPlotCurve( nullptr, wellName );
|
||||
curve->setAppearance( RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID, interpolationType, 2, qColor, fillBrush );
|
||||
@@ -792,9 +792,8 @@ void RimWellAllocationOverTimePlot::setValidTimeStepRangeForCase()
|
||||
return;
|
||||
}
|
||||
|
||||
auto isTimeStepInCase = [&]( const QDateTime timeStep ) -> bool {
|
||||
return std::find( m_case->timeStepDates().cbegin(), m_case->timeStepDates().cend(), timeStep ) != m_case->timeStepDates().cend();
|
||||
};
|
||||
auto isTimeStepInCase = [&]( const QDateTime timeStep ) -> bool
|
||||
{ return std::find( m_case->timeStepDates().cbegin(), m_case->timeStepDates().cend(), timeStep ) != m_case->timeStepDates().cend(); };
|
||||
if ( m_selectedFromTimeStep().isValid() && isTimeStepInCase( m_selectedFromTimeStep() ) && m_selectedToTimeStep().isValid() &&
|
||||
isTimeStepInCase( m_selectedToTimeStep() ) )
|
||||
{
|
||||
|
||||
@@ -303,13 +303,11 @@ void RimWellAllocationPlot::updateFromWell()
|
||||
|
||||
accumulatedWellFlowPlot()->addPlot( plotTrack );
|
||||
|
||||
const std::vector<double>& depthValues = depthType == RiaDefines::DepthTypeEnum::CONNECTION_NUMBER
|
||||
? wfCalculator->connectionNumbersFromTop( brIdx )
|
||||
: depthType == RiaDefines::DepthTypeEnum::PSEUDO_LENGTH
|
||||
? wfCalculator->pseudoLengthFromTop( brIdx )
|
||||
: depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH
|
||||
? wfCalculator->trueVerticalDepth( brIdx )
|
||||
: std::vector<double>();
|
||||
const std::vector<double>& depthValues =
|
||||
depthType == RiaDefines::DepthTypeEnum::CONNECTION_NUMBER ? wfCalculator->connectionNumbersFromTop( brIdx )
|
||||
: depthType == RiaDefines::DepthTypeEnum::PSEUDO_LENGTH ? wfCalculator->pseudoLengthFromTop( brIdx )
|
||||
: depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ? wfCalculator->trueVerticalDepth( brIdx )
|
||||
: std::vector<double>();
|
||||
|
||||
if ( !depthValues.empty() )
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ std::map<QString, const std::vector<double>*>
|
||||
{
|
||||
if ( flowDiagSolution->tracerStatusInTimeStep( tracerName, timeStepIndex ) == requestedTracerType )
|
||||
{
|
||||
RigFlowDiagResultAddress resAddr( RIG_FLD_CELL_FRACTION_RESNAME, phaseSelection, tracerName.toStdString() );
|
||||
RigFlowDiagResultAddress resAddr( RIG_FLD_CELL_FRACTION_RESNAME, phaseSelection, tracerName.toStdString() );
|
||||
const std::vector<double>* tracerCellFractions = flowDiagSolution->flowDiagResults()->resultValues( resAddr, timeStepIndex );
|
||||
if ( tracerCellFractions )
|
||||
{
|
||||
|
||||
@@ -828,7 +828,8 @@ QString RimWellConnectivityTable::createTableTitle() const
|
||||
RiaDefines::EclipseUnitSystem unitSet = m_case->eclipseCaseData()->unitsType();
|
||||
RimWellLogFile::WellFlowCondition condition = RimWellLogFile::WELL_FLOW_COND_RESERVOIR;
|
||||
|
||||
auto timeSampleValueTypeText = [&]() -> QString {
|
||||
auto timeSampleValueTypeText = [&]() -> QString
|
||||
{
|
||||
if ( m_timeSampleValueType == TimeSampleValueType::FLOW_RATE_PERCENTAGE )
|
||||
{
|
||||
return QString( "Percentage of Total Reservoir Flow Rate [%]" );
|
||||
@@ -844,7 +845,8 @@ QString RimWellConnectivityTable::createTableTitle() const
|
||||
return QString();
|
||||
};
|
||||
|
||||
auto timeRangeValueTypeText = [&]() -> QString {
|
||||
auto timeRangeValueTypeText = [&]() -> QString
|
||||
{
|
||||
if ( m_timeRangeValueType() == TimeRangeValueType::ACCUMULATED_FLOW_VOLUME )
|
||||
{
|
||||
return "Accumulated Total " + RimWellPlotTools::flowVolumePlotAxisTitle( condition, unitSet );
|
||||
@@ -1150,7 +1152,8 @@ std::vector<QString> RimWellConnectivityTable::getViewFilteredWellNamesFromFilte
|
||||
{
|
||||
if ( !m_cellFilterView || !m_case || !m_case->eclipseCaseData() ) return {};
|
||||
|
||||
auto isProductionTypeOfFilterType = [&]( RiaDefines::WellProductionType productionType ) -> bool {
|
||||
auto isProductionTypeOfFilterType = [&]( RiaDefines::WellProductionType productionType ) -> bool
|
||||
{
|
||||
if ( filterType == ViewFilterType::FILTER_BY_VISIBLE_PRODUCERS )
|
||||
{
|
||||
return productionType == RiaDefines::WellProductionType::PRODUCER ||
|
||||
@@ -1338,8 +1341,8 @@ RigWellAllocationOverTime RimWellConnectivityTable::createWellAllocationOverTime
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellConnectivityTable::createAndEmplaceTimeStepAndCalculatorPairInMap( std::map<QDateTime, RigAccWellFlowCalculator>& rTimeStepAndCalculatorPairs,
|
||||
const QDateTime timeStep,
|
||||
int timeStepIndex,
|
||||
const QDateTime timeStep,
|
||||
int timeStepIndex,
|
||||
const RigSimWellData* simWellData ) const
|
||||
{
|
||||
if ( timeStepIndex < 0 ) return;
|
||||
@@ -1365,9 +1368,9 @@ void RimWellConnectivityTable::createAndEmplaceTimeStepAndCalculatorPairInMap( s
|
||||
simWellData->wellProductionType( timeStepIndex ) == RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE );
|
||||
|
||||
// Retrieve cell visibilities for valid cell filter view
|
||||
const auto* cellVisibilities = m_cellFilterView && m_viewFilterType == ViewFilterType::CALCULATE_BY_VISIBLE_CELLS
|
||||
? m_cellFilterView->currentTotalCellVisibility().p()
|
||||
: nullptr;
|
||||
const auto* cellVisibilities = m_cellFilterView && m_viewFilterType == ViewFilterType::CALCULATE_BY_VISIBLE_CELLS
|
||||
? m_cellFilterView->currentTotalCellVisibility().p()
|
||||
: nullptr;
|
||||
RigEclCellIndexCalculator cellIdxCalc( m_case->eclipseCaseData()->mainGrid(),
|
||||
m_case->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL ),
|
||||
cellVisibilities );
|
||||
|
||||
@@ -703,17 +703,20 @@ QString RimWellPlotTools::simWellName( const QString& wellPathNameOrSimWellName
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPlotTools::tryMatchChannelName( const std::set<QString>& channelNames, const QString& channelNameToMatch )
|
||||
{
|
||||
auto itr = std::find_if( channelNames.begin(), channelNames.end(), [&]( const QString& channelName ) {
|
||||
if ( channelName.startsWith( '^' ) )
|
||||
{
|
||||
std::regex pattern( channelName.toStdString() );
|
||||
return std::regex_match( channelNameToMatch.toStdString(), pattern );
|
||||
}
|
||||
else
|
||||
{
|
||||
return (bool)channelName.contains( channelNameToMatch, Qt::CaseInsensitive );
|
||||
}
|
||||
} );
|
||||
auto itr = std::find_if( channelNames.begin(),
|
||||
channelNames.end(),
|
||||
[&]( const QString& channelName )
|
||||
{
|
||||
if ( channelName.startsWith( '^' ) )
|
||||
{
|
||||
std::regex pattern( channelName.toStdString() );
|
||||
return std::regex_match( channelNameToMatch.toStdString(), pattern );
|
||||
}
|
||||
else
|
||||
{
|
||||
return (bool)channelName.contains( channelNameToMatch, Qt::CaseInsensitive );
|
||||
}
|
||||
} );
|
||||
return itr != channelNames.end();
|
||||
}
|
||||
|
||||
@@ -1323,7 +1326,7 @@ std::map<QDateTime, std::set<RifDataSourceForRftPlt>>
|
||||
void RimWellPlotTools::calculateValueOptionsForTimeSteps( const QString& wellPathNameOrSimWellName,
|
||||
const std::vector<RifDataSourceForRftPlt>& selSources,
|
||||
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& interestingRFTResults,
|
||||
QList<caf::PdmOptionItemInfo>& options )
|
||||
QList<caf::PdmOptionItemInfo>& options )
|
||||
{
|
||||
auto timestepsToShowWithSources = calculateRelevantTimeStepsFromCases( wellPathNameOrSimWellName, selSources, interestingRFTResults );
|
||||
|
||||
|
||||
@@ -562,11 +562,10 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
||||
std::vector<QString> tracerNames = wfPhaseAccumulator.tracerNames();
|
||||
for ( const QString& tracerName : tracerNames )
|
||||
{
|
||||
auto color = tracerName == RIG_FLOW_OIL_NAME
|
||||
? cvf::Color3f::DARK_GREEN
|
||||
: tracerName == RIG_FLOW_GAS_NAME
|
||||
? cvf::Color3f::DARK_RED
|
||||
: tracerName == RIG_FLOW_WATER_NAME ? cvf::Color3f::BLUE : cvf::Color3f::DARK_GRAY;
|
||||
auto color = tracerName == RIG_FLOW_OIL_NAME ? cvf::Color3f::DARK_GREEN
|
||||
: tracerName == RIG_FLOW_GAS_NAME ? cvf::Color3f::DARK_RED
|
||||
: tracerName == RIG_FLOW_WATER_NAME ? cvf::Color3f::BLUE
|
||||
: cvf::Color3f::DARK_GRAY;
|
||||
|
||||
if ( tracerName == RIG_FLOW_OIL_NAME && selectedPhases.count( FLOW_PHASE_OIL ) ||
|
||||
tracerName == RIG_FLOW_GAS_NAME && selectedPhases.count( FLOW_PHASE_GAS ) ||
|
||||
@@ -633,12 +632,10 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
||||
const auto& channelName = std::get<1>( channelInfo );
|
||||
if ( selectedPhases.count( RimWellPlotTools::flowPhaseFromChannelName( channelName ) ) > 0 )
|
||||
{
|
||||
auto color = RimWellPlotTools::isOilFlowChannel( channelName )
|
||||
? cvf::Color3f::DARK_GREEN
|
||||
: RimWellPlotTools::isGasFlowChannel( channelName )
|
||||
? cvf::Color3f::DARK_RED
|
||||
: RimWellPlotTools::isWaterFlowChannel( channelName ) ? cvf::Color3f::BLUE
|
||||
: cvf::Color3f::DARK_GRAY;
|
||||
auto color = RimWellPlotTools::isOilFlowChannel( channelName ) ? cvf::Color3f::DARK_GREEN
|
||||
: RimWellPlotTools::isGasFlowChannel( channelName ) ? cvf::Color3f::DARK_RED
|
||||
: RimWellPlotTools::isWaterFlowChannel( channelName ) ? cvf::Color3f::BLUE
|
||||
: cvf::Color3f::DARK_GRAY;
|
||||
|
||||
FlowPhase flowPhase = FLOW_PHASE_NONE;
|
||||
if ( RimWellPlotTools::isOilFlowChannel( channelName ) )
|
||||
|
||||
@@ -1346,9 +1346,9 @@ void RimWellRftPlot::defineCurveColorsAndSymbols( const std::set<RiaRftPltCurveD
|
||||
for ( RimWellRftEnsembleCurveSet* curveSet : m_ensembleCurveSets() )
|
||||
{
|
||||
CAF_ASSERT( curveSet );
|
||||
auto ensemble_it = std::find_if( ensembles.begin(), ensembles.end(), [&curveSet]( const RimSummaryCaseCollection* ensemble ) {
|
||||
return curveSet->ensemble() == ensemble;
|
||||
} );
|
||||
auto ensemble_it = std::find_if( ensembles.begin(),
|
||||
ensembles.end(),
|
||||
[&curveSet]( const RimSummaryCaseCollection* ensemble ) { return curveSet->ensemble() == ensemble; } );
|
||||
if ( ensemble_it != ensembles.end() )
|
||||
{
|
||||
curveSet->initializeLegend();
|
||||
|
||||
Reference in New Issue
Block a user