Files
opm-common/opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.hpp
Tor Harald Sandve bb40baa96f Make MULTREGT work for NNC.
The region multipliers are no longer added  to the cartesian logical
MULT[XYZ] structure. Instead a new method
getRegionMultiplier(globalIndex1, globalIndex2,FaceDir) is added that
return the multiplier between globalIndex1 cell and globalIndex2 cell.
The face direction is added to support directional dependent MULTREGT
input. This implementation of MULTREGT also supports restricting the
multipliers to only apply for NNC or NONNNC.
2014-12-09 12:14:36 +01:00

83 lines
2.4 KiB
C++

/*
Copyright 2014 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM 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.
OPM 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 for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MULTREGTSCANNER_HPP
#define MULTREGTSCANNER_HPP
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/GridProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp>
#include <opm/parser/eclipse/EclipseState/Util/Value.hpp>
namespace Opm {
namespace MULTREGT {
enum NNCBehaviourEnum {
NNC = 1,
NONNC = 2,
ALL = 3,
NOAQUNNC = 4
};
std::string RegionNameFromDeckValue(const std::string& stringValue);
NNCBehaviourEnum NNCBehaviourFromString(const std::string& stringValue);
}
class MULTREGTRecord {
public:
MULTREGTRecord(DeckRecordConstPtr deckRecord);
Value<int> m_srcRegion;
Value<int> m_targetRegion;
double m_transMultiplier;
int m_directions;
MULTREGT::NNCBehaviourEnum m_nncBehaviour;
Value<std::string> m_region;
};
typedef std::map< std::pair<int , int> , const MULTREGTRecord * > MULTREGTSearchMap;
typedef std::tuple<size_t , FaceDir::DirEnum , double> MULTREGTConnection;
class MULTREGTScanner {
public:
MULTREGTScanner(std::shared_ptr<GridProperties<int> > cellRegionNumbers, const std::vector<DeckKeywordConstPtr>& keywords);
double getRegionMultiplier(size_t globalCellIdx1, size_t globalCellIdx2, FaceDir::DirEnum faceDir) const;
private:
void addKeyword(DeckKeywordConstPtr deckKeyword);
void assertKeywordSupported(DeckKeywordConstPtr deckKeyword);
std::vector< MULTREGTRecord > m_records;
std::map<std::string , MULTREGTSearchMap> m_searchMap;
std::shared_ptr<GridProperties<int> > m_cellRegionNumbers;
};
}
#endif