mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2315. Replaced abs() by fabs() where relevant
This commit is contained in:
parent
0f30433286
commit
4cdc109ec3
@ -1045,9 +1045,9 @@ CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(R
|
|||||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ");
|
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ");
|
||||||
cvf::ref<RigResultAccessor> dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ");
|
cvf::ref<RigResultAccessor> dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ");
|
||||||
|
|
||||||
double xLengthFraction = abs(lengthsInCell.x() / dxAccessObject->cellScalarGlobIdx(cellIndex));
|
double xLengthFraction = fabs(lengthsInCell.x() / dxAccessObject->cellScalarGlobIdx(cellIndex));
|
||||||
double yLengthFraction = abs(lengthsInCell.y() / dyAccessObject->cellScalarGlobIdx(cellIndex));
|
double yLengthFraction = fabs(lengthsInCell.y() / dyAccessObject->cellScalarGlobIdx(cellIndex));
|
||||||
double zLengthFraction = abs(lengthsInCell.z() / dzAccessObject->cellScalarGlobIdx(cellIndex));
|
double zLengthFraction = fabs(lengthsInCell.z() / dzAccessObject->cellScalarGlobIdx(cellIndex));
|
||||||
|
|
||||||
if (xLengthFraction > yLengthFraction && xLengthFraction > zLengthFraction)
|
if (xLengthFraction > yLengthFraction && xLengthFraction > zLengthFraction)
|
||||||
{
|
{
|
||||||
|
@ -1797,7 +1797,7 @@ void RigFemPartResultsCollection::calculateGammaFromFrames(int partIndex,
|
|||||||
|
|
||||||
float por = srcPORFrameData[nodeIdx];
|
float por = srcPORFrameData[nodeIdx];
|
||||||
|
|
||||||
if ( por == inf || abs(por) < 0.01e6*1.0e-5 )
|
if ( por == inf || fabs(por) < 0.01e6*1.0e-5 )
|
||||||
dstFrameData[elmNodResIdx] = inf;
|
dstFrameData[elmNodResIdx] = inf;
|
||||||
else
|
else
|
||||||
dstFrameData[elmNodResIdx] = srcSTFrameData[elmNodResIdx]/por;
|
dstFrameData[elmNodResIdx] = srcSTFrameData[elmNodResIdx]/por;
|
||||||
|
@ -213,7 +213,7 @@ cvf::Vec3d RimFracture::fracturePosition() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
double RimFracture::wellFractureAzimuthDiff() const
|
double RimFracture::wellFractureAzimuthDiff() const
|
||||||
{
|
{
|
||||||
double wellDifference = abs(wellAzimuthAtFracturePosition() - azimuth);
|
double wellDifference = fabs(wellAzimuthAtFracturePosition() - azimuth);
|
||||||
return wellDifference;
|
return wellDifference;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ void RimFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
{
|
{
|
||||||
if (fracture->fractureTemplate() == this)
|
if (fracture->fractureTemplate() == this)
|
||||||
{
|
{
|
||||||
if (changedField == &azimuthAngle && (abs(oldValue.toDouble() - fracture->azimuth()) < 1e-5))
|
if (changedField == &azimuthAngle && (fabs(oldValue.toDouble() - fracture->azimuth()) < 1e-5))
|
||||||
{
|
{
|
||||||
fracture->azimuth = azimuthAngle;
|
fracture->azimuth = azimuthAngle;
|
||||||
}
|
}
|
||||||
@ -152,15 +152,15 @@ void RimFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
{
|
{
|
||||||
if (fracture->fractureTemplate() == this)
|
if (fracture->fractureTemplate() == this)
|
||||||
{
|
{
|
||||||
if (changedField == &perforationLength && (abs(oldValue.toDouble() - fracture->perforationLength()) < 1e-5))
|
if (changedField == &perforationLength && (fabs(oldValue.toDouble() - fracture->perforationLength()) < 1e-5))
|
||||||
{
|
{
|
||||||
fracture->perforationLength = perforationLength;
|
fracture->perforationLength = perforationLength;
|
||||||
}
|
}
|
||||||
if (changedField == &perforationEfficiency && (abs(oldValue.toDouble() - fracture->perforationEfficiency()) < 1e-5))
|
if (changedField == &perforationEfficiency && (fabs(oldValue.toDouble() - fracture->perforationEfficiency()) < 1e-5))
|
||||||
{
|
{
|
||||||
fracture->perforationEfficiency = perforationEfficiency;
|
fracture->perforationEfficiency = perforationEfficiency;
|
||||||
}
|
}
|
||||||
if (changedField == &wellDiameter && (abs(oldValue.toDouble() - fracture->wellDiameter()) < 1e-5))
|
if (changedField == &wellDiameter && (fabs(oldValue.toDouble() - fracture->wellDiameter()) < 1e-5))
|
||||||
{
|
{
|
||||||
fracture->wellDiameter = wellDiameter;
|
fracture->wellDiameter = wellDiameter;
|
||||||
}
|
}
|
||||||
|
@ -180,9 +180,9 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
|
|||||||
fracturePlane.setFromPointAndNormal(static_cast<cvf::Vec3d>(m_fractureTransform.translation()),
|
fracturePlane.setFromPointAndNormal(static_cast<cvf::Vec3d>(m_fractureTransform.translation()),
|
||||||
static_cast<cvf::Vec3d>(m_fractureTransform.col(2)));
|
static_cast<cvf::Vec3d>(m_fractureTransform.col(2)));
|
||||||
|
|
||||||
Ax += abs(area*(fracturePlane.normal().dot(localY)));
|
Ax += fabs(area*(fracturePlane.normal().dot(localY)));
|
||||||
Ay += abs(area*(fracturePlane.normal().dot(localX)));
|
Ay += fabs(area*(fracturePlane.normal().dot(localX)));
|
||||||
Az += abs(area*(fracturePlane.normal().dot(localZ)));
|
Az += fabs(area*(fracturePlane.normal().dot(localZ)));
|
||||||
}
|
}
|
||||||
|
|
||||||
double fractureArea = 0.0;
|
double fractureArea = 0.0;
|
||||||
|
@ -159,7 +159,7 @@ double RigSimulationWellCoordsAndMD::simWellAzimuthAngle(const cvf::Vec3d& posit
|
|||||||
cvf::Vec3d direction = p2 - p1;
|
cvf::Vec3d direction = p2 - p1;
|
||||||
|
|
||||||
|
|
||||||
if (abs(direction.y()) > 1e-5)
|
if (fabs(direction.y()) > 1e-5)
|
||||||
{
|
{
|
||||||
double atanValue = direction.x() / direction.y();
|
double atanValue = direction.x() / direction.y();
|
||||||
azimuthAngle = atan(atanValue);
|
azimuthAngle = atan(atanValue);
|
||||||
@ -200,7 +200,7 @@ double RigSimulationWellCoordsAndMD::simWellDipAngle(const cvf::Vec3d& position)
|
|||||||
double horizonal = sqrt(pow(direction.x(), 2) + pow(direction.y(), 2));
|
double horizonal = sqrt(pow(direction.x(), 2) + pow(direction.y(), 2));
|
||||||
double vertical = direction.z();
|
double vertical = direction.z();
|
||||||
|
|
||||||
if (abs(vertical) > 1e-5)
|
if (fabs(vertical) > 1e-5)
|
||||||
{
|
{
|
||||||
double atanValue = vertical / horizonal;
|
double atanValue = vertical / horizonal;
|
||||||
dipAngle = atan(atanValue);
|
dipAngle = atan(atanValue);
|
||||||
|
@ -461,7 +461,7 @@ bool RigStimPlanFractureDefinition::timeStepExisist(double timeStepValueToCheck)
|
|||||||
{
|
{
|
||||||
for (double timeStep : m_timeSteps)
|
for (double timeStep : m_timeSteps)
|
||||||
{
|
{
|
||||||
if (abs(timeStepValueToCheck - timeStep) < 1e-5) return true;
|
if (fabs(timeStepValueToCheck - timeStep) < 1e-5) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -487,7 +487,7 @@ size_t RigStimPlanFractureDefinition::getTimeStepIndex(double timeStepValue)
|
|||||||
size_t index = 0;
|
size_t index = 0;
|
||||||
while (index < m_timeSteps.size())
|
while (index < m_timeSteps.size())
|
||||||
{
|
{
|
||||||
if (abs(m_timeSteps[index] - timeStepValue) < 1e-4)
|
if (fabs(m_timeSteps[index] - timeStepValue) < 1e-4)
|
||||||
{
|
{
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user