mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Show NNCs with no common area in folder below Faults
This commit is contained in:
parent
314d07e733
commit
03df28282c
@ -49,6 +49,8 @@ ${CEE_CURRENT_LIST_DIR}RimFaultCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimMockModelSettings.h
|
||||
${CEE_CURRENT_LIST_DIR}RimTernaryLegendConfig.h
|
||||
${CEE_CURRENT_LIST_DIR}RimFaultResultSlot.h
|
||||
${CEE_CURRENT_LIST_DIR}RimNoCommonAreaNNC.h
|
||||
${CEE_CURRENT_LIST_DIR}RimNoCommonAreaNncCollection.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -96,6 +98,8 @@ ${CEE_CURRENT_LIST_DIR}RimFaultCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimMockModelSettings.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimTernaryLegendConfig.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimFaultResultSlot.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimNoCommonAreaNNC.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimNoCommonAreaNncCollection.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "RiaPreferences.h"
|
||||
#include "RigCaseData.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimNoCommonAreaNNC.h"
|
||||
#include "RimNoCommonAreaNncCollection.h"
|
||||
#include "RimReservoirView.h"
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RivColorTableArray.h"
|
||||
@ -67,7 +69,10 @@ RimFaultCollection::RimFaultCollection()
|
||||
cvf::Color3f defWellLabelColor = RiaApplication::instance()->preferences()->defaultWellLabelColor();
|
||||
CAF_PDM_InitField(&faultLabelColor, "FaultLabelColor", defWellLabelColor, "Label color", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&faults, "Faults", "Faults", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&faults, "Faults", "Faults", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&noCommonAreaNnncCollection, "NoCommonAreaNnncCollection", "NNCs With No Common Area", "", "", "");
|
||||
noCommonAreaNnncCollection = new RimNoCommonAreaNncCollection;
|
||||
|
||||
m_reservoirView = NULL;
|
||||
}
|
||||
@ -78,6 +83,8 @@ RimFaultCollection::RimFaultCollection()
|
||||
RimFaultCollection::~RimFaultCollection()
|
||||
{
|
||||
faults.deleteAllChildObjects();
|
||||
|
||||
delete noCommonAreaNnncCollection();
|
||||
}
|
||||
|
||||
|
||||
@ -226,6 +233,30 @@ void RimFaultCollection::syncronizeFaults()
|
||||
|
||||
QString toolTip = QString("Fault count (%1)").arg(newFaults.size());
|
||||
setUiToolTip(toolTip);
|
||||
|
||||
// NNCs
|
||||
this->noCommonAreaNnncCollection()->noCommonAreaNncs().deleteAllChildObjects();
|
||||
|
||||
RigMainGrid* mainGrid = m_reservoirView->eclipseCase()->reservoirData()->mainGrid();
|
||||
std::vector<RigConnection>& nncConnections = mainGrid->nncData()->connections();
|
||||
for (size_t i = 0; i < nncConnections.size(); i++)
|
||||
{
|
||||
if (!nncConnections[i].hasCommonArea())
|
||||
{
|
||||
RimNoCommonAreaNNC* noCommonAreaNnc = new RimNoCommonAreaNNC();
|
||||
|
||||
size_t i1, j1, k1;
|
||||
mainGrid->ijkFromCellIndex(nncConnections[i].m_c1GlobIdx, &i1, &j1, &k1);
|
||||
|
||||
size_t i2, j2, k2;
|
||||
mainGrid->ijkFromCellIndex(nncConnections[i].m_c2GlobIdx, &i2, &j2, &k2);
|
||||
|
||||
QString txt = QString("[%1 %2 %3] - [%4 %5 %6]").arg(i1).arg(j1).arg(k1).arg(i2).arg(j2).arg(k2);
|
||||
|
||||
noCommonAreaNnc->name = txt;
|
||||
this->noCommonAreaNnncCollection()->noCommonAreaNncs().push_back(noCommonAreaNnc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -280,3 +311,12 @@ void RimFaultCollection::setShowFaultsOutsideFilters(bool enableState)
|
||||
m_showFaultsOutsideFilters = enableState;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaultCollection::addMockData()
|
||||
{
|
||||
if (!(m_reservoirView && m_reservoirView->eclipseCase() && m_reservoirView->eclipseCase()->reservoirData() && m_reservoirView->eclipseCase()->reservoirData()->mainGrid())) return;
|
||||
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
class RimFault;
|
||||
class RimReservoirView;
|
||||
class RimNoCommonAreaNncCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -56,6 +57,8 @@ public:
|
||||
void setReservoirView(RimReservoirView* ownerReservoirView);
|
||||
void syncronizeFaults();
|
||||
|
||||
void addMockData();
|
||||
|
||||
bool isGridVisualizationMode() const;
|
||||
|
||||
bool showFaultsOutsideFilters() const;
|
||||
@ -75,6 +78,8 @@ public:
|
||||
caf::PdmPointersField<RimFault*> faults;
|
||||
RimFault* findFaultByName(QString name);
|
||||
|
||||
caf::PdmField<RimNoCommonAreaNncCollection*> noCommonAreaNnncCollection;
|
||||
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
|
||||
|
41
ApplicationCode/ProjectDataModel/RimNoCommonAreaNNC.cpp
Normal file
41
ApplicationCode/ProjectDataModel/RimNoCommonAreaNNC.cpp
Normal file
@ -0,0 +1,41 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA, Ceetron Solutions 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 "RimNoCommonAreaNNC.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimNoCommonAreaNNC, "NoCommonAreaNNC");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimNoCommonAreaNNC::RimNoCommonAreaNNC()
|
||||
{
|
||||
CAF_PDM_InitObject("RimNoCommonAreaNNC", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&name, "Name", "Name", "", "", "");
|
||||
name.setUiReadOnly(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimNoCommonAreaNNC::userDescriptionField()
|
||||
{
|
||||
return &name;
|
||||
}
|
||||
|
40
ApplicationCode/ProjectDataModel/RimNoCommonAreaNNC.h
Normal file
40
ApplicationCode/ProjectDataModel/RimNoCommonAreaNNC.h
Normal file
@ -0,0 +1,40 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA, Ceetron Solutions 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 "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimNoCommonAreaNNC : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimNoCommonAreaNNC();
|
||||
|
||||
caf::PdmField<QString> name;
|
||||
|
||||
caf::PdmFieldHandle* userDescriptionField();
|
||||
|
||||
};
|
@ -0,0 +1,40 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA, Ceetron Solutions 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 "RimNoCommonAreaNncCollection.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimNoCommonAreaNncCollection, "RimNoCommonAreaNncCollection");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimNoCommonAreaNncCollection::RimNoCommonAreaNncCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("RimNoCommonAreaNncCollection", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&noCommonAreaNncs, "NoCommonAreaNncs", "NoCommonAreaNncs", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimNoCommonAreaNncCollection::~RimNoCommonAreaNncCollection()
|
||||
{
|
||||
noCommonAreaNncs.deleteAllChildObjects();
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA, Ceetron Solutions 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 "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
class RimNoCommonAreaNNC;
|
||||
|
||||
//==================================================================================================
|
||||
/// Placeholder class used to create a folder in the tree view.
|
||||
/// TODO: Remove this class when new tree view is integrated
|
||||
//==================================================================================================
|
||||
class RimNoCommonAreaNncCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimNoCommonAreaNncCollection();
|
||||
virtual ~RimNoCommonAreaNncCollection();
|
||||
|
||||
caf::PdmPointersField<RimNoCommonAreaNNC*> noCommonAreaNncs;
|
||||
};
|
@ -40,6 +40,11 @@ public:
|
||||
m_transmissibility(0.0)
|
||||
{}
|
||||
|
||||
bool hasCommonArea() const
|
||||
{
|
||||
return m_polygon.size() > 0;
|
||||
}
|
||||
|
||||
size_t m_c1GlobIdx;
|
||||
cvf::StructGridInterface::FaceType m_c1Face;
|
||||
size_t m_c2GlobIdx;
|
||||
@ -47,7 +52,6 @@ public:
|
||||
double m_transmissibility;
|
||||
|
||||
std::vector<cvf::Vec3d> m_polygon;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -499,7 +499,7 @@ void RigReservoirBuilderMock::addFaults(RigCaseData* eclipseCase)
|
||||
if (cellDimension().x() > 5)
|
||||
{
|
||||
min.x() = cellDimension().x() / 2;
|
||||
max.x() = min.x() + 1;
|
||||
max.x() = min.x() + 2;
|
||||
}
|
||||
|
||||
if (cellDimension().y() > 5)
|
||||
@ -515,6 +515,32 @@ void RigReservoirBuilderMock::addFaults(RigCaseData* eclipseCase)
|
||||
}
|
||||
|
||||
grid->setFaults(faults);
|
||||
|
||||
// NNCs
|
||||
std::vector<RigConnection>& nncConnections = grid->nncData()->connections();
|
||||
{
|
||||
size_t i1 = 2;
|
||||
size_t j1 = 2;
|
||||
size_t k1 = 3;
|
||||
|
||||
size_t i2 = 2;
|
||||
size_t j2 = 3;
|
||||
size_t k2 = 4;
|
||||
|
||||
addNnc(grid, i1, j1, k1, i2, j2, k2, nncConnections);
|
||||
}
|
||||
|
||||
{
|
||||
size_t i1 = 2;
|
||||
size_t j1 = 2;
|
||||
size_t k1 = 3;
|
||||
|
||||
size_t i2 = 2;
|
||||
size_t j2 = 5;
|
||||
size_t k2 = 4;
|
||||
|
||||
addNnc(grid, i1, j1, k1, i2, j2, k2, nncConnections);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -525,3 +551,19 @@ void RigReservoirBuilderMock::enableWellData(bool enableWellData)
|
||||
m_enableWellData = false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigReservoirBuilderMock::addNnc(RigMainGrid* grid, size_t i1, size_t j1, size_t k1, size_t i2, size_t j2, size_t k2, std::vector<RigConnection> &nncConnections)
|
||||
{
|
||||
size_t c1GlobalIndex = grid->cellIndexFromIJK(i1, j1, k1);
|
||||
size_t c2GlobalIndex = grid->cellIndexFromIJK(i2, j2, k2);
|
||||
|
||||
RigConnection conn;
|
||||
conn.m_c1GlobIdx = c1GlobalIndex;
|
||||
conn.m_c2GlobIdx = c2GlobalIndex;
|
||||
conn.m_transmissibility = 0.2;
|
||||
|
||||
nncConnections.push_back(conn);
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,8 @@ public:
|
||||
|
||||
private:
|
||||
void addFaults(RigCaseData* eclipseCase);
|
||||
|
||||
static void addNnc(RigMainGrid* grid, size_t i1, size_t j1, size_t k1, size_t i2, size_t j2, size_t k2, std::vector<RigConnection> &nncConnections);
|
||||
void addWellData(RigCaseData* eclipseCase, RigGridBase* grid);
|
||||
static void appendCells(size_t nodeStartIndex, size_t cellCount, RigGridBase* hostGrid, std::vector<RigCell>& cells);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user