Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fault Reactivation: Flip node order and bump to dev 19 #11195

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ 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 );
Expand Down Expand Up @@ -342,6 +344,7 @@ 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();
}
Expand Down Expand Up @@ -472,6 +475,9 @@ 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 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ class RimFaultReactivationModel : public RimCheckableNamedObject, public RimPoly
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,12 @@ 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();
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class RigFaultReactivationModel : public cvf::Object
RimFaultReactivation::GridPart normalPointsAt() const;

void postProcessElementSets( const RimEclipseCase* eCase );
void flipNodeOrder( bool flipFW, bool flipHW );

private:
std::shared_ptr<RigFaultReactivationModelGenerator> m_generator;
Expand Down
16 changes: 14 additions & 2 deletions ApplicationLibCode/ReservoirDataModel/RigGriddedPart3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ void RigGriddedPart3d::postProcessElementSets( const RigMainGrid* mainGrid, cons
{
if ( usedElements.contains( element ) ) continue;

auto corners = elementCorners( element );
auto corners = elementDataCorners( element );
bool bActive = false;

size_t cellIdx = 0;
Expand Down Expand Up @@ -738,7 +738,7 @@ void RigGriddedPart3d::updateElementSet( ElementSets elSet,
break;
}

auto corners = elementCorners( elIdx + t );
auto corners = elementDataCorners( elIdx + t );

size_t cellIdx = 0;
for ( const auto& p : corners )
Expand Down Expand Up @@ -767,3 +767,15 @@ 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] );
}
}
1 change: 1 addition & 0 deletions ApplicationLibCode/ReservoirDataModel/RigGriddedPart3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class RigGriddedPart3d : public cvf::Object
void setUseLocalCoordinates( bool useLocalCoordinates );

void postProcessElementSets( const RigMainGrid* mainGrid, const RigActiveCellInfo* cellInfo );
void flipNodeOrder();

bool useLocalCoordinates() const;
double topHeight() const;
Expand Down
2 changes: 1 addition & 1 deletion ResInsightVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(RESINSIGHT_VERSION_TEXT "-dev")
# Must be unique and increasing within one combination of major/minor/patch version
# The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT
# Format of text must be ".xx"
set(RESINSIGHT_DEV_VERSION ".18")
set(RESINSIGHT_DEV_VERSION ".19")

# https://github.com/CRAVA/crava/tree/master/libs/nrlib
set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f")
Expand Down
Loading