Substantial edits to Eclipse3DProperties
* Removed all references to state, need to fix initPORV * Made TransMult return raw pointer const GridProperty over shared pointer. * Moved getDirectionProperty and hasDirectionProperty out of API ** Removed tests as these methods are no longer public * Moved grid properties stuff to new class * Removed use of deck in SatfuncInitializers, moved to TableManager * Removed shared_ptr for several members of EclipseState and 3DProperties * Moved region-property from EclipseState to Eclipse3DProperties * Moved initGridopts from EclipseState to Eclipse3DProperties * Made several Eclipse3DProperties methods private * Postprocessors take raw pointers, not shared_ptr---these will be phased out * Fixed return reference instead of copy several places ** GridProperties<T> in Eclipse3DProperties are now references, not shared_ptr ** Eclipse3DProperties takes const Deck&, not shared_ptr * Removed obsolete tests
This commit is contained in:
@@ -25,18 +25,16 @@
|
||||
#define BOOST_TEST_MODULE MultiRegTests
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
|
||||
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/Deck/Section.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
|
||||
|
||||
static Opm::DeckPtr createDeckInvalidArray() {
|
||||
@@ -201,25 +199,20 @@ BOOST_AUTO_TEST_CASE(MissingRegionVectorThrows) {
|
||||
BOOST_CHECK_THROW( new Opm::EclipseState( deck, Opm::ParseContext()) , std::invalid_argument );
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(UnInitializedVectorThrows) {
|
||||
Opm::DeckPtr deck = createDeckUnInitialized();
|
||||
BOOST_CHECK_THROW( new Opm::EclipseState( deck, Opm::ParseContext()) , std::invalid_argument );
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(IntSetCorrectly) {
|
||||
Opm::DeckPtr deck = createValidIntDeck();
|
||||
Opm::EclipseState state(deck , Opm::ParseContext());
|
||||
std::shared_ptr<const Opm::GridProperty<int> > property = state.getIntGridProperty( "SATNUM");
|
||||
for (size_t j=0; j< 5; j++)
|
||||
const auto& property = state.getEclipseProperties().getIntGridProperty("SATNUM");
|
||||
for (size_t j = 0; j < 5; j++)
|
||||
for (size_t i = 0; i < 5; i++) {
|
||||
if (i < 2)
|
||||
BOOST_CHECK_EQUAL( 11 , property->iget(i,j,0));
|
||||
BOOST_CHECK_EQUAL(11, property.iget(i, j, 0));
|
||||
else
|
||||
BOOST_CHECK_EQUAL( 40 , property->iget(i,j,0));
|
||||
BOOST_CHECK_EQUAL(40, property.iget(i, j, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user