mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Faults: Reading from Eclipse text files and basic visualization
Added reading of faults directly from Eclipse text files Added named faults in project tree Added fault geompetry parts Added test data
This commit is contained in:
@@ -18,6 +18,7 @@ ${CEE_CURRENT_LIST_DIR}RigCaseCellResultsData.h
|
||||
${CEE_CURRENT_LIST_DIR}RigSingleWellResultsData.h
|
||||
${CEE_CURRENT_LIST_DIR}RigStatisticsMath.h
|
||||
${CEE_CURRENT_LIST_DIR}RigWellPath.h
|
||||
${CEE_CURRENT_LIST_DIR}RigFault.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -34,6 +35,7 @@ ${CEE_CURRENT_LIST_DIR}RigCaseCellResultsData.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigSingleWellResultsData.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigStatisticsMath.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigWellPath.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigFault.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
66
ApplicationCode/ReservoirDataModel/RigFault.cpp
Normal file
66
ApplicationCode/ReservoirDataModel/RigFault.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigFault.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFault::RigFault()
|
||||
{
|
||||
m_cellRangesForFaces.resize(6);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFault::addCellRangeForFace(cvf::StructGridInterface::FaceType face, const cvf::CellRange& cellRange)
|
||||
{
|
||||
size_t faceIndex = static_cast<size_t>(face);
|
||||
CVF_ASSERT(faceIndex < m_cellRangesForFaces.size());
|
||||
|
||||
m_cellRangesForFaces[faceIndex].push_back(cellRange);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFault::setName(const QString& name)
|
||||
{
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RigFault::name() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<cvf::CellRange>& RigFault::cellRangeForFace(cvf::StructGridInterface::FaceType face) const
|
||||
{
|
||||
size_t faceIndex = static_cast<size_t>(face);
|
||||
CVF_ASSERT(faceIndex < m_cellRangesForFaces.size());
|
||||
|
||||
return m_cellRangesForFaces[faceIndex];
|
||||
}
|
||||
50
ApplicationCode/ReservoirDataModel/RigFault.h
Normal file
50
ApplicationCode/ReservoirDataModel/RigFault.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfVector3.h"
|
||||
#include "cvfBoundingBox.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <QString>
|
||||
#include "cvfStructGrid.h"
|
||||
#include "cvfCellRange.h"
|
||||
|
||||
|
||||
|
||||
class RigFault : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RigFault();
|
||||
|
||||
void setName(const QString& name);
|
||||
QString name() const;
|
||||
|
||||
void addCellRangeForFace(cvf::StructGridInterface::FaceType face, const cvf::CellRange& cellRange);
|
||||
|
||||
const std::vector<cvf::CellRange>& cellRangeForFace(cvf::StructGridInterface::FaceType face) const;
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
|
||||
std::vector< std::vector<cvf::CellRange> > m_cellRangesForFaces;
|
||||
};
|
||||
@@ -538,6 +538,14 @@ cvf::BoundingBox RigGridBase::boundingBox()
|
||||
return m_boundingBox;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigGridBase::setFaults(const cvf::Collection<RigFault>& faults)
|
||||
{
|
||||
m_faults = faults;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -545,49 +553,51 @@ bool RigGridCellFaceVisibilityFilter::isFaceVisible(size_t i, size_t j, size_t k
|
||||
{
|
||||
CVF_TIGHT_ASSERT(m_grid);
|
||||
|
||||
if (m_showFaultFaces)
|
||||
size_t cellIndex = m_grid->cellIndexFromIJK(i, j, k);
|
||||
if (m_grid->cell(cellIndex).subGrid())
|
||||
{
|
||||
size_t cellIndex = m_grid->cellIndexFromIJK(i, j, k);
|
||||
if (m_grid->cell(cellIndex).isCellFaceFault(face))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Do not show any faces in the place where a LGR is present
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_showExternalFaces)
|
||||
size_t ni, nj, nk;
|
||||
cvf::StructGridInterface::neighborIJKAtCellFace(i, j, k, face, &ni, &nj, &nk);
|
||||
|
||||
// If the cell is on the edge of the grid, Interpret as having an invisible neighbour
|
||||
if (ni >= m_grid->cellCountI() || nj >= m_grid->cellCountJ() || nk >= m_grid->cellCountK())
|
||||
{
|
||||
size_t cellIndex = m_grid->cellIndexFromIJK(i, j, k);
|
||||
if (m_grid->cell(cellIndex).subGrid())
|
||||
{
|
||||
// Do not show any faces in the place where a LGR is present
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t ni, nj, nk;
|
||||
cvf::StructGridInterface::neighborIJKAtCellFace(i, j, k, face, &ni, &nj, &nk);
|
||||
|
||||
// If the cell is on the edge of the grid, Interpret as having an invisible neighbour
|
||||
if (ni >= m_grid->cellCountI() || nj >= m_grid->cellCountJ() || nk >= m_grid->cellCountK())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t neighborCellIndex = m_grid->cellIndexFromIJK(ni, nj, nk);
|
||||
size_t neighborCellIndex = m_grid->cellIndexFromIJK(ni, nj, nk);
|
||||
|
||||
// Do show the faces in the boarder between this grid and a possible LGR. Some of the LGR cells
|
||||
// might not be visible.
|
||||
if (m_grid->cell(neighborCellIndex).subGrid())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Do show the faces in the boarder between this grid and a possible LGR. Some of the LGR cells
|
||||
// might not be visible.
|
||||
if (m_grid->cell(neighborCellIndex).subGrid())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// If the neighbour cell is invisible, we need to draw the face
|
||||
if ((cellVisibility != NULL) && !(*cellVisibility)[neighborCellIndex])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// If the neighbour cell is invisible, we need to draw the face
|
||||
if ((cellVisibility != NULL) && !(*cellVisibility)[neighborCellIndex])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFaultFaceVisibilityFilter::isFaceVisible(size_t i, size_t j, size_t k, cvf::StructGridInterface::FaceType face, const cvf::UByteArray* cellVisibility) const
|
||||
{
|
||||
size_t cellIndex = m_grid->cellIndexFromIJK(i, j, k);
|
||||
if (m_grid->cell(cellIndex).isCellFaceFault(face))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -22,15 +22,17 @@
|
||||
|
||||
#include "cvfVector3.h"
|
||||
#include "cvfBoundingBox.h"
|
||||
|
||||
#include "cvfStructGrid.h"
|
||||
#include "cvfStructGridGeometryGenerator.h"
|
||||
#include "cvfStructGridScalarDataAccess.h"
|
||||
|
||||
#include "cafFixedArray.h"
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "cvfStructGridScalarDataAccess.h"
|
||||
|
||||
#include "RifReaderInterface.h"
|
||||
#include "cafFixedArray.h"
|
||||
#include "RigFault.h"
|
||||
|
||||
|
||||
class RigMainGrid;
|
||||
@@ -75,6 +77,9 @@ public:
|
||||
void coarseningBox(size_t coarseningBoxIndex, size_t* i1, size_t* i2, size_t* j1, size_t* j2, size_t* k1, size_t* k2) const;
|
||||
|
||||
cvf::BoundingBox boundingBox();
|
||||
|
||||
void setFaults(const cvf::Collection<RigFault>& faults);
|
||||
const cvf::Collection<RigFault>& faults() { return m_faults; }
|
||||
|
||||
protected:
|
||||
friend class RigMainGrid;//::initAllSubGridsParentGridPointer();
|
||||
@@ -116,6 +121,8 @@ private:
|
||||
cvf::BoundingBox m_boundingBox;
|
||||
|
||||
std::vector<caf::SizeTArray6> m_coarseningBoxInfo;
|
||||
|
||||
cvf::Collection<RigFault> m_faults;
|
||||
};
|
||||
|
||||
|
||||
@@ -123,17 +130,25 @@ class RigGridCellFaceVisibilityFilter : public cvf::CellFaceVisibilityFilter
|
||||
{
|
||||
public:
|
||||
RigGridCellFaceVisibilityFilter(const RigGridBase* grid)
|
||||
: m_grid(grid),
|
||||
m_showFaultFaces(true),
|
||||
m_showExternalFaces(true)
|
||||
: m_grid(grid)
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool isFaceVisible( size_t i, size_t j, size_t k, cvf::StructGridInterface::FaceType face, const cvf::UByteArray* cellVisibility ) const;
|
||||
|
||||
private:
|
||||
const RigGridBase* m_grid;
|
||||
};
|
||||
|
||||
class RigFaultFaceVisibilityFilter : public cvf::CellFaceVisibilityFilter
|
||||
{
|
||||
public:
|
||||
bool m_showFaultFaces;
|
||||
bool m_showExternalFaces;
|
||||
RigFaultFaceVisibilityFilter(const RigGridBase* grid)
|
||||
: m_grid(grid)
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool isFaceVisible( size_t i, size_t j, size_t k, cvf::StructGridInterface::FaceType face, const cvf::UByteArray* cellVisibility ) const;
|
||||
|
||||
private:
|
||||
const RigGridBase* m_grid;
|
||||
|
||||
Reference in New Issue
Block a user