mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-11 07:56:08 -06:00
Fix crashes when exporting completions from input grid
This commit is contained in:
parent
c291f22d4d
commit
647bf0cf46
@ -1164,12 +1164,16 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::gener
|
||||
const RigActiveCellInfo* activeCellInfo =
|
||||
settings.caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
|
||||
auto timeSteps = settings.caseToApply->timeStepDates();
|
||||
|
||||
if ( wellPath->perforationIntervalCollection()->isChecked() )
|
||||
{
|
||||
for ( const RimPerforationInterval* interval : intervals )
|
||||
{
|
||||
if ( !interval->isChecked() ) continue;
|
||||
if ( !interval->isActiveOnDate( settings.caseToApply->timeStepDates()[settings.timeStep] ) ) continue;
|
||||
if ( (size_t)settings.timeStep < timeSteps.size() &&
|
||||
!interval->isActiveOnDate( settings.caseToApply->timeStepDates()[settings.timeStep] ) )
|
||||
continue;
|
||||
|
||||
using namespace std;
|
||||
pair<vector<cvf::Vec3d>, vector<double>> perforationPointsAndMD =
|
||||
|
@ -807,7 +807,8 @@ double RicWellPathExportMswCompletionsImpl::calculateLengthThroughActiveCells(
|
||||
double totalOverlap = 0.0;
|
||||
for ( const WellPathCellIntersectionInfo& intersection : wellPathIntersections )
|
||||
{
|
||||
if ( activeCellInfo->isActive( intersection.globCellIndex ) )
|
||||
if ( intersection.globCellIndex < activeCellInfo->reservoirCellCount() &&
|
||||
activeCellInfo->isActive( intersection.globCellIndex ) )
|
||||
{
|
||||
double overlapStart = std::max( startMD, intersection.startMD );
|
||||
double overlapEnd = std::min( endMD, intersection.endMD );
|
||||
@ -1993,8 +1994,10 @@ std::vector<RigCompletionData>
|
||||
const RigActiveCellInfo* activeCellInfo =
|
||||
eclipseCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
|
||||
if ( wellPath->perforationIntervalCollection()->isChecked() && perforationInterval->isChecked() &&
|
||||
perforationInterval->isActiveOnDate( eclipseCase->timeStepDates()[timeStep] ) )
|
||||
bool hasDate = (size_t)timeStep < eclipseCase->timeStepDates().size();
|
||||
bool isActive = !hasDate || perforationInterval->isActiveOnDate( eclipseCase->timeStepDates()[timeStep] );
|
||||
|
||||
if ( wellPath->perforationIntervalCollection()->isChecked() && perforationInterval->isChecked() && isActive )
|
||||
{
|
||||
std::pair<std::vector<cvf::Vec3d>, std::vector<double>> perforationPointsAndMD =
|
||||
wellPath->wellPathGeometry()->clippedPointSubset( perforationInterval->startMD(),
|
||||
|
Loading…
Reference in New Issue
Block a user