Fault distance from point (#13367)

* Add python interface for distance to closest fault
* Split up some older code into multiple files.
* Add python test
This commit is contained in:
JJ authored and GitHub committed 2025-12-20 09:50:51 +01:00
1 parent 4d312ecc82
commit 225d034327
17 files changed
+896 -554

No files matched your search

@@ -809,6 +809,28 @@ const RigFault* RigMainGrid::findFaultFromCellIndexAndCellFace( size_t reservoir
return nullptr;
}
//--------------------------------------------------------------------------------------------------
/// Returns the name of the closest fault, the distance to the fault, and the face type of the closest face
//--------------------------------------------------------------------------------------------------
std::tuple<QString, double, cvf::StructGridInterface::FaceType> RigMainGrid::minimumDistanceFaultToPoint( const cvf::Vec3d& point ) const
{
double minDistance = std::numeric_limits<double>::max();
cvf::StructGridInterface::FaceType minFace = cvf::StructGridInterface::FaceType::NO_FACE;
QString minFaultName;
for ( const auto& fault : m_faults )
{
auto [faultMinDistance, faultMinFace] = fault->minimumDistanceToPoint( point, this );
if ( faultMinDistance < minDistance )
{
minDistance = faultMinDistance;
minFace = faultMinFace;
minFaultName = fault->name();
}
}
return { minFaultName, minDistance, minFace };
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------