Refactor: Update usage of caf::VecIjk.

This commit is contained in:
Kristian Bendiksen committed 2025-11-14 14:44:21 +01:00
1 parent 3b81080086
commit 38c691d9a4
31 files changed
+132 -152

No files matched your search

@@ -25,8 +25,8 @@
//--------------------------------------------------------------------------------------------------
RigActiveCellInfo::RigActiveCellInfo()
: m_reservoirActiveCellCount( 0 )
, m_activeCellPositionMin( cvf::Vec3d::ZERO )
, m_activeCellPositionMax( cvf::Vec3d::ZERO )
, m_activeCellPositionMin( 0, 0, 0 )
, m_activeCellPositionMax( 0, 0, 0 )
{
}
@@ -139,7 +139,7 @@ size_t RigActiveCellInfo::reservoirActiveCellCount() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigActiveCellInfo::setIjkBoundingBox( const cvf::Vec3st& min, const cvf::Vec3st& max )
void RigActiveCellInfo::setIjkBoundingBox( const caf::VecIjk0& min, const caf::VecIjk0& max )
{
m_activeCellPositionMin = min;
m_activeCellPositionMax = max;
@@ -148,7 +148,7 @@ void RigActiveCellInfo::setIjkBoundingBox( const cvf::Vec3st& min, const cvf::Ve
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::pair<cvf::Vec3st, cvf::Vec3st> RigActiveCellInfo::ijkBoundingBox() const
std::pair<caf::VecIjk0, caf::VecIjk0> RigActiveCellInfo::ijkBoundingBox() const
{
return std::make_pair( m_activeCellPositionMin, m_activeCellPositionMax );
}
@@ -185,8 +185,8 @@ void RigActiveCellInfo::clear()
m_perGridActiveCellInfo.clear();
m_cellIndexToResultIndex.clear();
m_reservoirActiveCellCount = 0;
m_activeCellPositionMin = cvf::Vec3st( 0, 0, 0 );
m_activeCellPositionMax = cvf::Vec3st( 0, 0, 0 );
m_activeCellPositionMin = caf::VecIjk0( 0, 0, 0 );
m_activeCellPositionMax = caf::VecIjk0( 0, 0, 0 );
m_activeCellsBoundingBox.reset();
}
@@ -22,9 +22,9 @@
#include "RigTypeSafeIndex.h"
#include "cafVecIjk.h"
#include "cvfBoundingBox.h"
#include "cvfObject.h"
#include "cvfVector3.h"
#include <vector>
@@ -47,8 +47,8 @@ public:
size_t gridActiveCellCounts( size_t gridIndex ) const;
void computeDerivedData();
void setIjkBoundingBox( const cvf::Vec3st& min, const cvf::Vec3st& max );
std::pair<cvf::Vec3st, cvf::Vec3st> ijkBoundingBox() const;
void setIjkBoundingBox( const caf::VecIjk0& min, const caf::VecIjk0& max );
std::pair<caf::VecIjk0, caf::VecIjk0> ijkBoundingBox() const;
cvf::BoundingBox geometryBoundingBox() const;
void setGeometryBoundingBox( cvf::BoundingBox bb );
@@ -78,8 +78,8 @@ private:
size_t m_reservoirActiveCellCount;
cvf::Vec3st m_activeCellPositionMin;
cvf::Vec3st m_activeCellPositionMax;
caf::VecIjk0 m_activeCellPositionMin;
caf::VecIjk0 m_activeCellPositionMax;
cvf::BoundingBox m_activeCellsBoundingBox;
};
@@ -401,7 +401,7 @@ class CellRangeBB
public:
CellRangeBB()
: m_min( cvf::UNDEFINED_SIZE_T, cvf::UNDEFINED_SIZE_T, cvf::UNDEFINED_SIZE_T )
, m_max( cvf::Vec3st::ZERO )
, m_max( 0, 0, 0 )
{
}
@@ -417,8 +417,8 @@ public:
}
public:
cvf::Vec3st m_min;
cvf::Vec3st m_max;
caf::VecIjk0 m_min;
caf::VecIjk0 m_max;
};
//--------------------------------------------------------------------------------------------------
@@ -249,12 +249,12 @@ bool RigGridBase::ijkFromCellIndex( size_t cellIndex, size_t* i, size_t* j, size
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::optional<caf::VecIjk> RigGridBase::ijkFromCellIndex( size_t cellIndex ) const
std::optional<caf::VecIjk0> RigGridBase::ijkFromCellIndex( size_t cellIndex ) const
{
size_t i, j, k;
if ( ijkFromCellIndex( cellIndex, &i, &j, &k ) )
{
return caf::VecIjk( i, j, k );
return caf::VecIjk0( i, j, k );
}
return std::nullopt;
@@ -102,7 +102,7 @@ public:
bool ijkFromCellIndex( size_t cellIndex, size_t* i, size_t* j, size_t* k ) const override;
virtual void ijkFromCellIndexUnguarded( size_t cellIndex, size_t* i, size_t* j, size_t* k ) const;
std::optional<caf::VecIjk> ijkFromCellIndex( size_t cellIndex ) const;
std::optional<caf::VecIjk0> ijkFromCellIndex( size_t cellIndex ) const;
bool cellIJKFromCoordinate( const cvf::Vec3d& coord, size_t* i, size_t* j, size_t* k ) const override; // unused
void cellMinMaxCordinates( size_t cellIndex, cvf::Vec3d* minCoordinate, cvf::Vec3d* maxCoordinate ) const override; // unused
@@ -305,7 +305,7 @@ cvf::Vec3d RigWellResultPoint::bottomPosition() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::optional<caf::VecIjk> RigWellResultPoint::cellIjk() const
std::optional<caf::VecIjk1> RigWellResultPoint::cellIjk() const
{
return m_cellIjk;
}
@@ -313,7 +313,7 @@ std::optional<caf::VecIjk> RigWellResultPoint::cellIjk() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigWellResultPoint::setIjk( caf::VecIjk cellIJK )
void RigWellResultPoint::setIjk( caf::VecIjk1 cellIJK )
{
m_cellIjk = cellIJK;
}
@@ -73,8 +73,8 @@ struct RigWellResultPoint
cvf::Vec3d bottomPosition() const;
std::optional<caf::VecIjk> cellIjk() const;
void setIjk( caf::VecIjk cellIJK );
std::optional<caf::VecIjk1> cellIjk() const;
void setIjk( caf::VecIjk1 cellIJK );
private:
size_t m_gridIndex;
@@ -96,5 +96,5 @@ private:
double m_connectionFactor;
bool m_isConnectedToValve;
std::optional<caf::VecIjk> m_cellIjk;
std::optional<caf::VecIjk1> m_cellIjk;
};
@@ -167,7 +167,7 @@ void RigWellTargetMapping::generateCandidates( RimEclipseCase* eclips
int numClustersFound = 0;
for ( int clusterId = 1; clusterId <= numClusters; clusterId++ )
{
std::optional<caf::VecIjk> startCell = findStartCell( eclipseCase, timeStepIdx, volumeType, limits, data, filterVector, clusters );
std::optional<caf::VecIjk0> startCell = findStartCell( eclipseCase, timeStepIdx, volumeType, limits, data, filterVector, clusters );
if ( startCell.has_value() )
{
@@ -296,13 +296,13 @@ void RigWellTargetMapping::generateCandidates( RimEclipseCase* eclips
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::optional<caf::VecIjk> RigWellTargetMapping::findStartCell( RimEclipseCase* eclipseCase,
size_t timeStepIdx,
const VolumeType volumeType,
const ClusteringLimits& limits,
const DataContainer& data,
const std::vector<double>& filterVector,
const std::vector<int>& clusters )
std::optional<caf::VecIjk0> RigWellTargetMapping::findStartCell( RimEclipseCase* eclipseCase,
size_t timeStepIdx,
const VolumeType volumeType,
const ClusteringLimits& limits,
const DataContainer& data,
const std::vector<double>& filterVector,
const std::vector<int>& clusters )
{
auto resultsData = eclipseCase->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
if ( !resultsData )
@@ -346,7 +346,7 @@ std::optional<caf::VecIjk> RigWellTargetMapping::findStartCell( RimEclipseCase*
///
//--------------------------------------------------------------------------------------------------
void RigWellTargetMapping::growCluster( RimEclipseCase* eclipseCase,
const caf::VecIjk& startCell,
const caf::VecIjk0& startCell,
const VolumeType volumeType,
const ClusteringLimits& limits,
const DataContainer& data,
@@ -159,16 +159,16 @@ public:
};
private:
static std::optional<caf::VecIjk> findStartCell( RimEclipseCase* eclipseCase,
size_t timeStepIdx,
const VolumeType volumeType,
const ClusteringLimits& limits,
const DataContainer& data,
const std::vector<double>& filterVector,
const std::vector<int>& clusters );
static std::optional<caf::VecIjk0> findStartCell( RimEclipseCase* eclipseCase,
size_t timeStepIdx,
const VolumeType volumeType,
const ClusteringLimits& limits,
const DataContainer& data,
const std::vector<double>& filterVector,
const std::vector<int>& clusters );
static void growCluster( RimEclipseCase* eclipseCase,
const caf::VecIjk& startCell,
const caf::VecIjk0& startCell,
const VolumeType volumeType,
const ClusteringLimits& limits,
const DataContainer& data,