New constructor for WellsManager that also takes the new parser as argument. New test comparing old and new

This commit is contained in:
Kristian Flikka
2014-01-07 16:10:45 +01:00
parent 41b7af408b
commit 1f1c0ebcf3
3 changed files with 641 additions and 1 deletions

View File

@@ -27,6 +27,10 @@
#define BOOST_TEST_MODULE WellsManagerTests
#include <boost/test/unit_test.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/core/wells/WellsManager.hpp>
#include <opm/core/wells.h>
#include <opm/core/well_controls.h>
@@ -195,6 +199,39 @@ BOOST_AUTO_TEST_CASE(Constructor_Works) {
}
}
BOOST_AUTO_TEST_CASE(New_Constructor_Works) {
Opm::ParserPtr parser(new Opm::Parser());
Opm::SchedulePtr schedule(new Opm::Schedule(parser->parse("wells_manager_data.data")));
Opm::EclipseGridParser Deck("wells_manager_data.data");
Opm::GridManager gridManager(Deck);
Deck.setCurrentEpoch(0);
{
Opm::WellsManager wellsManager(schedule, 0, Deck, *gridManager.c_grid(), NULL);
Opm::WellsManager oldWellsManager(Deck, *gridManager.c_grid(), NULL);
const Wells* wells = wellsManager.c_wells();
wells_static_check( wells );
check_controls_epoch0( wells->ctrls );
BOOST_CHECK(wells_equal(wells, oldWellsManager.c_wells()));
}
Deck.setCurrentEpoch(1);
{
Opm::WellsManager wellsManager(schedule, 1,Deck, *gridManager.c_grid(), NULL);
Opm::WellsManager oldWellsManager(Deck, *gridManager.c_grid(), NULL);
const Wells* wells = wellsManager.c_wells();
wells_static_check( wells );
check_controls_epoch1( wells->ctrls );
BOOST_CHECK(wells_equal(wells, oldWellsManager.c_wells()));
}
}
BOOST_AUTO_TEST_CASE(WellsEqual) {