Skip to content

Commit

Permalink
[refactor] Store NNCs from PINCH separately.
Browse files Browse the repository at this point in the history
This cleaner and does not increase the storage size for the normal
NNCs. It will also be needed for correct multiplier application.
  • Loading branch information
blattms committed Sep 24, 2024
1 parent 84ecc6c commit 4006afc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions opm/input/eclipse/EclipseState/EclipseState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,19 @@ namespace Opm {
return m_inputNnc;
}

const std::vector<NNCdata>& EclipseState::getPinchNNC() const {
return m_pinchNnc;
}

void EclipseState::setInputNNC(const NNC& nnc) {
m_inputNnc = nnc;
}

void EclipseState::setPinchNNC(std::vector<NNCdata>&& nnc) {
m_pinchNnc = nnc;
std::sort(m_pinchNnc.begin(), m_pinchNnc.end());
}

void EclipseState::appendInputNNC(const std::vector<NNCdata>& nnc) {
for (const auto& nnc_data : nnc ) {
this->m_inputNnc.addNNC(nnc_data.cell1, nnc_data.cell2, nnc_data.trans);
Expand All @@ -314,6 +323,10 @@ namespace Opm {
return !m_inputNnc.input().empty();
}

bool EclipseState::hasPinchNNC() const {
return !m_pinchNnc.empty();
}

bool EclipseState::hasInputLGR() const {
return m_lgrs.size() != 0;
}
Expand Down
7 changes: 7 additions & 0 deletions opm/input/eclipse/EclipseState/EclipseState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ namespace Opm {
/// non-neighboring connections
/// the non-standard adjacencies as specified in input deck
const NNC& getInputNNC() const;
/// \brief Get sorted vector of NNCs created by PINCH
const std::vector<NNCdata>& getPinchNNC() const;
void appendInputNNC(const std::vector<NNCdata>& nnc);
void setInputNNC(const NNC& nnc);
/// \brief Set NNCs created by PINCH
void setPinchNNC(std::vector<NNCdata>&& nnc);
bool hasInputNNC() const;
bool hasPinchNNC() const;

// The potentially parallelized field properties
virtual const FieldPropsManager& fieldProps() const;
Expand Down Expand Up @@ -150,6 +155,7 @@ namespace Opm {
serializer(m_eclipseConfig);
serializer(m_deckUnitSystem);
serializer(m_inputNnc);
serializer(m_pinchNnc);
serializer(m_gridDims);
serializer(m_lgrs);
serializer(m_simulationConfig);
Expand Down Expand Up @@ -189,6 +195,7 @@ namespace Opm {
UnitSystem m_deckUnitSystem;
EclipseGrid m_inputGrid;
NNC m_inputNnc;
std::vector<NNCdata> m_pinchNnc;
GridDims m_gridDims;
FieldPropsManager field_props;
LgrCollection m_lgrs;
Expand Down

0 comments on commit 4006afc

Please sign in to comment.