#1585 Move more code away from StimPlanTemplate

This commit is contained in:
Jacob Støren 2017-06-12 15:22:52 +02:00
parent bd5b185260
commit 681a3404b4
3 changed files with 20 additions and 24 deletions

View File

@ -611,7 +611,7 @@ void RimStimPlanFractureTemplate::fractureTriangleGeometry(std::vector<cvf::Vec3
std::vector<double> xCoords = m_stimPlanFractureDefinitionData->getNegAndPosXcoords();
cvf::uint lenXcoords = static_cast<cvf::uint>(xCoords.size());
std::vector<double> adjustedDepths = adjustedDepthCoordsAroundWellPathPosition();
std::vector<double> adjustedDepths = m_stimPlanFractureDefinitionData->adjustedDepthCoordsAroundWellPathPosition(m_wellPathDepthAtFracture());
if (neededUnit == fractureTemplateUnit())
{
@ -676,22 +676,6 @@ void RimStimPlanFractureTemplate::fractureTriangleGeometry(std::vector<cvf::Vec3
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RimStimPlanFractureTemplate::adjustedDepthCoordsAroundWellPathPosition() const
{
std::vector<double> depthRelativeToWellPath;
for (const double& depth : m_stimPlanFractureDefinitionData->depths)
{
double adjustedDepth = depth - m_wellPathDepthAtFracture();
adjustedDepth = -adjustedDepth;
depthRelativeToWellPath.push_back(adjustedDepth);
}
return depthRelativeToWellPath;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -741,7 +725,7 @@ void RimStimPlanFractureTemplate::getStimPlanDataAsPolygonsAndValues(std::vector
parameterValues.clear();
//TODO: Code partly copied from RivWellFracturePartMgr - can this be combined in some function?
std::vector<double> depthCoordsAtNodes = adjustedDepthCoordsAroundWellPathPosition();
std::vector<double> depthCoordsAtNodes = m_stimPlanFractureDefinitionData->adjustedDepthCoordsAroundWellPathPosition(m_wellPathDepthAtFracture());
std::vector<double> xCoordsAtNodes = m_stimPlanFractureDefinitionData->getNegAndPosXcoords();
//Cells are around nodes instead of between nodes
@ -791,7 +775,7 @@ void RimStimPlanFractureTemplate::setupStimPlanCells()
if (fractureTemplateUnit == RimUnitSystem::UNITS_FIELD) condUnit = "md-ft";
std::vector<std::vector<double>> conductivityValuesAtTimeStep = m_stimPlanFractureDefinitionData->getMirroredDataAtTimeIndex("CONDUCTIVITY", condUnit, m_activeTimeStepIndex);
std::vector<double> depthCoordsAtNodes = adjustedDepthCoordsAroundWellPathPosition();
std::vector<double> depthCoordsAtNodes = m_stimPlanFractureDefinitionData->adjustedDepthCoordsAroundWellPathPosition(m_wellPathDepthAtFracture());
std::vector<double> xCoordsAtNodes = m_stimPlanFractureDefinitionData->getNegAndPosXcoords();
std::vector<double> xCoords;
@ -852,7 +836,7 @@ void RimStimPlanFractureTemplate::setupStimPlanCells()
m_fractureGrid->setFractureCells(stimPlanCells);
m_fractureGrid->setWellCenterFractureCellIJ(wellCenterStimPlanCellIJ);
m_fractureGrid->setICellCount(m_stimPlanFractureDefinitionData->getNegAndPosXcoords().size() - 2);
m_fractureGrid->setJCellCount(adjustedDepthCoordsAroundWellPathPosition().size() - 2);
m_fractureGrid->setJCellCount(m_stimPlanFractureDefinitionData->adjustedDepthCoordsAroundWellPathPosition(m_wellPathDepthAtFracture()).size() - 2);
}
//--------------------------------------------------------------------------------------------------
@ -870,7 +854,7 @@ std::vector<cvf::Vec3d> RimStimPlanFractureTemplate::getStimPlanRowPolygon(size_
{
std::vector<cvf::Vec3d> rowPolygon;
std::vector<double> depthCoordsAtNodes = adjustedDepthCoordsAroundWellPathPosition();
std::vector<double> depthCoordsAtNodes = m_stimPlanFractureDefinitionData->adjustedDepthCoordsAroundWellPathPosition(m_wellPathDepthAtFracture());
std::vector<double> xCoordsAtNodes = m_stimPlanFractureDefinitionData->getNegAndPosXcoords();
std::vector<double> xCoords;
@ -893,7 +877,7 @@ std::vector<cvf::Vec3d> RimStimPlanFractureTemplate::getStimPlanColPolygon(size_
{
std::vector<cvf::Vec3d> colPolygon;
std::vector<double> depthCoordsAtNodes = adjustedDepthCoordsAroundWellPathPosition();
std::vector<double> depthCoordsAtNodes = m_stimPlanFractureDefinitionData->adjustedDepthCoordsAroundWellPathPosition(m_wellPathDepthAtFracture());
std::vector<double> xCoordsAtNodes = m_stimPlanFractureDefinitionData->getNegAndPosXcoords();
std::vector<double> xCoords;
@ -921,7 +905,7 @@ std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fractureBorderPolygon(RimUn
std::vector<std::vector<double>> dataAtTimeStep = m_stimPlanFractureDefinitionData->getDataAtTimeIndex(parameterName, parameterUnit, m_activeTimeStepIndex);
std::vector<double> adjustedDepths = adjustedDepthCoordsAroundWellPathPosition();
std::vector<double> adjustedDepths = m_stimPlanFractureDefinitionData->adjustedDepthCoordsAroundWellPathPosition(m_wellPathDepthAtFracture());
for (int k = 0; k < dataAtTimeStep.size(); k++)
{

View File

@ -98,7 +98,6 @@ private:
static void getGriddingValues(QXmlStreamReader &xmlStream, std::vector<double>& gridValues, size_t& startNegValues);
static std::vector<std::vector<double>> getAllDepthDataAtTimeStep(QXmlStreamReader &xmlStream, size_t startingNegValuesXs);
std::vector<double> adjustedDepthCoordsAroundWellPathPosition() const;
bool setPropertyForPolygonDefault();
void setDepthOfWellPathAtFracture();

View File

@ -87,6 +87,19 @@ public:
return true;
}
std::vector<double> adjustedDepthCoordsAroundWellPathPosition(double wellPathDepthAtFracture) const
{
std::vector<double> depthRelativeToWellPath;
for (const double& depth : this->depths)
{
double adjustedDepth = depth - wellPathDepthAtFracture;
adjustedDepth = -adjustedDepth;
depthRelativeToWellPath.push_back(adjustedDepth);
}
return depthRelativeToWellPath;
}
std::vector<std::vector<double>> getMirroredDataAtTimeIndex(const QString& resultName,
const QString& unitName,