diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.cpp index 0b3379eedc..451f954768 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.cpp +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.cpp @@ -72,7 +72,8 @@ const RigFemPartGrid* RigFemPart::getOrCreateStructGrid() const { if ( m_structGrid.isNull() ) { - m_structGrid = new RigFemPartGrid( this ); + m_structGrid = new RigFemPartGrid(); + m_structGrid->setFemPart( this ); } return m_structGrid.p(); diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartGrid.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartGrid.cpp index cbe5283411..9861d33b3c 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartGrid.cpp +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartGrid.cpp @@ -26,10 +26,9 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigFemPartGrid::RigFemPartGrid( const RigFemPart* femPart ) +RigFemPartGrid::RigFemPartGrid() + : m_femPart( nullptr ) { - m_femPart = femPart; - generateStructGridData(); } //-------------------------------------------------------------------------------------------------- @@ -37,6 +36,15 @@ RigFemPartGrid::RigFemPartGrid( const RigFemPart* femPart ) //-------------------------------------------------------------------------------------------------- RigFemPartGrid::~RigFemPartGrid() {} +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigFemPartGrid::setFemPart( const RigFemPart* femPart ) +{ + m_femPart = femPart; + generateStructGridData(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartGrid.h b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartGrid.h index f01e859e9a..7c72aa9259 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartGrid.h +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartGrid.h @@ -26,9 +26,11 @@ class RigFemPart; class RigFemPartGrid : public cvf::StructGridInterface { public: - explicit RigFemPartGrid( const RigFemPart* femPart ); + RigFemPartGrid(); ~RigFemPartGrid() override; + void setFemPart( const RigFemPart* femPart ); + bool ijkFromCellIndex( size_t cellIndex, size_t* i, size_t* j, size_t* k ) const override; size_t cellIndexFromIJK( size_t i, size_t j, size_t k ) const override;