#1139 - pre-proto - Adjustments in reading of XML file to handle files with multiple time-steps and several parameters.

This commit is contained in:
astridkbjorke
2017-02-15 10:32:34 +01:00
parent 3fac46b1a9
commit ff59429ad8
4 changed files with 185 additions and 43 deletions

View File

@@ -33,3 +33,45 @@ RigStimPlanFractureDefinition::~RigStimPlanFractureDefinition()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigStimPlanFractureDefinition::timeStepExisist(double timeStepValueToCheck)
{
for (double timeStep : timeSteps)
{
if (abs(timeStepValueToCheck - timeStep) < 1e-5) return true;
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigStimPlanFractureDefinition::reorderYgridToDepths()
{
std::vector<double> depthsInIncreasingOrder;
for (double gridYvalue : gridYs)
{
depthsInIncreasingOrder.insert(depthsInIncreasingOrder.begin(), gridYvalue);
}
depths = depthsInIncreasingOrder;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigStimPlanFractureDefinition::getTimeStepIndex(double timeStepValue)
{
size_t index = 0;
while (index < timeSteps.size())
{
if (abs(timeSteps[index] - timeStepValue) < 1e-4)
{
return index;
}
index++;
}
return -1; //returns -1 if not found
}