mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merged branch pre-proto into pre-proto
This commit is contained in:
commit
f7521ad12f
@ -63,6 +63,7 @@ void RicNewStimPlanFractureTemplateFeature::onActionTriggered(bool isChecked)
|
|||||||
fractureDef->name = "StimPlan Fracture Template";
|
fractureDef->name = "StimPlan Fracture Template";
|
||||||
fractureDef->setFileName(fileName);
|
fractureDef->setFileName(fileName);
|
||||||
fractureDef->loadDataAndUpdate();
|
fractureDef->loadDataAndUpdate();
|
||||||
|
fractureDef->setDefaultsBasedOnXMLfile();
|
||||||
|
|
||||||
fracDefColl->updateConnectedEditors();
|
fracDefColl->updateConnectedEditors();
|
||||||
RiuMainWindow::instance()->selectAsCurrentItem(fractureDef);
|
RiuMainWindow::instance()->selectAsCurrentItem(fractureDef);
|
||||||
|
@ -250,7 +250,7 @@ void RivWellFracturePartMgr::generateFractureOutlinePolygonPart(caf::DisplayCoor
|
|||||||
cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createPolygonDrawable(caf::DisplayCoordTransform* displayCoordTransform)
|
cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createPolygonDrawable(caf::DisplayCoordTransform* displayCoordTransform)
|
||||||
{
|
{
|
||||||
|
|
||||||
std::vector<cvf::Vec3f> polygon = m_rimFracture->attachedFractureDefinition()->fracturePolygon();
|
std::vector<cvf::Vec3f> polygon = m_rimFracture->attachedFractureDefinition()->fracturePolygon(m_rimFracture->fractureUnit);
|
||||||
|
|
||||||
//Transform to model coordinates and then display coords
|
//Transform to model coordinates and then display coords
|
||||||
std::vector<cvf::Vec3f> polygonInDisplayCoords;
|
std::vector<cvf::Vec3f> polygonInDisplayCoords;
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include "RimEllipseFractureTemplate.h"
|
#include "RimEllipseFractureTemplate.h"
|
||||||
|
|
||||||
|
#include "RiaLogging.h"
|
||||||
|
|
||||||
#include "RigTesselatorTools.h"
|
#include "RigTesselatorTools.h"
|
||||||
|
|
||||||
#include "RimDefines.h"
|
#include "RimDefines.h"
|
||||||
@ -99,12 +101,38 @@ void RimEllipseFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEllipseFractureTemplate::fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices)
|
void RimEllipseFractureTemplate::fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices, caf::AppEnum< RimDefines::UnitSystem > fractureUnit)
|
||||||
{
|
{
|
||||||
RigEllipsisTesselator tesselator(20);
|
RigEllipsisTesselator tesselator(20);
|
||||||
|
|
||||||
float a = halfLength;
|
float a = cvf::UNDEFINED_FLOAT;
|
||||||
float b = height / 2.0f;
|
float b = cvf::UNDEFINED_FLOAT;
|
||||||
|
|
||||||
|
if (fractureUnit == fractureTemplateUnit())
|
||||||
|
{
|
||||||
|
a = halfLength;
|
||||||
|
b = height / 2.0f;
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (fractureTemplateUnit() == RimDefines::UNITS_METRIC && fractureUnit == RimDefines::UNITS_FIELD)
|
||||||
|
{
|
||||||
|
RiaLogging::info(QString("Converting fracture template geometry from metric to field"));
|
||||||
|
a = RimDefines::meterToFeet(halfLength);
|
||||||
|
b = RimDefines::meterToFeet(height / 2.0f);
|
||||||
|
}
|
||||||
|
else if (fractureTemplateUnit() == RimDefines::UNITS_FIELD && fractureUnit == RimDefines::UNITS_METRIC)
|
||||||
|
{
|
||||||
|
RiaLogging::info(QString("Converting fracture template geometry from field to metric"));
|
||||||
|
a = RimDefines::feetToMeter(halfLength);
|
||||||
|
b = RimDefines::feetToMeter(height / 2.0f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Should never get here...
|
||||||
|
RiaLogging::error(QString("Error: Could not convert units for fracture / fracture template"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
tesselator.tesselateEllipsis(a, b, triangleIndices, nodeCoords);
|
tesselator.tesselateEllipsis(a, b, triangleIndices, nodeCoords);
|
||||||
}
|
}
|
||||||
@ -112,14 +140,14 @@ void RimEllipseFractureTemplate::fractureGeometry(std::vector<cvf::Vec3f>* nodeC
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<cvf::Vec3f> RimEllipseFractureTemplate::fracturePolygon()
|
std::vector<cvf::Vec3f> RimEllipseFractureTemplate::fracturePolygon(caf::AppEnum< RimDefines::UnitSystem > fractureUnit)
|
||||||
{
|
{
|
||||||
std::vector<cvf::Vec3f> polygon;
|
std::vector<cvf::Vec3f> polygon;
|
||||||
|
|
||||||
std::vector<cvf::Vec3f> nodeCoords;
|
std::vector<cvf::Vec3f> nodeCoords;
|
||||||
std::vector<cvf::uint> triangleIndices;
|
std::vector<cvf::uint> triangleIndices;
|
||||||
|
|
||||||
fractureGeometry(&nodeCoords, &triangleIndices);
|
fractureGeometry(&nodeCoords, &triangleIndices, fractureUnit);
|
||||||
|
|
||||||
for (size_t i = 1; i < nodeCoords.size(); i++)
|
for (size_t i = 1; i < nodeCoords.size(); i++)
|
||||||
{
|
{
|
||||||
|
@ -53,8 +53,8 @@ public:
|
|||||||
|
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||||
|
|
||||||
void fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* polygonIndices);
|
void fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* polygonIndices, caf::AppEnum< RimDefines::UnitSystem > fractureTemplateUnit);
|
||||||
std::vector<cvf::Vec3f> fracturePolygon();
|
std::vector<cvf::Vec3f> fracturePolygon(caf::AppEnum< RimDefines::UnitSystem > fractureTemplateUnit);
|
||||||
void changeUnits();
|
void changeUnits();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "RigResultAccessorFactory.h"
|
#include "RigResultAccessorFactory.h"
|
||||||
#include "RigTesselatorTools.h"
|
#include "RigTesselatorTools.h"
|
||||||
|
|
||||||
|
#include "RimDefines.h"
|
||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
#include "RimEclipseCellColors.h"
|
#include "RimEclipseCellColors.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
@ -83,6 +84,7 @@ RimFracture::RimFracture(void)
|
|||||||
azimuth.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
azimuth.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
||||||
CAF_PDM_InitField(&perforationLength, "PerforationLength", 0.0, "Perforation Length", "", "", "");
|
CAF_PDM_InitField(&perforationLength, "PerforationLength", 0.0, "Perforation Length", "", "", "");
|
||||||
CAF_PDM_InitField(&showPolygonFractureOutline, "showPolygonFractureOutline", true, "Show Polygon Outline", "", "", "");
|
CAF_PDM_InitField(&showPolygonFractureOutline, "showPolygonFractureOutline", true, "Show Polygon Outline", "", "", "");
|
||||||
|
CAF_PDM_InitField(&fractureUnit, "fractureUnit", caf::AppEnum<RimDefines::UnitSystem>(RimDefines::UNITS_METRIC), "Fracture Unit System", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitField(&stimPlanTimeIndexToPlot, "timeIndexToPlot", 0, "StimPlan Time Step", "", "", "");
|
CAF_PDM_InitField(&stimPlanTimeIndexToPlot, "timeIndexToPlot", 0, "StimPlan Time Step", "", "", "");
|
||||||
|
|
||||||
@ -181,7 +183,8 @@ void RimFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
|
|||||||
changedField == &m_fractureTemplate ||
|
changedField == &m_fractureTemplate ||
|
||||||
changedField == &stimPlanTimeIndexToPlot ||
|
changedField == &stimPlanTimeIndexToPlot ||
|
||||||
changedField == this->objectToggleField() ||
|
changedField == this->objectToggleField() ||
|
||||||
changedField == &showPolygonFractureOutline)
|
changedField == &showPolygonFractureOutline ||
|
||||||
|
changedField == &fractureUnit)
|
||||||
{
|
{
|
||||||
|
|
||||||
setRecomputeGeometryFlag();
|
setRecomputeGeometryFlag();
|
||||||
@ -225,7 +228,7 @@ void RimFracture::computeGeometry()
|
|||||||
RimFractureTemplate* fractureDef = attachedFractureDefinition();
|
RimFractureTemplate* fractureDef = attachedFractureDefinition();
|
||||||
if (fractureDef )
|
if (fractureDef )
|
||||||
{
|
{
|
||||||
fractureDef->fractureGeometry(&nodeCoords, &triangleIndices);
|
fractureDef->fractureGeometry(&nodeCoords, &triangleIndices, fractureUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
cvf::Mat4f m = transformMatrix();
|
cvf::Mat4f m = transformMatrix();
|
||||||
@ -371,7 +374,7 @@ void RimFracture::computeTransmissibility(RimEclipseCase* caseToApply)
|
|||||||
|
|
||||||
if (attachedFractureDefinition())
|
if (attachedFractureDefinition())
|
||||||
{
|
{
|
||||||
std::vector<cvf::Vec3f> fracPolygon = attachedFractureDefinition()->fracturePolygon();
|
std::vector<cvf::Vec3f> fracPolygon = attachedFractureDefinition()->fracturePolygon(fractureUnit);
|
||||||
|
|
||||||
std::vector<cvf::Vec3d> fracPolygonDouble;
|
std::vector<cvf::Vec3d> fracPolygonDouble;
|
||||||
for (auto v : fracPolygon) fracPolygonDouble.push_back(static_cast<cvf::Vec3d>(v));
|
for (auto v : fracPolygon) fracPolygonDouble.push_back(static_cast<cvf::Vec3d>(v));
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "RimCheckableNamedObject.h"
|
#include "RimCheckableNamedObject.h"
|
||||||
|
#include "RimDefines.h"
|
||||||
|
|
||||||
#include "cvfBase.h"
|
#include "cvfBase.h"
|
||||||
#include "cvfObject.h"
|
#include "cvfObject.h"
|
||||||
@ -26,6 +27,7 @@
|
|||||||
#include "cvfMatrix4.h"
|
#include "cvfMatrix4.h"
|
||||||
#include "cvfPlane.h"
|
#include "cvfPlane.h"
|
||||||
|
|
||||||
|
#include "cafAppEnum.h"
|
||||||
#include "cafPdmChildField.h"
|
#include "cafPdmChildField.h"
|
||||||
#include "cafPdmFieldCvfVec3d.h"
|
#include "cafPdmFieldCvfVec3d.h"
|
||||||
#include "cafPdmProxyValueField.h"
|
#include "cafPdmProxyValueField.h"
|
||||||
@ -56,6 +58,8 @@ public:
|
|||||||
caf::PdmField<int> stimPlanTimeIndexToPlot;
|
caf::PdmField<int> stimPlanTimeIndexToPlot;
|
||||||
caf::PdmField<bool> showPolygonFractureOutline;
|
caf::PdmField<bool> showPolygonFractureOutline;
|
||||||
|
|
||||||
|
caf::PdmField< caf::AppEnum< RimDefines::UnitSystem > > fractureUnit;
|
||||||
|
|
||||||
|
|
||||||
cvf::Vec3d anchorPosition();
|
cvf::Vec3d anchorPosition();
|
||||||
void setAnchorPosition(const cvf::Vec3d& pos);
|
void setAnchorPosition(const cvf::Vec3d& pos);
|
||||||
|
@ -69,8 +69,8 @@ public:
|
|||||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||||
|
|
||||||
virtual void fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices) = 0;
|
virtual void fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices, caf::AppEnum< RimDefines::UnitSystem > fractureTemplateUnit) = 0;
|
||||||
virtual std::vector<cvf::Vec3f> fracturePolygon() = 0;
|
virtual std::vector<cvf::Vec3f> fracturePolygon(caf::AppEnum< RimDefines::UnitSystem > fractureTemplateUnit) = 0;
|
||||||
protected:
|
protected:
|
||||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||||
};
|
};
|
||||||
|
@ -80,6 +80,7 @@ void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* ch
|
|||||||
{
|
{
|
||||||
updateUiTreeName();
|
updateUiTreeName();
|
||||||
loadDataAndUpdate();
|
loadDataAndUpdate();
|
||||||
|
setDefaultsBasedOnXMLfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (&wellPathDepthAtFracture == changedField || ¶meterForPolygon == changedField || ×tepForPolygon == changedField)
|
if (&wellPathDepthAtFracture == changedField || ¶meterForPolygon == changedField || ×tepForPolygon == changedField)
|
||||||
@ -235,8 +236,6 @@ void RimStimPlanFractureTemplate::readStimPlanXMLFile(QString * errorMessage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dataFile.close();
|
dataFile.close();
|
||||||
setDepthOfWellPathAtFracture();
|
|
||||||
RiaLogging::info(QString("Setting well/fracture intersection depth at %1").arg(wellPathDepthAtFracture));
|
|
||||||
|
|
||||||
if (xmlStream2.hasError())
|
if (xmlStream2.hasError())
|
||||||
{
|
{
|
||||||
@ -259,6 +258,46 @@ void RimStimPlanFractureTemplate::readStimPlanXMLFile(QString * errorMessage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimStimPlanFractureTemplate::setDefaultsBasedOnXMLfile()
|
||||||
|
{
|
||||||
|
setDepthOfWellPathAtFracture();
|
||||||
|
RiaLogging::info(QString("Setting well/fracture intersection depth at %1").arg(wellPathDepthAtFracture));
|
||||||
|
timestepForPolygon = static_cast<int>(m_stimPlanFractureDefinitionData->totalNumberTimeSteps() - 1);
|
||||||
|
bool polygonPropertySet = setPropertyForPolygonDefault();
|
||||||
|
|
||||||
|
if (polygonPropertySet) RiaLogging::info(QString("Calculating polygon outline based on %1 at timestep %2").arg(parameterForPolygon).arg(m_stimPlanFractureDefinitionData->timeSteps[timestepForPolygon]));
|
||||||
|
else RiaLogging::info(QString("Property for polygon calculation not set."));
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimStimPlanFractureTemplate::setPropertyForPolygonDefault()
|
||||||
|
{
|
||||||
|
//first option: Width
|
||||||
|
for (std::pair<QString, QString> property : getStimPlanPropertyNamesUnits())
|
||||||
|
{
|
||||||
|
if (property.first == "WIDTH")
|
||||||
|
{
|
||||||
|
parameterForPolygon = property.first + " " + property.second;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//if width not found, use conductivity
|
||||||
|
for (std::pair<QString, QString> property : getStimPlanPropertyNamesUnits())
|
||||||
|
{
|
||||||
|
if (property.first == "CONDUCTIVITY")
|
||||||
|
{
|
||||||
|
parameterForPolygon = property.first + " " + property.second;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -492,7 +531,7 @@ QString RimStimPlanFractureTemplate::getAttributeValueString(QXmlStreamReader &x
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimStimPlanFractureTemplate::fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices)
|
void RimStimPlanFractureTemplate::fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices, caf::AppEnum< RimDefines::UnitSystem > fractureUnit)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (m_stimPlanFractureDefinitionData.isNull())
|
if (m_stimPlanFractureDefinitionData.isNull())
|
||||||
@ -506,6 +545,30 @@ void RimStimPlanFractureTemplate::fractureGeometry(std::vector<cvf::Vec3f>* node
|
|||||||
|
|
||||||
std::vector<double> adjustedDepths = adjustedDepthCoordsAroundWellPathPosition();
|
std::vector<double> adjustedDepths = adjustedDepthCoordsAroundWellPathPosition();
|
||||||
|
|
||||||
|
if (fractureUnit == fractureTemplateUnit())
|
||||||
|
{
|
||||||
|
RiaLogging::debug(QString("No conversion necessary for %1").arg(name));
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (fractureTemplateUnit() == RimDefines::UNITS_METRIC && fractureUnit == RimDefines::UNITS_FIELD)
|
||||||
|
{
|
||||||
|
RiaLogging::info(QString("Converting StimPlan geometry from metric to field for fracture template %1").arg(name));
|
||||||
|
for (double& value : adjustedDepths) value = RimDefines::meterToFeet(value);
|
||||||
|
for (double& value : xCoords) value = RimDefines::meterToFeet(value);
|
||||||
|
}
|
||||||
|
else if (fractureTemplateUnit() == RimDefines::UNITS_FIELD && fractureUnit == RimDefines::UNITS_METRIC)
|
||||||
|
{
|
||||||
|
RiaLogging::info(QString("Converting StimPlan geometry from field to metric for fracture template %1").arg(name));
|
||||||
|
for (double& value : adjustedDepths) value = RimDefines::feetToMeter(value);
|
||||||
|
for (double& value : xCoords) value = RimDefines::feetToMeter(value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Should never get here...
|
||||||
|
RiaLogging::error(QString("Error: Could not convert units for fracture template %1").arg(name));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (cvf::uint k = 0; k < adjustedDepths.size(); k++)
|
for (cvf::uint k = 0; k < adjustedDepths.size(); k++)
|
||||||
{
|
{
|
||||||
for (cvf::uint i = 0; i < lenXcoords; i++)
|
for (cvf::uint i = 0; i < lenXcoords; i++)
|
||||||
@ -622,7 +685,7 @@ void RimStimPlanFractureTemplate::computeMinMax(const QString& resultName, const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fracturePolygon()
|
std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fracturePolygon(caf::AppEnum< RimDefines::UnitSystem > fractureUnit)
|
||||||
{
|
{
|
||||||
std::vector<cvf::Vec3f> polygon;
|
std::vector<cvf::Vec3f> polygon;
|
||||||
QString parameterName;
|
QString parameterName;
|
||||||
@ -661,14 +724,14 @@ std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fracturePolygon()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<cvf::Vec3f> negPolygon;
|
std::vector<cvf::Vec3f> negPolygon;
|
||||||
for (const auto& node : polygon)
|
for (const cvf::Vec3f& node : polygon)
|
||||||
{
|
{
|
||||||
cvf::Vec3f negNode = node;
|
cvf::Vec3f negNode = node;
|
||||||
negNode.x() = -negNode.x();
|
negNode.x() = -negNode.x();
|
||||||
negPolygon.insert(negPolygon.begin(), negNode);
|
negPolygon.insert(negPolygon.begin(), negNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& negNode : negPolygon)
|
for (const cvf::Vec3f& negNode : negPolygon)
|
||||||
{
|
{
|
||||||
polygon.push_back(negNode);
|
polygon.push_back(negNode);
|
||||||
}
|
}
|
||||||
@ -676,6 +739,44 @@ std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fracturePolygon()
|
|||||||
//Adding first point last - to close the polygon
|
//Adding first point last - to close the polygon
|
||||||
if (polygon.size()>0) polygon.push_back(polygon[0]);
|
if (polygon.size()>0) polygon.push_back(polygon[0]);
|
||||||
|
|
||||||
|
|
||||||
|
if (fractureUnit == fractureTemplateUnit())
|
||||||
|
{
|
||||||
|
RiaLogging::debug(QString("No conversion necessary for %1").arg(name));
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (fractureTemplateUnit() == RimDefines::UNITS_METRIC && fractureUnit == RimDefines::UNITS_FIELD)
|
||||||
|
{
|
||||||
|
RiaLogging::info(QString("Converting StimPlan geometry from metric to field for fracture template %1").arg(name));
|
||||||
|
for (cvf::Vec3f& node : polygon)
|
||||||
|
{
|
||||||
|
float x = RimDefines::meterToFeet(node.x());
|
||||||
|
float y = RimDefines::meterToFeet(node.y());
|
||||||
|
float z = RimDefines::meterToFeet(node.z());
|
||||||
|
node = cvf::Vec3f(x, y, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (fractureTemplateUnit() == RimDefines::UNITS_FIELD && fractureUnit == RimDefines::UNITS_METRIC)
|
||||||
|
{
|
||||||
|
RiaLogging::info(QString("Converting StimPlan geometry from field to metric for fracture template %1").arg(name));
|
||||||
|
for (cvf::Vec3f& node : polygon)
|
||||||
|
{
|
||||||
|
float x = RimDefines::feetToMeter(node.x());
|
||||||
|
float y = RimDefines::feetToMeter(node.y());
|
||||||
|
float z = RimDefines::feetToMeter(node.z());
|
||||||
|
node = cvf::Vec3f(x, y, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Should never get here...
|
||||||
|
RiaLogging::error(QString("Error: Could not convert units for fracture template %1").arg(name));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return polygon;
|
return polygon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,8 +59,8 @@ public:
|
|||||||
const QString& fileName();
|
const QString& fileName();
|
||||||
QString fileNameWithOutPath();
|
QString fileNameWithOutPath();
|
||||||
|
|
||||||
void fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices);
|
void fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* triangleIndices, caf::AppEnum< RimDefines::UnitSystem > fractureUnit) override;
|
||||||
std::vector<cvf::Vec3f> fracturePolygon();
|
std::vector<cvf::Vec3f> fracturePolygon(caf::AppEnum< RimDefines::UnitSystem > fractureUnit);
|
||||||
|
|
||||||
std::vector<double> getNegAndPosXcoords();
|
std::vector<double> getNegAndPosXcoords();
|
||||||
std::vector<double> adjustedDepthCoordsAroundWellPathPosition();
|
std::vector<double> adjustedDepthCoordsAroundWellPathPosition();
|
||||||
@ -69,6 +69,7 @@ public:
|
|||||||
void computeMinMax(const QString& resultName, const QString& unitName, double* minValue, double* maxValue) const;
|
void computeMinMax(const QString& resultName, const QString& unitName, double* minValue, double* maxValue) const;
|
||||||
|
|
||||||
void loadDataAndUpdate();
|
void loadDataAndUpdate();
|
||||||
|
void setDefaultsBasedOnXMLfile();
|
||||||
|
|
||||||
std::vector<std::vector<double>> getDataAtTimeIndex(const QString& resultName, const QString& unitName, size_t timeStepIndex) const;
|
std::vector<std::vector<double>> getDataAtTimeIndex(const QString& resultName, const QString& unitName, size_t timeStepIndex) const;
|
||||||
|
|
||||||
@ -88,7 +89,6 @@ private:
|
|||||||
|
|
||||||
size_t readStimplanGridAndTimesteps(QXmlStreamReader &xmlStream);
|
size_t readStimplanGridAndTimesteps(QXmlStreamReader &xmlStream);
|
||||||
|
|
||||||
|
|
||||||
static double getAttributeValueDouble(QXmlStreamReader &xmlStream, QString parameterName);
|
static double getAttributeValueDouble(QXmlStreamReader &xmlStream, QString parameterName);
|
||||||
static QString getAttributeValueString(QXmlStreamReader &xmlStream, QString parameterName);
|
static QString getAttributeValueString(QXmlStreamReader &xmlStream, QString parameterName);
|
||||||
void getGriddingValues(QXmlStreamReader &xmlStream, std::vector<double>& gridValues, size_t& startNegValues);
|
void getGriddingValues(QXmlStreamReader &xmlStream, std::vector<double>& gridValues, size_t& startNegValues);
|
||||||
@ -98,5 +98,6 @@ private:
|
|||||||
cvf::ref<RigStimPlanFractureDefinition> m_stimPlanFractureDefinitionData;
|
cvf::ref<RigStimPlanFractureDefinition> m_stimPlanFractureDefinitionData;
|
||||||
|
|
||||||
bool numberOfParameterValuesOK(std::vector<std::vector<double>> propertyValuesAtTimestep);
|
bool numberOfParameterValuesOK(std::vector<std::vector<double>> propertyValuesAtTimestep);
|
||||||
|
bool setPropertyForPolygonDefault();
|
||||||
void setDepthOfWellPathAtFracture();
|
void setDepthOfWellPathAtFracture();
|
||||||
};
|
};
|
||||||
|
@ -89,6 +89,14 @@ size_t RigStimPlanFractureDefinition::getTimeStepIndex(double timeStepValue)
|
|||||||
return -1; //returns -1 if not found
|
return -1; //returns -1 if not found
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
size_t RigStimPlanFractureDefinition::totalNumberTimeSteps()
|
||||||
|
{
|
||||||
|
return timeSteps.size();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -56,6 +56,7 @@ public:
|
|||||||
bool timeStepExisist(double timeStepValue);
|
bool timeStepExisist(double timeStepValue);
|
||||||
void reorderYgridToDepths();
|
void reorderYgridToDepths();
|
||||||
size_t getTimeStepIndex(double timeStepValue);
|
size_t getTimeStepIndex(double timeStepValue);
|
||||||
|
size_t totalNumberTimeSteps();
|
||||||
|
|
||||||
void setDataAtTimeValue(QString resultName, QString unit, std::vector<std::vector<double>> data, double timeStepValue);
|
void setDataAtTimeValue(QString resultName, QString unit, std::vector<std::vector<double>> data, double timeStepValue);
|
||||||
std::vector<std::vector<double>> getDataAtTimeIndex(const QString& resultName, const QString& unit, size_t timeStepIndex) const;
|
std::vector<std::vector<double>> getDataAtTimeIndex(const QString& resultName, const QString& unit, size_t timeStepIndex) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user