#2295. Guard for null frac template where it is being used

This commit is contained in:
Bjørn Erik Jensen 2018-01-02 12:53:52 +01:00
parent c27058f2a4
commit 82d8b7c98a
3 changed files with 20 additions and 4 deletions

View File

@ -141,9 +141,11 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
for (RimFracture* fracture : fractures)
{
bool useFiniteConductivityInFracture = (fracture->fractureTemplate()->conductivityType() == RimFractureTemplate::FINITE_CONDUCTIVITY);
RimFractureTemplate* fracTemplate = fracture->fractureTemplate();
if (!fracTemplate) continue;
bool useFiniteConductivityInFracture = (fracTemplate->conductivityType() == RimFractureTemplate::FINITE_CONDUCTIVITY);
const RigFractureGrid* fractureGrid = fracTemplate->fractureGrid();
//If finite cond chosen and conductivity not present in stimplan file, do not calculate trans for this fracture

View File

@ -113,12 +113,19 @@ void RivWellFracturePartMgr::generateSurfacePart(const caf::DisplayCoordTransfor
//--------------------------------------------------------------------------------------------------
void RivWellFracturePartMgr::generateContainmentMaskPart(const RimEclipseView* activeView)
{
std::vector<cvf::Vec3f> borderPolygonLocalCS = m_rimFracture->fractureTemplate()->fractureBorderPolygon(m_rimFracture->fractureUnit());
RimFractureTemplate* fracTemplate = m_rimFracture->fractureTemplate();
std::vector<cvf::Vec3f> borderPolygonLocalCS;
cvf::Mat4d frMx = m_rimFracture->transformMatrix();
cvf::BoundingBox frBBox;
std::vector<cvf::Vec3d> borderPolygonGlobCs;
std::vector<cvf::Vec3d> borderPolygonLocalCsd;
if (fracTemplate)
{
borderPolygonLocalCS = fracTemplate->fractureBorderPolygon(m_rimFracture->fractureUnit());
}
for (const auto& pv: borderPolygonLocalCS)
{
cvf::Vec3d pvd(pv);
@ -450,7 +457,12 @@ cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createStimPlanMeshDrawable(Ri
//--------------------------------------------------------------------------------------------------
void RivWellFracturePartMgr::getPolygonBB(float &polygonXmin, float &polygonXmax, float &polygonYmin, float &polygonYmax)
{
std::vector<cvf::Vec3f> polygon = m_rimFracture->fractureTemplate()->fractureBorderPolygon(m_rimFracture->fractureUnit());
std::vector<cvf::Vec3f> polygon;
if (m_rimFracture->fractureTemplate())
{
polygon = m_rimFracture->fractureTemplate()->fractureBorderPolygon(m_rimFracture->fractureUnit());
}
if (polygon.size() > 1)
{
@ -477,6 +489,7 @@ cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createPolygonDrawable(const c
std::vector<cvf::uint> lineIndices;
std::vector<cvf::Vec3f> vertices;
if(m_rimFracture->fractureTemplate())
{
std::vector<cvf::Vec3f> polygon = m_rimFracture->fractureTemplate()->fractureBorderPolygon(m_rimFracture->fractureUnit());

View File

@ -44,6 +44,7 @@ RigWellPathStimplanIntersector::RigWellPathStimplanIntersector(const RigWellPath
{
RimFractureTemplate* fractureTemplate = rimFracture->fractureTemplate();
if(fractureTemplate)
{
const std::vector<RigFractureCell>& stpCells = fractureTemplate->fractureGrid()->fractureCells();
for ( const auto& stpCell: stpCells ) stpCellPolygons.push_back(stpCell.getPolygon());