mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Geomech frames support (#9678)
Support for showing frames in geomech data.
This commit is contained in:
@@ -792,15 +792,19 @@ void RimPolygonFilter::updateCellsForGeoMech( const std::vector<cvf::Vec3d>& poi
|
||||
{
|
||||
if ( gCase->geoMechData() && gCase->geoMechData()->femParts()->partCount() > 0 )
|
||||
{
|
||||
const RigFemPartGrid* grid = gCase->geoMechData()->femParts()->part( 0 )->getOrCreateStructGrid();
|
||||
int partCount = gCase->geoMechData()->femParts()->partCount();
|
||||
for ( int i = 0; i < partCount; i++ )
|
||||
{
|
||||
const RigFemPartGrid* grid = gCase->geoMechData()->femParts()->part( i )->getOrCreateStructGrid();
|
||||
|
||||
if ( m_polyFilterMode == PolygonFilterModeType::DEPTH_Z )
|
||||
{
|
||||
updateCellsDepthGeoMech( points, grid );
|
||||
}
|
||||
else if ( m_polyFilterMode == PolygonFilterModeType::INDEX_K )
|
||||
{
|
||||
updateCellsKIndexGeoMech( points, grid );
|
||||
if ( m_polyFilterMode == PolygonFilterModeType::DEPTH_Z )
|
||||
{
|
||||
updateCellsDepthGeoMech( points, grid );
|
||||
}
|
||||
else if ( m_polyFilterMode == PolygonFilterModeType::INDEX_K )
|
||||
{
|
||||
updateCellsKIndexGeoMech( points, grid );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ QStringList RimGeoMechCase::timeStepStrings() const
|
||||
const RigGeoMechCaseData* rigCaseData = geoMechData();
|
||||
if ( rigCaseData && rigCaseData->femPartResults() )
|
||||
{
|
||||
std::vector<std::string> stepNames = rigCaseData->femPartResults()->filteredStepNames();
|
||||
std::vector<std::string> stepNames = rigCaseData->femPartResults()->stepNames();
|
||||
for ( size_t i = 0; i < stepNames.size(); i++ )
|
||||
{
|
||||
stringList += QString::fromStdString( stepNames[i] );
|
||||
@@ -496,15 +496,15 @@ QStringList RimGeoMechCase::timeStepStrings() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGeoMechCase::timeStepName( int frameIdx ) const
|
||||
QString RimGeoMechCase::timeStepName( int timeStepIdx ) const
|
||||
{
|
||||
const RigGeoMechCaseData* rigCaseData = geoMechData();
|
||||
if ( rigCaseData && rigCaseData->femPartResults() )
|
||||
{
|
||||
std::vector<std::string> stepNames = rigCaseData->femPartResults()->filteredStepNames();
|
||||
if ( frameIdx < static_cast<int>( stepNames.size() ) )
|
||||
std::vector<std::string> stepNames = rigCaseData->femPartResults()->stepNames();
|
||||
if ( timeStepIdx < static_cast<int>( stepNames.size() ) )
|
||||
{
|
||||
return QString::fromStdString( stepNames[frameIdx] );
|
||||
return QString::fromStdString( stepNames[timeStepIdx] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,28 +519,31 @@ cvf::BoundingBox RimGeoMechCase::reservoirBoundingBox()
|
||||
cvf::BoundingBox boundingBox;
|
||||
|
||||
RigGeoMechCaseData* rigCaseData = this->geoMechData();
|
||||
if ( rigCaseData && rigCaseData->femPartResults() && rigCaseData->femParts()->part( 0 ) )
|
||||
if ( rigCaseData && rigCaseData->femPartResults() && rigCaseData->femParts() )
|
||||
{
|
||||
RigFemPart* femPart = rigCaseData->femParts()->part( 0 );
|
||||
const RigFemPartGrid* femPartGrid = femPart->getOrCreateStructGrid();
|
||||
|
||||
RigFemResultAddress porBarAddr( RigFemResultPosEnum::RIG_ELEMENT_NODAL, "POR-Bar", "" );
|
||||
const std::vector<float>& resultValues = rigCaseData->femPartResults()->resultValues( porBarAddr, 0, 0 );
|
||||
|
||||
for ( int i = 0; i < femPart->elementCount(); ++i )
|
||||
for ( int p = 0; p < rigCaseData->femParts()->partCount(); p++ )
|
||||
{
|
||||
size_t resValueIdx = femPart->elementNodeResultIdx( (int)i, 0 );
|
||||
CVF_ASSERT( resValueIdx < resultValues.size() );
|
||||
double scalarValue = resultValues[resValueIdx];
|
||||
bool validPorValue = scalarValue != std::numeric_limits<double>::infinity();
|
||||
RigFemPart* femPart = rigCaseData->femParts()->part( p );
|
||||
const RigFemPartGrid* femPartGrid = femPart->getOrCreateStructGrid();
|
||||
|
||||
if ( validPorValue )
|
||||
RigFemResultAddress porBarAddr( RigFemResultPosEnum::RIG_ELEMENT_NODAL, "POR-Bar", "" );
|
||||
const std::vector<float>& resultValues = rigCaseData->femPartResults()->resultValues( porBarAddr, p, 0, 0 );
|
||||
|
||||
for ( int i = 0; i < femPart->elementCount(); ++i )
|
||||
{
|
||||
std::array<cvf::Vec3d, 8> hexCorners;
|
||||
femPartGrid->cellCornerVertices( i, hexCorners.data() );
|
||||
for ( size_t c = 0; c < 8; ++c )
|
||||
size_t resValueIdx = femPart->elementNodeResultIdx( (int)i, 0 );
|
||||
CVF_ASSERT( resValueIdx < resultValues.size() );
|
||||
double scalarValue = resultValues[resValueIdx];
|
||||
bool validPorValue = scalarValue != std::numeric_limits<double>::infinity();
|
||||
|
||||
if ( validPorValue )
|
||||
{
|
||||
boundingBox.add( hexCorners[c] );
|
||||
std::array<cvf::Vec3d, 8> hexCorners;
|
||||
femPartGrid->cellCornerVertices( i, hexCorners.data() );
|
||||
for ( size_t c = 0; c < 8; ++c )
|
||||
{
|
||||
boundingBox.add( hexCorners[c] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
|
||||
std::vector<QDateTime> timeStepDates() const override;
|
||||
QStringList timeStepStrings() const override;
|
||||
QString timeStepName( int frameIdx ) const override;
|
||||
QString timeStepName( int timeStepIdx ) const override;
|
||||
|
||||
cvf::BoundingBox reservoirBoundingBox() override;
|
||||
cvf::BoundingBox activeCellsBoundingBox() const override;
|
||||
|
||||
@@ -159,9 +159,12 @@ cvf::ref<cvf::UByteArray> RimGeoMechContourMapProjection::getCellVisibility() co
|
||||
}
|
||||
if ( view()->propertyFilterCollection()->isActive() )
|
||||
{
|
||||
auto [stepIdx, frameIdx] = view()->currentStepAndDataFrame();
|
||||
|
||||
RivFemElmVisibilityCalculator::computePropertyVisibility( cellGridIdxVisibility.p(),
|
||||
m_femPart.p(),
|
||||
view()->currentTimeStep(),
|
||||
stepIdx,
|
||||
frameIdx,
|
||||
cellGridIdxVisibility.p(),
|
||||
view()->geoMechPropertyFilterCollection() );
|
||||
}
|
||||
@@ -172,7 +175,7 @@ cvf::ref<cvf::UByteArray> RimGeoMechContourMapProjection::getCellVisibility() co
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::BoundingBox RimGeoMechContourMapProjection::calculateExpandedPorBarBBox( int timeStep ) const
|
||||
cvf::BoundingBox RimGeoMechContourMapProjection::calculateExpandedPorBarBBox( int timeStep, int frameIndex ) const
|
||||
{
|
||||
RigFemResultAddress porBarAddr( RigFemResultPosEnum::RIG_ELEMENT_NODAL,
|
||||
"POR-Bar",
|
||||
@@ -180,7 +183,7 @@ cvf::BoundingBox RimGeoMechContourMapProjection::calculateExpandedPorBarBBox( in
|
||||
RigGeoMechCaseData* caseData = geoMechCase()->geoMechData();
|
||||
RigFemPartResultsCollection* resultCollection = caseData->femPartResults();
|
||||
|
||||
const std::vector<float>& resultValues = resultCollection->resultValues( porBarAddr, 0, timeStep );
|
||||
const std::vector<float>& resultValues = resultCollection->resultValues( porBarAddr, 0, timeStep, frameIndex );
|
||||
cvf::BoundingBox boundingBox;
|
||||
|
||||
if ( resultValues.empty() )
|
||||
@@ -230,7 +233,9 @@ void RimGeoMechContourMapProjection::updateGridInformation()
|
||||
|
||||
if ( m_limitToPorePressureRegions )
|
||||
{
|
||||
m_expandedBoundingBox = calculateExpandedPorBarBBox( view()->currentTimeStep() );
|
||||
auto [stepIdx, frameIdx] = view()->currentStepAndDataFrame();
|
||||
|
||||
m_expandedBoundingBox = calculateExpandedPorBarBBox( stepIdx, frameIdx );
|
||||
if ( !m_expandedBoundingBox.isValid() )
|
||||
{
|
||||
m_limitToPorePressureRegions = false;
|
||||
@@ -333,12 +338,13 @@ std::vector<double> RimGeoMechContourMapProjection::retrieveParameterWeights()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RimGeoMechContourMapProjection::generateResults( int timeStep )
|
||||
std::vector<double> RimGeoMechContourMapProjection::generateResults( int viewerStepIndex )
|
||||
{
|
||||
RimGeoMechCellColors* cellColors = view()->cellResult();
|
||||
RigFemResultAddress resultAddress = cellColors->resultAddress();
|
||||
|
||||
std::vector<double> aggregatedResults = generateResultsFromAddress( resultAddress, m_mapCellVisibility, timeStep );
|
||||
std::vector<double> aggregatedResults =
|
||||
generateResultsFromAddress( resultAddress, m_mapCellVisibility, viewerStepIndex );
|
||||
|
||||
return aggregatedResults;
|
||||
}
|
||||
@@ -348,13 +354,15 @@ std::vector<double> RimGeoMechContourMapProjection::generateResults( int timeSte
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RimGeoMechContourMapProjection::generateResultsFromAddress( RigFemResultAddress resultAddress,
|
||||
const std::vector<bool>& mapCellVisibility,
|
||||
int timeStep )
|
||||
int viewerStepIndex )
|
||||
{
|
||||
RigGeoMechCaseData* caseData = geoMechCase()->geoMechData();
|
||||
RigFemPartResultsCollection* resultCollection = caseData->femPartResults();
|
||||
size_t nCells = numberOfCells();
|
||||
std::vector<double> aggregatedResults = std::vector<double>( nCells, std::numeric_limits<double>::infinity() );
|
||||
|
||||
auto [stepIdx, frameIdx] = caseData->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( viewerStepIndex );
|
||||
|
||||
bool wasInvalid = false;
|
||||
if ( !resultAddress.isValid() )
|
||||
{
|
||||
@@ -375,7 +383,7 @@ std::vector<double> RimGeoMechContourMapProjection::generateResultsFromAddress(
|
||||
resultAddress.resultPosType = RIG_ELEMENT_NODAL; // formation indices are stored per element node result.
|
||||
}
|
||||
|
||||
std::vector<float> resultValuesF = resultCollection->resultValues( resultAddress, 0, timeStep );
|
||||
std::vector<float> resultValuesF = resultCollection->resultValues( resultAddress, 0, stepIdx, frameIdx );
|
||||
if ( resultValuesF.empty() ) return aggregatedResults;
|
||||
|
||||
std::vector<double> resultValues = gridCellValues( resultAddress, resultValuesF );
|
||||
@@ -672,3 +680,32 @@ void RimGeoMechContourMapProjection::defineEditorAttribute( const caf::PdmFieldH
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<double, double> RimGeoMechContourMapProjection::minmaxValuesAllTimeSteps()
|
||||
{
|
||||
if ( !resultRangeIsValid() )
|
||||
{
|
||||
clearTimeStepRange();
|
||||
|
||||
m_minResultAllTimeSteps = std::min( m_minResultAllTimeSteps, minValue( m_aggregatedResults ) );
|
||||
m_maxResultAllTimeSteps = std::max( m_maxResultAllTimeSteps, maxValue( m_aggregatedResults ) );
|
||||
|
||||
if ( geoMechCase() && geoMechCase()->geoMechData() && geoMechCase()->geoMechData()->femPartResults() )
|
||||
{
|
||||
int steps = geoMechCase()->geoMechData()->femPartResults()->totalSteps();
|
||||
|
||||
for ( int stepIdx = 0; stepIdx < steps; stepIdx++ )
|
||||
{
|
||||
if ( stepIdx == m_currentResultTimestep ) continue;
|
||||
|
||||
std::vector<double> aggregatedResults = generateResults( stepIdx );
|
||||
m_minResultAllTimeSteps = std::min( m_minResultAllTimeSteps, minValue( aggregatedResults ) );
|
||||
m_maxResultAllTimeSteps = std::max( m_maxResultAllTimeSteps, maxValue( aggregatedResults ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
return std::make_pair( m_minResultAllTimeSteps, m_maxResultAllTimeSteps );
|
||||
}
|
||||
|
||||
@@ -62,14 +62,14 @@ protected:
|
||||
|
||||
// GeoMech implementation specific data generation methods
|
||||
cvf::ref<cvf::UByteArray> getCellVisibility() const override;
|
||||
cvf::BoundingBox calculateExpandedPorBarBBox( int timeStep ) const;
|
||||
cvf::BoundingBox calculateExpandedPorBarBBox( int timeStep, int frameIndex ) const;
|
||||
void updateGridInformation() override;
|
||||
std::vector<bool> getMapCellVisibility() override;
|
||||
std::vector<double> retrieveParameterWeights() override;
|
||||
std::vector<double> generateResults( int timeStep ) override;
|
||||
std::vector<double> generateResults( int viewerStepIndex ) override;
|
||||
std::vector<double> generateResultsFromAddress( RigFemResultAddress resultAddress,
|
||||
const std::vector<bool>& mapCellVisibility,
|
||||
int timeStep );
|
||||
int viewerStepIndex );
|
||||
bool resultVariableChanged() const override;
|
||||
void clearResultVariable() override;
|
||||
RimGridView* baseView() const override;
|
||||
@@ -85,6 +85,8 @@ protected:
|
||||
RimGeoMechCase* geoMechCase() const;
|
||||
RimGeoMechContourMapView* view() const;
|
||||
|
||||
std::pair<double, double> minmaxValuesAllTimeSteps() override;
|
||||
|
||||
void updateAfterResultGeneration( int timeStep ) override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -260,7 +260,7 @@ void RimGeoMechContourMapView::updateGeometry()
|
||||
{ // Step 1: generate results. About 30% of the time.
|
||||
if ( m_contourMapProjection->isChecked() )
|
||||
{
|
||||
m_contourMapProjection->generateResultsIfNecessary( m_currentTimeStep() );
|
||||
m_contourMapProjection->generateResultsIfNecessary( m_currentTimeStep );
|
||||
}
|
||||
onUpdateLegends();
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ QList<caf::PdmOptionItemInfo>
|
||||
std::vector<std::string> stepNames;
|
||||
if ( m_geomCase->geoMechData() )
|
||||
{
|
||||
stepNames = m_geomCase->geoMechData()->femPartResults()->filteredStepNames();
|
||||
stepNames = m_geomCase->geoMechData()->femPartResults()->stepNames();
|
||||
}
|
||||
|
||||
options.push_back( caf::PdmOptionItemInfo( QString( "Disabled" ), RigFemResultAddress::noTimeLapseValue() ) );
|
||||
@@ -265,7 +265,7 @@ QList<caf::PdmOptionItemInfo>
|
||||
std::vector<std::string> stepNames;
|
||||
if ( m_geomCase->geoMechData() )
|
||||
{
|
||||
stepNames = m_geomCase->geoMechData()->femPartResults()->filteredStepNames();
|
||||
stepNames = m_geomCase->geoMechData()->femPartResults()->stepNames();
|
||||
}
|
||||
|
||||
for ( size_t stepIdx = 0; stepIdx < stepNames.size(); ++stepIdx )
|
||||
@@ -698,14 +698,14 @@ QString RimGeoMechResultDefinition::diffResultUiName() const
|
||||
{
|
||||
if ( referenceCaseDependentResultSelected() )
|
||||
{
|
||||
std::vector<std::string> stepNames = m_geomCase->geoMechData()->femPartResults()->filteredStepNames();
|
||||
QString timeStepString = QString::fromStdString( stepNames[m_referenceTimeStep()] );
|
||||
std::vector<std::string> timeStepNames = m_geomCase->geoMechData()->femPartResults()->stepNames();
|
||||
QString timeStepString = QString::fromStdString( timeStepNames[m_referenceTimeStep()] );
|
||||
diffResultString += QString( "<b>Reference Time Step</b>: %1" ).arg( timeStepString );
|
||||
}
|
||||
else if ( m_timeLapseBaseTimestep != RigFemResultAddress::noTimeLapseValue() )
|
||||
{
|
||||
std::vector<std::string> stepNames = m_geomCase->geoMechData()->femPartResults()->filteredStepNames();
|
||||
QString timeStepString = QString::fromStdString( stepNames[m_timeLapseBaseTimestep()] );
|
||||
std::vector<std::string> timeStepNames = m_geomCase->geoMechData()->femPartResults()->stepNames();
|
||||
QString timeStepString = QString::fromStdString( timeStepNames[m_timeLapseBaseTimestep()] );
|
||||
diffResultString += QString( "<b>Base Time Step</b>: %1" ).arg( timeStepString );
|
||||
}
|
||||
}
|
||||
@@ -943,7 +943,7 @@ void RimGeoMechResultDefinition::setResultAddress( const RigFemResultAddress& re
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechResultDefinition::updateLegendTextAndRanges( RimRegularLegendConfig* legendConfigToUpdate,
|
||||
const QString& legendHeading,
|
||||
int timeStepIndex )
|
||||
int viewerStepIndex )
|
||||
{
|
||||
if ( !this->ownerCaseData() || !( this->resultAddress().isValid() ) )
|
||||
{
|
||||
@@ -960,8 +960,14 @@ void RimGeoMechResultDefinition::updateLegendTextAndRanges( RimRegularLegendConf
|
||||
|
||||
RigFemResultAddress resVarAddress = this->resultAddress();
|
||||
|
||||
gmCase->femPartResults()->minMaxScalarValues( resVarAddress, timeStepIndex, &localMin, &localMax );
|
||||
gmCase->femPartResults()->posNegClosestToZero( resVarAddress, timeStepIndex, &localPosClosestToZero, &localNegClosestToZero );
|
||||
auto [stepIdx, frameIdx] = gmCase->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( viewerStepIndex );
|
||||
|
||||
gmCase->femPartResults()->minMaxScalarValues( resVarAddress, stepIdx, frameIdx, &localMin, &localMax );
|
||||
gmCase->femPartResults()->posNegClosestToZero( resVarAddress,
|
||||
stepIdx,
|
||||
frameIdx,
|
||||
&localPosClosestToZero,
|
||||
&localNegClosestToZero );
|
||||
|
||||
gmCase->femPartResults()->minMaxScalarValues( resVarAddress, &globalMin, &globalMax );
|
||||
gmCase->femPartResults()->posNegClosestToZero( resVarAddress, &globalPosClosestToZero, &globalNegClosestToZero );
|
||||
|
||||
@@ -83,6 +83,8 @@ CAF_PDM_SOURCE_INIT( RimGeoMechView, "GeoMechView" );
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGeoMechView::RimGeoMechView( void )
|
||||
: m_currentInternalTimeStep( 0 )
|
||||
, m_currentDataFrameIndex( -1 )
|
||||
{
|
||||
CAF_PDM_InitScriptableObject( "Geomechanical View", ":/3DViewGeoMech16x16.png", "", "The Geomechanical 3d View" );
|
||||
|
||||
@@ -277,10 +279,9 @@ void RimGeoMechView::onCreateDisplayModel()
|
||||
|
||||
if ( isTimeStepDependentDataVisibleInThisOrComparisonView() )
|
||||
{
|
||||
// Create empty frames in the viewer
|
||||
|
||||
int frameCount = geoMechCase()->geoMechData()->femPartResults()->frameCount();
|
||||
for ( int frameIndex = 0; frameIndex < frameCount; frameIndex++ )
|
||||
// Create empty frames in the viewer, one per global timestep
|
||||
const int totalSteps = geoMechCase()->geoMechData()->femPartResults()->totalSteps();
|
||||
for ( int timeStepIndex = 0; timeStepIndex < totalSteps; timeStepIndex++ )
|
||||
{
|
||||
cvf::ref<cvf::Scene> scene = new cvf::Scene;
|
||||
cvf::ref<cvf::ModelBasicList> emptyModel = new cvf::ModelBasicList;
|
||||
@@ -370,7 +371,11 @@ void RimGeoMechView::updateElementDisplacements()
|
||||
{
|
||||
std::string errmsg;
|
||||
std::vector<cvf::Vec3f> displacements;
|
||||
m_geomechCase->geoMechData()->readDisplacements( &errmsg, part->partId(), m_currentTimeStep, &displacements );
|
||||
m_geomechCase->geoMechData()->readDisplacements( &errmsg,
|
||||
part->partId(),
|
||||
m_currentInternalTimeStep,
|
||||
m_currentDataFrameIndex,
|
||||
&displacements );
|
||||
part->setDisplacements( displacements );
|
||||
}
|
||||
}
|
||||
@@ -381,6 +386,15 @@ void RimGeoMechView::updateElementDisplacements()
|
||||
m_vizLogic->scheduleGeometryRegenOfVisiblePartMgrs( m_currentTimeStep );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<int, int> RimGeoMechView::viewerStepToTimeStepAndFrameIndex( int viewerTimeStep )
|
||||
{
|
||||
// assuming callers check if the case etc. exists
|
||||
return m_geomechCase->geoMechData()->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( viewerTimeStep );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -431,7 +445,10 @@ void RimGeoMechView::onUpdateDisplayModelForCurrentTimeStep()
|
||||
|
||||
cvf::ref<cvf::ModelBasicList> frameParts = new cvf::ModelBasicList;
|
||||
frameParts->setName( name );
|
||||
m_tensorPartMgr->appendDynamicGeometryPartsToModel( frameParts.p(), m_currentTimeStep );
|
||||
m_tensorPartMgr->appendDynamicGeometryPartsToModel( frameParts.p(),
|
||||
m_currentTimeStep,
|
||||
m_currentInternalTimeStep,
|
||||
m_currentDataFrameIndex );
|
||||
frameParts->updateBoundingBoxesRecursive();
|
||||
|
||||
if ( frameParts->partCount() != 0 )
|
||||
@@ -445,7 +462,10 @@ void RimGeoMechView::onUpdateDisplayModelForCurrentTimeStep()
|
||||
bool hasGeneralCellResult = this->cellResult()->hasResult();
|
||||
|
||||
if ( hasGeneralCellResult )
|
||||
m_vizLogic->updateCellResultColor( m_currentTimeStep(), this->cellResult() );
|
||||
m_vizLogic->updateCellResultColor( m_currentTimeStep(),
|
||||
m_currentInternalTimeStep,
|
||||
m_currentDataFrameIndex,
|
||||
this->cellResult() );
|
||||
else
|
||||
m_vizLogic->updateStaticCellColors( m_currentTimeStep() );
|
||||
|
||||
@@ -466,8 +486,8 @@ void RimGeoMechView::onUpdateDisplayModelForCurrentTimeStep()
|
||||
{
|
||||
m_vizLogic->updateStaticCellColors( -1 );
|
||||
|
||||
m_intersectionCollection->updateCellResultColor( false, m_currentTimeStep );
|
||||
if ( m_surfaceCollection ) m_surfaceCollection->updateCellResultColor( false, m_currentTimeStep );
|
||||
m_intersectionCollection->updateCellResultColor( false, m_currentInternalTimeStep );
|
||||
if ( m_surfaceCollection ) m_surfaceCollection->updateCellResultColor( false, m_currentInternalTimeStep );
|
||||
|
||||
nativeOrOverrideViewer()->animationControl()->slotPause(); // To avoid animation timer spinning in the background
|
||||
}
|
||||
@@ -589,7 +609,7 @@ void RimGeoMechView::onUpdateLegends()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechView::updateTensorLegendTextAndRanges( RimRegularLegendConfig* legendConfig, int timeStepIndex )
|
||||
void RimGeoMechView::updateTensorLegendTextAndRanges( RimRegularLegendConfig* legendConfig, int viewerTimeStep )
|
||||
{
|
||||
if ( !m_geomechCase || !m_geomechCase->geoMechData() ) return;
|
||||
|
||||
@@ -606,9 +626,16 @@ void RimGeoMechView::updateTensorLegendTextAndRanges( RimRegularLegendConfig* le
|
||||
|
||||
RigFemResultAddress resVarAddress( resPos, resFieldName.toStdString(), "" );
|
||||
|
||||
gmCase->femPartResults()->minMaxScalarValuesOverAllTensorComponents( resVarAddress, timeStepIndex, &localMin, &localMax );
|
||||
auto [timeStepIndex, frameIndex] = gmCase->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( viewerTimeStep );
|
||||
|
||||
gmCase->femPartResults()->minMaxScalarValuesOverAllTensorComponents( resVarAddress,
|
||||
timeStepIndex,
|
||||
frameIndex,
|
||||
&localMin,
|
||||
&localMax );
|
||||
gmCase->femPartResults()->posNegClosestToZeroOverAllTensorComponents( resVarAddress,
|
||||
timeStepIndex,
|
||||
frameIndex,
|
||||
&localPosClosestToZero,
|
||||
&localNegClosestToZero );
|
||||
|
||||
@@ -793,15 +820,16 @@ RimGeoMechCase* RimGeoMechView::geoMechCase() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechView::onClampCurrentTimestep()
|
||||
{
|
||||
int maxFrameCount = 0;
|
||||
int maxSteps = 0;
|
||||
|
||||
if ( m_geomechCase )
|
||||
{
|
||||
maxFrameCount = m_geomechCase->geoMechData()->femPartResults()->frameCount();
|
||||
maxSteps = m_geomechCase->geoMechData()->femPartResults()->totalSteps();
|
||||
}
|
||||
|
||||
if ( m_currentTimeStep >= maxFrameCount ) m_currentTimeStep = maxFrameCount - 1;
|
||||
if ( m_currentTimeStep >= maxSteps ) m_currentTimeStep = maxSteps - 1;
|
||||
if ( m_currentTimeStep < 0 ) m_currentTimeStep = 0;
|
||||
|
||||
std::tie( m_currentInternalTimeStep, m_currentDataFrameIndex ) = viewerStepToTimeStepAndFrameIndex( m_currentTimeStep );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -811,7 +839,7 @@ size_t RimGeoMechView::onTimeStepCountRequested()
|
||||
{
|
||||
if ( m_geomechCase && m_geomechCase->geoMechData() && m_geomechCase->geoMechData()->femPartResults() )
|
||||
{
|
||||
return m_geomechCase->geoMechData()->femPartResults()->frameCount();
|
||||
return m_geomechCase->geoMechData()->femPartResults()->totalSteps();
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -963,9 +991,9 @@ const RimGeoMechPropertyFilterCollection* RimGeoMechView::geoMechPropertyFilterC
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechView::calculateCurrentTotalCellVisibility( cvf::UByteArray* totalVisibility, int timeStep )
|
||||
void RimGeoMechView::calculateCurrentTotalCellVisibility( cvf::UByteArray* totalVisibility, int viewerTimeStep )
|
||||
{
|
||||
m_vizLogic->calculateCurrentTotalCellVisibility( totalVisibility, timeStep );
|
||||
m_vizLogic->calculateCurrentTotalCellVisibility( totalVisibility, viewerTimeStep );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1063,6 +1091,14 @@ const RimGeoMechPartCollection* RimGeoMechView::partsCollection() const
|
||||
return m_partsCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<int, int> RimGeoMechView::currentStepAndDataFrame() const
|
||||
{
|
||||
return std::make_pair( m_currentInternalTimeStep, m_currentDataFrameIndex );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -93,9 +93,9 @@ public:
|
||||
|
||||
bool isUsingFormationNames() const override;
|
||||
|
||||
void calculateCurrentTotalCellVisibility( cvf::UByteArray* totalVisibility, int timeStep ) override;
|
||||
void calculateCurrentTotalCellVisibility( cvf::UByteArray* totalVisibility, int viewerTimeStep ) override;
|
||||
|
||||
void updateLegendTextAndRanges( RimRegularLegendConfig* legendConfig, int timeStepIndex );
|
||||
void updateLegendTextAndRanges( RimRegularLegendConfig* legendConfig, int viewerTimeStep );
|
||||
|
||||
const cvf::ref<RivGeoMechVizLogic> vizLogic() const;
|
||||
const RimTensorResults* tensorResults() const;
|
||||
@@ -112,6 +112,8 @@ public:
|
||||
bool showDisplacements() const;
|
||||
void setShowDisplacementsAndUpdate( bool show );
|
||||
|
||||
std::pair<int, int> currentStepAndDataFrame() const;
|
||||
|
||||
protected:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
@@ -138,10 +140,12 @@ private:
|
||||
|
||||
void onUpdateLegends() override;
|
||||
|
||||
void updateTensorLegendTextAndRanges( RimRegularLegendConfig* legendConfig, int timeStepIndex );
|
||||
void updateTensorLegendTextAndRanges( RimRegularLegendConfig* legendConfig, int viewerTimeStep );
|
||||
|
||||
void updateElementDisplacements();
|
||||
|
||||
std::pair<int, int> viewerStepToTimeStepAndFrameIndex( int viewerTimeStep );
|
||||
|
||||
caf::PdmChildField<RimTensorResults*> m_tensorResults;
|
||||
caf::PdmChildField<RimGeoMechPropertyFilterCollection*> m_propertyFilterCollection;
|
||||
caf::PdmPointer<RimGeoMechPropertyFilterCollection> m_overridePropertyFilterCollection;
|
||||
@@ -154,4 +158,7 @@ private:
|
||||
cvf::ref<cvf::Transform> m_scaleTransform;
|
||||
|
||||
cvf::ref<RivTensorResultPartMgr> m_tensorPartMgr;
|
||||
|
||||
int m_currentInternalTimeStep;
|
||||
int m_currentDataFrameIndex;
|
||||
};
|
||||
|
||||
@@ -134,7 +134,7 @@ void RimIntersectionCollection::applySingleColorEffect()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionCollection::updateCellResultColor( bool hasGeneralCellResult, size_t timeStepIndex )
|
||||
void RimIntersectionCollection::updateCellResultColor( bool hasGeneralCellResult, int timeStepIndex )
|
||||
{
|
||||
if ( !this->isActive() ) return;
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
// Visualization interface
|
||||
|
||||
void applySingleColorEffect();
|
||||
void updateCellResultColor( bool hasGeneralCellResult, size_t timeStepIndex );
|
||||
void updateCellResultColor( bool hasGeneralCellResult, int timeStepIndex );
|
||||
void appendPartsToModel( Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform );
|
||||
void rebuildGeometry();
|
||||
|
||||
|
||||
@@ -157,9 +157,10 @@ protected:
|
||||
void clearResults();
|
||||
void clearTimeStepRange();
|
||||
|
||||
double maxValue( const std::vector<double>& aggregatedResults ) const;
|
||||
double minValue( const std::vector<double>& aggregatedResults ) const;
|
||||
std::pair<double, double> minmaxValuesAllTimeSteps();
|
||||
double maxValue( const std::vector<double>& aggregatedResults ) const;
|
||||
double minValue( const std::vector<double>& aggregatedResults ) const;
|
||||
|
||||
virtual std::pair<double, double> minmaxValuesAllTimeSteps();
|
||||
|
||||
virtual cvf::ref<cvf::UByteArray> getCellVisibility() const;
|
||||
virtual std::vector<bool> getMapCellVisibility();
|
||||
|
||||
@@ -288,13 +288,22 @@ RigHistogramData RimHistogramCalculator::histogramData( RimGeoMechView*
|
||||
}
|
||||
else if ( timeRange == StatisticsTimeRangeType::CURRENT_TIMESTEP )
|
||||
{
|
||||
int timeStepIdx = geoMechView->currentTimeStep();
|
||||
caseData->femPartResults()->meanScalarValue( resAddress, timeStepIdx, &histData.mean );
|
||||
caseData->femPartResults()->minMaxScalarValues( resAddress, timeStepIdx, &histData.min, &histData.max );
|
||||
caseData->femPartResults()->p10p90ScalarValues( resAddress, timeStepIdx, &histData.p10, &histData.p90 );
|
||||
caseData->femPartResults()->sumScalarValue( resAddress, timeStepIdx, &histData.sum );
|
||||
auto [timeStepIdx, frameIdx] = geoMechView->currentStepAndDataFrame();
|
||||
caseData->femPartResults()->meanScalarValue( resAddress, timeStepIdx, frameIdx, &histData.mean );
|
||||
caseData->femPartResults()->minMaxScalarValues( resAddress,
|
||||
timeStepIdx,
|
||||
frameIdx,
|
||||
&histData.min,
|
||||
&histData.max );
|
||||
caseData->femPartResults()->p10p90ScalarValues( resAddress,
|
||||
timeStepIdx,
|
||||
frameIdx,
|
||||
&histData.p10,
|
||||
&histData.p90 );
|
||||
caseData->femPartResults()->sumScalarValue( resAddress, timeStepIdx, frameIdx, &histData.sum );
|
||||
|
||||
histData.histogram = caseData->femPartResults()->scalarValuesHistogram( resAddress, timeStepIdx );
|
||||
histData.histogram =
|
||||
caseData->femPartResults()->scalarValuesHistogram( resAddress, timeStepIdx, frameIdx );
|
||||
}
|
||||
}
|
||||
else if ( cellRange == StatisticsCellRangeType::VISIBLE_CELLS )
|
||||
|
||||
@@ -199,19 +199,19 @@ void RimTensorResults::mappingRange( double* min, double* max ) const
|
||||
Rim3dView* view = nullptr;
|
||||
firstAncestorOrThisOfType( view );
|
||||
|
||||
int currentTimeStep = view->currentTimeStep();
|
||||
|
||||
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>( view );
|
||||
RigFemPartResultsCollection* resultCollection = geoMechView->geoMechCase()->geoMechData()->femPartResults();
|
||||
if ( !resultCollection ) return;
|
||||
|
||||
auto [stepIdx, frameIdx] = geoMechView->currentStepAndDataFrame();
|
||||
|
||||
if ( m_rangeMode == RimRegularLegendConfig::RangeModeType::AUTOMATIC_ALLTIMESTEPS )
|
||||
{
|
||||
resultCollection->minMaxScalarValuesOverAllTensorComponents( selectedTensorResult(), min, max );
|
||||
}
|
||||
else if ( m_rangeMode == RimRegularLegendConfig::RangeModeType::AUTOMATIC_CURRENT_TIMESTEP )
|
||||
{
|
||||
resultCollection->minMaxScalarValuesOverAllTensorComponents( selectedTensorResult(), currentTimeStep, min, max );
|
||||
resultCollection->minMaxScalarValuesOverAllTensorComponents( selectedTensorResult(), stepIdx, frameIdx, min, max );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,6 +135,8 @@ RimWbsParameters::RimWbsParameters()
|
||||
m_wellPath.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitField( &m_timeStep, "TimeStep", -1, "TimeStep" );
|
||||
m_timeStep.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitField( &m_frameIndex, "FrameIndex", -1, "FrameIndex" );
|
||||
m_frameIndex.uiCapability()->setUiHidden( true );
|
||||
|
||||
m_parameterSourceFields = { { RigWbsParameter::PP_Reservoir(), &m_porePressureSource },
|
||||
{ RigWbsParameter::PP_NonReservoir(), &m_porePressureNonReservoirSource },
|
||||
@@ -182,6 +184,7 @@ RimWbsParameters& RimWbsParameters::operator=( const RimWbsParameters& copyFrom
|
||||
m_geoMechCase = copyFrom.m_geoMechCase();
|
||||
m_wellPath = copyFrom.m_wellPath();
|
||||
m_timeStep = copyFrom.m_timeStep();
|
||||
m_frameIndex = copyFrom.m_frameIndex();
|
||||
|
||||
for ( auto parameterSourcePair : m_parameterSourceFields )
|
||||
{
|
||||
@@ -230,6 +233,14 @@ void RimWbsParameters::setTimeStep( int timeStep )
|
||||
m_timeStep = timeStep;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWbsParameters::setFrameIndex( int frameIndex )
|
||||
{
|
||||
m_frameIndex = frameIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -425,7 +436,7 @@ bool RimWbsParameters::hasElementPropertyEntry( const RigFemResultAddress& resAd
|
||||
femPartResults = m_geoMechCase->geoMechData()->femPartResults();
|
||||
if ( femPartResults )
|
||||
{
|
||||
return !femPartResults->resultValues( resAddr, 0, m_timeStep ).empty();
|
||||
return !femPartResults->resultValues( resAddr, 0, m_timeStep, m_frameIndex ).empty();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
void setGeoMechCase( RimGeoMechCase* geoMechCase );
|
||||
void setWellPath( RimWellPath* wellPath );
|
||||
void setTimeStep( int timeStep );
|
||||
void setFrameIndex( int frameIndex );
|
||||
|
||||
void applyWbsParametersToExtractor( RigGeoMechWellLogExtractor* extractor );
|
||||
|
||||
@@ -98,6 +99,7 @@ private:
|
||||
caf::PdmPtrField<RimGeoMechCase*> m_geoMechCase;
|
||||
caf::PdmPtrField<RimWellPath*> m_wellPath;
|
||||
caf::PdmField<int> m_timeStep;
|
||||
caf::PdmField<int> m_frameIndex;
|
||||
|
||||
std::map<RigWbsParameter, caf::PdmField<ParameterSourceEnum>*> m_parameterSourceFields;
|
||||
std::map<RigWbsParameter, caf::PdmField<double>*> m_userDefinedValueFields;
|
||||
|
||||
@@ -111,11 +111,15 @@ void RimWellBoreStabilityPlot::copyWbsParameters( const RimWbsParameters* wbsPar
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellBoreStabilityPlot::setCaseWellPathAndTimeStep( RimGeoMechCase* geoMechCase, RimWellPath* wellPath, int timeStep )
|
||||
void RimWellBoreStabilityPlot::setCaseWellPathAndTimeStep( RimGeoMechCase* geoMechCase,
|
||||
RimWellPath* wellPath,
|
||||
int timeStep,
|
||||
int frameIndex /* = -1 */ )
|
||||
{
|
||||
m_wbsParameters->setGeoMechCase( geoMechCase );
|
||||
m_wbsParameters->setWellPath( wellPath );
|
||||
m_wbsParameters->setTimeStep( timeStep );
|
||||
m_wbsParameters->setFrameIndex( frameIndex );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -215,6 +219,7 @@ void RimWellBoreStabilityPlot::applyDataSource()
|
||||
m_wbsParameters->setGeoMechCase( dynamic_cast<RimGeoMechCase*>( m_commonDataSource->caseToApply() ) );
|
||||
m_wbsParameters->setWellPath( m_commonDataSource->wellPathToApply() );
|
||||
m_wbsParameters->setTimeStep( m_commonDataSource->timeStepToApply() );
|
||||
m_wbsParameters->setFrameIndex( -1 );
|
||||
|
||||
this->updateReferenceWellPathInCurves();
|
||||
this->updateConnectedEditors();
|
||||
|
||||
@@ -39,7 +39,8 @@ public:
|
||||
void applyWbsParametersToExtractor( RigGeoMechWellLogExtractor* extractor );
|
||||
double userDefinedValue( const RigWbsParameter& parameter ) const;
|
||||
void copyWbsParameters( const RimWbsParameters* wbsParameters );
|
||||
void setCaseWellPathAndTimeStep( RimGeoMechCase* geoMechCase, RimWellPath* wellPath, int timeStep );
|
||||
|
||||
void setCaseWellPathAndTimeStep( RimGeoMechCase* geoMechCase, RimWellPath* wellPath, int timeStep, int frameIndex = -1 );
|
||||
|
||||
protected:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
@@ -367,7 +367,7 @@ RimSurfaceInViewCollection*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSurfaceInViewCollection::updateCellResultColor( bool hasGeneralCellResult, size_t timeStepIndex )
|
||||
void RimSurfaceInViewCollection::updateCellResultColor( bool hasGeneralCellResult, int timeStepIndex )
|
||||
{
|
||||
if ( !this->isChecked() ) return;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
void clearGeometry();
|
||||
|
||||
void appendPartsToModel( cvf::ModelBasicList* surfaceVizModel, cvf::Transform* scaleTransform );
|
||||
void updateCellResultColor( bool hasGeneralCellResult, size_t timeStepIndex );
|
||||
void updateCellResultColor( bool hasGeneralCellResult, int timeStepIndex );
|
||||
void applySingleColorEffect();
|
||||
|
||||
bool hasAnyActiveSeparateResults();
|
||||
|
||||
@@ -154,7 +154,7 @@ void Rim3dWellLogCurve::curveValuesAndMdsAtTimeStep( std::vector<double>* values
|
||||
std::vector<double>* measuredDepthValues,
|
||||
int timeStep ) const
|
||||
{
|
||||
return this->curveValuesAndMds( values, measuredDepthValues );
|
||||
curveValuesAndMds( values, measuredDepthValues );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -170,7 +170,7 @@ void Rim3dWellLogExtractionCurve::curveValuesAndMds( std::vector<double>* values
|
||||
{
|
||||
CVF_ASSERT( m_timeStep() >= 0 );
|
||||
|
||||
return this->curveValuesAndMdsAtTimeStep( values, measuredDepthValues, m_timeStep() );
|
||||
return this->curveValuesAndMdsAtTimeStep( values, measuredDepthValues, m_timeStep );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -223,7 +223,11 @@ void Rim3dWellLogExtractionCurve::curveValuesAndMdsAtTimeStep( std::vector<doubl
|
||||
RimWellLogExtractionCurve::findAndLoadWbsParametersFromLasFiles( wellPath, geomExtractor.p() );
|
||||
|
||||
m_geomResultDefinition->loadResult();
|
||||
geomExtractor->curveData( m_geomResultDefinition->resultAddress(), timeStep, values );
|
||||
|
||||
auto [stepIndex, frameIndex] =
|
||||
geomCase->geoMechData()->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( timeStep );
|
||||
|
||||
geomExtractor->curveData( m_geomResultDefinition->resultAddress(), stepIndex, frameIndex, values );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -338,7 +342,7 @@ QString Rim3dWellLogExtractionCurve::createAutoName() const
|
||||
RigGeoMechCaseData* data = geomCase->geoMechData();
|
||||
if ( data )
|
||||
{
|
||||
maxTimeStep = data->femPartResults()->frameCount();
|
||||
maxTimeStep = data->femPartResults()->totalSteps();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,6 +454,7 @@ void Rim3dWellLogExtractionCurve::fieldChangedByUi( const caf::PdmFieldHandle* c
|
||||
this->resetMinMaxValues();
|
||||
this->updateConnectedEditors();
|
||||
}
|
||||
|
||||
Rim3dWellLogCurve::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
}
|
||||
|
||||
|
||||
@@ -607,6 +607,9 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
|
||||
cvf::ref<RigGeoMechWellLogExtractor> refWellExtractor =
|
||||
wellLogCollection->findOrCreateExtractor( m_refWellPath, geomCase );
|
||||
|
||||
auto [timeStepIdx, frameIdx] =
|
||||
geomCase->geoMechData()->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( m_timeStep );
|
||||
|
||||
if ( wellExtractor.notNull() )
|
||||
{
|
||||
curveData.measuredDepthValues = wellExtractor->cellIntersectionMDs();
|
||||
@@ -628,7 +631,7 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
|
||||
|
||||
m_geomResultDefinition->loadResult();
|
||||
curveData.xUnits =
|
||||
wellExtractor->curveData( m_geomResultDefinition->resultAddress(), m_timeStep, &curveData.values );
|
||||
wellExtractor->curveData( m_geomResultDefinition->resultAddress(), timeStepIdx, frameIdx, &curveData.values );
|
||||
}
|
||||
|
||||
// Do not adjust depth values of Azimuth and Inclination as they are dependent
|
||||
@@ -640,7 +643,6 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
|
||||
{
|
||||
RigFemResultAddress indexKResAdr( RigFemResultPosEnum::RIG_ELEMENT_NODAL, "INDEX", "INDEX_K" );
|
||||
|
||||
const size_t frameIdx = 0;
|
||||
std::vector<double> refWellMeasuredDepthValues = refWellExtractor->cellIntersectionMDs();
|
||||
std::vector<double> refWellTvDepthValues = refWellExtractor->cellIntersectionTVDs();
|
||||
std::vector<double> refWellPropertyValues;
|
||||
@@ -648,9 +650,9 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
|
||||
std::vector<double> wellIndexKValues;
|
||||
if ( indexKResAdr.isValid() )
|
||||
{
|
||||
wellExtractor->curveData( indexKResAdr, frameIdx, &wellIndexKValues );
|
||||
refWellExtractor->curveData( indexKResAdr, frameIdx, &refWellIndexKValues );
|
||||
refWellExtractor->curveData( m_geomResultDefinition->resultAddress(), frameIdx, &refWellPropertyValues );
|
||||
wellExtractor->curveData( indexKResAdr, timeStepIdx, frameIdx, &wellIndexKValues );
|
||||
refWellExtractor->curveData( indexKResAdr, timeStepIdx, frameIdx, &refWellIndexKValues );
|
||||
refWellExtractor->curveData( m_geomResultDefinition->resultAddress(), timeStepIdx, frameIdx, &refWellPropertyValues );
|
||||
}
|
||||
|
||||
if ( !wellIndexKValues.empty() && !refWellIndexKValues.empty() && !refWellPropertyValues.empty() )
|
||||
@@ -666,7 +668,8 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
|
||||
}
|
||||
if ( performDataSmoothing )
|
||||
{
|
||||
refWellExtractor->performCurveDataSmoothing( frameIdx,
|
||||
refWellExtractor->performCurveDataSmoothing( timeStepIdx,
|
||||
frameIdx,
|
||||
&curveData.measuredDepthValues,
|
||||
&curveData.tvDepthValues,
|
||||
&curveData.values,
|
||||
@@ -677,7 +680,8 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
|
||||
|
||||
if ( wellExtractor.notNull() && performDataSmoothing )
|
||||
{
|
||||
wellExtractor->performCurveDataSmoothing( m_timeStep,
|
||||
wellExtractor->performCurveDataSmoothing( timeStepIdx,
|
||||
frameIdx,
|
||||
&curveData.measuredDepthValues,
|
||||
&curveData.tvDepthValues,
|
||||
&curveData.values,
|
||||
@@ -1148,7 +1152,7 @@ QString RimWellLogExtractionCurve::createCurveAutoName()
|
||||
{
|
||||
if ( geomCase->geoMechData() )
|
||||
{
|
||||
maxTimeStep = geomCase->geoMechData()->femPartResults()->frameCount();
|
||||
maxTimeStep = geomCase->geoMechData()->femPartResults()->totalSteps();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2604,7 +2604,7 @@ CurveSamplingPointData RimWellLogTrack::curveSamplingPointData( RigGeoMechWellLo
|
||||
curveData.tvd = extractor->cellIntersectionTVDs();
|
||||
curveData.rkbDiff = extractor->wellPathGeometry()->rkbDiff();
|
||||
|
||||
extractor->curveData( resultAddress, 0, &curveData.data );
|
||||
extractor->curveData( resultAddress, 0, 0, &curveData.data );
|
||||
return curveData;
|
||||
}
|
||||
|
||||
@@ -3190,6 +3190,9 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
|
||||
int timeStep = wellBoreStabilityPlot->commonDataSource()->timeStepToApply();
|
||||
if ( geoMechCase && wellPath && timeStep >= 0 )
|
||||
{
|
||||
auto [stepIdx, frameIdx] =
|
||||
geoMechCase->geoMechData()->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( timeStep );
|
||||
|
||||
RigGeoMechWellLogExtractor* geoMechWellLogExtractor = nullptr;
|
||||
geoMechWellLogExtractor =
|
||||
RiaExtractionTools::findOrCreateWellLogExtractor( wellPath, dynamic_cast<RimGeoMechCase*>( geoMechCase ) );
|
||||
@@ -3207,9 +3210,9 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
|
||||
wbsPlot->applyWbsParametersToExtractor( geoMechWellLogExtractor );
|
||||
}
|
||||
|
||||
std::vector<double> ppSourceRegions = geoMechWellLogExtractor->porePressureSourceRegions( timeStep );
|
||||
std::vector<double> poissonSourceRegions = geoMechWellLogExtractor->poissonSourceRegions( timeStep );
|
||||
std::vector<double> ucsSourceRegions = geoMechWellLogExtractor->ucsSourceRegions( timeStep );
|
||||
std::vector<double> ppSourceRegions = geoMechWellLogExtractor->porePressureSourceRegions( stepIdx, frameIdx );
|
||||
std::vector<double> poissonSourceRegions = geoMechWellLogExtractor->poissonSourceRegions( stepIdx, frameIdx );
|
||||
std::vector<double> ucsSourceRegions = geoMechWellLogExtractor->ucsSourceRegions( stepIdx, frameIdx );
|
||||
|
||||
{
|
||||
caf::ColorTable colorTable( m_colorShadingLegend->colorArray() );
|
||||
|
||||
@@ -81,11 +81,12 @@ double RimWellIADataAccess::resultValue( QString fieldName,
|
||||
QString componentName,
|
||||
RigFemResultPosEnum resultType,
|
||||
size_t resultIndex,
|
||||
int timeStep )
|
||||
int timeStep,
|
||||
int frameId )
|
||||
{
|
||||
RigFemResultAddress address( resultType, fieldName.toStdString(), componentName.toStdString() );
|
||||
|
||||
const std::vector<float>& scalarResults = m_caseData->femPartResults()->resultValues( address, 0, timeStep );
|
||||
const std::vector<float>& scalarResults = m_caseData->femPartResults()->resultValues( address, 0, timeStep, frameId );
|
||||
|
||||
if ( resultIndex < scalarResults.size() ) return scalarResults[resultIndex];
|
||||
|
||||
@@ -99,7 +100,8 @@ double RimWellIADataAccess::interpolatedResultValue( QString fieldNa
|
||||
QString componentName,
|
||||
RigFemResultPosEnum resultType,
|
||||
cvf::Vec3d position,
|
||||
int timeStep )
|
||||
int timeStep,
|
||||
int frameId )
|
||||
{
|
||||
RigFemResultAddress address( resultType, fieldName.toStdString(), componentName.toStdString() );
|
||||
|
||||
@@ -110,7 +112,7 @@ double RimWellIADataAccess::interpolatedResultValue( QString fieldNa
|
||||
const int* elementConn = femPart->connectivities( elmIdx );
|
||||
int elmNodeCount = RigFemTypes::elementNodeCount( elmType );
|
||||
|
||||
const std::vector<float>& scalarResults = m_caseData->femPartResults()->resultValues( address, 0, timeStep );
|
||||
const std::vector<float>& scalarResults = m_caseData->femPartResults()->resultValues( address, 0, timeStep, frameId );
|
||||
|
||||
std::array<double, 8> nodeResults;
|
||||
std::array<cvf::Vec3d, 8> nodeCorners;
|
||||
|
||||
@@ -45,12 +45,14 @@ public:
|
||||
QString componentName,
|
||||
RigFemResultPosEnum resultType,
|
||||
size_t resultIndex,
|
||||
int timeStep );
|
||||
int timeStep,
|
||||
int frameId );
|
||||
double interpolatedResultValue( QString fieldname,
|
||||
QString componentName,
|
||||
RigFemResultPosEnum resultType,
|
||||
cvf::Vec3d position,
|
||||
int timeStep );
|
||||
int timeStep,
|
||||
int frameId );
|
||||
|
||||
private:
|
||||
RimGeoMechCase* m_case;
|
||||
|
||||
@@ -473,7 +473,7 @@ bool RimWellIASettings::updateResInsightParameters()
|
||||
for ( size_t i = 0; i < nativeKeys.size(); i++ )
|
||||
{
|
||||
double stressValue =
|
||||
dataAccess.interpolatedResultValue( "ST", nativeKeys[i], RigFemResultPosEnum::RIG_ELEMENT_NODAL, position, 0 );
|
||||
dataAccess.interpolatedResultValue( "ST", nativeKeys[i], RigFemResultPosEnum::RIG_ELEMENT_NODAL, position, 0, 0 );
|
||||
if ( std::isfinite( stressValue ) )
|
||||
{
|
||||
initialStress->addParameter( paramKeys[i], stressValue * 100000.0 );
|
||||
@@ -484,7 +484,7 @@ bool RimWellIASettings::updateResInsightParameters()
|
||||
}
|
||||
}
|
||||
|
||||
double ppValue = dataAccess.interpolatedResultValue( "POR-Bar", "", RigFemResultPosEnum::RIG_NODAL, position, 0 );
|
||||
double ppValue = dataAccess.interpolatedResultValue( "POR-Bar", "", RigFemResultPosEnum::RIG_NODAL, position, 0, 0 );
|
||||
if ( std::isfinite( ppValue ) )
|
||||
{
|
||||
initialStress->addParameter( "PP", ppValue * 100000.0 );
|
||||
@@ -673,9 +673,13 @@ std::vector<cvf::Vec3d> RimWellIASettings::extractDisplacements( std::vector<cvf
|
||||
|
||||
for ( auto& pos : corners )
|
||||
{
|
||||
double u1 = dataAccess.interpolatedResultValue( "U", "U1", RigFemResultPosEnum::RIG_NODAL, pos, timeStep );
|
||||
double u2 = dataAccess.interpolatedResultValue( "U", "U2", RigFemResultPosEnum::RIG_NODAL, pos, timeStep );
|
||||
double u3 = dataAccess.interpolatedResultValue( "U", "U3", RigFemResultPosEnum::RIG_NODAL, pos, timeStep );
|
||||
int lastFrame = -1;
|
||||
double u1 =
|
||||
dataAccess.interpolatedResultValue( "U", "U1", RigFemResultPosEnum::RIG_NODAL, pos, timeStep, lastFrame );
|
||||
double u2 =
|
||||
dataAccess.interpolatedResultValue( "U", "U2", RigFemResultPosEnum::RIG_NODAL, pos, timeStep, lastFrame );
|
||||
double u3 =
|
||||
dataAccess.interpolatedResultValue( "U", "U3", RigFemResultPosEnum::RIG_NODAL, pos, timeStep, lastFrame );
|
||||
|
||||
displacements.push_back( cvf::Vec3d( u1, u2, u3 ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user