#1646 Fix disappearing mesh lines by using double transformation calculations

This commit is contained in:
Jacob Støren
2017-06-23 10:16:39 +02:00
parent 63cf1e91b3
commit 7d7172f811
12 changed files with 62 additions and 57 deletions

View File

@@ -36,7 +36,7 @@
///
//--------------------------------------------------------------------------------------------------
RigEclipseToStimPlanCellTransmissibilityCalculator::RigEclipseToStimPlanCellTransmissibilityCalculator(RimEclipseCase* caseToApply,
cvf::Mat4f fractureTransform,
cvf::Mat4d fractureTransform,
double skinFactor,
double cDarcy,
const RigFractureCell& stimPlanCell)
@@ -109,9 +109,8 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
std::vector<cvf::Vec3d> stimPlanPolygonTransformed;
for (cvf::Vec3d v : m_stimPlanCell.getPolygon())
{
cvf::Vec3f stimPlanPolygonNode = cvf::Vec3f(v);
stimPlanPolygonNode.transformPoint(m_fractureTransform);
stimPlanPolygonTransformed.push_back(cvf::Vec3d(stimPlanPolygonNode));
v.transformPoint(m_fractureTransform);
stimPlanPolygonTransformed.push_back(v);
}
std::vector<size_t> fracCells = getPotentiallyFracturedCellsForPolygon(stimPlanPolygonTransformed);
@@ -144,18 +143,18 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
RigCellGeometryTools::findCellLocalXYZ(hexCorners, localX, localY, localZ);
//Transform planCell polygon(s) and averageZdirection to x/y coordinate system (where fracturePolygon already is located)
cvf::Mat4f invertedTransMatrix = m_fractureTransform.getInverted();
cvf::Mat4d invertedTransMatrix = m_fractureTransform.getInverted();
for (std::vector<cvf::Vec3d> & planeCellPolygon : planeCellPolygons)
{
for (cvf::Vec3d& v : planeCellPolygon)
{
v.transformPoint(static_cast<cvf::Mat4d>(invertedTransMatrix));
v.transformPoint(invertedTransMatrix);
}
}
cvf::Vec3d localZinFracPlane;
localZinFracPlane = localZ;
localZinFracPlane.transformVector(static_cast<cvf::Mat4d>(invertedTransMatrix));
localZinFracPlane.transformVector(invertedTransMatrix);
cvf::Vec3d directionOfLength = cvf::Vec3d::ZERO;
directionOfLength.cross(localZinFracPlane, cvf::Vec3d(0, 0, 1));
directionOfLength.normalize();

View File

@@ -34,7 +34,7 @@ class RigEclipseToStimPlanCellTransmissibilityCalculator
{
public:
explicit RigEclipseToStimPlanCellTransmissibilityCalculator(RimEclipseCase* caseToApply,
cvf::Mat4f fractureTransform,
cvf::Mat4d fractureTransform,
double skinFactor,
double cDarcy,
const RigFractureCell& stimPlanCell);
@@ -51,7 +51,7 @@ private:
RimEclipseCase* m_case;
double m_cDarcy;
double m_fractureSkinFactor;
cvf::Mat4f m_fractureTransform;
cvf::Mat4d m_fractureTransform;
const RigFractureCell& m_stimPlanCell;
std::vector<size_t> m_globalIndeciesToContributingEclipseCells;

View File

@@ -135,13 +135,13 @@ bool RigHexIntersectionTools::planeHexCellIntersection(cvf::Vec3d* hexCorners, c
///
//--------------------------------------------------------------------------------------------------
bool RigHexIntersectionTools::planeHexIntersectionPolygons(std::array<cvf::Vec3d, 8> hexCorners,
cvf::Mat4f transformMatrixForPlane,
cvf::Mat4d transformMatrixForPlane,
std::vector<std::vector<cvf::Vec3d> >& polygons)
{
bool isCellIntersected = false;
cvf::Plane fracturePlane;
fracturePlane.setFromPointAndNormal(static_cast<cvf::Vec3d>(transformMatrixForPlane.translation()),
fracturePlane.setFromPointAndNormal(transformMatrixForPlane.translation(),
static_cast<cvf::Vec3d>(transformMatrixForPlane.col(2)));
//Find line-segments where cell and fracture plane intersects

View File

@@ -66,7 +66,7 @@ struct RigHexIntersectionTools
std::list<std::pair<cvf::Vec3d, cvf::Vec3d > >& intersectionLineSegments);
static bool planeHexIntersectionPolygons(std::array<cvf::Vec3d, 8> hexCorners,
cvf::Mat4f transformMatrixForPlane,
cvf::Mat4d transformMatrixForPlane,
std::vector<std::vector<cvf::Vec3d> > & polygons);
};

View File

@@ -17,7 +17,7 @@
RigWellPathStimplanIntersector::RigWellPathStimplanIntersector(const RigWellPath* wellpathGeom, const RimFracture* rimFracture)
{
std::vector<cvf::Vec3d> wellPathPoints = wellpathGeom->m_wellPathPoints;
cvf::Mat4f fractureXf = rimFracture->transformMatrix();
cvf::Mat4d fractureXf = rimFracture->transformMatrix();
double wellRadius = rimFracture->wellRadius(rimFracture->fractureUnit());
std::vector<cvf::Vec3f> fracturePolygonf ;
std::vector<std::vector<cvf::Vec3d> > stpCellPolygons;
@@ -39,14 +39,14 @@ RigWellPathStimplanIntersector::RigWellPathStimplanIntersector(const RigWellPath
/// Todo: Use only the perforated parts of the well path
//--------------------------------------------------------------------------------------------------
void RigWellPathStimplanIntersector::calculate(const cvf::Mat4f &fractureXf,
void RigWellPathStimplanIntersector::calculate(const cvf::Mat4d &fractureXf,
const std::vector<cvf::Vec3d>& wellPathPointsOrg,
double wellRadius,
double perforationLength,
const std::vector<std::vector<cvf::Vec3d> >& stpCellPolygons,
std::map<size_t, WellCellIntersection>& m_stimPlanCellIdxToIntersectionInfoMap)
{
cvf::Mat4d toFractureXf = cvf::Mat4d(fractureXf.getInverted());
cvf::Mat4d toFractureXf = fractureXf.getInverted();
std::vector<cvf::Vec3d> perforationLengthBoundingBoxPolygon;
double cicleRadius = perforationLength / 2;

View File

@@ -44,7 +44,7 @@ public:
private:
friend class RigWellPathStimplanIntersectorTester;
static void calculate(const cvf::Mat4f& fractureXf,
static void calculate(const cvf::Mat4d& fractureXf,
const std::vector<cvf::Vec3d>& wellPathPoints,
double wellRadius,
double perforationLength,
@@ -58,7 +58,7 @@ private:
class RigWellPathStimplanIntersectorTester
{
public:
static void testCalculate(const cvf::Mat4f& fractureXf,
static void testCalculate(const cvf::Mat4d& fractureXf,
const std::vector<cvf::Vec3d>& wellPathPoints,
double wellRadius,
double perforationLength,