mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added RigCellFaceResultAccessObject
This commit is contained in:
parent
cb8edaffde
commit
1d3ba4637d
@ -14,6 +14,7 @@ ${CEE_CURRENT_LIST_DIR}RigResultAccessObject.h
|
||||
${CEE_CURRENT_LIST_DIR}RigResultAccessObjectFactory.h
|
||||
${CEE_CURRENT_LIST_DIR}RigAllGridCellsResultAccessObject.h
|
||||
${CEE_CURRENT_LIST_DIR}RigActiveCellsResultAccessObject.h
|
||||
${CEE_CURRENT_LIST_DIR}RigCellFaceResultAccessObject.h
|
||||
${CEE_CURRENT_LIST_DIR}RigLocalGrid.h
|
||||
${CEE_CURRENT_LIST_DIR}RigMainGrid.h
|
||||
${CEE_CURRENT_LIST_DIR}RigReservoirBuilderMock.h
|
||||
@ -37,6 +38,7 @@ ${CEE_CURRENT_LIST_DIR}RigResultAccessObject.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigResultAccessObjectFactory.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigAllGridCellsResultAccessObject.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigActiveCellsResultAccessObject.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigCellFaceResultAccessObject.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigLocalGrid.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigMainGrid.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigReservoirBuilderMock.cpp
|
||||
|
@ -44,40 +44,3 @@ private:
|
||||
QString m_resultName;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
|
||||
class CellFaceScalarDataAccess : public Object
|
||||
{
|
||||
public:
|
||||
virtual double cellFaceScalar(size_t cellIndex, cvf::StructGridInterface faceId) const = 0;
|
||||
};
|
||||
|
||||
class PlainCellFaceScalarDataAccess : public CellFaceScalarDataAccess
|
||||
{
|
||||
public:
|
||||
PlainCellFaceScalarDataAccess()
|
||||
{
|
||||
cellEdgeDataAccessObjects.resize(6);
|
||||
}
|
||||
|
||||
void setDataAccessObjectForFace(cvf::StructGridInterface faceId, cvf::StructGridScalarDataAccess* dataAccessObject)
|
||||
{
|
||||
cellEdgeDataAccessObjects[faceId] = dataAccessObject;
|
||||
}
|
||||
|
||||
virtual double cellFaceScalar( size_t cellIndex, cvf::StructGridInterface faceId ) const
|
||||
{
|
||||
cvf::StructGridScalarDataAccess* dataAccessObj = cellEdgeDataAccessObjects[faceId];
|
||||
if (dataAccessObj != NULL)
|
||||
{
|
||||
return dataAccessObj->cellScalar(cellIndex);
|
||||
}
|
||||
|
||||
return HUGE_VAL;
|
||||
}
|
||||
private:
|
||||
cvf::Collection<cvf::StructGridScalarDataAccess> cellEdgeDataAccessObjects;
|
||||
};
|
||||
|
||||
*/
|
||||
|
@ -43,39 +43,3 @@ private:
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
|
||||
class CellFaceScalarDataAccess : public Object
|
||||
{
|
||||
public:
|
||||
virtual double cellFaceScalar(size_t cellIndex, cvf::StructGridInterface faceId) const = 0;
|
||||
};
|
||||
|
||||
class PlainCellFaceScalarDataAccess : public CellFaceScalarDataAccess
|
||||
{
|
||||
public:
|
||||
PlainCellFaceScalarDataAccess()
|
||||
{
|
||||
cellEdgeDataAccessObjects.resize(6);
|
||||
}
|
||||
|
||||
void setDataAccessObjectForFace(cvf::StructGridInterface faceId, cvf::StructGridScalarDataAccess* dataAccessObject)
|
||||
{
|
||||
cellEdgeDataAccessObjects[faceId] = dataAccessObject;
|
||||
}
|
||||
|
||||
virtual double cellFaceScalar( size_t cellIndex, cvf::StructGridInterface faceId ) const
|
||||
{
|
||||
cvf::StructGridScalarDataAccess* dataAccessObj = cellEdgeDataAccessObjects[faceId];
|
||||
if (dataAccessObj != NULL)
|
||||
{
|
||||
return dataAccessObj->cellScalar(cellIndex);
|
||||
}
|
||||
|
||||
return HUGE_VAL;
|
||||
}
|
||||
private:
|
||||
cvf::Collection<cvf::StructGridScalarDataAccess> cellEdgeDataAccessObjects;
|
||||
};
|
||||
|
||||
*/
|
||||
|
@ -496,7 +496,7 @@ cvf::ref<cvf::StructGridScalarDataAccess> RigCaseData::dataAccessObject(const Ri
|
||||
if (timeStepIndex != cvf::UNDEFINED_SIZE_T &&
|
||||
scalarSetIndex != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccess = RigResultAccessObjectFactory::createNativeDataAccessObject(this, grid->gridIndex(), porosityModel, timeStepIndex, scalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccess = RigResultAccessObjectFactory::TO_BE_DELETED_createNativeDataAccessObject(this, grid->gridIndex(), porosityModel, timeStepIndex, scalarSetIndex);
|
||||
return dataAccess;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,82 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA, Ceetron Solutions 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>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigCellFaceResultAccessObject.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigCellFaceResultAccessObject::RigCellFaceResultAccessObject(const QString& resultName)
|
||||
: m_resultName(resultName)
|
||||
{
|
||||
m_resultAccessObjects.resize(6);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCellFaceResultAccessObject::setDataAccessObjectForFace(cvf::StructGridInterface::FaceType faceId, RigResultAccessObject* resultAccessObject)
|
||||
{
|
||||
m_resultAccessObjects[faceId] = resultAccessObject;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigCellFaceResultAccessObject::cellScalar(size_t localCellIndex) const
|
||||
{
|
||||
|
||||
// TODO: How to handle when we get here?
|
||||
CVF_ASSERT(false);
|
||||
|
||||
return cvf::UNDEFINED_DOUBLE;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigCellFaceResultAccessObject::cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const
|
||||
{
|
||||
const RigResultAccessObject* resultAccessObj = m_resultAccessObjects.at(faceId);
|
||||
if (resultAccessObj != NULL)
|
||||
{
|
||||
return resultAccessObj->cellFaceScalar(localCellIndex, faceId);
|
||||
}
|
||||
|
||||
return HUGE_VAL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RigCellFaceResultAccessObject::resultName() const
|
||||
{
|
||||
return m_resultName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCellFaceResultAccessObject::setCellScalar(size_t localCellIndex, double scalarValue)
|
||||
{
|
||||
// TODO: How to handle when we get here?
|
||||
CVF_ASSERT(false);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,45 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA, Ceetron Solutions 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>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RigResultAccessObject.h"
|
||||
|
||||
#include "cvfCollection.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RigCellFaceResultAccessObject : public RigResultAccessObject
|
||||
{
|
||||
public:
|
||||
RigCellFaceResultAccessObject(const QString& resultName);
|
||||
|
||||
void setDataAccessObjectForFace(cvf::StructGridInterface::FaceType faceId, RigResultAccessObject* resultAccessObject);
|
||||
|
||||
virtual double cellScalar(size_t localCellIndex) const;
|
||||
virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const;
|
||||
virtual QString resultName() const;
|
||||
virtual void setCellScalar(size_t localCellIndex, double scalarValue);
|
||||
|
||||
private:
|
||||
cvf::Collection<RigResultAccessObject> m_resultAccessObjects;
|
||||
|
||||
QString m_resultName;
|
||||
};
|
@ -39,40 +39,3 @@ public:
|
||||
virtual void setCellScalar(size_t localCellIndex, double scalarValue) = 0;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
|
||||
class CellFaceScalarDataAccess : public Object
|
||||
{
|
||||
public:
|
||||
virtual double cellFaceScalar(size_t cellIndex, cvf::StructGridInterface faceId) const = 0;
|
||||
};
|
||||
|
||||
class PlainCellFaceScalarDataAccess : public CellFaceScalarDataAccess
|
||||
{
|
||||
public:
|
||||
PlainCellFaceScalarDataAccess()
|
||||
{
|
||||
cellEdgeDataAccessObjects.resize(6);
|
||||
}
|
||||
|
||||
void setDataAccessObjectForFace(cvf::StructGridInterface faceId, cvf::StructGridScalarDataAccess* dataAccessObject)
|
||||
{
|
||||
cellEdgeDataAccessObjects[faceId] = dataAccessObject;
|
||||
}
|
||||
|
||||
virtual double cellFaceScalar( size_t cellIndex, cvf::StructGridInterface faceId ) const
|
||||
{
|
||||
cvf::StructGridScalarDataAccess* dataAccessObj = cellEdgeDataAccessObjects[faceId];
|
||||
if (dataAccessObj != NULL)
|
||||
{
|
||||
return dataAccessObj->cellScalar(cellIndex);
|
||||
}
|
||||
|
||||
return HUGE_VAL;
|
||||
}
|
||||
private:
|
||||
cvf::Collection<cvf::StructGridScalarDataAccess> cellEdgeDataAccessObjects;
|
||||
};
|
||||
|
||||
*/
|
||||
|
@ -146,7 +146,7 @@ public:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> RigResultAccessObjectFactory::createNativeDataAccessObject(RigCaseData* eclipseCase,
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> RigResultAccessObjectFactory::TO_BE_DELETED_createNativeDataAccessObject(RigCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
|
@ -28,8 +28,16 @@ class RigGridBase;
|
||||
class RigResultAccessObjectFactory
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// TO BE DELETED
|
||||
static cvf::ref<cvf::StructGridScalarDataAccess>
|
||||
createNativeDataAccessObject(RigCaseData* eclipseCase,
|
||||
TO_BE_DELETED_createNativeDataAccessObject(RigCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
|
Loading…
Reference in New Issue
Block a user