mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-09 23:53:04 -06:00
#3534 Completion Export : Guard for missing width values
This commit is contained in:
parent
5cddab62ac
commit
59f0112f2e
@ -174,21 +174,27 @@ double RigEclipseToStimPlanCalculator::areaWeightedWidth() const
|
|||||||
auto stimPlanFractureTemplate = dynamic_cast<const RimStimPlanFractureTemplate*>(m_fracture->fractureTemplate());
|
auto stimPlanFractureTemplate = dynamic_cast<const RimStimPlanFractureTemplate*>(m_fracture->fractureTemplate());
|
||||||
if (stimPlanFractureTemplate)
|
if (stimPlanFractureTemplate)
|
||||||
{
|
{
|
||||||
RiaWeightedMeanCalculator<double> calc;
|
|
||||||
|
|
||||||
auto widthValues = stimPlanFractureTemplate->widthResultValues();
|
auto widthValues = stimPlanFractureTemplate->widthResultValues();
|
||||||
|
if (!widthValues.empty())
|
||||||
for (const auto& singleCellCalc : m_singleFractureCellCalculators)
|
|
||||||
{
|
{
|
||||||
double cellArea = singleCellCalc.second.areaOpenForFlow();
|
RiaWeightedMeanCalculator<double> calc;
|
||||||
|
|
||||||
size_t globalStimPlanCellIndex = singleCellCalc.first;
|
for (const auto& singleCellCalc : m_singleFractureCellCalculators)
|
||||||
double widthValue = widthValues[globalStimPlanCellIndex];
|
{
|
||||||
|
double cellArea = singleCellCalc.second.areaOpenForFlow();
|
||||||
|
|
||||||
calc.addValueAndWeight(widthValue, cellArea);
|
size_t globalStimPlanCellIndex = singleCellCalc.first;
|
||||||
|
double widthValue = widthValues[globalStimPlanCellIndex];
|
||||||
|
|
||||||
|
calc.addValueAndWeight(widthValue, cellArea);
|
||||||
|
}
|
||||||
|
|
||||||
|
width = calc.weightedMean();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
width = stimPlanFractureTemplate->computeFractureWidth(m_fracture);
|
||||||
}
|
}
|
||||||
|
|
||||||
width = calc.weightedMean();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return width;
|
return width;
|
||||||
|
Loading…
Reference in New Issue
Block a user