Added Schedule code to load Completions - with integrationTest

This commit is contained in:
Joakim Hove
2013-11-09 13:17:42 +01:00
parent 7d015772ee
commit 0f09746143
6 changed files with 97 additions and 56 deletions

View File

@@ -73,6 +73,9 @@ namespace Opm {
handleWCONPROD(keyword, currentStep);
if (keyword->name() == "COMPDAT")
handleCOMPDAT( keyword , currentStep );
deckIndex++;
}
}
@@ -118,6 +121,18 @@ namespace Opm {
handleWCON(keyword, currentStep, true);
}
void Schedule::handleCOMPDAT(DeckKeywordConstPtr keyword , size_t currentStep) {
std::map<std::string , std::vector< CompletionConstPtr> > completionMapList = Completion::completionsFromCOMPDATKeyword( keyword );
std::map<std::string , std::vector< CompletionConstPtr> >::iterator iter;
for( iter= completionMapList.begin(); iter != completionMapList.end(); iter++) {
const std::string wellName = iter->first;
WellPtr well = getWell( wellName );
well->addCompletions( currentStep , iter->second );
}
}
boost::gregorian::date Schedule::getStartDate() const {
return m_timeMap->getStartDate();
}

View File

@@ -58,6 +58,7 @@ namespace Opm
void handleWCON(DeckKeywordConstPtr keyword, size_t currentStep, bool isPredictionMode);
void handleWCONHIST(DeckKeywordConstPtr keyword , size_t currentStep);
void handleWCONPROD(DeckKeywordConstPtr keyword, size_t currentStep);
void handleCOMPDAT(DeckKeywordConstPtr keyword , size_t currentStep);
void handleDATES(DeckKeywordConstPtr keyword);
void handleTSTEP(DeckKeywordConstPtr keyword);
};

View File

@@ -32,6 +32,8 @@ namespace Opm {
return "AUTO";
case SHUT:
return "SHUT";
default:
throw std::invalid_argument("Unhandled enum value");
}
}

View File

@@ -1,36 +0,0 @@
/*
Copyright 2013 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/>.
*/
#include <stdexcept>
#include <iostream>
#include <boost/filesystem.hpp>
#define BOOST_TEST_MODULE WellTest
#include <boost/test/unit_test.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
BOOST_AUTO_TEST_CASE(CreateWellCorrentName) {
Opm::Well well("WELL1");
BOOST_CHECK_EQUAL( "WELL1" , well.name() );
}