mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1926 Fishbones Export : Guard input values to std::vector::reserve()
This commit is contained in:
parent
d83c468033
commit
edd39b6ff1
@ -138,19 +138,23 @@ void RigEclipseWellLogExtractor::curveData(const RigResultAccessor* resultAccess
|
|||||||
std::vector<WellPathCellIntersectionInfo> RigEclipseWellLogExtractor::cellIntersectionInfo()
|
std::vector<WellPathCellIntersectionInfo> RigEclipseWellLogExtractor::cellIntersectionInfo()
|
||||||
{
|
{
|
||||||
std::vector<WellPathCellIntersectionInfo> cellIntersectionInfos;
|
std::vector<WellPathCellIntersectionInfo> cellIntersectionInfos;
|
||||||
cellIntersectionInfos.reserve(m_intersections.size()-1);
|
|
||||||
|
|
||||||
for (size_t cpIdx = 0; cpIdx < m_intersections.size()-1; ++cpIdx)
|
if (m_intersections.size() > 1)
|
||||||
{
|
{
|
||||||
size_t cellIdx1 = m_intersectedCells[cpIdx];
|
cellIntersectionInfos.reserve(m_intersections.size()-1);
|
||||||
size_t cellIdx2 = m_intersectedCells[cpIdx+1];
|
|
||||||
|
|
||||||
if (cellIdx1 == cellIdx2)
|
for (size_t cpIdx = 0; cpIdx < m_intersections.size()-1; ++cpIdx)
|
||||||
{
|
{
|
||||||
cvf::Vec3d internalCellLengths;
|
size_t cellIdx1 = m_intersectedCells[cpIdx];
|
||||||
internalCellLengths = RigWellPathIntersectionTools::calculateLengthInCell( m_caseData->mainGrid(), cellIdx1, m_intersections[cpIdx], m_intersections[cpIdx+1] );
|
size_t cellIdx2 = m_intersectedCells[cpIdx+1];
|
||||||
|
|
||||||
cellIntersectionInfos.push_back(WellPathCellIntersectionInfo(cellIdx1, m_intersections[cpIdx], m_intersections[cpIdx+1], internalCellLengths));
|
if (cellIdx1 == cellIdx2)
|
||||||
|
{
|
||||||
|
cvf::Vec3d internalCellLengths;
|
||||||
|
internalCellLengths = RigWellPathIntersectionTools::calculateLengthInCell( m_caseData->mainGrid(), cellIdx1, m_intersections[cpIdx], m_intersections[cpIdx+1] );
|
||||||
|
|
||||||
|
cellIntersectionInfos.push_back(WellPathCellIntersectionInfo(cellIdx1, m_intersections[cpIdx], m_intersections[cpIdx+1], internalCellLengths));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user