Added TransMult object to EclipseState
This commit is contained in:
@@ -39,6 +39,7 @@ namespace Opm {
|
||||
initSchedule(deck);
|
||||
initTitle(deck);
|
||||
initProperties(deck);
|
||||
initTransMult(deck);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +52,9 @@ namespace Opm {
|
||||
return schedule;
|
||||
}
|
||||
|
||||
std::shared_ptr<const TransMult> EclipseState::getTransMult() const {
|
||||
return m_transMult;
|
||||
}
|
||||
|
||||
std::string EclipseState::getTitle() const {
|
||||
return m_title;
|
||||
@@ -60,6 +64,12 @@ namespace Opm {
|
||||
schedule = ScheduleConstPtr( new Schedule(deck) );
|
||||
}
|
||||
|
||||
void EclipseState::initTransMult(DeckConstPtr deck) {
|
||||
EclipseGridConstPtr grid = getEclipseGrid();
|
||||
m_transMult = std::make_shared<TransMult>( grid->getNX() , grid->getNY() , grid->getNZ());
|
||||
}
|
||||
|
||||
|
||||
void EclipseState::initEclipseGrid(DeckConstPtr deck) {
|
||||
std::shared_ptr<Opm::GRIDSection> gridSection(new Opm::GRIDSection(deck) );
|
||||
std::shared_ptr<Opm::RUNSPECSection> runspecSection(new Opm::RUNSPECSection(deck) );
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/Box.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/BoxManager.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/GridProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/TransMult.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
|
||||
#include <set>
|
||||
@@ -48,13 +49,15 @@ namespace Opm {
|
||||
bool hasDoubleGridProperty(const std::string& keyword) const;
|
||||
|
||||
void loadGridPropertyFromDeckKeyword(std::shared_ptr<const Box> inputBox , DeckKeywordConstPtr deckKeyword);
|
||||
|
||||
|
||||
std::shared_ptr<const TransMult> getTransMult() const;
|
||||
private:
|
||||
void initSchedule(DeckConstPtr deck);
|
||||
void initEclipseGrid(DeckConstPtr deck);
|
||||
void initPhases(DeckConstPtr deck);
|
||||
void initTitle(DeckConstPtr deck);
|
||||
void initProperties(DeckConstPtr deck);
|
||||
void initTransMult(DeckConstPtr deck);
|
||||
|
||||
double getSIScaling(const std::string &dimensionString) const;
|
||||
|
||||
@@ -78,6 +81,7 @@ namespace Opm {
|
||||
std::shared_ptr<UnitSystem> m_unitSystem;
|
||||
std::shared_ptr<GridProperties<int> > m_intGridProperties;
|
||||
std::shared_ptr<GridProperties<double> > m_doubleGridProperties;
|
||||
std::shared_ptr<TransMult> m_transMult;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<EclipseState> EclipseStatePtr;
|
||||
|
||||
@@ -137,3 +137,14 @@ BOOST_AUTO_TEST_CASE(GetProperty) {
|
||||
|
||||
BOOST_CHECK_THROW( satNUM->iget(100000) , std::invalid_argument);
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(GetTransMult) {
|
||||
DeckPtr deck = createDeck();
|
||||
EclipseState state(deck);
|
||||
std::shared_ptr<const TransMult> transMult = state.getTransMult();
|
||||
|
||||
|
||||
BOOST_CHECK_EQUAL( 1.0 , transMult->getMultiplier(0,0,0,FaceDir::XPluss));
|
||||
BOOST_CHECK_THROW(transMult->getMultiplier(1000 , FaceDir::XPluss) , std::invalid_argument);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user