collectLGRinEclState
This commit is contained in:
@@ -153,6 +153,7 @@ namespace Opm {
|
||||
void initIOConfigPostSchedule(const Deck& deck);
|
||||
void assignRunTitle(const Deck& deck);
|
||||
void reportNumberOfActivePhases() const;
|
||||
void initLgrs(const Deck& deck);
|
||||
void conveyNumericalAquiferEffects();
|
||||
void applyMULTXYZ();
|
||||
void initFaults(const Deck& deck);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <opm/input/eclipse/EclipseState/Util/OrderedMap.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/CarfinManager.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/Carfin.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@@ -32,7 +33,7 @@ namespace Opm {
|
||||
class LgrCollection {
|
||||
public:
|
||||
LgrCollection();
|
||||
LgrCollection(const GRIDSection& gridSection, const GridDims& gridDims);
|
||||
LgrCollection(const GRIDSection& gridSection, const EclipseGrid& grid);
|
||||
|
||||
static LgrCollection serializationTestObject();
|
||||
|
||||
@@ -43,7 +44,7 @@ public:
|
||||
Carfin& getLgr(const std::string& lgrName);
|
||||
const Carfin& getLgr(const std::string& lgrName) const;
|
||||
|
||||
void addLgr(const std::string& lgrName);
|
||||
void addLgr(const EclipseGrid& grid, const DeckRecord& lgrRecord);
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
|
||||
@@ -127,7 +127,6 @@ namespace Opm {
|
||||
, m_inputNnc( m_inputGrid, deck)
|
||||
, m_gridDims( deck )
|
||||
, field_props( deck, m_runspec.phases(), m_inputGrid, m_tables)
|
||||
, m_lgrs( deck)
|
||||
, m_simulationConfig( m_eclipseConfig.init().restartRequested(), deck, field_props)
|
||||
, aquifer_config( m_tables, m_inputGrid, deck, field_props)
|
||||
, m_transMult( GridDims(deck), deck, field_props)
|
||||
@@ -141,6 +140,7 @@ namespace Opm {
|
||||
this->conveyNumericalAquiferEffects();
|
||||
this->m_inputGrid.resetACTNUM(this->field_props.actnum());
|
||||
this->field_props.reset_actnum(this->getInputGrid().getACTNUM());
|
||||
this->initLgrs(deck);
|
||||
this->aquifer_config.load_connections(deck, this->getInputGrid());
|
||||
|
||||
this->applyMULTXYZ();
|
||||
@@ -274,6 +274,17 @@ namespace Opm {
|
||||
return !m_inputNnc.input().empty();
|
||||
}
|
||||
|
||||
void EclipseState::initLgrs(const Deck& deck) {
|
||||
if (!DeckSection::hasGRID(deck))
|
||||
return;
|
||||
|
||||
const GRIDSection gridSection ( deck );
|
||||
|
||||
m_lgrs = LgrCollection(gridSection, m_inputGrid);
|
||||
|
||||
}
|
||||
|
||||
|
||||
std::string EclipseState::getTitle() const {
|
||||
return m_title;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
#include <opm/input/eclipse/Deck/DeckRecord.hpp>
|
||||
#include <opm/input/eclipse/Deck/DeckSection.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/LgrCollection.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/CarfinManager.hpp>
|
||||
@@ -35,8 +36,7 @@ namespace Opm {
|
||||
TODO: Collect also lgrs from RADFIN blocks...
|
||||
*/
|
||||
|
||||
LgrCollection::LgrCollection(const GRIDSection& gridSection,
|
||||
const GridDims& grid) {
|
||||
LgrCollection::LgrCollection(const GRIDSection& gridSection, const EclipseGrid& grid) {
|
||||
const auto& lgrKeywords = gridSection.getKeywordList<ParserKeywords::CARFIN>();
|
||||
|
||||
for (auto keyword_iter = lgrKeywords.begin(); keyword_iter != lgrKeywords.end(); ++keyword_iter) {
|
||||
@@ -45,9 +45,8 @@ namespace Opm {
|
||||
|
||||
for (auto iter = lgrsKeyword->begin(); iter != lgrsKeyword->end(); ++iter) {
|
||||
const auto& lgrRecord = *iter;
|
||||
const std::string& lgrName = lgrRecord.getItem(0).get< std::string >(0);
|
||||
|
||||
//addLgr(lgrName);
|
||||
|
||||
addLgr(grid, lgrRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,10 +67,17 @@ namespace Opm {
|
||||
return m_lgrs.get( lgrName );
|
||||
}
|
||||
|
||||
void LgrCollection::addLgr(const std::string& lgrName) {
|
||||
Carfin lgr(lgrName);
|
||||
m_lgrs.insert(std::make_pair(lgr.NAME(), lgr));
|
||||
void LgrCollection::addLgr(const EclipseGrid& grid, const DeckRecord& lgrRecord) {
|
||||
Carfin lgr(grid,
|
||||
[&grid](const std::size_t global_index)
|
||||
{
|
||||
return grid.cellActive(global_index);
|
||||
},
|
||||
[&grid](const std::size_t global_index)
|
||||
{
|
||||
return grid.activeIndex(global_index);
|
||||
});
|
||||
lgr.update(lgrRecord);
|
||||
m_lgrs.insert(std::make_pair(lgr.NAME(), lgr));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user