mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1487 - pre-proto - Adding class RigFractureGrid, which now holds RigStimPlanFracTemplateCells and functions for accessing these.
This commit is contained in:
59
ApplicationCode/ReservoirDataModel/RigFractureGrid.cpp
Normal file
59
ApplicationCode/ReservoirDataModel/RigFractureGrid.cpp
Normal file
@@ -0,0 +1,59 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 - Statoil ASA
|
||||
//
|
||||
// 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>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigFractureGrid.h"
|
||||
#include "RiaLogging.h"
|
||||
#include <QString>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFractureGrid::RigFractureGrid()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigFractureGrid::getGlobalIndexFromIJ(size_t i, size_t j) const
|
||||
{
|
||||
return i * m_jCount + j;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigStimPlanFracTemplateCell& RigFractureGrid::stimPlanCellFromIndex(size_t index) const
|
||||
{
|
||||
if (index < m_fractureCells.size())
|
||||
{
|
||||
const RigStimPlanFracTemplateCell& cell = m_fractureCells[index];
|
||||
return cell;
|
||||
}
|
||||
else
|
||||
{
|
||||
//TODO: Better error handling?
|
||||
RiaLogging::error(QString("Requesting non-existent StimPlanCell"));
|
||||
RiaLogging::error(QString("Returning cell 0, results will be invalid"));
|
||||
const RigStimPlanFracTemplateCell& cell = m_fractureCells[0];
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user