Added hasEDIT test, to avoid exception on decks without EDIT section

This commit is contained in:
Kristian Flikka 2014-07-09 13:27:26 +02:00
parent c4cd20f9f2
commit 766ed83a2b
2 changed files with 6 additions and 4 deletions

View File

@ -79,9 +79,7 @@ namespace Opm {
EclipseGridConstPtr grid = getEclipseGrid();
m_faults = std::make_shared<FaultCollection>( grid->getNX() , grid->getNY() , grid->getNZ());
std::shared_ptr<Opm::GRIDSection> gridSection(new Opm::GRIDSection(deck) );
std::shared_ptr<Opm::EDITSection> editSection(new Opm::EDITSection(deck) );
for (size_t index=0; index < gridSection->count("FAULTS"); index++) {
DeckKeywordConstPtr faultsKeyword = gridSection->getKeyword("FAULTS" , index);
for (auto iter = faultsKeyword->begin(); iter != faultsKeyword->end(); ++iter) {
@ -112,7 +110,12 @@ namespace Opm {
}
setMULTFLT( gridSection );
setMULTFLT( editSection );
if (Section::hasEDIT(deck)) {
std::shared_ptr<Opm::EDITSection> editSection(new Opm::EDITSection(deck) );
setMULTFLT( editSection );
}
m_transMult->applyMULTFLT( m_faults );
}

View File

@ -65,7 +65,6 @@ PORO
162*0.3 /
/
EDIT
PROPS ===============================================================
PVTO