mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #2320 from OPM/fabs
#2315. Replaced abs() by fabs() where relevant
This commit is contained in:
commit
0939cff93a
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user