mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fault reactivation: Improve POR-Bar extraction.
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#include "RimFaultReactivationDataAccessorVoidRatio.h"
|
||||
#include "RimFaultReactivationEnums.h"
|
||||
#include "RimFaultReactivationModel.h"
|
||||
#include <limits>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -179,20 +180,24 @@ std::vector<double> RimFaultReactivationDataAccess::extractModelData( const RigF
|
||||
CAF_ASSERT( it != borderSurfaceElements.end() && "Sea bed border surface does not exist" );
|
||||
std::set<unsigned int> seabedElements( it->second.begin(), it->second.end() );
|
||||
|
||||
std::vector<double> values;
|
||||
|
||||
if ( nodeProperties.contains( property ) )
|
||||
{
|
||||
for ( auto& node : grid->dataNodes() )
|
||||
int numNodes = static_cast<int>( grid->dataNodes().size() );
|
||||
std::vector<double> values( numNodes, std::numeric_limits<double>::infinity() );
|
||||
|
||||
for ( int nodeIndex = 0; nodeIndex < numNodes; nodeIndex++ )
|
||||
{
|
||||
double value = accessor->valueAtPosition( node, model, gridPart );
|
||||
values.push_back( value );
|
||||
double value = accessor->valueAtPosition( grid->dataNodes()[nodeIndex], model, gridPart );
|
||||
values[nodeIndex] = value;
|
||||
}
|
||||
return values;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t numElements = grid->elementIndices().size();
|
||||
for ( size_t elementIndex = 0; elementIndex < numElements; elementIndex++ )
|
||||
int numElements = static_cast<int>( grid->elementIndices().size() );
|
||||
std::vector<double> values( numElements, std::numeric_limits<double>::infinity() );
|
||||
|
||||
for ( int elementIndex = 0; elementIndex < numElements; elementIndex++ )
|
||||
{
|
||||
std::vector<cvf::Vec3d> corners = grid->elementDataCorners( elementIndex );
|
||||
|
||||
@@ -203,13 +208,12 @@ std::vector<double> RimFaultReactivationDataAccess::extractModelData( const RigF
|
||||
double topDepth = computeAverageDepth( corners, { 0, 1, 2, 3 } ) - topDepthAdjust;
|
||||
double bottomDepth = computeAverageDepth( corners, { 4, 5, 6, 7 } );
|
||||
|
||||
cvf::Vec3d position = RigCaseToCaseCellMapperTools::calculateCellCenter( corners.data() );
|
||||
double value = accessor->valueAtPosition( position, model, gridPart, topDepth, bottomDepth, elementIndex );
|
||||
values.push_back( value );
|
||||
cvf::Vec3d position = RigCaseToCaseCellMapperTools::calculateCellCenter( corners.data() );
|
||||
double value = accessor->valueAtPosition( position, model, gridPart, topDepth, bottomDepth, elementIndex );
|
||||
values[elementIndex] = value;
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user