mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user