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:
Magne Sjaastad 2023-04-13 07:05:53 +02:00 committed by GitHub
parent 310b54ef93
commit 952e766c2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
230 changed files with 2010 additions and 2019 deletions

View File

@ -4,7 +4,7 @@ on: [push]
jobs:
clang-format-job:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Set apt mirror
# GitHub Actions apt proxy is super unstable
@ -15,25 +15,26 @@ jobs:
curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt
sudo sed -i 's/http:\/\/azure.archive.ubuntu.com\/ubuntu\//mirror+file:\/etc\/apt\/mirrors.txt/' /etc/apt/sources.list
- name: Install clang-format 10.0
- name: Install clang-format 15.0
run: |
sudo apt-get install --option="APT::Acquire::Retries=3" clang-format-10
clang-format-10 --version
sudo apt-get update
sudo apt-get install --option="APT::Acquire::Retries=3" clang-format-15
clang-format-15 --version
- uses: actions/checkout@v3
- name: Check format - ApplicationLibCode
run: |
cd ApplicationLibCode
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | xargs clang-format-10 -i
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | xargs clang-format-15 -i
git diff
- name: Check format - ApplicationExeCode
run: |
cd ApplicationExeCode
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | xargs clang-format-10 -i
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | xargs clang-format-15 -i
git diff
- name: Check format - AppFwk
run: |
cd Fwk/AppFwk
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | grep -v gtest | xargs clang-format-10 -i
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | grep -v gtest | xargs clang-format-15 -i
git diff
- uses: peter-evans/create-pull-request@v4
with:

View File

@ -48,7 +48,7 @@ private:
~RiaCompletionTypeCalculationScheduler() override;
RiaCompletionTypeCalculationScheduler( const RiaCompletionTypeCalculationScheduler& o ) = delete;
void operator=( const RiaCompletionTypeCalculationScheduler& o ) = delete;
void operator=( const RiaCompletionTypeCalculationScheduler& o ) = delete;
private:
std::vector<caf::PdmPointer<RimEclipseCase>> m_eclipseCasesToRecalculate;

View File

@ -1446,10 +1446,10 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences*
reply = QMessageBox::question( activeMainWindow(),
QString( "Apply %1 to Existing Views or Plots?" ).arg( listString ),
QString( "You have changed default %1 and have existing views or plots with "
"different settings.\n" )
"different settings.\n" )
.arg( listString ) +
QString( "Do you want to apply the new default settings to all existing "
"views?" ),
"views?" ),
QMessageBox::Ok | QMessageBox::Cancel );
applySettingsToAllViews = ( reply == QMessageBox::Ok );
}
@ -1674,7 +1674,7 @@ bool RiaGuiApplication::notify( QObject* receiver, QEvent* event )
memoryExhaustedBox = new QMessageBox( QMessageBox::Critical,
"ResInsight Exhausted Memory",
"Memory is Exhausted!\n ResInsight could not allocate the memory needed, and is now "
"unstable and will probably crash soon." );
"unstable and will probably crash soon." );
}
bool done = false;

View File

@ -64,12 +64,14 @@ QDateTime RiaDateStringParser::parseDateString( const std::string& dateString, O
//--------------------------------------------------------------------------------------------------
bool RiaDateStringParser::parseDateStringWithSeparators( const std::string& dateString, int& year, int& month, int& day, OrderPreference preference )
{
auto tryParseAllYearFirst = []( const std::string& dateString, int& year, int& month, int& day ) {
auto tryParseAllYearFirst = []( const std::string& dateString, int& year, int& month, int& day )
{
return tryParseYearFirst( dateString, year, month, day ) || tryParseDayFirst( dateString, year, month, day ) ||
tryParseMonthFirst( dateString, year, month, day );
};
auto tryParseAllDayFirst = []( const std::string& dateString, int& year, int& month, int& day ) {
auto tryParseAllDayFirst = []( const std::string& dateString, int& year, int& month, int& day )
{
return tryParseDayFirst( dateString, year, month, day ) || tryParseYearFirst( dateString, year, month, day ) ||
tryParseMonthFirst( dateString, year, month, day );
};
@ -83,12 +85,14 @@ bool RiaDateStringParser::parseDateStringWithSeparators( const std::string& date
//--------------------------------------------------------------------------------------------------
bool RiaDateStringParser::parseDateStringWithoutSeparators( const std::string& dateString, int& year, int& month, int& day, OrderPreference preference )
{
auto tryParseAllYearFirstNoSeparators = []( const std::string& dateString, int& year, int& month, int& day ) {
auto tryParseAllYearFirstNoSeparators = []( const std::string& dateString, int& year, int& month, int& day )
{
return tryParseYearFirstNoSeparators( dateString, year, month, day ) ||
tryParseDayFirstNoSeparators( dateString, year, month, day ) || tryParseMonthFirstNoSeparators( dateString, year, month, day );
};
auto tryParseAllDayFirstNoSeparators = []( const std::string& dateString, int& year, int& month, int& day ) {
auto tryParseAllDayFirstNoSeparators = []( const std::string& dateString, int& year, int& month, int& day )
{
return tryParseDayFirstNoSeparators( dateString, year, month, day ) || tryParseYearFirstNoSeparators( dateString, year, month, day ) ||
tryParseMonthFirstNoSeparators( dateString, year, month, day );
};

View File

@ -61,11 +61,11 @@ void RiaImageTools::distanceTransform2d( std::vector<std::vector<unsigned int>>&
}
}
auto f = []( int64_t x, int64_t i, const std::vector<std::vector<int64_t>>& g, int64_t y ) {
return ( x - i ) * ( x - i ) + g[i][y] * g[i][y];
};
auto f = []( int64_t x, int64_t i, const std::vector<std::vector<int64_t>>& g, int64_t y )
{ return ( x - i ) * ( x - i ) + g[i][y] * g[i][y]; };
auto sep = []( int64_t i, int64_t u, const std::vector<std::vector<int64_t>>& g, int64_t y ) {
auto sep = []( int64_t i, int64_t u, const std::vector<std::vector<int64_t>>& g, int64_t y )
{
if ( i == u ) return (int64_t)0;
int64_t numerator = u * u - i * i + g[u][y] * g[u][y] - g[i][y] * g[i][y];

View File

@ -89,7 +89,7 @@ public:
dateFormatString( const QString& fullDateFormat,
RiaDefines::DateFormatComponents dateComponents = RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY );
static QString
timeFormatString( const QString& fullTimeFormat,
timeFormatString( const QString& fullTimeFormat,
RiaDefines::TimeFormatComponents timeComponents = RiaDefines::TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND );
static QList<caf::PdmOptionItemInfo> createOptionItems( const std::vector<time_t>& timeSteps );

View File

@ -33,10 +33,13 @@ std::vector<const RigWellPath*> RiaSimWellBranchTools::simulationWellBranches( c
{
std::vector<RimEclipseCase*> simCases = RimEclipseCaseTools::eclipseCases();
auto caseItr = std::find_if( simCases.begin(), simCases.end(), [&simWellName]( const RimEclipseCase* eclCase ) {
const auto& eclData = eclCase->eclipseCaseData();
return eclData != nullptr && eclData->hasSimulationWell( simWellName );
} );
auto caseItr = std::find_if( simCases.begin(),
simCases.end(),
[&simWellName]( const RimEclipseCase* eclCase )
{
const auto& eclData = eclCase->eclipseCaseData();
return eclData != nullptr && eclData->hasSimulationWell( simWellName );
} );
RimEclipseCase* eclipseCase = caseItr != simCases.end() ? *caseItr : nullptr;
RigEclipseCaseData* eclCaseData = eclipseCase != nullptr ? eclipseCase->eclipseCaseData() : nullptr;
return eclCaseData != nullptr ? eclCaseData->simulationWellBranches( simWellName, false, useAutoDetectionOfBranches )

View File

@ -80,9 +80,8 @@ void RiaStdStringTools::splitByDelimiter( const std::string& str, Container& con
template <typename InputIt>
std::string join( InputIt begin, InputIt end, const std::string& separator = ", " )
{
auto compose_key = [&separator]( std::string& key, const std::string& key_part ) -> std::string {
return key.empty() ? key_part : key + separator + key_part;
};
auto compose_key = [&separator]( std::string& key, const std::string& key_part ) -> std::string
{ return key.empty() ? key_part : key + separator + key_part; };
return std::accumulate( begin, end, std::string(), compose_key );
}

View File

@ -243,7 +243,7 @@ QStringList RiaSummaryStringTools::dataSourceNames( const std::vector<RimSummary
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<RifEclipseSummaryAddress> RiaSummaryStringTools::computeFilteredAddresses( const QStringList& textFilters,
std::set<RifEclipseSummaryAddress> RiaSummaryStringTools::computeFilteredAddresses( const QStringList& textFilters,
const std::set<RifEclipseSummaryAddress>& sourceAddresses,
bool includeDiffCurves )
{

View File

@ -79,11 +79,14 @@ QString RiaWellNameComparer::tryMatchNameInList( QString searchName, const std::
}
// Try matching ignoring spaces, dashes and underscores
matchedName = tryMatchName( searchName, nameList, []( const QString& str ) {
QString s = str;
s = removeWellNamePrefix( s );
return s.remove( ' ' ).remove( '-' ).remove( '_' );
} );
matchedName = tryMatchName( searchName,
nameList,
[]( const QString& str )
{
QString s = str;
s = removeWellNamePrefix( s );
return s.remove( ' ' ).remove( '-' ).remove( '_' );
} );
if ( !matchedName.isEmpty() )
{

View File

@ -223,8 +223,8 @@ void RiaSCurveCalculator::initializeByFinding_q1q2( cvf::Vec3d p1, double azi1,
const double maxStepSize = 1.0e9;
const double maxLengthToQ = 1.0e10;
bool enableBackstepping = false;
//#define USE_JACOBI_UPDATE
//#define DEBUG_OUTPUT_ON
// #define USE_JACOBI_UPDATE
// #define DEBUG_OUTPUT_ON
// Needs the initial partial derivatives to see the direction of change
// dR1/dq1, dR1/dq2, dR2/dq1, dR2/dq2

View File

@ -78,7 +78,7 @@ RimStimPlanModelPlot* RicNewStimPlanModelPlotFeature::createPlot( RimStimPlanMod
plot->setStimPlanModel( stimPlanModel );
{
auto task = progInfo.task( "Creating formation track", 2 );
auto task = progInfo.task( "Creating formation track", 2 );
RimEclipseCase* formationEclipseCase = stimPlanModel->eclipseCaseForType( RimExtractionConfiguration::EclipseCaseType::STATIC_CASE );
createFormationTrack( plot, stimPlanModel, formationEclipseCase );
}

View File

@ -704,7 +704,8 @@ std::vector<cvf::Vec3d> RicExportFractureCompletionsImpl::computeWellPointsInFra
RiaLogging::info( QString( "Angle: %1 degrees." ).arg( cvf::Math::toDegrees( angle ) ) );
auto rotMat = cvf::GeometryTools::rotationMatrixBetweenVectors( directionToStartPos, directionToStartPosInFracturePlane );
auto rotatePoint = []( const cvf::Vec3d& point, const cvf::Vec3d& offset, auto rotMat ) {
auto rotatePoint = []( const cvf::Vec3d& point, const cvf::Vec3d& offset, auto rotMat )
{
cvf::Vec3d p = point - offset;
p.transformPoint( rotMat );
p += offset;

View File

@ -412,7 +412,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::computeStaticCompletionsForWellPath( RimWellPath* wellPath,
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::computeStaticCompletionsForWellPath( RimWellPath* wellPath,
RimEclipseCase* eclipseCase )
{
std::vector<RigCompletionData> completionsPerEclipseCell;
@ -448,7 +448,7 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::compu
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::computeDynamicCompletionsForWellPath( RimWellPath* wellPath,
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::computeDynamicCompletionsForWellPath( RimWellPath* wellPath,
RimEclipseCase* eclipseCase,
size_t timeStepIndex )
{
@ -761,8 +761,8 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspecsToFile( RimEclips
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile( RimEclipseCase* gridCase,
QFilePtr exportFile,
void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile( RimEclipseCase* gridCase,
QFilePtr exportFile,
const std::map<QString, std::vector<RigCompletionData>>& completions )
{
QTextStream stream( exportFile.get() );

View File

@ -102,14 +102,14 @@ public:
calculateCellMainDirection( RimEclipseCase* eclipseCase, size_t globalCellIndex, const cvf::Vec3d& lengthsInCell );
static TransmissibilityData
calculateTransmissibilityData( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
const cvf::Vec3d& internalCellLengths,
double skinFactor,
double wellRadius,
size_t globalCellIndex,
bool useLateralNTG,
size_t volumeScaleConstant = 1,
calculateTransmissibilityData( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
const cvf::Vec3d& internalCellLengths,
double skinFactor,
double wellRadius,
size_t globalCellIndex,
bool useLateralNTG,
size_t volumeScaleConstant = 1,
RigCompletionData::CellDirection directionForVolumeScaling = RigCompletionData::CellDirection::DIR_I );
static double calculateDFactor( RimEclipseCase* eclipseCase,

View File

@ -115,14 +115,18 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( c
auto allCompletions = wellPath->allCompletionsRecursively();
bool exportFractures =
exportSettings.includeFractures() && std::any_of( allCompletions.begin(), allCompletions.end(), []( auto completion ) {
return completion->isEnabled() && completion->componentType() == RiaDefines::WellPathComponentType::FRACTURE;
} );
exportSettings.includeFractures() &&
std::any_of( allCompletions.begin(),
allCompletions.end(),
[]( auto completion )
{ return completion->isEnabled() && completion->componentType() == RiaDefines::WellPathComponentType::FRACTURE; } );
bool exportFishbones =
exportSettings.includeFishbones() && std::any_of( allCompletions.begin(), allCompletions.end(), []( auto completion ) {
return completion->isEnabled() && completion->componentType() == RiaDefines::WellPathComponentType::FISHBONES;
} );
exportSettings.includeFishbones() &&
std::any_of( allCompletions.begin(),
allCompletions.end(),
[]( auto completion )
{ return completion->isEnabled() && completion->componentType() == RiaDefines::WellPathComponentType::FISHBONES; } );
if ( exportSettings.fileSplit() == RicExportCompletionDataSettingsUi::ExportSplit::SPLIT_ON_WELL && !unifiedWellPathFile )
{
@ -157,11 +161,14 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( c
}
else
{
bool anyPerforationsPresent =
exportSettings.includeFractures() && std::any_of( allCompletions.begin(), allCompletions.end(), []( auto completion ) {
return completion->isEnabled() &&
completion->componentType() == RiaDefines::WellPathComponentType::PERFORATION_INTERVAL;
} );
bool anyPerforationsPresent = exportSettings.includeFractures() &&
std::any_of( allCompletions.begin(),
allCompletions.end(),
[]( auto completion ) {
return completion->isEnabled() &&
completion->componentType() ==
RiaDefines::WellPathComponentType::PERFORATION_INTERVAL;
} );
QString perforationText = anyPerforationsPresent ? "Perforation_" : "";
QString fileName =
@ -202,11 +209,11 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( c
else
{
QString fileName = QString( "%1_Fracture_MSW_%2" ).arg( wellPath->name(), exportSettings.caseToApply->caseUserDescription() );
exportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
exportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
fileName,
"",
exportSettings.exportDataSourceAsComment() );
lgrExportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
lgrExportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
fileName + "_LGR",
"",
exportSettings.exportDataSourceAsComment() );
@ -237,11 +244,11 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( c
else
{
QString fileName = QString( "%1_Fishbones_MSW_%2" ).arg( wellPath->name(), exportSettings.caseToApply->caseUserDescription() );
exportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
exportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
fileName,
"",
exportSettings.exportDataSourceAsComment() );
lgrExportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
lgrExportFile = RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder,
fileName + "_LGR",
"",
exportSettings.exportDataSourceAsComment() );
@ -350,7 +357,8 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForFractures( RimEcl
RicMswExportInfo& exportInfo,
const RimWellPath* wellPath,
bool completionSegmentsAfterMainBore,
bool exportLgrData ) {
bool exportLgrData )
{
formatter.setOptionalComment( exportDataSourceAsComment );
double maxSegmentLength = wellPath->mswCompletionParameters()->maxSegmentLength();
@ -555,9 +563,9 @@ void RicWellPathExportMswCompletionsImpl::updateDataForMultipleItemsInSameGridCe
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( const RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
double initialMD,
void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( const RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
double initialMD,
const std::vector<WellPathCellIntersectionInfo>& cellIntersections,
bool enableSegmentSplitting,
gsl::not_null<RicMswExportInfo*> exportInfo,
@ -572,14 +580,14 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( const RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
double initialMD,
void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( const RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
double initialMD,
const std::vector<WellPathCellIntersectionInfo>& cellIntersections,
const std::vector<RimFishbones*>& fishbonesSubs,
bool enableSegmentSplitting,
gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch )
const std::vector<RimFishbones*>& fishbonesSubs,
bool enableSegmentSplitting,
gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch )
{
std::vector<WellPathCellIntersectionInfo> filteredIntersections =
filterIntersections( cellIntersections, initialMD, wellPath->wellPathGeometry(), eclipseCase );
@ -762,12 +770,12 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfoForWell(
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicWellPathExportMswCompletionsImpl::generateFracturesMswExportInfo( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
double initialMD,
bool RicWellPathExportMswCompletionsImpl::generateFracturesMswExportInfo( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
double initialMD,
const std::vector<WellPathCellIntersectionInfo>& cellIntersections,
gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch )
gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch )
{
auto mswParameters = wellPath->mswCompletionParameters();
auto fractures = wellPath->fractureCollection()->activeFractures();
@ -827,13 +835,13 @@ bool RicWellPathExportMswCompletionsImpl::generateFracturesMswExportInfo( RimEcl
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicWellPathExportMswCompletionsImpl::generatePerforationsMswExportInfo( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
int timeStep,
double initialMD,
bool RicWellPathExportMswCompletionsImpl::generatePerforationsMswExportInfo( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
int timeStep,
double initialMD,
const std::vector<WellPathCellIntersectionInfo>& cellIntersections,
gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch )
gsl::not_null<RicMswExportInfo*> exportInfo,
gsl::not_null<RicMswBranch*> branch )
{
auto perforationIntervals = wellPath->perforationIntervalCollection()->activePerforations();
@ -938,9 +946,9 @@ std::vector<WellPathCellIntersectionInfo> RicWellPathExportMswCompletionsImpl::g
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RicWellPathExportMswCompletionsImpl::computeIntitialMeasuredDepth( const RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
const RimMswCompletionParameters* mswParameters,
double RicWellPathExportMswCompletionsImpl::computeIntitialMeasuredDepth( const RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
const RimMswCompletionParameters* mswParameters,
const std::vector<WellPathCellIntersectionInfo>& allIntersections )
{
if ( allIntersections.empty() ) return 0.0;
@ -1866,10 +1874,10 @@ std::vector<RimWellPath*> RicWellPathExportMswCompletionsImpl::wellPathsWithTieI
///
//--------------------------------------------------------------------------------------------------
std::pair<double, double>
RicWellPathExportMswCompletionsImpl::calculateOverlapWithActiveCells( double startMD,
double endMD,
RicWellPathExportMswCompletionsImpl::calculateOverlapWithActiveCells( double startMD,
double endMD,
const std::vector<WellPathCellIntersectionInfo>& wellPathIntersections,
const RigActiveCellInfo* activeCellInfo )
const RigActiveCellInfo* activeCellInfo )
{
for ( const WellPathCellIntersectionInfo& intersection : wellPathIntersections )
{

View File

@ -122,10 +122,10 @@ private:
gsl::not_null<const RigWellPath*> wellPathGeometry,
gsl::not_null<const RimEclipseCase*> eclipseCase );
static std::pair<double, double> calculateOverlapWithActiveCells( double startMD,
double endMD,
static std::pair<double, double> calculateOverlapWithActiveCells( double startMD,
double endMD,
const std::vector<WellPathCellIntersectionInfo>& wellPathIntersections,
const RigActiveCellInfo* activeCellInfo );
const RigActiveCellInfo* activeCellInfo );
static void createWellPathSegments( gsl::not_null<RicMswBranch*> branch,
const std::vector<WellPathCellIntersectionInfo>& cellSegmentIntersections,
@ -167,10 +167,10 @@ private:
gsl::not_null<RicMswSegment*> segment,
bool* foundSubGridIntersections );
static std::vector<RigCompletionData> generatePerforationIntersections( gsl::not_null<const RimWellPath*> wellPath,
static std::vector<RigCompletionData> generatePerforationIntersections( gsl::not_null<const RimWellPath*> wellPath,
gsl::not_null<const RimPerforationInterval*> perforationInterval,
int timeStep,
gsl::not_null<const RimEclipseCase*> eclipseCase );
int timeStep,
gsl::not_null<const RimEclipseCase*> eclipseCase );
static void assignPerforationIntersections( const std::vector<RigCompletionData>& completionData,
gsl::not_null<RicMswCompletion*> perforationCompletion,

View File

@ -628,7 +628,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureCompletionSummar
RifTextDataTableColumn( "" ), // Fracture
RifTextDataTableColumn( "" ), // Template
floatNumberColumn( "" ), // Tr
floatNumberColumn( "" ), //#con
floatNumberColumn( "" ), // #con
floatNumberColumn( "" ), // Fcd
RifTextDataTableColumn( "", RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // Area
RifTextDataTableColumn( meanText, RifTextDataTableDoubleFormatting( RIF_FLOAT, 1 ), RIGHT ), // KfWf

View File

@ -115,7 +115,7 @@ void RicCreateDepthAdjustedLasFilesFeature::createDepthAdjustedWellLogFileFromEc
RimWellPath* sourceWell,
const std::vector<RimWellPath*> destinationWells,
const std::vector<QString>& selectedResultProperties,
const QString& exportFolder )
const QString& exportFolder )
{
if ( sourceWell->wellLogFiles().empty() ) return;
@ -142,7 +142,7 @@ void RicCreateDepthAdjustedLasFilesFeature::createDepthAdjustedWellLogFileFromGe
RimWellPath* sourceWell,
const std::vector<RimWellPath*> destinationWells,
const std::vector<QString>& selectedResultProperties,
const QString& exportFolder )
const QString& exportFolder )
{
if ( sourceWell->wellLogFiles().empty() ) return;

View File

@ -265,9 +265,9 @@ std::string RicCreateDepthAdjustedLasFilesImpl::createDepthUnitText( RiaDefines:
//--------------------------------------------------------------------------------------------------
std::string RicCreateDepthAdjustedLasFilesImpl::createDepthUnitComment( RiaDefines::DepthUnitType depthUnitType )
{
return depthUnitType == RiaDefines::DepthUnitType::UNIT_METER
? "in meters"
: depthUnitType == RiaDefines::DepthUnitType::UNIT_FEET ? "in feet" : "in Connection number";
return depthUnitType == RiaDefines::DepthUnitType::UNIT_METER ? "in meters"
: depthUnitType == RiaDefines::DepthUnitType::UNIT_FEET ? "in feet"
: "in Connection number";
}
//--------------------------------------------------------------------------------------------------

View File

@ -100,7 +100,7 @@ void RicExportEclipseSectorModelFeature::executeCommand( RimEclipseView*
int faultsProgressPercentage = exportSettings.exportFaults() ? 10 : 0;
int gridProgressPercentage = 100 - resultProgressPercentage - faultsProgressPercentage;
int gridProgressPercentage = 100 - resultProgressPercentage - faultsProgressPercentage;
caf::ProgressInfo progress( gridProgressPercentage + resultProgressPercentage + faultsProgressPercentage, "Export Eclipse Sector Model" );
cvf::Vec3st refinement( exportSettings.refinementCountI(), exportSettings.refinementCountJ(), exportSettings.refinementCountK() );
@ -157,7 +157,7 @@ void RicExportEclipseSectorModelFeature::executeCommand( RimEclipseView*
QString fileName = dirPath.absoluteFilePath( keyword + ".GRDECL" );
bool worked = RifEclipseInputFileTools::exportKeywords( fileName,
view->eclipseCase()->eclipseCaseData(),
{ keyword },
{ keyword },
exportSettings.writeEchoKeywords(),
min,
max,

View File

@ -114,9 +114,10 @@ public:
int priority() const
{
return type == RigCompletionData::CompletionType::FRACTURE
? 1
: type == RigCompletionData::CompletionType::FISHBONES ? 2 : type == RigCompletionData::CompletionType::PERFORATION ? 3 : 4;
return type == RigCompletionData::CompletionType::FRACTURE ? 1
: type == RigCompletionData::CompletionType::FISHBONES ? 2
: type == RigCompletionData::CompletionType::PERFORATION ? 3
: 4;
}
// Sort by priority, then name, then number
@ -190,8 +191,8 @@ private:
const std::vector<RigCompletionDataGridCell>& intersectingCells,
const caf::VecIjk& lgrSizes,
LgrNameFactory& lgrNameFactory );
static std::vector<LgrInfo> buildLgrsPerCompletion( int firstLgrId,
RimEclipseCase* eclipseCase,
static std::vector<LgrInfo> buildLgrsPerCompletion( int firstLgrId,
RimEclipseCase* eclipseCase,
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
const caf::VecIjk& lgrSizesPerMainGridCell,
LgrNameFactory& lgrNameFactory );

View File

@ -39,7 +39,7 @@ public:
static void saveViewWindowToFile( RimViewWindow* viewWindow, const QString& defaultFileBaseName = "image" );
static void saveImageToFile( const QImage& image, const QString& defaultFileBaseName = "image" );
static QString
generateSaveFileName( const QString& defaultFileBaseName = "image", bool supportPDF = false, const QString& defaultExtension = "png" );
generateSaveFileName( const QString& defaultFileBaseName = "image", bool supportPDF = false, const QString& defaultExtension = "png" );
static QIcon icon();
static QString text();

View File

@ -70,7 +70,7 @@ public:
std::vector<MultipleFracturesOption> fractureOptions( const RigEclipseCaseData* caseData,
const RimWellPath* wellPath,
const std::vector<RicCreateMultipleFracturesOptionItemUi*>& allUiOptions );
RicCreateMultipleFracturesOptionItemUi* firstUiOptionContainingK( size_t k,
RicCreateMultipleFracturesOptionItemUi* firstUiOptionContainingK( size_t k,
const std::vector<RicCreateMultipleFracturesOptionItemUi*>& allUiOptions );
//--------------------------------------------------------------------------------------------------

View File

@ -116,7 +116,8 @@ std::vector<T*> RicMeshFractureTemplateHelper<T>::createNewTemplatesFromFiles( c
RimFractureTemplateCollection* fracDefColl = oilfield->fractureDefinitionCollection();
if ( !fracDefColl ) return std::vector<T*>();
auto findTemplateByName = []( RimFractureTemplateCollection* coll, const QString& name ) -> T* {
auto findTemplateByName = []( RimFractureTemplateCollection* coll, const QString& name ) -> T*
{
for ( auto t : coll->fractureTemplates() )
if ( t->name() == name ) return dynamic_cast<T*>( t );

View File

@ -45,7 +45,7 @@ private:
~RicExportToSharingServerScheduler() override;
RicExportToSharingServerScheduler( const RicExportToSharingServerScheduler& o ) = delete;
void operator=( const RicExportToSharingServerScheduler& o ) = delete;
void operator=( const RicExportToSharingServerScheduler& o ) = delete;
void startTimer( int msecs );
void triggerUpdateSession();

View File

@ -63,9 +63,8 @@ bool RicCloseSummaryCaseInCollectionFeature::isCommandEnabled()
summaryCaseCollections.erase( std::remove_if( summaryCaseCollections.begin(),
summaryCaseCollections.end(),
[]( RimSummaryCaseCollection* coll ) {
return dynamic_cast<RimDerivedEnsembleCaseCollection*>( coll ) != nullptr;
} ),
[]( RimSummaryCaseCollection* coll )
{ return dynamic_cast<RimDerivedEnsembleCaseCollection*>( coll ) != nullptr; } ),
summaryCaseCollections.end() );
return ( summaryCaseMainCollections.size() > 0 || summaryCaseCollections.size() > 0 );

View File

@ -188,14 +188,15 @@ std::vector<std::pair<QString, RiaDefines::ResultCatType>>
const RigEclipseCaseData* caseData )
{
auto findResultCategory =
[]( const QString& keyword, const std::vector<RiaDefines::ResultCatType>& categories, const RigEclipseCaseData* caseData ) {
// Find the result category for a given keyword
auto resultData = caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
for ( auto category : categories )
if ( resultData->hasResultEntry( RigEclipseResultAddress( category, keyword ) ) ) return category;
[]( const QString& keyword, const std::vector<RiaDefines::ResultCatType>& categories, const RigEclipseCaseData* caseData )
{
// Find the result category for a given keyword
auto resultData = caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
for ( auto category : categories )
if ( resultData->hasResultEntry( RigEclipseResultAddress( category, keyword ) ) ) return category;
return RiaDefines::ResultCatType::UNDEFINED;
};
return RiaDefines::ResultCatType::UNDEFINED;
};
std::vector<std::pair<QString, RiaDefines::ResultCatType>> props;
for ( auto keyword : resultNames )

View File

@ -61,9 +61,9 @@ public:
std::vector<std::pair<QString, RiaDefines::ResultCatType>> properties() const;
static std::vector<std::pair<QString, RiaDefines::ResultCatType>> properties( const std::vector<QString>& resultNames,
static std::vector<std::pair<QString, RiaDefines::ResultCatType>> properties( const std::vector<QString>& resultNames,
const std::vector<RiaDefines::ResultCatType>& resultCategories,
const RigEclipseCaseData* caseData );
const RigEclipseCaseData* caseData );
void setCaseData( RigEclipseCaseData* caseData );

View File

@ -70,9 +70,8 @@ bool RicDeleteSummaryCaseCollectionFeature::isCommandEnabled()
selection.erase( std::remove_if( selection.begin(),
selection.end(),
[]( RimSummaryCaseCollection* coll ) {
return dynamic_cast<RimDerivedEnsembleCaseCollection*>( coll ) != nullptr;
} ),
[]( RimSummaryCaseCollection* coll )
{ return dynamic_cast<RimDerivedEnsembleCaseCollection*>( coll ) != nullptr; } ),
selection.end() );
return ( selection.size() > 0 );
}

View File

@ -112,9 +112,9 @@ void RicElasticPropertiesImportTools::importElasticPropertiesFromFile( const QSt
}
// Sort the matching items by porosity
std::sort( matchingFacies.begin(), matchingFacies.end(), []( const RifElasticProperties& a, const RifElasticProperties& b ) {
return a.porosity < b.porosity;
} );
std::sort( matchingFacies.begin(),
matchingFacies.end(),
[]( const RifElasticProperties& a, const RifElasticProperties& b ) { return a.porosity < b.porosity; } );
std::vector<QString> matchingFormations;
if ( formationName == formationWildCard )

View File

@ -144,11 +144,12 @@ void RicImportEnsembleFeature::setupActionLook( QAction* actionToSetup )
//--------------------------------------------------------------------------------------------------
QString RicImportEnsembleFeature::askForEnsembleName( const QString& suggestion )
{
RimProject* project = RimProject::current();
std::vector<RimSummaryCaseCollection*> groups = project->summaryGroups();
int ensemblesStartingWithRoot = std::count_if( groups.begin(), groups.end(), [suggestion]( RimSummaryCaseCollection* group ) {
return group->isEnsemble() && group->name().startsWith( suggestion );
} );
RimProject* project = RimProject::current();
std::vector<RimSummaryCaseCollection*> groups = project->summaryGroups();
int ensemblesStartingWithRoot = std::count_if( groups.begin(),
groups.end(),
[suggestion]( RimSummaryCaseCollection* group )
{ return group->isEnsemble() && group->name().startsWith( suggestion ); } );
QInputDialog dialog;
dialog.setInputMode( QInputDialog::TextInput );

View File

@ -80,8 +80,8 @@ void RicImportObservedDataFeature::selectObservedDataFileInDialog()
}
else
{
errorText = "Not able to import file. Make sure '*.rsm' is used as extension if data is in RMS format "
"or '*.txt' or '*.csv' if data is in CSV format.";
errorText = "Not able to import file. Make sure '*.rsm' is used as extension if data is in RMS format "
"or '*.txt' or '*.csv' if data is in CSV format.";
retryImport = false;
}

View File

@ -436,9 +436,9 @@ RicSummaryCaseRestartDialogResult RicSummaryCaseRestartDialog::openDialog( const
//--------------------------------------------------------------------------------------------------
RicSummaryCaseRestartDialog::ImportOptions RicSummaryCaseRestartDialog::selectedSummaryImportOption() const
{
return m_summaryReadAllBtn->isChecked()
? ImportOptions::IMPORT_ALL
: m_summarySeparateCasesBtn->isChecked() ? ImportOptions::SEPARATE_CASES : ImportOptions::NOT_IMPORT;
return m_summaryReadAllBtn->isChecked() ? ImportOptions::IMPORT_ALL
: m_summarySeparateCasesBtn->isChecked() ? ImportOptions::SEPARATE_CASES
: ImportOptions::NOT_IMPORT;
}
//--------------------------------------------------------------------------------------------------

View File

@ -90,7 +90,8 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
completer->setWrapAround( false );
editor->setCompleter( completer );
auto generateColorFields = [themeSelector, widget, editor]() -> void {
auto generateColorFields = [themeSelector, widget, editor]() -> void
{
QLayoutItem* item;
if ( widget->layout() )
{
@ -114,17 +115,20 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
column );
QPushButton* colorBox = new QPushButton( "" );
colorBox->setStyleSheet( QString( "background-color: %0;" ).arg( variableValueMap.value( variableName ) ) );
connect( colorBox, &QPushButton::clicked, [variableValueMap, variableName, theme, editor, widget, colorBox]() -> void {
QColor color = QColorDialog::getColor( colorBox->palette().color( QPalette::Button ), widget );
if ( color.isValid() )
{
colorBox->setStyleSheet( QString( "background-color: %0;" ).arg( color.name() ) );
colorBox->style()->unpolish( colorBox );
colorBox->style()->polish( colorBox );
RiuGuiTheme::changeVariableValue( theme, variableName, color.name() );
editor->setPlainText( RiuGuiTheme::applyVariableValueMapToStyleSheet( theme ) );
}
} );
connect( colorBox,
&QPushButton::clicked,
[variableValueMap, variableName, theme, editor, widget, colorBox]() -> void
{
QColor color = QColorDialog::getColor( colorBox->palette().color( QPalette::Button ), widget );
if ( color.isValid() )
{
colorBox->setStyleSheet( QString( "background-color: %0;" ).arg( color.name() ) );
colorBox->style()->unpolish( colorBox );
colorBox->style()->polish( colorBox );
RiuGuiTheme::changeVariableValue( theme, variableName, color.name() );
editor->setPlainText( RiuGuiTheme::applyVariableValueMapToStyleSheet( theme ) );
}
} );
innerLayout->addWidget( colorBox, row++, column + 1 );
if ( row == 10 )
{
@ -137,12 +141,15 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
// A more elegant way, but not supported in old Qt version.
// connect( themeSelector, qOverload<int>( &QComboBox::currentIndexChanged ), [=]() {
connect( themeSelector, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), [=]() {
generateColorFields();
RiaDefines::ThemeEnum theme = static_cast<RiaDefines::ThemeEnum>( themeSelector->currentData().toInt() );
RiuGuiTheme::updateGuiTheme( static_cast<RiaDefines::ThemeEnum>( theme ) );
editor->setPlainText( RiuGuiTheme::loadStyleSheet( theme ) );
} );
connect( themeSelector,
static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ),
[=]()
{
generateColorFields();
RiaDefines::ThemeEnum theme = static_cast<RiaDefines::ThemeEnum>( themeSelector->currentData().toInt() );
RiuGuiTheme::updateGuiTheme( static_cast<RiaDefines::ThemeEnum>( theme ) );
editor->setPlainText( RiuGuiTheme::loadStyleSheet( theme ) );
} );
generateColorFields();
@ -156,11 +163,14 @@ void RicThemeColorEditorFeature::onActionTriggered( bool isChecked )
QPushButton* button = new QPushButton( "Apply style sheet changes" );
layout->addWidget( button, 6, 1 );
connect( button, &QPushButton::clicked, [themeSelector, editor, generateColorFields]() {
RiaDefines::ThemeEnum theme = static_cast<RiaDefines::ThemeEnum>( themeSelector->currentData().toInt() );
RiuGuiTheme::writeStyleSheetToFile( theme, editor->toPlainText() );
generateColorFields();
} );
connect( button,
&QPushButton::clicked,
[themeSelector, editor, generateColorFields]()
{
RiaDefines::ThemeEnum theme = static_cast<RiaDefines::ThemeEnum>( themeSelector->currentData().toInt() );
RiuGuiTheme::writeStyleSheetToFile( theme, editor->toPlainText() );
generateColorFields();
} );
dialog->setLayout( layout );

View File

@ -151,7 +151,7 @@ bool RicPasteAsciiDataToSummaryPlotFeature::hasPastedText()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimAsciiDataCurve*> RicPasteAsciiDataToSummaryPlotFeature::parseCurves( QString& data,
std::vector<RimAsciiDataCurve*> RicPasteAsciiDataToSummaryPlotFeature::parseCurves( QString& data,
const RicPasteAsciiDataToSummaryPlotFeatureUi& settings )
{
std::vector<RimAsciiDataCurve*> curves;

View File

@ -509,9 +509,10 @@ void RicSummaryPlotEditorUi::updatePreviewCurvesFromCurveDefinitions( const std:
// Set single curve set color
auto allCurveSets = m_previewPlot->ensembleCurveSetCollection()->curveSets();
size_t colorIndex = std::count_if( allCurveSets.begin(), allCurveSets.end(), []( RimEnsembleCurveSet* curveSet ) {
return curveSet->colorMode() == RimEnsembleCurveSet::ColorMode::SINGLE_COLOR;
} );
size_t colorIndex = std::count_if( allCurveSets.begin(),
allCurveSets.end(),
[]( RimEnsembleCurveSet* curveSet )
{ return curveSet->colorMode() == RimEnsembleCurveSet::ColorMode::SINGLE_COLOR; } );
curveSet->setColor( RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f( colorIndex ) );
// Add curve to plot
@ -976,9 +977,9 @@ void RicSummaryPlotEditorUi::setInitialCurveVisibility( const RimSummaryPlot* ta
//--------------------------------------------------------------------------------------------------
int ensembleCurveCount( const std::set<RiaSummaryCurveDefinition>& allCurveDefs )
{
return std::count_if( allCurveDefs.begin(), allCurveDefs.end(), []( const RiaSummaryCurveDefinition& def ) {
return def.isEnsembleCurve();
} );
return std::count_if( allCurveDefs.begin(),
allCurveDefs.end(),
[]( const RiaSummaryCurveDefinition& def ) { return def.isEnsembleCurve(); } );
}
//--------------------------------------------------------------------------------------------------

View File

@ -33,7 +33,7 @@ class RicAsciiExportWellLogPlotFeature : public caf::CmdFeature
public:
static QString
makeValidExportFileName( const RimWellLogPlot* wellLogPlot, const QString& folder, const QString& prefix, bool capitalizeFileName );
makeValidExportFileName( const RimWellLogPlot* wellLogPlot, const QString& folder, const QString& prefix, bool capitalizeFileName );
static bool exportAsciiForWellLogPlot( const QString& fileName, const RimWellLogPlot* wellLogPlot );
protected:

View File

@ -52,7 +52,7 @@ bool RicNewWellLogPlotFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewWellLogPlotFeature::onActionTriggered( bool isChecked )
{
RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
RimWellLogExtractionCurve* curve = RicWellLogTools::addWellLogExtractionCurve( plotTrack, nullptr, nullptr, nullptr, nullptr, -1, true );
curve->loadDataAndUpdate( true );
RimWellLogPlot* plot = nullptr;

View File

@ -107,9 +107,10 @@ std::set<RimViewWindow*> RicWellLogFileCloseFeature::referringWellLogPlots( cons
obj->firstAncestorOrThisOfType( wellLogPlot );
RimViewWindow* plot = allocationPlot ? dynamic_cast<RimViewWindow*>( allocationPlot )
: pltPlot ? dynamic_cast<RimViewWindow*>( pltPlot )
: rftPlot ? dynamic_cast<RimViewWindow*>( rftPlot )
: wellLogPlot ? dynamic_cast<RimViewWindow*>( wellLogPlot ) : nullptr;
: pltPlot ? dynamic_cast<RimViewWindow*>( pltPlot )
: rftPlot ? dynamic_cast<RimViewWindow*>( rftPlot )
: wellLogPlot ? dynamic_cast<RimViewWindow*>( wellLogPlot )
: nullptr;
if ( plot != nullptr )
{

View File

@ -92,7 +92,7 @@ private:
static cvf::ref<cvf::DrawableGeo> createTriangelDrawableGeo( cvf::Vec3fArray* triangleVertexArray );
static cvf::ref<cvf::DrawableGeo> createIndexedTriangelDrawableGeo( cvf::Vec3fArray* triangleVertexArray, cvf::UIntArray* triangleIndices );
static cvf::ref<cvf::Part> createPart( cvf::DrawableGeo* geo, const cvf::Color4f& color, const cvf::String& partName );
static cvf::ref<cvf::Part> createPart( cvf::DrawableGeo* geo, const cvf::Color4f& color, const cvf::String& partName );
private:
std::map<HandleType, cvf::ref<cvf::Part>> m_handleParts; // These arrays have the same length

View File

@ -1037,13 +1037,13 @@ QString RifEclipseInputFileTools::faultFaceText( cvf::StructGridInterface::FaceT
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RifEclipseInputFileTools::readFaultsAndParseIncludeStatementsRecursively( QFile& file,
qint64 startPos,
bool RifEclipseInputFileTools::readFaultsAndParseIncludeStatementsRecursively( QFile& file,
qint64 startPos,
const std::vector<std::pair<QString, QString>>& pathAliasDefinitions,
cvf::Collection<RigFault>* faults,
std::vector<QString>* filenamesWithFaults,
bool* isEditKeywordDetected,
const QString& faultIncludeFileAbsolutePathPrefix )
cvf::Collection<RigFault>* faults,
std::vector<QString>* filenamesWithFaults,
bool* isEditKeywordDetected,
const QString& faultIncludeFileAbsolutePathPrefix )
{
QString line;

View File

@ -276,7 +276,7 @@ void RifEclipseRestartFilesetAccess::openTimeStep( size_t timeStep )
if ( m_ecl_files[timeStep] == nullptr )
{
int index = static_cast<int>( timeStep );
int index = static_cast<int>( timeStep );
ecl_file_type* ecl_file = ecl_file_open( RiaStringEncodingTools::toNativeEncoded( m_fileNames[index] ).data(), ECL_FILE_CLOSE_STREAM );
m_ecl_files[timeStep] = ecl_file;

View File

@ -104,14 +104,14 @@ public:
static RifEclipseSummaryAddress miscAddress( const std::string& vectorName, int calculationId = -1 );
static RifEclipseSummaryAddress regionAddress( const std::string& vectorName, int regionNumber, int calculationId = -1 );
static RifEclipseSummaryAddress
regionToRegionAddress( const std::string& vectorName, int regionNumber, int region2Number, int calculationId = -1 );
regionToRegionAddress( const std::string& vectorName, int regionNumber, int region2Number, int calculationId = -1 );
static RifEclipseSummaryAddress groupAddress( const std::string& vectorName, const std::string& groupName, int calculationId = -1 );
static RifEclipseSummaryAddress wellAddress( const std::string& vectorName, const std::string& wellName, int calculationId = -1 );
static RifEclipseSummaryAddress
wellCompletionAddress( const std::string& vectorName, const std::string& wellName, int i, int j, int k, int calculationId = -1 );
static RifEclipseSummaryAddress
wellLgrAddress( const std::string& vectorName, const std::string& lgrName, const std::string& wellName, int calculationId = -1 );
wellLgrAddress( const std::string& vectorName, const std::string& lgrName, const std::string& wellName, int calculationId = -1 );
static RifEclipseSummaryAddress wellCompletionLgrAddress( const std::string& vectorName,
const std::string& lgrName,
const std::string& wellName,
@ -120,10 +120,10 @@ public:
int k,
int calculationId = -1 );
static RifEclipseSummaryAddress
wellSegmentAddress( const std::string& vectorName, const std::string& wellName, int segmentNumber, int calculationId = -1 );
wellSegmentAddress( const std::string& vectorName, const std::string& wellName, int segmentNumber, int calculationId = -1 );
static RifEclipseSummaryAddress blockAddress( const std::string& vectorName, int i, int j, int k, int calculationId = -1 );
static RifEclipseSummaryAddress
blockLgrAddress( const std::string& vectorName, const std::string& lgrName, int i, int j, int k, int calculationId = -1 );
blockLgrAddress( const std::string& vectorName, const std::string& lgrName, int i, int j, int k, int calculationId = -1 );
static RifEclipseSummaryAddress importedAddress( const std::string& vectorName, int calculationId = -1 );
static RifEclipseSummaryAddress ensembleStatisticsAddress( const std::string& vectorName, const std::string& datavectorName );

View File

@ -89,7 +89,8 @@ std::pair<std::string, std::vector<float>>
{
std::vector<float> values;
auto isKeywordWithoutData = []( const std::string& keyword ) {
auto isKeywordWithoutData = []( const std::string& keyword )
{
std::vector<std::string> keywords = { "ECHO", "NOECHO" };
return std::find( keywords.begin(), keywords.end(), keyword ) != keywords.end();
};

View File

@ -52,7 +52,7 @@ public:
private:
static void readElasticProperties( std::vector<RifElasticProperties>& elasticProperties, const QString& filePath, const QString& separator );
static RifElasticProperties parseElasticProperties( const QString& line, int lineNumber, const QString& filePath, const QString& separator );
static QStringList tokenize( const QString& line, const QString& separator );
static QStringList tokenize( const QString& line, const QString& separator );
static void
verifyNonEmptyTokens( const QStringList& tokens, const QStringList& nameOfNonEmptyTokens, int lineNumber, const QString& filePath );

View File

@ -98,9 +98,8 @@ std::vector<time_t> RifHdf5SummaryReader::timeSteps() const
// Add custom method to convert from time_point to time_t. The usual implementation of
// chrono::system_clock::to_time_t() uses nanoseconds which will overflow on data with
// long time spans.
auto convertTimePointToTimeT = []( const TP& value ) {
return std::chrono::duration_cast<std::chrono::seconds>( value.time_since_epoch() ).count();
};
auto convertTimePointToTimeT = []( const TP& value )
{ return std::chrono::duration_cast<std::chrono::seconds>( value.time_since_epoch() ).count(); };
auto startDat = std::chrono::system_clock::from_time_t( startDate() );

View File

@ -348,7 +348,8 @@ std::vector<std::vector<cvf::Vec3d>>
std::sort( zDistanceAlongPillar.begin(), zDistanceAlongPillar.end() );
auto normalize = []( const std::vector<double>& values ) -> std::vector<double> {
auto normalize = []( const std::vector<double>& values ) -> std::vector<double>
{
if ( values.size() < 2 ) return {};
std::vector<double> normalizedValues;

View File

@ -168,9 +168,9 @@ void RifOpmHdf5Summary::buildMetaData()
{
auto [addresses, smspecIndices, addressToKeywordMap] = RifOpmCommonSummaryTools::buildAddressesSmspecAndKeywordMap( m_eSmry.get() );
m_allResultAddresses = addresses;
m_adrToSmspecIndices = smspecIndices;
m_summaryAddressToKeywordMap = addressToKeywordMap;
m_allResultAddresses = addresses;
m_adrToSmspecIndices = smspecIndices;
m_summaryAddressToKeywordMap = addressToKeywordMap;
}
}
}

View File

@ -1815,7 +1815,7 @@ void RifReaderEclipseOutput::readWellCells( const ecl_grid_type* mainEclGrid, bo
if ( well_segment_has_grid_connections( outletSegment, gridName.data() ) )
{
const well_conn_collection_type* connections = well_segment_get_connections( outletSegment, gridName.data() );
int connectionCount = well_conn_collection_get_size( connections );
int connectionCount = well_conn_collection_get_size( connections );
// Select the deepest connection
well_conn_type* ert_connection = well_conn_collection_iget( connections, connectionCount - 1 );

View File

@ -113,7 +113,7 @@ std::set<QDateTime> RifReaderEnsembleStatisticsRft::availableTimeSteps( const QS
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<QDateTime> RifReaderEnsembleStatisticsRft::availableTimeSteps( const QString& wellName,
std::set<QDateTime> RifReaderEnsembleStatisticsRft::availableTimeSteps( const QString& wellName,
const RifEclipseRftAddress::RftWellLogChannelType& wellLogChannelName )
{
std::set<QDateTime> allTimeSteps;

View File

@ -167,7 +167,7 @@ std::set<QDateTime> RifReaderPressureDepthData::availableTimeSteps( const QStrin
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<QDateTime> RifReaderPressureDepthData::availableTimeSteps( const QString& wellName,
std::set<QDateTime> RifReaderPressureDepthData::availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels )
{
if ( relevantChannels.count( RifEclipseRftAddress::RftWellLogChannelType::TVD ) ||

View File

@ -72,7 +72,8 @@ bool RifRoffFileTools::openGridFile( const QString& fileName, RigEclipseCaseData
return false;
}
auto getInt = []( auto values, const std::string& name ) {
auto getInt = []( auto values, const std::string& name )
{
auto v = std::find_if( values.begin(), values.end(), [&name]( const auto& arg ) { return arg.first == name; } );
if ( v != values.end() )
return std::get<int>( v->second );
@ -80,7 +81,8 @@ bool RifRoffFileTools::openGridFile( const QString& fileName, RigEclipseCaseData
throw std::runtime_error( "Missing parameter (integer): " + name );
};
auto getFloat = []( auto values, const std::string& name ) {
auto getFloat = []( auto values, const std::string& name )
{
auto v = std::find_if( values.begin(), values.end(), [&name]( const auto& arg ) { return arg.first == name; } );
if ( v != values.end() )
return std::get<float>( v->second );

View File

@ -72,7 +72,7 @@ public:
std::pair<int, int> convertToInlineXline( double worldx, double worldy );
std::shared_ptr<ZGYAccess::SeismicSliceData>
slice( RiaDefines::SeismicSliceDirection direction, int sliceIndex, int zStartIndex = -1, int zSize = 0 );
slice( RiaDefines::SeismicSliceDirection direction, int sliceIndex, int zStartIndex = -1, int zSize = 0 );
std::shared_ptr<ZGYAccess::SeismicSliceData> trace( int inlineIndex, int xlineIndex, int zStartIndex = -1, int zSize = 0 );
private:

View File

@ -40,7 +40,7 @@ public:
private:
static bool
writeToFrkFile( const QString& filepath, const std::vector<QString>& labels, const std::map<QString, std::vector<double>>& values );
writeToFrkFile( const QString& filepath, const std::vector<QString>& labels, const std::map<QString, std::vector<double>>& values );
static bool writeToCsvFile( const QString& filepath,
const std::vector<QString>& labels,
const std::map<QString, std::vector<double>>& values,

View File

@ -55,11 +55,10 @@ bool vectorContains( const std::vector<T>& vector, T item )
//--------------------------------------------------------------------------------------------------
RicSummaryCaseRestartDialog::ImportOptions mapReadOption( RiaPreferencesSummary::SummaryRestartFilesImportMode mode )
{
return mode == RiaPreferencesSummary::SummaryRestartFilesImportMode::NOT_IMPORT
? RicSummaryCaseRestartDialog::ImportOptions::NOT_IMPORT
: mode == RiaPreferencesSummary::SummaryRestartFilesImportMode::SEPARATE_CASES
? RicSummaryCaseRestartDialog::ImportOptions::SEPARATE_CASES
: RicSummaryCaseRestartDialog::ImportOptions::IMPORT_ALL;
return mode == RiaPreferencesSummary::SummaryRestartFilesImportMode::NOT_IMPORT ? RicSummaryCaseRestartDialog::ImportOptions::NOT_IMPORT
: mode == RiaPreferencesSummary::SummaryRestartFilesImportMode::SEPARATE_CASES
? RicSummaryCaseRestartDialog::ImportOptions::SEPARATE_CASES
: RicSummaryCaseRestartDialog::ImportOptions::IMPORT_ALL;
}
//--------------------------------------------------------------------------------------------------

View File

@ -377,7 +377,8 @@ std::pair<std::vector<cvf::Vec3d>, std::vector<unsigned>> RifSurfaceImporter::re
// of axesVectorCandidates. Also increases the number of occurrences of vector candidates.
auto maybeInsertAxisVectorCandidate = [epsilon]( const cvf::Vec2d vector,
std::map<cvf::Vec2d, double, vec2dCompare>& axesVectorCandidates,
std::map<cvf::Vec2d, unsigned, vec2dCompare>& axesVectorCandidatesNum ) -> bool {
std::map<cvf::Vec2d, unsigned, vec2dCompare>& axesVectorCandidatesNum ) -> bool
{
double length = vector.length();
cvf::Vec2d normalizedVector = vector.getNormalized();
for ( std::map<cvf::Vec2d, double, vec2dCompare>::iterator iter = axesVectorCandidates.begin(); iter != axesVectorCandidates.end();
@ -471,9 +472,9 @@ std::pair<std::vector<cvf::Vec3d>, std::vector<unsigned>> RifSurfaceImporter::re
pairs.push_back( *itr );
}
sort( pairs.begin(), pairs.end(), [=]( std::pair<cvf::Vec2d, unsigned>& a, std::pair<cvf::Vec2d, unsigned>& b ) {
return a.second > b.second;
} );
sort( pairs.begin(),
pairs.end(),
[=]( std::pair<cvf::Vec2d, unsigned>& a, std::pair<cvf::Vec2d, unsigned>& b ) { return a.second > b.second; } );
cvf::Vec2d primaryAxisVector = pairs[0].first * axesVectorCandidates[pairs[0].first];
@ -488,7 +489,8 @@ std::pair<std::vector<cvf::Vec3d>, std::vector<unsigned>> RifSurfaceImporter::re
auto distanceOnLine = [to3d, to2d, surfacePoints, primaryAxisVector, epsilon]( const cvf::Vec2d linePoint1,
const cvf::Vec2d linePoint2,
const cvf::Vec2d point ) -> int {
const cvf::Vec2d point ) -> int
{
double normalizedIntersection = 0.0;
cvf::Vec2d projectedPoint =
to2d( cvf::GeometryTools::projectPointOnLine( to3d( linePoint1 ), to3d( linePoint2 ), to3d( point ), &normalizedIntersection ) );
@ -632,7 +634,8 @@ bool RifSurfaceImporter::generateTriangleIndices( const std::vector<std::vector<
//--------------------------------------------------------------------------------------------------
bool RifSurfaceImporter::vectorFuzzyCompare( const cvf::Vec2d& vector1, const cvf::Vec2d& vector2, double epsilon )
{
auto AlmostEqualRelativeAndAbs = [=]( double A, double B, double maxRelDiff ) -> bool {
auto AlmostEqualRelativeAndAbs = [=]( double A, double B, double maxRelDiff ) -> bool
{
// Check if the numbers are really close -- needed
// when comparing numbers near zero.
double diff = fabs( A - B );

View File

@ -49,7 +49,8 @@ std::pair<std::shared_ptr<RigThermalFractureDefinition>, QString> RifThermalFrac
QString separator = ",";
auto appendPropertyValues = [definition]( int nodeIndex, int valueOffset, const QStringList& values, double conductivityFactor ) {
auto appendPropertyValues = [definition]( int nodeIndex, int valueOffset, const QStringList& values, double conductivityFactor )
{
CAF_ASSERT( valueOffset <= values.size() );
for ( int i = valueOffset; i < values.size(); i++ )
{

View File

@ -268,9 +268,10 @@ void RifWellPathImporter::readAllAsciiWellData( const QString& filePath )
// name <WellNameA>
// wellname: <WellNameA>
std::string lineLowerCase = line;
transform( lineLowerCase.begin(), lineLowerCase.end(), lineLowerCase.begin(), []( const char c ) -> char {
return (char)::tolower( c );
} );
transform( lineLowerCase.begin(),
lineLowerCase.end(),
lineLowerCase.begin(),
[]( const char c ) -> char { return (char)::tolower( c ); } );
std::string tokenName = "name";
std::size_t foundNameIdx = lineLowerCase.find( tokenName );

View File

@ -62,7 +62,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorEV::calculate( int partIndex
caf::ProgressInfo stepCountProgress( static_cast<size_t>( m_resultCollection->timeStepCount() ) * 4, progressText );
auto loadFrameLambda = [&]( const QString& component ) {
auto loadFrameLambda = [&]( const QString& component )
{
auto task = stepCountProgress.task( "Loading " + component, m_resultCollection->timeStepCount() );
return m_resultCollection->findOrLoadScalarResult( partIndex, resAddr.copyWithComponent( component.toStdString() ) );
};

View File

@ -107,14 +107,14 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
// Stress (ST.S3)
RigFemScalarResultFrames* stressDataFrames = nullptr;
{
auto task = stepCountProgress.task( "Loading ST.S3", m_resultCollection->timeStepCount() );
auto task = stepCountProgress.task( "Loading ST.S3", m_resultCollection->timeStepCount() );
stressDataFrames = m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "ST", "S3" ) );
}
// Initial overburden gradient (ST.S33)
RigFemScalarResultFrames* obg0DataFrames = nullptr;
{
auto task = stepCountProgress.task( "Loading ST.S33", m_resultCollection->timeStepCount() );
auto task = stepCountProgress.task( "Loading ST.S33", m_resultCollection->timeStepCount() );
obg0DataFrames = m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "ST", "S33" ) );
}

View File

@ -51,7 +51,7 @@ private:
static std::vector<float> loadDataForFrame( RimMudWeightWindowParameters::ParameterType parameterType,
std::map<RimMudWeightWindowParameters::ParameterType, RigFemScalarResultFrames*>& parameterFrames,
int stepIndex,
int stepIndex,
int frameIndex );
static float getValueForElement( RimMudWeightWindowParameters::ParameterType parameterType,

View File

@ -149,8 +149,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorNormalized::calculate( int p
else
{
// Over/under/sideburden. Use hydrostatic pressure from cell centroid.
cvf::Vec3d cellCentroid = femPartGrid->cellCentroid( elmIdx );
double cellCentroidTvdRKB = std::abs( cellCentroid.z() ) + m_resultCollection->normalizationAirGap();
cvf::Vec3d cellCentroid = femPartGrid->cellCentroid( elmIdx );
double cellCentroidTvdRKB = std::abs( cellCentroid.z() ) + m_resultCollection->normalizationAirGap();
double cellCenterHydroStaticPressure = RiaWellLogUnitTools<double>::hydrostaticPorePressureBar( cellCentroidTvdRKB );
for ( int elmLocalNodeIdx = 0; elmLocalNodeIdx < 8; ++elmLocalNodeIdx )

View File

@ -63,7 +63,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorPoreCompressibility::calcula
{
caf::ProgressInfo stepCountProgress( static_cast<size_t>( m_resultCollection->timeStepCount() ) * 7, "Calculating Pore Compressibility" );
auto loadFrameLambda = [&]( RigFemResultAddress addr, const QString& errMsg = "" ) -> RigFemScalarResultFrames* {
auto loadFrameLambda = [&]( RigFemResultAddress addr, const QString& errMsg = "" ) -> RigFemScalarResultFrames*
{
auto task = stepCountProgress.task( QString( "Loading %1: %2" )
.arg( QString::fromStdString( addr.fieldName ) )
.arg( QString::fromStdString( addr.componentName ) ),

View File

@ -76,7 +76,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorPrincipalStrain::calculate(
caf::ProgressInfo stepCountProgress( static_cast<size_t>( m_resultCollection->timeStepCount() ) * 7, progressText );
auto loadFrameLambda = [&]( const std::string& component ) {
auto loadFrameLambda = [&]( const std::string& component )
{
auto task = stepCountProgress.task( QString::fromStdString( "Loading " + component ), m_resultCollection->timeStepCount() );
return m_resultCollection->findOrLoadScalarResult( partIndex, resAddr.copyWithComponent( component ) );
};

View File

@ -62,7 +62,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorSFI::calculate( int partInde
caf::ProgressInfo stepCountProgress( static_cast<size_t>( m_resultCollection->timeStepCount() ) * 3, progressText );
auto loadFrameLambda = [&]( const QString& component ) {
auto loadFrameLambda = [&]( const QString& component )
{
auto task = stepCountProgress.task( "Loading " + component, m_resultCollection->timeStepCount() );
return m_resultCollection->findOrLoadScalarResult( partIndex, resAddr.copyWithComponent( component.toStdString() ) );
};

View File

@ -62,7 +62,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorSM::calculate( int partIndex
caf::ProgressInfo stepCountProgress( static_cast<size_t>( m_resultCollection->timeStepCount() ) * 4, progressText );
auto loadFrameLambda = [&]( const QString& component ) {
auto loadFrameLambda = [&]( const QString& component )
{
auto task = stepCountProgress.task( component );
return m_resultCollection->findOrLoadScalarResult( partIndex, resVarAddr.copyWithComponent( component.toStdString() ) );
};

View File

@ -1812,7 +1812,7 @@ void RigFemPartResultsCollection::setMudWeightWindowParameters( double
RimMudWeightWindowParameters::LowerLimitType lowerLimit,
int referenceLayer,
RimMudWeightWindowParameters::FractureGradientCalculationType fgCalculationType,
double shMultiplier,
double shMultiplier,
RimMudWeightWindowParameters::NonReservoirPorePressureType nonReservoirPorePressureType,
double hydrostaticMultiplierPPNonRes,
const QString& nonReservoirPorePressureAddress )

View File

@ -215,8 +215,8 @@ RivGeoMechPartMgr* RivGeoMechVizLogic::getUpdatedPartMgr( RivGeoMechPartMgrCache
if ( m_geomechView->geoMechCase() )
{
caseData = m_geomechView->geoMechCase()->geoMechData();
partCount = caseData->femParts()->partCount();
caseData = m_geomechView->geoMechCase()->geoMechData();
partCount = caseData->femParts()->partCount();
std::tie( timeStepIdx, frameIdx ) = caseData->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( pMgrKey.viewerStepIndex() );
}

View File

@ -320,7 +320,7 @@ bool RifOdbReader::readFemParts( RigFemPartCollection* femParts )
odb_InstanceRepository instanceRepository = m_odb->rootAssembly().instances();
odb_InstanceRepositoryIT iter( instanceRepository );
caf::ProgressInfo modelProgress( instanceRepository.size() * ( size_t )( 2 + 4 ), "Reading Odb Parts" );
caf::ProgressInfo modelProgress( instanceRepository.size() * (size_t)( 2 + 4 ), "Reading Odb Parts" );
int instanceCount = 0;
for ( iter.first(); !iter.isDone(); iter.next(), instanceCount++ )

View File

@ -67,7 +67,7 @@ RivExtrudedCurveIntersectionGeometryGenerator::RivExtrudedCurveIntersectionGeome
std::vector<std::vector<cvf::Vec3d>>& polylines,
const cvf::Vec3d& extrusionDirection,
const RivIntersectionHexGridInterface* grid,
bool isFlattened,
bool isFlattened,
const cvf::Vec3d& flattenedPolylineStartPoint )
: m_intersection( crossSection )
, m_polylines( polylines )

View File

@ -419,7 +419,7 @@ void RivIntersectionResultsColoringTools::calculateElementBasedGeoMechTextureCoo
void RivIntersectionResultsColoringTools::calculateGeoMechTensorXfTextureCoords( cvf::Vec2fArray* textureCoords,
const cvf::Vec3fArray* triangelVertices,
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
RigGeoMechCaseData* caseData,
RigGeoMechCaseData* caseData,
const RigFemResultAddress& resVarAddress,
int partIdx,
int timeStepIdx,
@ -486,9 +486,9 @@ void RivIntersectionResultsColoringTools::calculatePlaneAngleTextureCoords( cvf:
// as plane
// normal
float angle = cvf::Math::toDegrees( operation( sphCoord ) );
cvf::Vec2f texCoord = ( angle != std::numeric_limits<float>::infinity() ) ? mapper->mapToTextureCoord( angle )
: cvf::Vec2f( 0.0f, 1.0f );
float angle = cvf::Math::toDegrees( operation( sphCoord ) );
cvf::Vec2f texCoord = ( angle != std::numeric_limits<float>::infinity() ) ? mapper->mapToTextureCoord( angle )
: cvf::Vec2f( 0.0f, 1.0f );
rawPtr[triangleVxStartIdx + 0] = texCoord;
rawPtr[triangleVxStartIdx + 1] = texCoord;
rawPtr[triangleVxStartIdx + 2] = texCoord;

View File

@ -266,8 +266,8 @@ bool Riv3dWellLogCurveGeometryGenerator::findClosestPointOnCurve( const cvf::Vec
double distance = ( projectionOfGlobalIntersection - globalIntersection ).length();
if ( distance < closestDistance )
{
*closestPoint = cvf::Vec3d( projectionOfGlobalIntersection );
closestDistance = distance;
*closestPoint = cvf::Vec3d( projectionOfGlobalIntersection );
closestDistance = distance;
*measuredDepthAtPoint = m_curveMeasuredDepths[i - 1] * ( 1.0 - clampedDistance ) + m_curveMeasuredDepths[i] * clampedDistance;
*valueAtClosestPoint = m_curveValues[i - 1] * ( 1.0 - clampedDistance ) + m_curveValues[i] * clampedDistance;
}

View File

@ -552,7 +552,7 @@ cvf::ref<cvf::DrawableGeo>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RivContourMapProjectionPartMgr::lineOverlapsWithPreviousContourLevel( const cvf::Vec3d& lineCenter,
bool RivContourMapProjectionPartMgr::lineOverlapsWithPreviousContourLevel( const cvf::Vec3d& lineCenter,
const RimContourMapProjection::ContourPolygons* previousLevel ) const
{
const int64_t jump = 50;

View File

@ -155,7 +155,8 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
auto getFaceCenterAndNormal = [activeCellInfo, cells, arrowScaling, displayCordXf]( size_t globalCellIdx,
cvf::StructGridInterface::FaceType faceType,
cvf::Vec3d& faceCenter,
cvf::Vec3d& faceNormal ) {
cvf::Vec3d& faceNormal )
{
faceCenter = displayCordXf->transformToDisplayCoord( cells[globalCellIdx].faceCenter( faceType ) );
cvf::Vec3d cellCenter = displayCordXf->transformToDisplayCoord( cells[globalCellIdx].center() );
faceNormal = ( faceCenter - cellCenter ).getNormalized() * arrowScaling;
@ -320,7 +321,7 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<cvf::Part> RivElementVectorResultPartMgr::createPart( const RimElementVectorResult& result,
cvf::ref<cvf::Part> RivElementVectorResultPartMgr::createPart( const RimElementVectorResult& result,
const std::vector<ElementVectorResultVisualization>& tensorVisualizations ) const
{
std::vector<uint> shaftIndices;
@ -411,9 +412,9 @@ cvf::ref<cvf::Part> RivElementVectorResultPartMgr::createPart( const RimElementV
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivElementVectorResultPartMgr::createResultColorTextureCoords( cvf::Vec2fArray* textureCoords,
void RivElementVectorResultPartMgr::createResultColorTextureCoords( cvf::Vec2fArray* textureCoords,
const std::vector<ElementVectorResultVisualization>& elementVectorResultVisualizations,
const cvf::ScalarMapper* mapper )
const cvf::ScalarMapper* mapper )
{
CVF_ASSERT( textureCoords );
CVF_ASSERT( mapper );

View File

@ -85,7 +85,7 @@ private:
static cvf::ref<cvf::DrawableGeo> generateLine( const cvf::Vec3dArray* coords );
static cvf::ref<cvf::DrawableGeo>
generateExtrudedCylinder( double radius, size_t crossSectionNodeCount, const cvf::Vec3dArray* cylinderCenterCoords );
generateExtrudedCylinder( double radius, size_t crossSectionNodeCount, const cvf::Vec3dArray* cylinderCenterCoords );
static cvf::ref<cvf::DrawableGeo> generateVariableRadiusTube( size_t crossSectionNodeCount,
const cvf::Vec3dArray* cylinderCenterCoords,
const std::vector<double>& radii );

View File

@ -167,7 +167,8 @@ void RivSimWellPipesPartMgr::buildWellPipeParts( const caf::DisplayCoordTransfor
m_wellBranches.clear();
m_flattenedBranchWellHeadOffsets.clear();
auto createSimWells = []( RimSimWellInView* simWellInView ) -> std::vector<SimulationWellCellBranch> {
auto createSimWells = []( RimSimWellInView* simWellInView ) -> std::vector<SimulationWellCellBranch>
{
std::vector<SimulationWellCellBranch> simWellBranches;
const RigSimWellData* simWellData = simWellInView->simWellData();
if ( simWellData && simWellData->isMultiSegmentWell() )
@ -449,7 +450,8 @@ void RivSimWellPipesPartMgr::appendValvesGeo( const RimEclipseView*
RivPipeGeometryGenerator::tubeWithCenterLinePartsAndVariableWidth( &pbd.m_valveParts, displayCoords, radii, valveColor );
auto computeRotationAxisAndAngle = []( const cvf::Vec3f& direction ) {
auto computeRotationAxisAndAngle = []( const cvf::Vec3f& direction )
{
// Compute upwards normal based on direction
// Compute the rotation axis and angle between up vector and Z_AXIS

View File

@ -51,12 +51,12 @@ public:
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model, size_t frameIndex );
private:
cvf::ref<cvf::Part> createArrowPart( const cvf::Vec3f& startPoint,
const cvf::Vec3f& endPoint,
float width,
bool isProducer,
const cvf::Color4f& arrowColor,
bool enableLighting );
cvf::ref<cvf::Part> createArrowPart( const cvf::Vec3f& startPoint,
const cvf::Vec3f& endPoint,
float width,
bool isProducer,
const cvf::Color4f& arrowColor,
bool enableLighting );
cvf::ref<cvf::DrawableGeo> createArrowGeometry( const cvf::Vec3f& startPoint, const cvf::Vec3f& endPoint, double width, bool useArrowEnd );
private:

View File

@ -597,7 +597,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanElementColorSurfacePar
return nullptr;
}
cvf::Mat4d fractureXf = m_rimFracture->transformMatrix();
cvf::Mat4d fractureXf = m_rimFracture->transformMatrix();
std::vector<cvf::Vec3f> nodeDisplayCoords = transformToFractureDisplayCoords( stimPlanMeshVertices, fractureXf, *displayCoordTransform );
std::vector<cvf::uint> triIndicesToInclude;

View File

@ -78,7 +78,7 @@ private:
void appendFracturePerforationLengthParts( const RimEclipseView& activeView, cvf::ModelBasicList* model );
cvf::ref<cvf::Part> createStimPlanMeshPart( const RimEclipseView& activeView );
cvf::ref<cvf::Part> createStimPlanMeshPart( const RimEclipseView& activeView );
cvf::ref<cvf::DrawableGeo> createStimPlanMeshDrawable( RimMeshFractureTemplate* stimPlanFracTemplate, const RimEclipseView& activeView );
void createVisibleFracturePolygons( RimMeshFractureTemplate* stimPlanFracTemplate, const RimEclipseView& activeView );

View File

@ -479,13 +479,13 @@ void RivWellPathPartMgr::appendPerforationValvesToModel( cvf::ModelBasicList*
{
measuredDepthsRelativeToStartMD = { 0.0, 1.0, 1.5, 4.0, 5.0, 5.5, 8.0, 9.0 };
radii = { wellPathRadius,
wellPathRadius * 1.8,
wellPathRadius * 2.0,
wellPathRadius * 2.0,
wellPathRadius * 1.8,
wellPathRadius * 1.7,
wellPathRadius * 1.7,
wellPathRadius };
wellPathRadius * 1.8,
wellPathRadius * 2.0,
wellPathRadius * 2.0,
wellPathRadius * 1.8,
wellPathRadius * 1.7,
wellPathRadius * 1.7,
wellPathRadius };
double startMD = valve->startMD();
std::vector<cvf::Vec3d> displayCoords;

View File

@ -242,7 +242,7 @@ QString RivSurfacePartMgr::resultInfoText( Rim3dView* view, uint hitPart, cvf::V
const auto& ind = m_usedSurfaceData->triangleIndices();
const auto& vert = m_usedSurfaceData->vertices();
size_t indIndex = ( size_t )( hitPart * 3 );
size_t indIndex = (size_t)( hitPart * 3 );
// find closest triangle corner point to hit point and show that value
if ( ind.size() > ( indIndex + 2 ) )

View File

@ -1,38 +1,38 @@
//##################################################################################################
// ##################################################################################################
//
// Custom Visualization Core library
// Copyright (C) 2011-2013 Ceetron AS
// Custom Visualization Core library
// Copyright (C) 2011-2013 Ceetron AS
//
// This library may be used under the terms of either the GNU General Public License or
// the GNU Lesser General Public License as follows:
// This library may be used under the terms of either the GNU General Public License or
// the GNU Lesser General Public License as follows:
//
// GNU General Public License Usage
// This library is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// GNU General Public License Usage
// This library is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
// This library is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <<http://www.gnu.org/licenses/gpl.html>>
// for more details.
// See the GNU General Public License at <<http://www.gnu.org/licenses/gpl.html>>
// for more details.
//
// GNU Lesser General Public License Usage
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
// GNU Lesser General Public License Usage
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
// This library is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU Lesser General Public License at <<http://www.gnu.org/licenses/lgpl-2.1.html>>
// for more details.
// See the GNU Lesser General Public License at <<http://www.gnu.org/licenses/lgpl-2.1.html>>
// for more details.
//
//##################################################################################################
// ##################################################################################################
#pragma once

View File

@ -897,7 +897,8 @@ int RimPolygonFilter::findEclipseKLayer( const std::vector<cvf::Vec3d>& points,
}
}
auto findKLayerBelowPoint = []( const cvf::Vec3d& point, RigMainGrid* mainGrid ) {
auto findKLayerBelowPoint = []( const cvf::Vec3d& point, RigMainGrid* mainGrid )
{
// Create a bounding box (ie a ray) from the point down to minimum of grid
cvf::Vec3d lowestPoint( point.x(), point.y(), mainGrid->boundingBox().min().z() );

View File

@ -580,9 +580,9 @@ std::set<std::pair<QString, QString>>
//--------------------------------------------------------------------------------------------------
std::vector<cvf::cref<RigFractureGrid>>
RimEnsembleFractureStatistics::createFractureGrids( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions,
RiaDefines::EclipseUnitSystem unitSystem,
const QString& resultNameOnFile,
MeshAlignmentType meshAlignmentType )
RiaDefines::EclipseUnitSystem unitSystem,
const QString& resultNameOnFile,
MeshAlignmentType meshAlignmentType )
{
// Defaults to avoid scaling
double halfLengthScaleFactor = 1.0;
@ -620,8 +620,8 @@ std::vector<cvf::cref<RigFractureGrid>>
//--------------------------------------------------------------------------------------------------
std::tuple<double, double, double, double>
RimEnsembleFractureStatistics::findSamplingIntervals( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions,
std::vector<double>& gridXs,
std::vector<double>& gridYs ) const
std::vector<double>& gridXs,
std::vector<double>& gridYs ) const
{
// Find min and max extent of all the grids
auto [minX, maxX, minY, maxY] = findMaxGridExtents( stimPlanFractureDefinitions, m_meshAlignmentType() );
@ -647,7 +647,7 @@ std::tuple<double, double, double, double>
//--------------------------------------------------------------------------------------------------
std::tuple<double, double, double, double>
RimEnsembleFractureStatistics::findMaxGridExtents( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions,
MeshAlignmentType meshAlignmentType )
MeshAlignmentType meshAlignmentType )
{
double minX = std::numeric_limits<double>::max();
double maxX = -std::numeric_limits<double>::max();
@ -698,13 +698,13 @@ void RimEnsembleFractureStatistics::generateUniformMesh( double mi
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleFractureStatistics::generateNaiveMesh( double minX,
double maxX,
double minY,
double maxY,
void RimEnsembleFractureStatistics::generateNaiveMesh( double minX,
double maxX,
double minY,
double maxY,
const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions,
std::vector<double>& gridXs,
std::vector<double>& gridYs ) const
std::vector<double>& gridXs,
std::vector<double>& gridYs ) const
{
// Find max number of cells in x direction
int maxNx = 0;
@ -735,13 +735,13 @@ void RimEnsembleFractureStatistics::generateNaiveMesh( double
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleFractureStatistics::generateAdaptiveMesh( double minX,
double maxX,
double minY,
double maxY,
void RimEnsembleFractureStatistics::generateAdaptiveMesh( double minX,
double maxX,
double minY,
double maxY,
const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions,
std::vector<double>& gridXs,
std::vector<double>& gridYs ) const
std::vector<double>& gridXs,
std::vector<double>& gridYs ) const
{
// Find max number of cells in x direction
int maxNx = 0;
@ -792,7 +792,8 @@ void RimEnsembleFractureStatistics::generateAdaptiveMesh( double
}
// Find the index of the last item where value is smaller
auto findSmallerIndex = []( double value, const std::vector<double>& vec ) {
auto findSmallerIndex = []( double value, const std::vector<double>& vec )
{
for ( size_t i = 0; i < vec.size(); i++ )
if ( vec[i] > value ) return i - 1;
return vec.size();
@ -900,8 +901,8 @@ void RimEnsembleFractureStatistics::computeMeanThicknessPerLayer( const std::vec
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleFractureStatistics::generateAllLayers( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& stimPlanFractureDefinitions,
std::vector<Layer>& layers,
MeshAlignmentType meshAlignmentType )
std::vector<Layer>& layers,
MeshAlignmentType meshAlignmentType )
{
for ( auto def : stimPlanFractureDefinitions )
{
@ -1008,7 +1009,8 @@ void RimEnsembleFractureStatistics::sampleAllGrids( const std::vector<cvf::cref<
std::shared_ptr<RigSlice2D> areaGrid,
std::shared_ptr<RigSlice2D> distanceGrid )
{
auto computeCellSideLength = []( const std::vector<double>& values, size_t idx ) {
auto computeCellSideLength = []( const std::vector<double>& values, size_t idx )
{
if ( idx < values.size() - 1 )
return values[idx + 1] - values[idx];
else
@ -1116,13 +1118,15 @@ void RimEnsembleFractureStatistics::generateStatisticsGrids(
std::shared_ptr<RigSlice2D> areaGrid,
std::shared_ptr<RigSlice2D> distanceGrid )
{
auto setValueNoInf = []( RigSlice2D& grid, size_t x, size_t y, double value ) {
auto setValueNoInf = []( RigSlice2D& grid, size_t x, size_t y, double value )
{
// Guard against inf (happens in the regions not covered by any mesh)
if ( std::isinf( value ) ) value = 0.0;
grid.setValue( x, y, value );
};
auto removeNonPositiveValues = []( const std::vector<double>& values ) {
auto removeNonPositiveValues = []( const std::vector<double>& values )
{
std::vector<double> nonZeroValues;
for ( double value : values )
if ( value > 0.0 ) nonZeroValues.push_back( value );
@ -1288,7 +1292,8 @@ QString RimEnsembleFractureStatistics::generateStatisticsTable(
text += "</thead>";
text += "<tbody>";
auto emptyTextOnInf = []( double value, RiaNumberFormat::NumberFormatType numberFormat, int precision ) {
auto emptyTextOnInf = []( double value, RiaNumberFormat::NumberFormatType numberFormat, int precision )
{
if ( std::isinf( value ) )
return QString( "" );
else

View File

@ -179,10 +179,10 @@ protected:
const RigSlice2D& distanceGrid,
double targetArea );
static void generateStatisticsGrids( const std::vector<std::vector<double>>& samples,
size_t numSamplesX,
size_t numSamplesY,
size_t numGrids,
static void generateStatisticsGrids( const std::vector<std::vector<double>>& samples,
size_t numSamplesX,
size_t numSamplesY,
size_t numGrids,
std::map<RimEnsembleFractureStatistics::StatisticsType, std::shared_ptr<RigSlice2D>>& statisticsGrids,
const std::vector<caf::AppEnum<RimEnsembleFractureStatistics::StatisticsType>>& statisticsTypes,
const RigHistogramData& areaHistogram,

View File

@ -164,7 +164,8 @@ void RimThermalFractureTemplate::loadDataAndUpdate()
m_fractureDefinitionData = fractureDefinitionData;
if ( m_fractureDefinitionData )
{
auto addInjectivityFactor = []( std::shared_ptr<RigThermalFractureDefinition> def ) {
auto addInjectivityFactor = []( std::shared_ptr<RigThermalFractureDefinition> def )
{
int leakoffPressureDropIndex = def->getPropertyIndex( RiaDefines::leakoffPressureDropResultName() );
int filtratePressureDropIndex = def->getPropertyIndex( RiaDefines::filtratePressureDropResultName() );
QString injectivityValueTag = RiaDefines::injectivityFactorResultName();
@ -185,7 +186,8 @@ void RimThermalFractureTemplate::loadDataAndUpdate()
}
};
auto addFilterCakeMobility = []( std::shared_ptr<RigThermalFractureDefinition> def ) {
auto addFilterCakeMobility = []( std::shared_ptr<RigThermalFractureDefinition> def )
{
int leakoffPressureDropIndex = def->getPropertyIndex( RiaDefines::leakoffPressureDropResultName() );
int filtratePressureDropIndex = def->getPropertyIndex( RiaDefines::filtratePressureDropResultName() );
int leakoffMobilityIndex = def->getPropertyIndex( RiaDefines::leakoffMobilityResultName() );

View File

@ -441,7 +441,8 @@ void eraseInvalidEntries( std::vector<CorrelationMatrixRowOrColumn<KeyType, Valu
{
matrix.erase( std::remove_if( matrix.begin(),
matrix.end(),
[=]( const CorrelationMatrixRowOrColumn<KeyType, ValueType>& entry ) {
[=]( const CorrelationMatrixRowOrColumn<KeyType, ValueType>& entry )
{
bool isValid = RiaCurveDataTools::isValidValue( entry.m_correlationSum, false );
return !isValid;
} ),
@ -454,7 +455,8 @@ void sortEntries( std::vector<CorrelationMatrixRowOrColumn<KeyType, ValueType>>&
std::sort( matrix.begin(),
matrix.end(),
[&sortByAbsoluteValues]( const CorrelationMatrixRowOrColumn<KeyType, ValueType>& lhs,
const CorrelationMatrixRowOrColumn<KeyType, ValueType>& rhs ) -> bool {
const CorrelationMatrixRowOrColumn<KeyType, ValueType>& rhs ) -> bool
{
if ( sortByAbsoluteValues )
return lhs.m_correlationAbsSum > rhs.m_correlationAbsSum;
else

View File

@ -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() ) )
{

View File

@ -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() )
{

View File

@ -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 )
{

View File

@ -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 );

View File

@ -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 );

View File

@ -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 ) )

View File

@ -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();

View File

@ -68,9 +68,9 @@ protected:
std::vector<double> retrieveParameterWeights() override;
std::vector<double> generateResults( int viewerStepIndex ) override;
std::vector<double>
generateResultsFromAddress( RigFemResultAddress resultAddress, const std::vector<bool>& mapCellVisibility, int viewerStepIndex );
bool resultVariableChanged() const override;
void clearResultVariable() override;
generateResultsFromAddress( RigFemResultAddress resultAddress, const std::vector<bool>& mapCellVisibility, int viewerStepIndex );
bool resultVariableChanged() const override;
void clearResultVariable() override;
RimGridView* baseView() const override;
std::vector<size_t> findIntersectingCells( const cvf::BoundingBox& bbox ) const override;
size_t kLayer( size_t globalCellIdx ) const override;

View File

@ -1118,7 +1118,7 @@ void Rim3dView::addMeasurementToModel( cvf::ModelBasicList* measureModel )
{
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
cvf::Camera* mainOrComparisonCamera = isUsingOverrideViewer() ? nativeOrOverrideViewer()->comparisonMainCamera()
: nativeOrOverrideViewer()->mainCamera();
: nativeOrOverrideViewer()->mainCamera();
m_measurementPartManager->appendGeometryPartsToModel( mainOrComparisonCamera,
measureModel,
transForm.p(),

View File

@ -873,7 +873,7 @@ void RimContourMapProjection::generateTrianglesWithVertexValues()
bool anyValidVertex = false;
for ( size_t n = 0; n < 3; ++n )
{
uint vn = ( *faceList )[i + n];
uint vn = ( *faceList )[i + n];
double value = vn < m_aggregatedVertexResults.size() ? m_aggregatedVertexResults[vn] : std::numeric_limits<double>::infinity();
triangle[n] = vertices[vn];
triangleWithValues[n] = cvf::Vec4d( vertices[vn], value );

View File

@ -170,8 +170,8 @@ protected:
std::vector<cvf::Vec3d> generateVertices() const;
void generateContourPolygons();
ContourPolygons createContourPolygonsFromLineSegments( caf::ContourLines::ListOfLineSegments& unorderedLineSegments, double contourValue );
void smoothContourPolygons( ContourPolygons* contourPolygons, bool favourExpansion );
void clipContourPolygons( ContourPolygons* contourPolygons, const ContourPolygons* clipBy );
void smoothContourPolygons( ContourPolygons* contourPolygons, bool favourExpansion );
void clipContourPolygons( ContourPolygons* contourPolygons, const ContourPolygons* clipBy );
static double sumPolygonArea( const ContourPolygons& contourPolygons );
static double sumTriangleAreas( const std::vector<cvf::Vec4d>& triangles );

View File

@ -55,7 +55,8 @@ std::vector<RimGridCalculation*> RimGridCalculationCollection::sortedGridCalcula
}
// Check if source calculation is depending on other. Will check one level dependency.
auto isSourceDependingOnOther = []( const RimGridCalculation* source, const RimGridCalculation* other ) -> bool {
auto isSourceDependingOnOther = []( const RimGridCalculation* source, const RimGridCalculation* other ) -> bool
{
auto outputCase = source->outputEclipseCase();
auto outputAdr = source->outputAddress();

Some files were not shown because too many files have changed in this diff Show More