Skip to content

Commit

Permalink
Allow extending cell intersection lines outside cell
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjenssen committed Jan 18, 2024
1 parent 3af0496 commit a18c92a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,11 @@ const std::array<int, 4> RigFaultReactivationModelGenerator::faceIJCornerIndexes
//--------------------------------------------------------------------------------------------------
cvf::Vec3d RigFaultReactivationModelGenerator::lineIntersect( const cvf::Plane& plane, cvf::Vec3d lineA, cvf::Vec3d lineB )
{
double dist = 0.0;
return caf::HexGridIntersectionTools::planeLineIntersectionForMC( plane, lineA, lineB, &dist );
double dist = 0.0;
cvf::Vec3d intersect;
caf::HexGridIntersectionTools::planeLineIntersect( plane, lineA, lineB, &intersect, &dist, 0.01 );

return intersect;
}

//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -497,13 +500,16 @@ void RigFaultReactivationModelGenerator::generateGeometry( size_t
for ( auto& kvp : zPositionsBack )
backReservoirLayers.push_back( kvp.second );

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

projectPointsToPlane( frontReservoirLayers, modelPlane );
projectPointsToPlane( backReservoirLayers, modelPlane );
// cvf::Plane modelPlane;
// modelPlane.setFromPointAndNormal( m_startPosition, m_normal );

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

// projectPointsToPlane( m_frontPoints, modelPlane );
// projectPointsToPlane( m_backPoints, modelPlane );

frontPart->generateGeometry( m_frontPoints,
frontReservoirLayers,
Expand Down Expand Up @@ -742,16 +748,19 @@ const std::pair<cvf::Vec3d, cvf::Vec3d> RigFaultReactivationModelGenerator::faul
//--------------------------------------------------------------------------------------------------
void RigFaultReactivationModelGenerator::projectPointsToPlane( std::vector<cvf::Vec3d>& points, const cvf::Plane& plane )
{
std::vector<cvf::Vec3d> newPoints;

for ( auto& p : points )
for ( int i = 0; i < (int)points.size(); i++ )
{
newPoints.push_back( plane.projectPoint( p ) );
points[i] = plane.projectPoint( points[i] );
}
}

points.clear();
for ( auto& p : newPoints )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigFaultReactivationModelGenerator::projectPointsToPlane( std::array<cvf::Vec3d, 12>& points, const cvf::Plane& plane )
{
for ( int i = 0; i < (int)points.size(); i++ )
{
points.push_back( p );
points[i] = plane.projectPoint( points[i] );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class RigFaultReactivationModelGenerator : cvf::Object
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 );
static void projectPointsToPlane( std::array<cvf::Vec3d, 12>& 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 a18c92a

Please sign in to comment.