From 4e7ab2684169245bff8c75af292104d7f8c75ec7 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 20 Feb 2024 13:40:33 +0100 Subject: [PATCH] RegionAttributeHelpers: template Scalar type --- .../wells/RegionAttributeHelpers.hpp | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/opm/simulators/wells/RegionAttributeHelpers.hpp b/opm/simulators/wells/RegionAttributeHelpers.hpp index 57003f9c0..edd3e420d 100644 --- a/opm/simulators/wells/RegionAttributeHelpers.hpp +++ b/opm/simulators/wells/RegionAttributeHelpers.hpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -63,7 +62,7 @@ namespace Opm { * In a parallel run only cells owned contribute to the cell average. * \tparam is_parallel Whether this is a parallel run. */ - template + template struct AverageIncrementCalculator { /** @@ -77,12 +76,12 @@ namespace Opm { * by this process (value 1), or not (value 0). * \param cell The cell index. */ - std::tuple - operator()(const std::vector& pressure, - const std::vector& temperature, - const std::vector& rs, - const std::vector& rv, - const std::vector& ownership, + std::tuple + operator()(const std::vector& pressure, + const std::vector& temperature, + const std::vector& rs, + const std::vector& rv, + const std::vector& ownership, std::size_t cell){ if ( ownership[cell] ) { @@ -98,15 +97,15 @@ namespace Opm { } } }; - template<> - struct AverageIncrementCalculator + template + struct AverageIncrementCalculator { - std::tuple - operator()(const std::vector& pressure, - const std::vector& temperature, - const std::vector& rs, - const std::vector& rv, - const std::vector&, + std::tuple + operator()(const std::vector& pressure, + const std::vector& temperature, + const std::vector& rs, + const std::vector& rv, + const std::vector&, std::size_t cell){ return std::make_tuple(pressure[cell], temperature[cell],