Fix data access crash when no temp is available

Change element node order
This commit is contained in:
Jon Jenssen
2024-02-15 17:36:38 +01:00
committed by jonjenssen
parent 5cfabbb8b8
commit 5162ae467c
8 changed files with 16 additions and 44 deletions

View File

@@ -75,12 +75,15 @@ void RimFaultReactivationDataAccessorTemperature::updateResultAccessor()
m_resultAccessor =
RigResultAccessorFactory::createFromResultAddress( m_caseData, 0, RiaDefines::PorosityModelType::MATRIX_MODEL, m_timeStep, resVarAddress );
auto [wellPaths, extractors] =
RimFaultReactivationDataAccessorWellLogExtraction::createEclipseWellPathExtractors( *m_model, *m_caseData, m_seabedDepth );
m_wellPaths = wellPaths;
m_extractors = extractors;
if ( m_resultAccessor.notNull() )
{
auto [wellPaths, extractors] =
RimFaultReactivationDataAccessorWellLogExtraction::createEclipseWellPathExtractors( *m_model, *m_caseData, m_seabedDepth );
m_wellPaths = wellPaths;
m_extractors = extractors;
m_gradient = computeGradient();
m_gradient = computeGradient();
}
}
//--------------------------------------------------------------------------------------------------

View File

@@ -99,8 +99,6 @@ RimFaultReactivationModel::RimFaultReactivationModel()
CAF_PDM_InitField( &m_faultZoneCells, "FaultZoneCells", 0, "Fault Zone Width [cells]" );
CAF_PDM_InitField( &m_showModelPlane, "ShowModelPlane", true, "Show 2D Model" );
CAF_PDM_InitField( &m_flipNodeOrderFW, "FlipNodeOrderFW", false, "FW: Flip Node Order" );
CAF_PDM_InitField( &m_flipNodeOrderHW, "FlipNodeOrderHW", false, "HW: Flip Node Order" );
CAF_PDM_InitFieldNoDefault( &m_fault, "Fault", "Fault" );
m_fault.uiCapability()->setUiReadOnly( true );
@@ -344,7 +342,6 @@ void RimFaultReactivationModel::updateVisualization()
m_2Dmodel->setGenerator( generator );
m_2Dmodel->updateGeometry( m_startCellIndex, (cvf::StructGridInterface::FaceType)m_startCellFace() );
m_2Dmodel->postProcessElementSets( eclipseCase() );
m_2Dmodel->flipNodeOrder( m_flipNodeOrderFW, m_flipNodeOrderHW );
view->scheduleCreateDisplayModelAndRedraw();
}
@@ -475,9 +472,6 @@ void RimFaultReactivationModel::defineUiOrdering( QString uiConfigName, caf::Pdm
gridModelGrp->add( &m_modelThickness );
gridModelGrp->add( &m_flipNodeOrderFW );
gridModelGrp->add( &m_flipNodeOrderHW );
auto appModelGrp = modelGrp->addNewGroup( "Appearance" );
appModelGrp->setCollapsedByDefault();
appModelGrp->add( &m_modelPart1Color );

View File

@@ -162,8 +162,6 @@ private:
caf::PdmField<cvf::Color3f> m_modelPart2Color;
caf::PdmField<bool> m_showModelPlane;
caf::PdmField<bool> m_flipNodeOrderFW;
caf::PdmField<bool> m_flipNodeOrderHW;
caf::PdmField<double> m_modelExtentFromAnchor;
caf::PdmField<double> m_modelMinZ;

View File

@@ -264,12 +264,3 @@ void RigFaultReactivationModel::postProcessElementSets( const RimEclipseCase* eC
m_3dparts[part]->postProcessElementSets( eCase->mainGrid(), cellInfo );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigFaultReactivationModel::flipNodeOrder( bool flipFW, bool flipHW )
{
if ( flipFW ) m_3dparts[GridPart::FW]->flipNodeOrder();
if ( flipHW ) m_3dparts[GridPart::HW]->flipNodeOrder();
}

View File

@@ -87,7 +87,6 @@ public:
RimFaultReactivation::GridPart normalPointsAt() const;
void postProcessElementSets( const RimEclipseCase* eCase );
void flipNodeOrder( bool flipFW, bool flipHW );
private:
std::shared_ptr<RigFaultReactivationModelGenerator> m_generator;

View File

@@ -590,7 +590,7 @@ void RigFaultReactivationModelGenerator::generateGeometry( size_t sta
m_horizontalPartition,
m_modelThickness,
m_topReservoirBack.z(),
m_modelNormal,
-1.0 * m_modelNormal,
m_faultZoneCells );
frontPart->generateLocalNodes( m_localCoordTransform );

View File

@@ -400,15 +400,15 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
{
for ( int t = 0; t < nThicknessCells; t++, elementIdx++ )
{
m_elementIndices[elementIdx].push_back( t + nextLayerIdxOff + i );
m_elementIndices[elementIdx].push_back( t + nextLayerIdxOff + i + nThicknessOff );
m_elementIndices[elementIdx].push_back( t + nextLayerIdxOff + i + nThicknessOff + 1 );
m_elementIndices[elementIdx].push_back( t + nextLayerIdxOff + i + 1 );
m_elementIndices[elementIdx].push_back( t + i );
m_elementIndices[elementIdx].push_back( t + i + nThicknessOff );
m_elementIndices[elementIdx].push_back( t + i + nThicknessOff + 1 );
m_elementIndices[elementIdx].push_back( t + i + 1 );
m_elementIndices[elementIdx].push_back( t + i + nThicknessOff + 1 );
m_elementIndices[elementIdx].push_back( t + i + nThicknessOff );
m_elementIndices[elementIdx].push_back( t + nextLayerIdxOff + i );
m_elementIndices[elementIdx].push_back( t + nextLayerIdxOff + i + 1 );
m_elementIndices[elementIdx].push_back( t + nextLayerIdxOff + i + nThicknessOff + 1 );
m_elementIndices[elementIdx].push_back( t + nextLayerIdxOff + i + nThicknessOff );
if ( v == 0 )
{
@@ -767,15 +767,3 @@ void RigGriddedPart3d::updateElementSet( ElementSets elSet,
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigGriddedPart3d::flipNodeOrder()
{
for ( auto& nodes : m_elementIndices )
{
std::swap( nodes[1], nodes[3] );
std::swap( nodes[5], nodes[7] );
}
}

View File

@@ -61,7 +61,6 @@ public:
void setUseLocalCoordinates( bool useLocalCoordinates );
void postProcessElementSets( const RigMainGrid* mainGrid, const RigActiveCellInfo* cellInfo );
void flipNodeOrder();
bool useLocalCoordinates() const;
double topHeight() const;