mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 14:40:26 -05:00
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:
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 };
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user