From dc50e61a01d3cc0468ffedad6d5667a95481076a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 21 Jan 2013 11:09:43 +0100 Subject: [PATCH] Use functionAverage() instead of direct coefficient access. This fixes the issue with limiters on multilinear basis. --- .../transport/reorder/TransportModelTracerTofDiscGal.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/opm/core/transport/reorder/TransportModelTracerTofDiscGal.cpp b/opm/core/transport/reorder/TransportModelTracerTofDiscGal.cpp index 59acb1de..fdbec440 100644 --- a/opm/core/transport/reorder/TransportModelTracerTofDiscGal.cpp +++ b/opm/core/transport/reorder/TransportModelTracerTofDiscGal.cpp @@ -498,14 +498,16 @@ namespace Opm min_here_tof = std::min(min_here_tof, tof_here); if (upstream) { if (interior) { + const double* upstream_coef = tof_coeff_ + num_basis*upstream_cell; if (face_min) { basis_func_->eval(upstream_cell, nc, &basis_nb_[0]); const double tof_upstream = std::inner_product(basis_nb_.begin(), basis_nb_.end(), - tof_coeff_ + num_basis*upstream_cell, 0.0); + upstream_coef, 0.0); min_upstream_tof = std::min(min_upstream_tof, tof_upstream); } else { - min_upstream_tof = std::min(min_upstream_tof, tof_coeff_[num_basis*upstream_cell]); + min_upstream_tof = std::min(min_upstream_tof, + basis_func_->functionAverage(upstream_coef)); } } else { // Allow tof down to 0 on inflow boundaries. @@ -523,7 +525,7 @@ namespace Opm if (min_upstream_tof < 0.0) { min_upstream_tof = 0.0; } - const double tof_c = tof_coeff_[num_basis*cell]; + const double tof_c = basis_func_->functionAverage(tof_coeff_ + num_basis*cell); double limiter = (tof_c - min_upstream_tof)/(tof_c - min_here_tof); if (tof_c < min_upstream_tof) { // Handle by setting a flat solution.