Merge pull request #2320 from OPM/fabs

#2315. Replaced abs() by fabs() where relevant
This commit is contained in:
Magne Sjaastad 2018-01-05 10:50:11 +01:00 committed by GitHub
commit 0939cff93a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 16 deletions

View File

@ -1045,9 +1045,9 @@ CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(R
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ");
cvf::ref<RigResultAccessor> dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ");
double xLengthFraction = abs(lengthsInCell.x() / dxAccessObject->cellScalarGlobIdx(cellIndex));
double yLengthFraction = abs(lengthsInCell.y() / dyAccessObject->cellScalarGlobIdx(cellIndex));
double zLengthFraction = abs(lengthsInCell.z() / dzAccessObject->cellScalarGlobIdx(cellIndex));
double xLengthFraction = fabs(lengthsInCell.x() / dxAccessObject->cellScalarGlobIdx(cellIndex));
double yLengthFraction = fabs(lengthsInCell.y() / dyAccessObject->cellScalarGlobIdx(cellIndex));
double zLengthFraction = fabs(lengthsInCell.z() / dzAccessObject->cellScalarGlobIdx(cellIndex));
if (xLengthFraction > yLengthFraction && xLengthFraction > zLengthFraction)
{

View File

@ -1797,7 +1797,7 @@ void RigFemPartResultsCollection::calculateGammaFromFrames(int partIndex,
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;
else
dstFrameData[elmNodResIdx] = srcSTFrameData[elmNodResIdx]/por;

View File

@ -213,7 +213,7 @@ cvf::Vec3d RimFracture::fracturePosition() const
//--------------------------------------------------------------------------------------------------
double RimFracture::wellFractureAzimuthDiff() const
{
double wellDifference = abs(wellAzimuthAtFracturePosition() - azimuth);
double wellDifference = fabs(wellAzimuthAtFracturePosition() - azimuth);
return wellDifference;
}

View File

@ -120,7 +120,7 @@ void RimFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
{
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;
}
@ -152,15 +152,15 @@ void RimFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
{
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;
}
if (changedField == &perforationEfficiency && (abs(oldValue.toDouble() - fracture->perforationEfficiency()) < 1e-5))
if (changedField == &perforationEfficiency && (fabs(oldValue.toDouble() - fracture->perforationEfficiency()) < 1e-5))
{
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;
}

View File

@ -180,9 +180,9 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
fracturePlane.setFromPointAndNormal(static_cast<cvf::Vec3d>(m_fractureTransform.translation()),
static_cast<cvf::Vec3d>(m_fractureTransform.col(2)));
Ax += abs(area*(fracturePlane.normal().dot(localY)));
Ay += abs(area*(fracturePlane.normal().dot(localX)));
Az += abs(area*(fracturePlane.normal().dot(localZ)));
Ax += fabs(area*(fracturePlane.normal().dot(localY)));
Ay += fabs(area*(fracturePlane.normal().dot(localX)));
Az += fabs(area*(fracturePlane.normal().dot(localZ)));
}
double fractureArea = 0.0;

View File

@ -159,7 +159,7 @@ double RigSimulationWellCoordsAndMD::simWellAzimuthAngle(const cvf::Vec3d& posit
cvf::Vec3d direction = p2 - p1;
if (abs(direction.y()) > 1e-5)
if (fabs(direction.y()) > 1e-5)
{
double atanValue = direction.x() / direction.y();
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 vertical = direction.z();
if (abs(vertical) > 1e-5)
if (fabs(vertical) > 1e-5)
{
double atanValue = vertical / horizonal;
dipAngle = atan(atanValue);

View File

@ -461,7 +461,7 @@ bool RigStimPlanFractureDefinition::timeStepExisist(double timeStepValueToCheck)
{
for (double timeStep : m_timeSteps)
{
if (abs(timeStepValueToCheck - timeStep) < 1e-5) return true;
if (fabs(timeStepValueToCheck - timeStep) < 1e-5) return true;
}
return false;
}
@ -487,7 +487,7 @@ size_t RigStimPlanFractureDefinition::getTimeStepIndex(double timeStepValue)
size_t index = 0;
while (index < m_timeSteps.size())
{
if (abs(m_timeSteps[index] - timeStepValue) < 1e-4)
if (fabs(m_timeSteps[index] - timeStepValue) < 1e-4)
{
return index;
}