2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2012-05-18 02:45:23 -05:00
|
|
|
//
|
|
|
|
// 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
|
2018-10-23 08:12:46 -05:00
|
|
|
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "RigCell.h"
|
2018-10-23 08:12:46 -05:00
|
|
|
#include "RigGridBase.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "RigLocalGrid.h"
|
2018-10-23 08:12:46 -05:00
|
|
|
#include "RigNNCData.h"
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "cvfBoundingBox.h"
|
2018-10-23 08:12:46 -05:00
|
|
|
#include "cvfCollection.h"
|
2013-02-01 07:39:32 -06:00
|
|
|
|
2018-10-23 08:12:46 -05:00
|
|
|
#include <vector>
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2016-08-22 06:24:46 -05:00
|
|
|
class RigActiveCellInfo;
|
|
|
|
|
2015-09-07 03:32:54 -05:00
|
|
|
namespace cvf
|
|
|
|
{
|
|
|
|
class BoundingBoxTree;
|
|
|
|
}
|
|
|
|
|
2016-08-22 06:24:46 -05:00
|
|
|
|
2013-02-01 07:39:32 -06:00
|
|
|
class RigMainGrid : public RigGridBase
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
RigMainGrid();
|
2018-10-18 12:45:57 -05:00
|
|
|
~RigMainGrid() override;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
public:
|
2018-10-23 08:12:46 -05:00
|
|
|
std::vector<cvf::Vec3d>& nodes();
|
|
|
|
const std::vector<cvf::Vec3d>& nodes() const;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2018-10-23 08:12:46 -05:00
|
|
|
std::vector<RigCell>& globalCellArray();
|
|
|
|
const std::vector<RigCell>& globalCellArray() const;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2018-05-08 07:37:23 -05:00
|
|
|
RigGridBase* gridAndGridLocalIdxFromGlobalCellIdx(size_t globalCellIdx, size_t* gridLocalCellIdx);
|
|
|
|
const RigGridBase* gridAndGridLocalIdxFromGlobalCellIdx(size_t globalCellIdx, size_t* gridLocalCellIdx) const;
|
|
|
|
|
2017-12-04 04:42:10 -06:00
|
|
|
const RigCell& cellByGridAndGridLocalCellIdx(size_t gridIdx, size_t gridLocalCellIdx) const;
|
|
|
|
size_t reservoirCellIndexByGridAndGridLocalCellIndex(size_t gridIdx, size_t gridLocalCellIdx) const;
|
2018-08-01 08:47:26 -05:00
|
|
|
size_t findReservoirCellIndexFromPoint(const cvf::Vec3d& point) const;
|
2018-10-16 02:53:30 -05:00
|
|
|
std::vector<size_t> findAllReservoirCellIndicesMatching2dPoint(const cvf::Vec2d& point2d) const;
|
2012-05-18 02:45:23 -05:00
|
|
|
void addLocalGrid(RigLocalGrid* localGrid);
|
2018-10-23 08:28:04 -05:00
|
|
|
|
|
|
|
size_t gridCountOnFile() const;
|
2018-10-23 08:12:46 -05:00
|
|
|
size_t gridCount() const;
|
2012-05-18 02:45:23 -05:00
|
|
|
RigGridBase* gridByIndex(size_t localGridIndex);
|
|
|
|
const RigGridBase* gridByIndex(size_t localGridIndex) const;
|
2013-09-05 06:03:53 -05:00
|
|
|
RigGridBase* gridById(int localGridId);
|
2018-10-23 08:28:04 -05:00
|
|
|
|
|
|
|
size_t totalTemporaryGridCellCount() const;
|
2013-09-05 06:03:53 -05:00
|
|
|
|
2013-12-10 15:44:40 -06:00
|
|
|
RigNNCData* nncData();
|
2013-12-12 15:15:14 -06:00
|
|
|
void setFaults(const cvf::Collection<RigFault>& faults);
|
2018-10-23 08:12:46 -05:00
|
|
|
const cvf::Collection<RigFault>& faults();
|
2018-10-30 05:41:35 -05:00
|
|
|
void calculateFaults(const RigActiveCellInfo* activeCellInfo);
|
2016-11-18 07:40:42 -06:00
|
|
|
|
|
|
|
void distributeNNCsToFaults();
|
|
|
|
|
2014-08-18 11:30:52 -05:00
|
|
|
const RigFault* findFaultFromCellIndexAndCellFace(size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face) const;
|
2014-09-23 05:24:48 -05:00
|
|
|
bool isFaceNormalsOutwards() const;
|
2013-12-10 15:44:40 -06:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
void computeCachedData();
|
2017-12-04 04:42:10 -06:00
|
|
|
void initAllSubGridsParentGridPointer();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2018-10-23 08:12:46 -05:00
|
|
|
cvf::Vec3d displayModelOffset() const override;
|
2013-02-13 04:04:45 -06:00
|
|
|
void setDisplayModelOffset(cvf::Vec3d offset);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-26 06:19:34 -05:00
|
|
|
void setFlipAxis(bool flipXAxis, bool flipYAxis);
|
2015-09-07 09:15:37 -05:00
|
|
|
void findIntersectingCells(const cvf::BoundingBox& inputBB, std::vector<size_t>* cellIndices) const;
|
2015-12-09 08:36:37 -06:00
|
|
|
|
|
|
|
cvf::BoundingBox boundingBox() const;
|
2018-10-23 08:12:46 -05:00
|
|
|
|
2018-11-08 04:24:40 -06:00
|
|
|
bool isTempGrid() const override;
|
|
|
|
const std::string& associatedWellPathName() const override;
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
private:
|
|
|
|
void initAllSubCellsMainGridCellIndex();
|
2015-12-09 08:36:37 -06:00
|
|
|
void buildCellSearchTree();
|
2017-03-31 04:10:22 -05:00
|
|
|
bool hasFaultWithName(const QString& name) const;
|
2013-01-30 03:39:45 -06:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
private:
|
|
|
|
std::vector<cvf::Vec3d> m_nodes; ///< Global vertex table
|
|
|
|
std::vector<RigCell> m_cells; ///< Global array of all cells in the reservoir (including the ones in LGR's)
|
|
|
|
cvf::Collection<RigLocalGrid> m_localGrids; ///< List of all the LGR's in this reservoir
|
2013-09-05 06:03:53 -05:00
|
|
|
std::vector<size_t> m_gridIdToIndexMapping; ///< Mapping from LGR Id to index.
|
2013-02-01 07:39:32 -06:00
|
|
|
|
2013-12-12 15:15:14 -06:00
|
|
|
|
|
|
|
cvf::Collection<RigFault> m_faults;
|
2013-12-10 15:44:40 -06:00
|
|
|
cvf::ref<RigNNCData> m_nncData;
|
2014-08-18 11:30:52 -05:00
|
|
|
cvf::ref<RigFaultsPrCellAccumulator> m_faultsPrCellAcc;
|
2013-12-10 15:44:40 -06:00
|
|
|
|
2013-02-13 04:04:45 -06:00
|
|
|
cvf::Vec3d m_displayModelOffset;
|
2015-12-09 08:36:37 -06:00
|
|
|
cvf::ref<cvf::BoundingBoxTree> m_cellSearchTree;
|
2015-10-24 04:56:15 -05:00
|
|
|
mutable cvf::BoundingBox m_boundingBox;
|
2013-04-26 06:19:34 -05:00
|
|
|
|
|
|
|
bool m_flipXAxis;
|
|
|
|
bool m_flipYAxis;
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|
|
|
|
|