mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added RigHugeValResultAccessor
Linux: Added include of cmath for define of HUGE_VAL
This commit is contained in:
parent
20d70d0565
commit
0941834da9
@ -17,3 +17,21 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigResultAccessor.h"
|
||||
|
||||
#include <cmath> // Needed for HUGE_VAL on Linux
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigHugeValResultAccessor::cellScalar(size_t gridLocalCellIndex) const
|
||||
{
|
||||
return HUGE_VAL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigHugeValResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const
|
||||
{
|
||||
return cellScalar(gridLocalCellIndex);
|
||||
}
|
||||
|
@ -35,3 +35,12 @@ public:
|
||||
virtual double cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const = 0;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RigHugeValResultAccessor : public RigResultAccessor
|
||||
{
|
||||
public:
|
||||
virtual double cellScalar(size_t gridLocalCellIndex) const;
|
||||
virtual double cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const;
|
||||
};
|
||||
|
@ -144,9 +144,10 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
|
||||
if (!grid) return NULL;
|
||||
|
||||
std::vector< std::vector<double> >& scalarSetResults = eclipseCase->results(porosityModel)->cellScalarResults(resultIndex);
|
||||
|
||||
if (timeStepIndex >= scalarSetResults.size())
|
||||
{
|
||||
return NULL;
|
||||
return new RigHugeValResultAccessor;
|
||||
}
|
||||
|
||||
std::vector<double>* resultValues = NULL;
|
||||
@ -155,6 +156,11 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
|
||||
resultValues = &(scalarSetResults[timeStepIndex]);
|
||||
}
|
||||
|
||||
if (!resultValues || resultValues->size() == 0)
|
||||
{
|
||||
return new RigHugeValResultAccessor;
|
||||
}
|
||||
|
||||
bool useGlobalActiveIndex = eclipseCase->results(porosityModel)->isUsingGlobalActiveIndex(resultIndex);
|
||||
if (useGlobalActiveIndex)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user