mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1138 - pre-proto - Re-reading data from files when opening stored project. Re-generating geometry when updating values for time-step / parameter to show from stimPlan-file.
This commit is contained in:
@@ -107,6 +107,34 @@ void RivWellFracturePartMgr::updatePartGeometryTexture(caf::DisplayCoordTransfor
|
|||||||
|
|
||||||
if (!m_rimFracture->hasValidGeometry()) return;
|
if (!m_rimFracture->hasValidGeometry()) return;
|
||||||
|
|
||||||
|
RimFractureTemplate * fracTemplate = m_rimFracture->attachedFractureDefinition();
|
||||||
|
RimStimPlanFractureTemplate* stimPlanFracTemplate;
|
||||||
|
|
||||||
|
if (dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate))
|
||||||
|
{
|
||||||
|
stimPlanFracTemplate = dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate);
|
||||||
|
}
|
||||||
|
else return;
|
||||||
|
|
||||||
|
int timeStepIndex = m_rimFracture->stimPlanTimeIndexToPlot;
|
||||||
|
std::vector<std::vector<double> > dataToPlot;
|
||||||
|
|
||||||
|
if (m_rimFracture->stimPlanParameterToPlot == RimFracture::CONDUCTIVITY)
|
||||||
|
{
|
||||||
|
dataToPlot = stimPlanFracTemplate->getConductivitiesAtTimeStep(timeStepIndex);
|
||||||
|
}
|
||||||
|
else if (m_rimFracture->stimPlanParameterToPlot == RimFracture::PERMEABILITY)
|
||||||
|
{
|
||||||
|
dataToPlot = stimPlanFracTemplate->getPermeabilitiesAtTimeStep(timeStepIndex);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (m_rimFracture->stimPlanParameterToPlot == RimFracture::WIDTH)
|
||||||
|
{
|
||||||
|
dataToPlot = stimPlanFracTemplate->getWidthsAtTimeStep(timeStepIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dataToPlot.empty()) return;
|
||||||
|
|
||||||
const std::vector<cvf::Vec3f>& nodeCoords = m_rimFracture->nodeCoords();
|
const std::vector<cvf::Vec3f>& nodeCoords = m_rimFracture->nodeCoords();
|
||||||
const std::vector<cvf::uint>& triangleIndices = m_rimFracture->triangleIndices();
|
const std::vector<cvf::uint>& triangleIndices = m_rimFracture->triangleIndices();
|
||||||
std::vector<cvf::Vec3f> displayCoords;
|
std::vector<cvf::Vec3f> displayCoords;
|
||||||
@@ -138,53 +166,10 @@ void RivWellFracturePartMgr::updatePartGeometryTexture(caf::DisplayCoordTransfor
|
|||||||
}
|
}
|
||||||
|
|
||||||
//double scalarValue = i % 4;
|
//double scalarValue = i % 4;
|
||||||
RimFractureTemplate * fracTemplate = m_rimFracture->attachedFractureDefinition();
|
|
||||||
RimStimPlanFractureTemplate* stimPlanFracTemplate;
|
|
||||||
|
|
||||||
if (dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate))
|
|
||||||
{
|
|
||||||
stimPlanFracTemplate = dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int timeStepIndex = m_rimFracture->stimPlanTimeIndexToPlot;
|
|
||||||
std::vector<std::vector<double> > dataToPlot;
|
|
||||||
|
|
||||||
if (m_rimFracture->stimPlanParameterToPlot == RimFracture::CONDUCTIVITY)
|
|
||||||
{
|
|
||||||
dataToPlot = stimPlanFracTemplate->getConductivitiesAtTimeStep(timeStepIndex);
|
|
||||||
}
|
|
||||||
else if (m_rimFracture->stimPlanParameterToPlot == RimFracture::PERMEABILITY)
|
|
||||||
{
|
|
||||||
dataToPlot = stimPlanFracTemplate->getPermeabilitiesAtTimeStep(timeStepIndex);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (m_rimFracture->stimPlanParameterToPlot == RimFracture::WIDTH)
|
|
||||||
{
|
|
||||||
dataToPlot = stimPlanFracTemplate->getWidthsAtTimeStep(timeStepIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (dataToPlot.empty())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
cvf::ref<cvf::Vec2fArray> textureCoords = new cvf::Vec2fArray;
|
cvf::ref<cvf::Vec2fArray> textureCoords = new cvf::Vec2fArray;
|
||||||
textureCoords->resize(nodeCoords.size());
|
textureCoords->resize(nodeCoords.size());
|
||||||
// for (size_t i = 0; i < textureCoords->size(); i++)
|
|
||||||
// {
|
|
||||||
//
|
|
||||||
// double scalarValue = 0;
|
|
||||||
//
|
|
||||||
// cvf::Vec2f texCoord = scalarMapper->mapToTextureCoord(scalarValue);
|
|
||||||
//
|
|
||||||
// textureCoords->set(i, texCoord);
|
|
||||||
// }
|
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (std::vector<double> depthData : dataToPlot)
|
for (std::vector<double> depthData : dataToPlot)
|
||||||
|
|||||||
@@ -204,7 +204,9 @@ void RimFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (changedField == &azimuth ||
|
if (changedField == &azimuth ||
|
||||||
changedField == &m_fractureTemplate)
|
changedField == &m_fractureTemplate ||
|
||||||
|
changedField == &stimPlanParameterToPlot ||
|
||||||
|
changedField == &stimPlanTimeIndexToPlot)
|
||||||
{
|
{
|
||||||
|
|
||||||
setRecomputeGeometryFlag();
|
setRecomputeGeometryFlag();
|
||||||
|
|||||||
@@ -250,6 +250,17 @@ void RimStimPlanFractureTemplate::readStimPlanXMLFile(QString * errorMessage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimStimPlanFractureTemplate::loadDataAndUpdate()
|
||||||
|
{
|
||||||
|
QString errorMessage;
|
||||||
|
readStimPlanXMLFile(&errorMessage);
|
||||||
|
qDebug() << errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -399,8 +410,7 @@ void RimStimPlanFractureTemplate::fractureGeometry(std::vector<cvf::Vec3f>* node
|
|||||||
|
|
||||||
if (m_stimPlanFractureDefinitionData.isNull())
|
if (m_stimPlanFractureDefinitionData.isNull())
|
||||||
{
|
{
|
||||||
return;
|
loadDataAndUpdate();
|
||||||
//TODO: try to read in data again if missing...
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -475,6 +485,8 @@ std::vector<double> RimStimPlanFractureTemplate::adjustedDepthCoordsAroundWellP
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<double> RimStimPlanFractureTemplate::getStimPlanTimeValues()
|
std::vector<double> RimStimPlanFractureTemplate::getStimPlanTimeValues()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (m_stimPlanFractureDefinitionData.isNull()) loadDataAndUpdate();
|
||||||
return m_stimPlanFractureDefinitionData->timeSteps;
|
return m_stimPlanFractureDefinitionData->timeSteps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ private:
|
|||||||
void updateUiTreeName();
|
void updateUiTreeName();
|
||||||
|
|
||||||
void readStimPlanXMLFile(QString * errorMessage);
|
void readStimPlanXMLFile(QString * errorMessage);
|
||||||
|
void loadDataAndUpdate();
|
||||||
|
|
||||||
|
|
||||||
void readStimplanGridAndTimesteps(QXmlStreamReader &xmlStream);
|
void readStimplanGridAndTimesteps(QXmlStreamReader &xmlStream);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user