mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2509 Fracture : Remove obsolete unit conversion code
This commit is contained in:
@@ -112,38 +112,12 @@ void RimEllipseFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEllipseFractureTemplate::fractureTriangleGeometry(std::vector<cvf::Vec3f>* nodeCoords,
|
||||
std::vector<cvf::uint>* triangleIndices,
|
||||
RiaEclipseUnitTools::UnitSystem neededUnit)
|
||||
std::vector<cvf::uint>* triangleIndices)
|
||||
{
|
||||
RigEllipsisTesselator tesselator(20);
|
||||
|
||||
float a = cvf::UNDEFINED_FLOAT;
|
||||
float b = cvf::UNDEFINED_FLOAT;
|
||||
|
||||
if (neededUnit == fractureTemplateUnit())
|
||||
{
|
||||
a = m_halfLength;
|
||||
b = m_height / 2.0f;
|
||||
|
||||
}
|
||||
else if (fractureTemplateUnit() == RiaEclipseUnitTools::UNITS_METRIC && neededUnit == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
RiaLogging::info(QString("Converting fracture template geometry from metric to field"));
|
||||
a = RiaEclipseUnitTools::meterToFeet(m_halfLength);
|
||||
b = RiaEclipseUnitTools::meterToFeet(m_height / 2.0f);
|
||||
}
|
||||
else if (fractureTemplateUnit() == RiaEclipseUnitTools::UNITS_FIELD && neededUnit == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
RiaLogging::info(QString("Converting fracture template geometry from field to metric"));
|
||||
a = RiaEclipseUnitTools::feetToMeter(m_halfLength);
|
||||
b = RiaEclipseUnitTools::feetToMeter(m_height / 2.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Should never get here...
|
||||
RiaLogging::error(QString("Error: Could not convert units for fracture / fracture template"));
|
||||
return;
|
||||
}
|
||||
float a = m_halfLength;
|
||||
float b = m_height / 2.0f;
|
||||
|
||||
tesselator.tesselateEllipsis(a, b, triangleIndices, nodeCoords);
|
||||
}
|
||||
@@ -151,14 +125,14 @@ void RimEllipseFractureTemplate::fractureTriangleGeometry(std::vector<cvf::Vec3f
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Vec3f> RimEllipseFractureTemplate::fractureBorderPolygon(RiaEclipseUnitTools::UnitSystem neededUnit)
|
||||
std::vector<cvf::Vec3f> RimEllipseFractureTemplate::fractureBorderPolygon()
|
||||
{
|
||||
std::vector<cvf::Vec3f> polygon;
|
||||
|
||||
std::vector<cvf::Vec3f> nodeCoords;
|
||||
std::vector<cvf::uint> triangleIndices;
|
||||
|
||||
fractureTriangleGeometry(&nodeCoords, &triangleIndices, neededUnit);
|
||||
fractureTriangleGeometry(&nodeCoords, &triangleIndices);
|
||||
|
||||
for (size_t i = 1; i < nodeCoords.size(); i++)
|
||||
{
|
||||
@@ -221,7 +195,7 @@ void RimEllipseFractureTemplate::setupFractureGridCells()
|
||||
|
||||
double cond = conductivity();
|
||||
|
||||
std::vector<cvf::Vec3f> ellipseFracPolygon = fractureBorderPolygon(fractureTemplateUnit());
|
||||
std::vector<cvf::Vec3f> ellipseFracPolygon = fractureBorderPolygon();
|
||||
std::vector<cvf::Vec3d> ellipseFracPolygonDouble;
|
||||
for (auto v : ellipseFracPolygon) ellipseFracPolygonDouble.push_back(static_cast<cvf::Vec3d>(v));
|
||||
std::vector<std::vector<cvf::Vec3d> >clippedFracturePolygons = RigCellGeometryTools::intersectPolygons(cellPolygon, ellipseFracPolygonDouble);
|
||||
|
||||
@@ -49,9 +49,8 @@ public:
|
||||
void loadDataAndUpdate();
|
||||
|
||||
void fractureTriangleGeometry(std::vector<cvf::Vec3f>* nodeCoords,
|
||||
std::vector<cvf::uint>* polygonIndices,
|
||||
RiaEclipseUnitTools::UnitSystem neededUnit);
|
||||
std::vector<cvf::Vec3f> fractureBorderPolygon(RiaEclipseUnitTools::UnitSystem neededUnit);
|
||||
std::vector<cvf::uint>* polygonIndices);
|
||||
std::vector<cvf::Vec3f> fractureBorderPolygon();
|
||||
void changeUnits();
|
||||
|
||||
const RigFractureGrid* fractureGrid() const;
|
||||
|
||||
@@ -361,7 +361,7 @@ void RimFracture::triangleGeometry(std::vector<cvf::uint>* triangleIndices, std:
|
||||
RimFractureTemplate* fractureDef = fractureTemplate();
|
||||
if (fractureDef)
|
||||
{
|
||||
fractureDef->fractureTriangleGeometry(nodeCoords, triangleIndices, fractureUnit());
|
||||
fractureDef->fractureTriangleGeometry(nodeCoords, triangleIndices);
|
||||
}
|
||||
|
||||
cvf::Mat4d m = transformMatrix();
|
||||
|
||||
@@ -119,10 +119,9 @@ public:
|
||||
double perforationLengthInFractureUnit(RiaEclipseUnitTools::UnitSystemType fractureUnit);
|
||||
|
||||
virtual void fractureTriangleGeometry(std::vector<cvf::Vec3f>* nodeCoords,
|
||||
std::vector<cvf::uint>* triangleIndices,
|
||||
RiaEclipseUnitTools::UnitSystem neededUnit) = 0;
|
||||
std::vector<cvf::uint>* triangleIndices) = 0;
|
||||
|
||||
virtual std::vector<cvf::Vec3f> fractureBorderPolygon(RiaEclipseUnitTools::UnitSystem neededUnit) = 0;
|
||||
virtual std::vector<cvf::Vec3f> fractureBorderPolygon() = 0;
|
||||
virtual const RigFractureGrid* fractureGrid() const = 0;
|
||||
const RimFractureContainment* fractureContainment();
|
||||
|
||||
|
||||
@@ -634,9 +634,11 @@ void RimStimPlanFractureTemplate::updateFractureGrid()
|
||||
|
||||
if (m_stimPlanFractureDefinitionData.notNull())
|
||||
{
|
||||
QString condUnit = RiaDefines::unitStringConductivity(fractureTemplateUnit());
|
||||
|
||||
m_fractureGrid = m_stimPlanFractureDefinitionData->createFractureGrid(m_conductivityResultNameOnFile,
|
||||
m_activeTimeStepIndex,
|
||||
fractureTemplateUnit(),
|
||||
condUnit,
|
||||
m_wellPathDepthAtFracture);
|
||||
}
|
||||
}
|
||||
@@ -647,8 +649,7 @@ void RimStimPlanFractureTemplate::updateFractureGrid()
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureTemplate::fractureTriangleGeometry(std::vector<cvf::Vec3f>* nodeCoords,
|
||||
std::vector<cvf::uint>* triangleIndices,
|
||||
RiaEclipseUnitTools::UnitSystem neededUnit)
|
||||
std::vector<cvf::uint>* triangleIndices)
|
||||
{
|
||||
|
||||
if (m_stimPlanFractureDefinitionData.isNull())
|
||||
@@ -658,7 +659,6 @@ void RimStimPlanFractureTemplate::fractureTriangleGeometry(std::vector<cvf::Vec3
|
||||
else
|
||||
{
|
||||
m_stimPlanFractureDefinitionData->createFractureTriangleGeometry(m_wellPathDepthAtFracture,
|
||||
neededUnit,
|
||||
name(),
|
||||
nodeCoords,
|
||||
triangleIndices);
|
||||
@@ -668,7 +668,7 @@ void RimStimPlanFractureTemplate::fractureTriangleGeometry(std::vector<cvf::Vec3
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fractureBorderPolygon(RiaEclipseUnitTools::UnitSystem neededUnit)
|
||||
std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fractureBorderPolygon()
|
||||
{
|
||||
if (m_stimPlanFractureDefinitionData.isNull()) return std::vector<cvf::Vec3f>();
|
||||
|
||||
@@ -681,7 +681,6 @@ std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fractureBorderPolygon(RiaEc
|
||||
parameterUnit,
|
||||
m_activeTimeStepIndex,
|
||||
m_wellPathDepthAtFracture,
|
||||
neededUnit,
|
||||
name());
|
||||
}
|
||||
|
||||
|
||||
@@ -69,9 +69,8 @@ public:
|
||||
const RigFractureGrid* fractureGrid() const override;
|
||||
void updateFractureGrid();
|
||||
void fractureTriangleGeometry(std::vector<cvf::Vec3f>* nodeCoords,
|
||||
std::vector<cvf::uint>* triangleIndices,
|
||||
RiaEclipseUnitTools::UnitSystem neededUnit) override;
|
||||
std::vector<cvf::Vec3f> fractureBorderPolygon(RiaEclipseUnitTools::UnitSystem neededUnit) override;
|
||||
std::vector<cvf::uint>* triangleIndices) override;
|
||||
std::vector<cvf::Vec3f> fractureBorderPolygon() override;
|
||||
|
||||
// Result Access
|
||||
|
||||
|
||||
Reference in New Issue
Block a user