From bf0e7f0e4af6a29754925656a8ec1cf106106e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 13 May 2020 13:53:45 +0200 Subject: [PATCH] Split file to ensure correct authorship and license is applied. --- CMakeLists_files.cmake | 2 + .../linalg/MatrixMarketSpecializations.hpp | 63 +++++++++++++++++++ .../linalg/WriteSystemMatrixHelper.hpp | 49 +-------------- 3 files changed, 66 insertions(+), 48 deletions(-) create mode 100644 opm/simulators/linalg/MatrixMarketSpecializations.hpp diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index fc3fb8f2a..9604ab1bd 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -156,6 +156,7 @@ list (APPEND PUBLIC_HEADER_FILES opm/simulators/linalg/ISTLSolverEbos.hpp opm/simulators/linalg/ISTLSolverEbosFlexible.hpp opm/simulators/linalg/MatrixBlock.hpp + opm/simulators/linalg/MatrixMarketSpecializations.hpp opm/simulators/linalg/OwningBlockPreconditioner.hpp opm/simulators/linalg/OwningTwoLevelPreconditioner.hpp opm/simulators/linalg/ParallelOverlappingILU0.hpp @@ -165,6 +166,7 @@ list (APPEND PUBLIC_HEADER_FILES opm/simulators/linalg/PressureTransferPolicy.hpp opm/simulators/linalg/PreconditionerFactory.hpp opm/simulators/linalg/PreconditionerWithUpdate.hpp + opm/simulators/linalg/WriteSystemMatrixHelper.hpp opm/simulators/linalg/findOverlapRowsAndColumns.hpp opm/simulators/linalg/getQuasiImpesWeights.hpp opm/simulators/linalg/setupPropertyTree.hpp diff --git a/opm/simulators/linalg/MatrixMarketSpecializations.hpp b/opm/simulators/linalg/MatrixMarketSpecializations.hpp new file mode 100644 index 000000000..b795c3a04 --- /dev/null +++ b/opm/simulators/linalg/MatrixMarketSpecializations.hpp @@ -0,0 +1,63 @@ +/* + The content of this file is based on the file dune/istl/matrixmarket.hh in + the Dune module dune-istl. + + The license of this file is therefore the same as that of Dune, see + https://www.dune-project.org/about/license/ +*/ + +#ifndef OPM_MATRIXMARKETSPECIALIZATIONS_HEADER_INCLUDED +#define OPM_MATRIXMARKETSPECIALIZATIONS_HEADER_INCLUDED + +#include + +namespace Opm +{ +template +class MatrixBlock; +} + +namespace Dune +{ + +namespace MatrixMarketImpl +{ + + template + struct mm_header_printer, A>> + { + static void print(std::ostream& os) + { + os << "%%MatrixMarket matrix coordinate "; + os << mm_numeric_type::str() << " general" << std::endl; + } + }; + + template + struct mm_block_structure_header, A>> + { + using M = BCRSMatrix, A>; + static void print(std::ostream& os, const M&) + { + os << "% ISTL_STRUCT blocked "; + os << i << " " << j << std::endl; + } + }; + +} // namespace MatrixMarketImpl + +template +struct mm_multipliers; + +template +struct mm_multipliers, A>> +{ + enum { + rows = i, + cols = j + }; +}; + +} // namespace Dune + +#endif diff --git a/opm/simulators/linalg/WriteSystemMatrixHelper.hpp b/opm/simulators/linalg/WriteSystemMatrixHelper.hpp index 933fcce7b..22772bc9a 100644 --- a/opm/simulators/linalg/WriteSystemMatrixHelper.hpp +++ b/opm/simulators/linalg/WriteSystemMatrixHelper.hpp @@ -21,55 +21,8 @@ #define OPM_WRITESYSTEMMATRIXHELPER_HEADER_INCLUDED #include +#include -namespace Opm -{ -template -class MatrixBlock; -} - -namespace Dune -{ - -namespace MatrixMarketImpl -{ - - template - struct mm_header_printer, A>> - { - static void print(std::ostream& os) - { - os << "%%MatrixMarket matrix coordinate "; - os << mm_numeric_type::str() << " general" << std::endl; - } - }; - - template - struct mm_block_structure_header, A>> - { - using M = BCRSMatrix, A>; - static void print(std::ostream& os, const M&) - { - os << "% ISTL_STRUCT blocked "; - os << i << " " << j << std::endl; - } - }; - -} // namespace MatrixMarketImpl - -template -struct mm_multipliers; - -template -struct mm_multipliers, A>> -{ - enum { - rows = i, - cols = j - }; -}; - -} // namespace Dune namespace Opm {