mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Whitespace
This commit is contained in:
parent
11f9b1fe21
commit
014f389fe3
@ -17,25 +17,30 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
#include "RiaStringEncodingTools.h"
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RifReaderEclipseOutput.h"
|
||||
#include "RifEclipseSummaryTools.h"
|
||||
|
||||
#include <string>
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RiaStringEncodingTools.h"
|
||||
|
||||
#include "RifEclipseSummaryTools.h"
|
||||
#include "RifReaderEclipseOutput.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QDir>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QDir>
|
||||
|
||||
#include "ert/ecl/ecl_file.h"
|
||||
#include "ert/ecl/ecl_kw.h"
|
||||
#include "ert/ecl/ecl_kw_magic.h"
|
||||
#include "ert/ecl/ecl_sum.h"
|
||||
#include "ert/ecl/smspec_node.h"
|
||||
#include "ert/ecl/ecl_file.h"
|
||||
#include "ert/ecl/ecl_kw_magic.h"
|
||||
#include "ert/ecl/ecl_kw.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<time_t> getTimeSteps(ecl_sum_type* ecl_sum)
|
||||
{
|
||||
std::vector<time_t> timeSteps;
|
||||
@ -53,7 +58,6 @@ std::vector<time_t> getTimeSteps(ecl_sum_type* ecl_sum)
|
||||
|
||||
time_t_vector_free(steps);
|
||||
}
|
||||
|
||||
}
|
||||
return timeSteps;
|
||||
}
|
||||
@ -104,8 +108,8 @@ void closeEclSum(ecl_sum_type* ecl_sum)
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifReaderEclipseSummary::RifReaderEclipseSummary()
|
||||
: m_ecl_sum(nullptr),
|
||||
m_ecl_SmSpec(nullptr)
|
||||
: m_ecl_sum(nullptr)
|
||||
, m_ecl_SmSpec(nullptr)
|
||||
{
|
||||
m_valuesCache.reset(new ValuesCache());
|
||||
}
|
||||
@ -198,11 +202,9 @@ std::vector<RifRestartFileInfo> RifReaderEclipseSummary::getRestartFiles(const Q
|
||||
*hasWarnings = true;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!currFile.fileName.isEmpty())
|
||||
restartFiles.push_back(currFile);
|
||||
if (!currFile.fileName.isEmpty()) restartFiles.push_back(currFile);
|
||||
}
|
||||
return restartFiles;
|
||||
}
|
||||
@ -372,7 +374,6 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode(const smspec_node_type * ertSu
|
||||
sumCategory = RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION;
|
||||
regionNumber = smspec_node_get_R1(ertSumVarNode);
|
||||
regionNumber2 = smspec_node_get_R2(ertSumVarNode);
|
||||
|
||||
}
|
||||
break;
|
||||
case ECL_SMSPEC_SEGMENT_VAR:
|
||||
@ -400,7 +401,9 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode(const smspec_node_type * ertSu
|
||||
wellName,
|
||||
wellSegmentNumber,
|
||||
lgrName,
|
||||
cellI, cellJ, cellK,
|
||||
cellI,
|
||||
cellJ,
|
||||
cellK,
|
||||
aquiferNumber,
|
||||
isErrorResult);
|
||||
}
|
||||
@ -519,7 +522,8 @@ RifRestartFileInfo RifReaderEclipseSummary::getRestartFile(const QString& header
|
||||
QString path = QFileInfo(restartCase).dir().path();
|
||||
QString restartBase = QDir(restartCase).dirName();
|
||||
|
||||
char* smspec_header = ecl_util_alloc_exfilename(path.toStdString().data(), restartBase.toStdString().data(), ECL_SUMMARY_HEADER_FILE, false /*unformatted*/, 0);
|
||||
char* smspec_header = ecl_util_alloc_exfilename(
|
||||
path.toStdString().data(), restartBase.toStdString().data(), ECL_SUMMARY_HEADER_FILE, false /*unformatted*/, 0);
|
||||
QString restartFileName = RiaFilePathTools::toInternalSeparator(RiaStringEncodingTools::fromNativeEncoded(smspec_header));
|
||||
free(smspec_header);
|
||||
|
||||
@ -586,7 +590,6 @@ std::set<RifReaderEclipseSummary::ValuesCache*> RifReaderEclipseSummary::ValuesC
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifReaderEclipseSummary::ValuesCache::ValuesCache()
|
||||
{
|
||||
// Register instance
|
||||
m_instances.insert(this);
|
||||
}
|
||||
|
||||
@ -595,14 +598,14 @@ RifReaderEclipseSummary::ValuesCache::ValuesCache()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifReaderEclipseSummary::ValuesCache::~ValuesCache()
|
||||
{
|
||||
// Deregister instance
|
||||
m_instances.erase(this);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderEclipseSummary::ValuesCache::insertValues(const RifEclipseSummaryAddress& address, const std::vector<double>& values)
|
||||
void RifReaderEclipseSummary::ValuesCache::insertValues(const RifEclipseSummaryAddress& address,
|
||||
const std::vector<double>& values)
|
||||
{
|
||||
m_cachedValues[address] = values;
|
||||
m_purgeList.erase(address);
|
||||
@ -633,7 +636,8 @@ void RifReaderEclipseSummary::ValuesCache::markAddressForPurge(const RifEclipseS
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderEclipseSummary::ValuesCache::purge()
|
||||
{
|
||||
for (auto instance : m_instances) instance->purgeData();
|
||||
for (auto instance : m_instances)
|
||||
instance->purgeData();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -641,7 +645,7 @@ void RifReaderEclipseSummary::ValuesCache::purge()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderEclipseSummary::ValuesCache::purgeData()
|
||||
{
|
||||
for (const auto purgeAddr : m_purgeList)
|
||||
for (const auto& purgeAddr : m_purgeList)
|
||||
{
|
||||
m_cachedValues.erase(purgeAddr);
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ TEST(RifEclipseSummaryTest, BasicTestSetCurrentFolder)
|
||||
|
||||
bool hasWarning = false;
|
||||
std::vector<RifRestartFileInfo> originFileInfos = eclSummary.getRestartFiles(summaryFileName, &hasWarning);
|
||||
EXPECT_TRUE(originFileInfos.empty());
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user