From 3be954fe98f46b9e9b8317fc0a3a8d774e2236d0 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Mon, 26 Feb 2018 15:49:59 +0100 Subject: [PATCH] Move multMatrixTransposed for better testability. Otherwise we need to deal with the property system of ewoms. --- opm/autodiff/ISTLSolver.hpp | 21 +++++++++++++++++++++ opm/autodiff/StandardWell_impl.hpp | 21 --------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/opm/autodiff/ISTLSolver.hpp b/opm/autodiff/ISTLSolver.hpp index 0c3eae7ec..52617e474 100644 --- a/opm/autodiff/ISTLSolver.hpp +++ b/opm/autodiff/ISTLSolver.hpp @@ -310,6 +310,27 @@ public: namespace Opm { +namespace Detail +{ + //! calculates ret = A^T * B + template< class K, int m, int n, int p > + static inline void multMatrixTransposed ( const Dune::FieldMatrix< K, n, m > &A, + const Dune::FieldMatrix< K, n, p > &B, + Dune::FieldMatrix< K, m, p > &ret ) + { + typedef typename Dune::FieldMatrix< K, m, p > :: size_type size_type; + + for( size_type i = 0; i < m; ++i ) + { + for( size_type j = 0; j < p; ++j ) + { + ret[ i ][ j ] = K( 0 ); + for( size_type k = 0; k < n; ++k ) + ret[ i ][ j ] += A[ k ][ i ] * B[ k ][ j ]; + } + } + } +} /// This class solves the fully implicit black-oil system by /// solving the reduced system (after eliminating well variables) /// as a block-structured matrix (one block for all cell variables) for a fixed diff --git a/opm/autodiff/StandardWell_impl.hpp b/opm/autodiff/StandardWell_impl.hpp index d96141f11..4c77a7f10 100644 --- a/opm/autodiff/StandardWell_impl.hpp +++ b/opm/autodiff/StandardWell_impl.hpp @@ -22,27 +22,6 @@ namespace Opm { -namespace Detail -{ - //! calculates ret = A^T * B - template< class K, int m, int n, int p > - static inline void multMatrixTransposed ( const Dune::FieldMatrix< K, n, m > &A, - const Dune::FieldMatrix< K, n, p > &B, - Dune::FieldMatrix< K, m, p > &ret ) - { - typedef typename Dune::FieldMatrix< K, m, p > :: size_type size_type; - - for( size_type i = 0; i < m; ++i ) - { - for( size_type j = 0; j < p; ++j ) - { - ret[ i ][ j ] = K( 0 ); - for( size_type k = 0; k < n; ++k ) - ret[ i ][ j ] += A[ k ][ i ] * B[ k ][ j ]; - } - } - } -} template StandardWell::