mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
riMULTXYZ: Added tolerances for CellEdge and Calculations
This commit is contained in:
parent
5377742bbc
commit
edd7a671d9
@ -150,7 +150,7 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(
|
||||
|
||||
double scalarValue = cellEdgeResultAccessor->cellFaceScalar(cellIndex, static_cast<cvf::StructGridInterface::FaceType>(cubeFaceIdx));
|
||||
|
||||
if (scalarValue != HUGE_VAL && scalarValue != ignoredScalarValue)
|
||||
if (!hideScalarValue(scalarValue, ignoredScalarValue, 1e-2))
|
||||
{
|
||||
edgeColor = edgeResultScalarMapper->mapToTextureCoord(scalarValue)[0];
|
||||
}
|
||||
@ -178,6 +178,10 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(
|
||||
geo->setVertexAttribute(new cvf::FloatVertexAttribute("a_colorNegK", cellEdgeColorTextureCoordsArrays.at(5)));
|
||||
}
|
||||
|
||||
bool RivCellEdgeGeometryUtils::hideScalarValue(double scalarValue, double scalarValueToHide, double tolerance)
|
||||
{
|
||||
return (scalarValue == HUGE_VAL || abs(scalarValue - scalarValueToHide) <= scalarValueToHide*tolerance);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -247,7 +251,7 @@ void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo(size_t tim
|
||||
|
||||
double scalarValue = cellEdgeResultAccessor->cellFaceScalar(cellIndex, static_cast<cvf::StructGridInterface::FaceType>(cubeFaceIdx));
|
||||
|
||||
if (scalarValue != HUGE_VAL && scalarValue != ignoredScalarValue)
|
||||
if (!hideScalarValue(scalarValue, ignoredScalarValue, 1e-2))
|
||||
{
|
||||
edgeColor = edgeResultScalarMapper->mapToTextureCoord(scalarValue)[0];
|
||||
}
|
||||
|
@ -67,4 +67,6 @@ private:
|
||||
size_t timeStepIndex,
|
||||
RigCaseData* eclipseCase,
|
||||
const RigGridBase* grid);
|
||||
|
||||
static bool hideScalarValue(double scalarValue, double scalarValueToHide, double tolerance);
|
||||
};
|
||||
|
@ -1104,15 +1104,16 @@ void RimReservoirCellResultsStorage::computeNncCombRiTrans()
|
||||
double riMult(double transResults, double riTransResults)
|
||||
{
|
||||
// To make 0.0 values give 1.0 in mult value
|
||||
// We might want a tolerance here.
|
||||
if (transResults == riTransResults)
|
||||
|
||||
if (riTransResults == 0.0)
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return transResults / riTransResults;
|
||||
if (abs (transResults) < 1e-12)
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
return transResults / riTransResults;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user