changed: avoid use of boost::multi_array in VFPProdTable

This commit is contained in:
Arne Morten Kvarving
2020-02-12 15:04:21 +01:00
parent 143c8ec3bf
commit fa572188fa
3 changed files with 76 additions and 91 deletions

View File

@@ -737,8 +737,7 @@ VFPPROD \n\
//The data itself
{
typedef Opm::VFPProdTable::array_type::size_type size_type;
const Opm::VFPProdTable::array_type& data = vfpprodTable.getTable();
const size_type* size = data.shape();
const auto size = vfpprodTable.shape();
BOOST_CHECK_EQUAL(size[0], 2);
BOOST_CHECK_EQUAL(size[1], 2);
@@ -750,13 +749,13 @@ VFPPROD \n\
double conversion_factor = 100000.0;
double index = 0.5;
for (size_type a=0; a<size[3]; ++a) {
for (size_type g=0; g<size[2]; ++g) {
for (size_type w=0; w<size[1]; ++w) {
for (size_type t=0; t<size[0]; ++t) {
for (size_type f=0; f<size[4]; ++f) {
for (size_type a = 0; a < size[3]; ++a) {
for (size_type g = 0; g < size[2]; ++g) {
for (size_type w = 0; w < size[1]; ++w) {
for (size_type t = 0; t < size[0]; ++t) {
for (size_type f = 0; f < size[4]; ++f) {
index += 1.0;
BOOST_CHECK_EQUAL(data[t][w][g][a][f], index*conversion_factor);
BOOST_CHECK_EQUAL(const_cast<const VFPProdTable&>(vfpprodTable)(t,w,g,a,f), index*conversion_factor);
}
}
}
@@ -855,15 +854,13 @@ VFPPROD \n\
//The data itself
{
typedef Opm::VFPProdTable::array_type::size_type size_type;
const Opm::VFPProdTable::array_type& data = vfpprodTable.getTable();
const size_type* size = data.shape();
const auto size = vfpprodTable.shape();
//Table given as BHP => barsa. Convert to pascal
double conversion_factor = 100000.0;
BOOST_CHECK_EQUAL(size[0]*size[1]*size[2]*size[3]*size[4], 1);
BOOST_CHECK_EQUAL(data[0][0][0][0][0], 1.5*conversion_factor);
BOOST_CHECK_EQUAL(const_cast<const VFPProdTable&>(vfpprodTable)(0,0,0,0,0), 1.5*conversion_factor);
}
}