Whitespace

This commit is contained in:
Magne Sjaastad 2019-04-04 11:27:47 +02:00
parent dd5756ae73
commit 733be4f539

View File

@ -3,17 +3,17 @@
// Copyright (C) 2011- Statoil ASA
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
//
// ResInsight 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.
//
//
// ResInsight 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@ -41,17 +41,17 @@
#include <QDebug>
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RigEclipseCaseData::RigEclipseCaseData(RimEclipseCase* ownerCase)
{
m_mainGrid = new RigMainGrid();
m_mainGrid = new RigMainGrid();
m_ownerCase = ownerCase;
m_matrixModelResults = new RigCaseCellResultsData(this, RiaDefines::MATRIX_MODEL);
m_matrixModelResults = new RigCaseCellResultsData(this, RiaDefines::MATRIX_MODEL);
m_fractureModelResults = new RigCaseCellResultsData(this, RiaDefines::FRACTURE_MODEL);
m_activeCellInfo = new RigActiveCellInfo;
m_activeCellInfo = new RigActiveCellInfo;
m_fractureActiveCellInfo = new RigActiveCellInfo;
m_matrixModelResults->setActiveCellInfo(m_activeCellInfo.p());
@ -61,15 +61,12 @@ RigEclipseCaseData::RigEclipseCaseData(RimEclipseCase* ownerCase)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RigEclipseCaseData::~RigEclipseCaseData()
{
}
RigEclipseCaseData::~RigEclipseCaseData() {}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RigMainGrid* RigEclipseCaseData::mainGrid()
{
@ -77,7 +74,7 @@ RigMainGrid* RigEclipseCaseData::mainGrid()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
const RigMainGrid* RigEclipseCaseData::mainGrid() const
{
@ -85,7 +82,7 @@ const RigMainGrid* RigEclipseCaseData::mainGrid() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RigEclipseCaseData::setMainGrid(RigMainGrid* mainGrid)
{
@ -96,7 +93,7 @@ void RigEclipseCaseData::setMainGrid(RigMainGrid* mainGrid)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RigEclipseCaseData::allGrids(std::vector<RigGridBase*>* grids)
{
@ -115,7 +112,7 @@ void RigEclipseCaseData::allGrids(std::vector<RigGridBase*>* grids)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RigEclipseCaseData::allGrids(std::vector<const RigGridBase*>* grids) const
{
@ -142,18 +139,17 @@ const RigGridBase* RigEclipseCaseData::grid(size_t index) const
return m_mainGrid->gridByIndex(index);
}
//--------------------------------------------------------------------------------------------------
/// Get grid by index. The main grid has index 0, so the first lgr has index 1
//--------------------------------------------------------------------------------------------------
RigGridBase* RigEclipseCaseData::grid(size_t index)
RigGridBase* RigEclipseCaseData::grid(size_t index)
{
CVF_ASSERT(m_mainGrid.notNull());
return m_mainGrid->gridByIndex(index);
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
const RigGridBase* RigEclipseCaseData::grid(const QString& gridName) const
{
@ -177,7 +173,7 @@ const RigGridBase* RigEclipseCaseData::grid(const QString& gridName) const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
size_t RigEclipseCaseData::gridCount() const
{
@ -185,35 +181,34 @@ size_t RigEclipseCaseData::gridCount() const
return m_mainGrid->gridCount();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RigEclipseCaseData::computeWellCellsPrGrid()
{
// If we have computed this already, return
if (m_wellCellsInGrid.size()) return;
if (m_wellCellsInGrid.size()) return;
std::vector<RigGridBase*> grids;
this->allGrids(&grids);
// Debug code used to display grid names and grid sizes
/*
size_t totCellCount = 0;
for (auto g : grids)
{
qDebug() << g->gridName().data();
qDebug() << g->cellCountI() << " " << g->cellCountJ() << " " << g->cellCountK() << " ";
/*
size_t totCellCount = 0;
for (auto g : grids)
{
qDebug() << g->gridName().data();
qDebug() << g->cellCountI() << " " << g->cellCountJ() << " " << g->cellCountK() << " ";
size_t cellCount = g->cellCount();
totCellCount += cellCount;
qDebug() << cellCount;
size_t cellCount = g->cellCount();
totCellCount += cellCount;
qDebug() << cellCount;
qDebug() << "\n";
}
qDebug() << "\n";
}
qDebug() << "\nTotal cell count " << totCellCount;
*/
qDebug() << "\nTotal cell count " << totCellCount;
*/
size_t gIdx;
@ -243,7 +238,7 @@ void RigEclipseCaseData::computeWellCellsPrGrid()
size_t tIdx;
for (tIdx = 0; tIdx < m_simWellData[wIdx]->m_wellCellsTimeSteps.size(); ++tIdx)
{
RigWellResultFrame& wellCells = m_simWellData[wIdx]->m_wellCellsTimeSteps[tIdx];
RigWellResultFrame& wellCells = m_simWellData[wIdx]->m_wellCellsTimeSteps[tIdx];
// Well result branches
for (size_t sIdx = 0; sIdx < wellCells.m_wellResultBranches.size(); ++sIdx)
@ -256,7 +251,7 @@ void RigEclipseCaseData::computeWellCellsPrGrid()
size_t gridIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridIndex;
size_t gridCellIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridCellIndex;
if(gridIndex < m_wellCellsInGrid.size() && gridCellIndex < m_wellCellsInGrid[gridIndex]->size())
if (gridIndex < m_wellCellsInGrid.size() && gridCellIndex < m_wellCellsInGrid[gridIndex]->size())
{
// NOTE : We do not check if the grid cell is active as we do for well head.
// If we add test for active cell, thorough testing and verification of the new behaviour must be adressed
@ -271,7 +266,7 @@ void RigEclipseCaseData::computeWellCellsPrGrid()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RigEclipseCaseData::setSimWellData(const cvf::Collection<RigSimWellData>& data)
{
@ -282,9 +277,8 @@ void RigEclipseCaseData::setSimWellData(const cvf::Collection<RigSimWellData>& d
computeWellCellsPrGrid();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
std::set<QString> RigEclipseCaseData::findSortedWellNames() const
{
@ -301,7 +295,7 @@ std::set<QString> RigEclipseCaseData::findSortedWellNames() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
const RigSimWellData* RigEclipseCaseData::findSimWellData(QString wellName) const
{
@ -317,7 +311,7 @@ const RigSimWellData* RigEclipseCaseData::findSimWellData(QString wellName) cons
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
const cvf::UByteArray* RigEclipseCaseData::wellCellsInGrid(size_t gridIndex)
{
@ -327,9 +321,8 @@ const cvf::UByteArray* RigEclipseCaseData::wellCellsInGrid(size_t gridIndex)
return m_wellCellsInGrid[gridIndex].p();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
const cvf::UIntArray* RigEclipseCaseData::gridCellToResultWellIndex(size_t gridIndex)
{
@ -340,7 +333,7 @@ const cvf::UIntArray* RigEclipseCaseData::gridCellToResultWellIndex(size_t gridI
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
const RigCell& RigEclipseCaseData::cellFromWellResultCell(const RigWellResultPoint& wellResultCell) const
{
@ -356,16 +349,16 @@ const RigCell& RigEclipseCaseData::cellFromWellResultCell(const RigWellResultPoi
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RigEclipseCaseData::findSharedSourceFace(cvf::StructGridInterface::FaceType& sharedSourceFace,
const RigWellResultPoint& sourceWellCellResult,
const RigWellResultPoint& otherWellCellResult) const
bool RigEclipseCaseData::findSharedSourceFace(cvf::StructGridInterface::FaceType& sharedSourceFace,
const RigWellResultPoint& sourceWellCellResult,
const RigWellResultPoint& otherWellCellResult) const
{
size_t gridIndex = sourceWellCellResult.m_gridIndex;
size_t gridIndex = sourceWellCellResult.m_gridIndex;
size_t gridCellIndex = sourceWellCellResult.m_gridCellIndex;
size_t otherGridIndex = otherWellCellResult.m_gridIndex;
size_t otherGridIndex = otherWellCellResult.m_gridIndex;
size_t otherGridCellIndex = otherWellCellResult.m_gridCellIndex;
if (gridIndex != otherGridIndex) return false;
@ -374,7 +367,7 @@ bool RigEclipseCaseData::findSharedSourceFace(cvf::StructGridInterface::FaceType
allGrids(&grids);
const RigGridBase* grid = grids[gridIndex];
size_t i, j, k;
size_t i, j, k;
grid->ijkFromCellIndex(gridCellIndex, &i, &j, &k);
size_t faceIdx;
@ -387,7 +380,6 @@ bool RigEclipseCaseData::findSharedSourceFace(cvf::StructGridInterface::FaceType
if (grid->isCellValid(ni, nj, nk))
{
size_t neighborCellIndex = grid->cellIndexFromIJK(ni, nj, nk);
if (neighborCellIndex == otherGridCellIndex)
@ -401,8 +393,6 @@ bool RigEclipseCaseData::findSharedSourceFace(cvf::StructGridInterface::FaceType
return false;
}
//--------------------------------------------------------------------------------------------------
/// Helper class used to find min/max range for valid and active cells
//--------------------------------------------------------------------------------------------------
@ -410,10 +400,9 @@ class CellRangeBB
{
public:
CellRangeBB()
: m_min(cvf::UNDEFINED_SIZE_T, cvf::UNDEFINED_SIZE_T, cvf::UNDEFINED_SIZE_T),
m_max(cvf::Vec3st::ZERO)
: m_min(cvf::UNDEFINED_SIZE_T, cvf::UNDEFINED_SIZE_T, cvf::UNDEFINED_SIZE_T)
, m_max(cvf::Vec3st::ZERO)
{
}
void add(size_t i, size_t j, size_t k)
@ -432,9 +421,8 @@ public:
cvf::Vec3st m_max;
};
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RigEclipseCaseData::computeActiveCellIJKBBox()
{
@ -465,7 +453,7 @@ void RigEclipseCaseData::computeActiveCellIJKBBox()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RigEclipseCaseData::computeActiveCellBoundingBoxes()
{
@ -474,7 +462,7 @@ void RigEclipseCaseData::computeActiveCellBoundingBoxes()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
std::vector<QString> RigEclipseCaseData::simulationWellNames() const
{
@ -487,7 +475,7 @@ std::vector<QString> RigEclipseCaseData::simulationWellNames() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RigEclipseCaseData::hasSimulationWell(const QString& simWellName) const
{
@ -546,15 +534,16 @@ std::vector<const RigWellPath*> RigEclipseCaseData::simulationWellBranches(const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RigEclipseCaseData::setVirtualPerforationTransmissibilities(RigVirtualPerforationTransmissibilities* virtualPerforationTransmissibilities)
void RigEclipseCaseData::setVirtualPerforationTransmissibilities(
RigVirtualPerforationTransmissibilities* virtualPerforationTransmissibilities)
{
m_virtualPerforationTransmissibilities = virtualPerforationTransmissibilities;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
const RigVirtualPerforationTransmissibilities* RigEclipseCaseData::virtualPerforationTransmissibilities() const
{
@ -562,7 +551,7 @@ const RigVirtualPerforationTransmissibilities* RigEclipseCaseData::virtualPerfor
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
std::vector<RigEquil> RigEclipseCaseData::equilData() const
{
@ -570,7 +559,7 @@ std::vector<RigEquil> RigEclipseCaseData::equilData() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RigEclipseCaseData::setEquilData(const std::vector<RigEquil>& equilObjects)
{
@ -578,7 +567,7 @@ void RigEclipseCaseData::setEquilData(const std::vector<RigEquil>& equilObjects)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelType porosityModel)
{
@ -591,7 +580,7 @@ RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelT
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelType porosityModel) const
{
@ -604,7 +593,7 @@ const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::Porosity
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RigEclipseCaseData::setActiveCellInfo(RiaDefines::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo)
{
@ -620,14 +609,12 @@ void RigEclipseCaseData::setActiveCellInfo(RiaDefines::PorosityModelType porosit
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RigEclipseCaseData::hasFractureResults() const
{
if (activeCellInfo(RiaDefines::FRACTURE_MODEL)
&& activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount() > 0)
if (activeCellInfo(RiaDefines::FRACTURE_MODEL) && activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount() > 0)
{
return true;
}
@ -636,7 +623,7 @@ bool RigEclipseCaseData::hasFractureResults() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RigEclipseCaseData::computeActiveCellsGeometryBoundingBox()
{
@ -696,7 +683,7 @@ void RigEclipseCaseData::setActiveFormationNames(RigFormationNames* activeFormat
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RigEclipseCaseData::setActiveFormationNamesAndUpdatePlots(RigFormationNames* activeFormationNames)
{
@ -713,7 +700,7 @@ void RigEclipseCaseData::setActiveFormationNamesAndUpdatePlots(RigFormationNames
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RigFormationNames* RigEclipseCaseData::activeFormationNames()
{
@ -721,7 +708,7 @@ RigFormationNames* RigEclipseCaseData::activeFormationNames()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelType porosityModel)
{
@ -734,7 +721,7 @@ RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelTyp
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
const RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelType porosityModel) const
{
@ -747,12 +734,12 @@ const RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityMo
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
const std::vector<double>* RigEclipseCaseData::resultValues(RiaDefines::PorosityModelType porosityModel,
RiaDefines::ResultCatType type,
const QString& resultName,
size_t timeStepIndex)
RiaDefines::ResultCatType type,
const QString& resultName,
size_t timeStepIndex)
{
RigCaseCellResultsData* gridCellResults = this->results(porosityModel);
@ -765,17 +752,3 @@ const std::vector<double>* RigEclipseCaseData::resultValues(RiaDefines::Porosity
return swatResults;
}
/*
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigCaseData::closeReaderInterface()
{
RifReaderInterface* readerInterface = m_matrixModelResults->readerInterface();
if (readerInterface)
{
readerInterface->close();
}
}
*/