mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1292 Fixed CppCheck Issues in ReservoirDataModel
This commit is contained in:
parent
3a1991d37d
commit
0bccc883ff
@ -374,7 +374,6 @@ void RigAccWellFlowCalculator::calculateFlowPrPseudoLength(size_t branchIdx, dou
|
|||||||
|
|
||||||
RigSimulationWellCoordsAndMD mdCalculator(branchClPoints);
|
RigSimulationWellCoordsAndMD mdCalculator(branchClPoints);
|
||||||
|
|
||||||
size_t prevConnIndx = -1;
|
|
||||||
int clSegIdx = static_cast<int>(branchCells.size()) - 1;
|
int clSegIdx = static_cast<int>(branchCells.size()) - 1;
|
||||||
|
|
||||||
std::vector<double> accFlowPrTracer(m_tracerNames.size(), 0.0);
|
std::vector<double> accFlowPrTracer(m_tracerNames.size(), 0.0);
|
||||||
|
@ -203,6 +203,14 @@ bool RigActiveCellInfo::isCoarseningActive() const
|
|||||||
return m_reservoirCellResultCount != m_reservoirActiveCellCount;
|
return m_reservoirCellResultCount != m_reservoirActiveCellCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RigActiveCellInfo::GridActiveCellCounts::GridActiveCellCounts()
|
||||||
|
: m_activeCellCount(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -61,6 +61,8 @@ private:
|
|||||||
class GridActiveCellCounts
|
class GridActiveCellCounts
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
GridActiveCellCounts();
|
||||||
|
|
||||||
size_t activeCellCount() const;
|
size_t activeCellCount() const;
|
||||||
void setActiveCellCount(size_t activeCellCount);
|
void setActiveCellCount(size_t activeCellCount);
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class RigStatisticsDataCache;
|
|||||||
class RigCaseCellResultsData : public cvf::Object
|
class RigCaseCellResultsData : public cvf::Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigCaseCellResultsData(RigMainGrid* ownerGrid);
|
explicit RigCaseCellResultsData(RigMainGrid* ownerGrid);
|
||||||
|
|
||||||
void setMainGrid(RigMainGrid* ownerGrid);
|
void setMainGrid(RigMainGrid* ownerGrid);
|
||||||
void setActiveCellInfo(RigActiveCellInfo* activeCellInfo) { m_activeCellInfo = activeCellInfo;}
|
void setActiveCellInfo(RigActiveCellInfo* activeCellInfo) { m_activeCellInfo = activeCellInfo;}
|
||||||
|
@ -120,7 +120,7 @@ void RigCaseToCaseCellMapper::addMapping(int depCaseCellIdx, int masterCaseMatch
|
|||||||
m_masterCellIndexSeries.back().push_back(masterCaseMatchingCell);
|
m_masterCellIndexSeries.back().push_back(masterCaseMatchingCell);
|
||||||
m_masterCellOrIntervalIndex[depCaseCellIdx] = -newSeriesIdx;
|
m_masterCellOrIntervalIndex[depCaseCellIdx] = -newSeriesIdx;
|
||||||
}
|
}
|
||||||
else if (mcOrSeriesIdx < 0)
|
else
|
||||||
{
|
{
|
||||||
m_masterCellIndexSeries[-mcOrSeriesIdx].push_back(masterCaseMatchingCell);
|
m_masterCellIndexSeries[-mcOrSeriesIdx].push_back(masterCaseMatchingCell);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class RigGridBase;
|
|||||||
class RigCombMultResultAccessor : public RigResultAccessor
|
class RigCombMultResultAccessor : public RigResultAccessor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigCombMultResultAccessor(const RigGridBase* grid);
|
explicit RigCombMultResultAccessor(const RigGridBase* grid);
|
||||||
|
|
||||||
void setMultResultAccessors(
|
void setMultResultAccessors(
|
||||||
RigResultAccessor* multXPosAccessor,
|
RigResultAccessor* multXPosAccessor,
|
||||||
|
@ -32,7 +32,7 @@ class RigGridBase;
|
|||||||
class RigCombTransResultAccessor : public RigResultAccessor
|
class RigCombTransResultAccessor : public RigResultAccessor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigCombTransResultAccessor(const RigGridBase* grid);
|
explicit RigCombTransResultAccessor(const RigGridBase* grid);
|
||||||
|
|
||||||
void setTransResultAccessors(RigResultAccessor* xTransAccessor,
|
void setTransResultAccessors(RigResultAccessor* xTransAccessor,
|
||||||
RigResultAccessor* yTransAccessor,
|
RigResultAccessor* yTransAccessor,
|
||||||
|
@ -43,7 +43,7 @@ public:
|
|||||||
enum { NO_FAULT = -1, UNKNOWN_FAULT = -2 };
|
enum { NO_FAULT = -1, UNKNOWN_FAULT = -2 };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RigFaultsPrCellAccumulator(size_t reservoirCellCount)
|
explicit RigFaultsPrCellAccumulator(size_t reservoirCellCount)
|
||||||
{
|
{
|
||||||
const int initVals[6] = { NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT};
|
const int initVals[6] = { NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT};
|
||||||
caf::IntArray6 initVal;
|
caf::IntArray6 initVal;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
class RigFlowDiagResultFrames: public cvf::Object
|
class RigFlowDiagResultFrames: public cvf::Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigFlowDiagResultFrames(size_t frameCount);
|
explicit RigFlowDiagResultFrames(size_t frameCount);
|
||||||
virtual ~RigFlowDiagResultFrames();
|
virtual ~RigFlowDiagResultFrames();
|
||||||
|
|
||||||
const
|
const
|
||||||
|
@ -33,7 +33,7 @@ class RimFlowDiagSolution;
|
|||||||
class RigFlowDiagTimeStepResult
|
class RigFlowDiagTimeStepResult
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigFlowDiagTimeStepResult(size_t activeCellCount);
|
explicit RigFlowDiagTimeStepResult(size_t activeCellCount);
|
||||||
|
|
||||||
void setTracerTOF (const std::string& tracerName, const std::map<int, double>& cellValues);
|
void setTracerTOF (const std::string& tracerName, const std::map<int, double>& cellValues);
|
||||||
void setTracerFraction(const std::string& tracerName, const std::map<int, double>& cellValues);
|
void setTracerFraction(const std::string& tracerName, const std::map<int, double>& cellValues);
|
||||||
@ -55,7 +55,7 @@ class RigOpmFldStaticData;
|
|||||||
class RigFlowDiagSolverInterface : public cvf::Object
|
class RigFlowDiagSolverInterface : public cvf::Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigFlowDiagSolverInterface(RimEclipseResultCase * eclipseCase);
|
explicit RigFlowDiagSolverInterface(RimEclipseResultCase * eclipseCase);
|
||||||
virtual ~RigFlowDiagSolverInterface();
|
virtual ~RigFlowDiagSolverInterface();
|
||||||
|
|
||||||
RigFlowDiagTimeStepResult calculate(size_t timestep,
|
RigFlowDiagTimeStepResult calculate(size_t timestep,
|
||||||
|
@ -126,11 +126,8 @@ void RigGridBase::initSubCellsMainGridCellIndex()
|
|||||||
size_t cellIdx;
|
size_t cellIdx;
|
||||||
for (cellIdx = 0; cellIdx < grid->cellCount(); ++cellIdx)
|
for (cellIdx = 0; cellIdx < grid->cellCount(); ++cellIdx)
|
||||||
{
|
{
|
||||||
RigLocalGrid* localGrid = NULL;
|
RigLocalGrid* localGrid = static_cast<RigLocalGrid*>(grid);
|
||||||
RigGridBase* parentGrid = NULL;
|
RigGridBase* parentGrid = localGrid->parentGrid();
|
||||||
|
|
||||||
localGrid = static_cast<RigLocalGrid*>(grid);
|
|
||||||
parentGrid = localGrid->parentGrid();
|
|
||||||
|
|
||||||
RigCell& cell = localGrid->cell(cellIdx);
|
RigCell& cell = localGrid->cell(cellIdx);
|
||||||
size_t parentCellIndex = cell.parentCellIndex();
|
size_t parentCellIndex = cell.parentCellIndex();
|
||||||
|
@ -43,7 +43,7 @@ class RigActiveCellInfo;
|
|||||||
class RigGridBase : public cvf::StructGridInterface
|
class RigGridBase : public cvf::StructGridInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigGridBase(RigMainGrid* mainGrid);
|
explicit RigGridBase(RigMainGrid* mainGrid);
|
||||||
virtual ~RigGridBase(void);
|
virtual ~RigGridBase(void);
|
||||||
|
|
||||||
void setGridPointDimensions(const cvf::Vec3st& gridDimensions) { m_gridPointDimensions = gridDimensions;}
|
void setGridPointDimensions(const cvf::Vec3st& gridDimensions) { m_gridPointDimensions = gridDimensions;}
|
||||||
@ -125,7 +125,7 @@ private:
|
|||||||
class RigGridCellFaceVisibilityFilter : public cvf::CellFaceVisibilityFilter
|
class RigGridCellFaceVisibilityFilter : public cvf::CellFaceVisibilityFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigGridCellFaceVisibilityFilter(const RigGridBase* grid)
|
explicit RigGridCellFaceVisibilityFilter(const RigGridBase* grid)
|
||||||
: m_grid(grid)
|
: m_grid(grid)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class SingleLasFileMetaData;
|
|||||||
class RigLasFileExporter
|
class RigLasFileExporter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigLasFileExporter(const std::vector<RimWellLogCurve*>& curves);
|
explicit RigLasFileExporter(const std::vector<RimWellLogCurve*>& curves);
|
||||||
|
|
||||||
void setResamplingInterval(double interval);
|
void setResamplingInterval(double interval);
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
class RigLocalGrid : public RigGridBase
|
class RigLocalGrid : public RigGridBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigLocalGrid(RigMainGrid* mainGrid);
|
explicit RigLocalGrid(RigMainGrid* mainGrid);
|
||||||
virtual ~RigLocalGrid();
|
virtual ~RigLocalGrid();
|
||||||
|
|
||||||
RigGridBase * parentGrid() const { return m_parentGrid; }
|
RigGridBase * parentGrid() const { return m_parentGrid; }
|
||||||
|
@ -45,11 +45,12 @@ void RigNNCData::processConnections(const RigMainGrid& mainGrid)
|
|||||||
|
|
||||||
// Try to find the shared face
|
// Try to find the shared face
|
||||||
|
|
||||||
char hasNeighbourInAnyDirection = 0;
|
|
||||||
bool isPossibleNeighborInDirection[6]= {true, true, true, true, true, true};
|
bool isPossibleNeighborInDirection[6]= {true, true, true, true, true, true};
|
||||||
|
|
||||||
if (c1.hostGrid() == c2.hostGrid())
|
if (c1.hostGrid() == c2.hostGrid())
|
||||||
{
|
{
|
||||||
|
char hasNeighbourInAnyDirection = 0;
|
||||||
|
|
||||||
size_t i1, j1, k1;
|
size_t i1, j1, k1;
|
||||||
c1.hostGrid()->ijkFromCellIndex(c1.gridLocalCellIndex(), &i1, &j1, &k1);
|
c1.hostGrid()->ijkFromCellIndex(c1.gridLocalCellIndex(), &i1, &j1, &k1);
|
||||||
size_t i2, j2, k2;
|
size_t i2, j2, k2;
|
||||||
|
@ -437,15 +437,14 @@ void RigReservoirBuilderMock::addWellData(RigEclipseCaseData* eclipseCase, RigGr
|
|||||||
|
|
||||||
RigWellResultPoint deadEndData1 = data;
|
RigWellResultPoint deadEndData1 = data;
|
||||||
deadEndData1.m_gridCellIndex = data.m_gridCellIndex + 2;
|
deadEndData1.m_gridCellIndex = data.m_gridCellIndex + 2;
|
||||||
deadEndData.m_isOpen = false;
|
deadEndData1.m_isOpen = false;
|
||||||
|
|
||||||
wellSegment.m_branchResultPoints.push_back(deadEndData);
|
wellSegment.m_branchResultPoints.push_back(deadEndData);
|
||||||
wellSegment.m_branchResultPoints.push_back(deadEndData1);
|
wellSegment.m_branchResultPoints.push_back(deadEndData1);
|
||||||
|
|
||||||
deadEndData.m_isOpen = true;
|
wellSegment.m_branchResultPoints.push_back(deadEndData);
|
||||||
wellSegment.m_branchResultPoints.push_back(deadEndData);
|
|
||||||
|
|
||||||
data.m_isOpen = true;
|
data.m_isOpen = true;
|
||||||
wellSegment.m_branchResultPoints.push_back(data);
|
wellSegment.m_branchResultPoints.push_back(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,9 +211,7 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellF
|
|||||||
|
|
||||||
cvf::Vec3d outOfPrevCell(centerPreviousCell);
|
cvf::Vec3d outOfPrevCell(centerPreviousCell);
|
||||||
|
|
||||||
int intersectionOk = prevCell.firstIntersectionPoint(rayToThisCell, &outOfPrevCell);
|
prevCell.firstIntersectionPoint(rayToThisCell, &outOfPrevCell);
|
||||||
//CVF_ASSERT(intersectionOk);
|
|
||||||
//CVF_ASSERT(intersectionOk);
|
|
||||||
if ((currentPoint - outOfPrevCell).lengthSquared() > 1e-3)
|
if ((currentPoint - outOfPrevCell).lengthSquared() > 1e-3)
|
||||||
{
|
{
|
||||||
branchCLCoords.push_back(outOfPrevCell);
|
branchCLCoords.push_back(outOfPrevCell);
|
||||||
@ -309,9 +307,7 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellF
|
|||||||
cvf::Vec3d outOfPrevCell(centerPreviousCell);
|
cvf::Vec3d outOfPrevCell(centerPreviousCell);
|
||||||
|
|
||||||
const RigCell& prevCell = eclipseCaseData->cellFromWellResultCell(*prevWellResPoint);
|
const RigCell& prevCell = eclipseCaseData->cellFromWellResultCell(*prevWellResPoint);
|
||||||
bool intersectionOk = prevCell.firstIntersectionPoint(rayToThisCell, &outOfPrevCell);
|
prevCell.firstIntersectionPoint(rayToThisCell, &outOfPrevCell);
|
||||||
//CVF_ASSERT(intersectionOk);
|
|
||||||
//CVF_ASSERT(intersectionOk);
|
|
||||||
if ((intoThisCell - outOfPrevCell).lengthSquared() > 1e-3)
|
if ((intoThisCell - outOfPrevCell).lengthSquared() > 1e-3)
|
||||||
{
|
{
|
||||||
branchCLCoords.push_back(outOfPrevCell);
|
branchCLCoords.push_back(outOfPrevCell);
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
class RigSimulationWellCoordsAndMD
|
class RigSimulationWellCoordsAndMD
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigSimulationWellCoordsAndMD(const std::vector<cvf::Vec3d>& wellPathPoints);
|
explicit RigSimulationWellCoordsAndMD(const std::vector<cvf::Vec3d>& wellPathPoints);
|
||||||
|
|
||||||
const std::vector<cvf::Vec3d>& wellPathPoints() const;
|
const std::vector<cvf::Vec3d>& wellPathPoints() const;
|
||||||
const std::vector<double>& measuredDepths() const;
|
const std::vector<double>& measuredDepths() const;
|
||||||
|
@ -27,7 +27,7 @@ class RifReaderEclipseSummary;
|
|||||||
class RigSummaryCaseData: public cvf::Object
|
class RigSummaryCaseData: public cvf::Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigSummaryCaseData(const QString& summaryHeaderFileName );
|
explicit RigSummaryCaseData(const QString& summaryHeaderFileName );
|
||||||
~RigSummaryCaseData();
|
~RigSummaryCaseData();
|
||||||
|
|
||||||
|
|
||||||
|
@ -186,14 +186,13 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(d
|
|||||||
bool isTvDepthsAvailable = false;
|
bool isTvDepthsAvailable = false;
|
||||||
std::vector<double> tvDepths;
|
std::vector<double> tvDepths;
|
||||||
|
|
||||||
size_t segmentStartIdx = 0;
|
|
||||||
|
|
||||||
if (m_tvDepths.size() > 0) isTvDepthsAvailable = true;
|
if (m_tvDepths.size() > 0) isTvDepthsAvailable = true;
|
||||||
|
|
||||||
if(m_measuredDepths.size() > 0)
|
if(m_measuredDepths.size() > 0)
|
||||||
{
|
{
|
||||||
double currentMd = m_measuredDepths[0];
|
double currentMd = m_measuredDepths[0];
|
||||||
|
|
||||||
|
size_t segmentStartIdx = 0;
|
||||||
while(segmentStartIdx < m_measuredDepths.size() - 1)
|
while(segmentStartIdx < m_measuredDepths.size() - 1)
|
||||||
{
|
{
|
||||||
double segmentStartMd = m_measuredDepths[segmentStartIdx];
|
double segmentStartMd = m_measuredDepths[segmentStartIdx];
|
||||||
|
@ -245,14 +245,12 @@ bool GeometryTools::calculateOverlapPolygonOfTwoQuads(std::vector<IndexType> * p
|
|||||||
|
|
||||||
for (cv1Idx = 0 ; cv1Idx < 4 ; ++cv1Idx)
|
for (cv1Idx = 0 ; cv1Idx < 4 ; ++cv1Idx)
|
||||||
{
|
{
|
||||||
bool found = false;
|
|
||||||
for (cv2Idx = 0; cv2Idx < 4; ++cv2Idx)
|
for (cv2Idx = 0; cv2Idx < 4; ++cv2Idx)
|
||||||
{
|
{
|
||||||
if (cv1CubeFaceIndices[cv1Idx] == cv2CubeFaceIndices[cv2Idx])
|
if (cv1CubeFaceIndices[cv1Idx] == cv2CubeFaceIndices[cv2Idx])
|
||||||
{
|
{
|
||||||
cv1VxTouchCv2[cv1Idx] = true;
|
cv1VxTouchCv2[cv1Idx] = true;
|
||||||
cv2VxTouchCv1[cv2Idx] = true;
|
cv2VxTouchCv1[cv2Idx] = true;
|
||||||
found = true;
|
|
||||||
++numMatchedNodes;
|
++numMatchedNodes;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
class RigStatisticsDataCache : public cvf::Object
|
class RigStatisticsDataCache : public cvf::Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigStatisticsDataCache(RigStatisticsCalculator* statisticsCalculator);
|
explicit RigStatisticsDataCache(RigStatisticsCalculator* statisticsCalculator);
|
||||||
|
|
||||||
void clearAllStatistics();
|
void clearAllStatistics();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user