Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjenssen committed Jan 16, 2024
1 parent 5c66046 commit 3af0496
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "RigFaultReactivationModel.h"
#include "RigGriddedPart3d.h"

#include "RimFaultReactivationDataAccess.h"
#include "RimFaultReactivationModel.h"

#include <map>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ void RimFaultReactivationModel::updateVisualization()
if ( !normal.normalize() ) return;

auto modelNormal = normal ^ cvf::Vec3d::Z_AXIS;
modelNormal.normalize();
if ( !modelNormal.normalize() ) return;

auto generator = std::make_shared<RigFaultReactivationModelGenerator>( m_targets[0]->targetPointXYZ(), modelNormal, normal );
generator->setFault( m_fault()->faultGeometry() );
Expand Down Expand Up @@ -499,6 +499,8 @@ void RimFaultReactivationModel::defineUiOrdering( QString uiConfigName, caf::Pdm

propertiesGrp->add( &m_frictionAngleDeg );

uiOrdering.add( &m_targets );

uiOrdering.skipRemainingFields();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "cvfColor3.h"
#include "cvfMatrix4.h"
#include "cvfObject.h"
#include "cvfPlane.h"
#include "cvfStructGrid.h"
#include "cvfTextureImage.h"
#include "cvfVector3.h"
Expand All @@ -37,7 +36,6 @@

class RigGriddedPart3d;
class RigMainGrid;
class RimFaultReactivationDataAccess;
class RigFaultReactivationModelGenerator;

class RigFRModelPart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,12 @@ void RigFaultReactivationModelGenerator::generateGeometry( size_t
for ( auto& kvp : zPositionsBack )
backReservoirLayers.push_back( kvp.second );

cvf::Plane modelPlane;
modelPlane.setFromPointAndNormal( m_startPosition, m_normal );

projectPointsToPlane( frontReservoirLayers, modelPlane );
projectPointsToPlane( backReservoirLayers, modelPlane );

generatePointsFrontBack();

frontPart->generateGeometry( m_frontPoints,
Expand Down Expand Up @@ -730,3 +736,22 @@ const std::pair<cvf::Vec3d, cvf::Vec3d> RigFaultReactivationModelGenerator::faul
{
return std::make_pair( m_topFault, m_bottomFault );
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigFaultReactivationModelGenerator::projectPointsToPlane( std::vector<cvf::Vec3d>& points, const cvf::Plane& plane )
{
std::vector<cvf::Vec3d> newPoints;

for ( auto& p : points )
{
newPoints.push_back( plane.projectPoint( p ) );
}

points.clear();
for ( auto& p : newPoints )
{
points.push_back( p );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class RigFaultReactivationModelGenerator : cvf::Object
static cvf::Vec3d extrapolatePoint( cvf::Vec3d startPoint, cvf::Vec3d endPoint, double stopDepth );
static void splitLargeLayers( std::map<double, cvf::Vec3d>& layers, std::vector<int>& kLayers, double maxHeight );
static void mergeTinyLayers( std::map<double, cvf::Vec3d>& layers, std::vector<int>& kLayers, double minHeight );
static void projectPointsToPlane( std::vector<cvf::Vec3d>& points, const cvf::Plane& plane );

std::map<double, cvf::Vec3d> elementLayers( cvf::StructGridInterface::FaceType face, std::vector<size_t>& cellIndexColumn );
std::vector<int> elementKLayers( const std::vector<size_t>& cellIndexColumn );
Expand Down

0 comments on commit 3af0496

Please sign in to comment.