mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Update clang-format.yml (#10068)
* Update to clang-format-15 Removed two custom .clang-format files in subfolders of AppFwk * Fixes by clang-format
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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() );
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 ) ||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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++ )
|
||||
{
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user