Fix automatic part id detection for Fault Reactivation Result, and resampling bug in RigWellLogCurveData

* Fix resampling bug and refactor code
- Fix bug for resampling, prevent index increment.
- Refactor functions into static functions.
- Fix issue in interpolateSegment not using correct indices for depthType != resamplingDepthType
- Add unit tests

* Change WellAllocationPlot to use step left
Remove dummy point and utilize step left for WellAllocationPont

* Fix bug in creating resampled values and depths for RigWellLogCurveData

* Fix automatic part detection for Fault Reactivation Result
- Fix incorrect automatic part detection
- Set default distance to intersection to 1.0 [m]
This commit is contained in:
Jørgen Herje
2023-06-20 10:08:10 +02:00
committed by GitHub
parent 22e9e7aeb0
commit 0685078ab3
9 changed files with 395 additions and 75 deletions

View File

@@ -124,6 +124,37 @@ const int* RigFemPart::connectivities( size_t elementIdx ) const
return &m_allElementConnectivities[m_elementConnectivityStartIndices[elementIdx]];
}
//--------------------------------------------------------------------------------------------------
/// Returns state of success for fill element coordinates
//--------------------------------------------------------------------------------------------------
bool RigFemPart::fillElementCoordinates( size_t elementIdx, std::array<cvf::Vec3d, 8>& coordinates ) const
{
const auto elemType = elementType( elementIdx );
const int* elemConnectivity = connectivities( elementIdx );
const auto nodeCount = RigFemTypes::elementNodeCount( elemType );
// Only handle element of hex for now - false success
if ( nodeCount != 8 ) return false;
// Retrieve the node indices
std::vector<int> nodeIndices;
for ( int i = 0; i < nodeCount; ++i )
{
const int nodeIdx = elemConnectivity[i];
nodeIndices.push_back( nodeIdx );
}
// Fill coordinates for each node
const auto& partNodes = nodes();
for ( int i = 0; i < nodeIndices.size(); ++i )
{
coordinates[i].set( partNodes.coordinates[nodeIndices[i]] );
}
// Return true success
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------