MatrixMarketSpecializations.hpp
Go to the documentation of this file.
1/*
2 The content of this file is based on the file dune/istl/matrixmarket.hh in
3 the Dune module dune-istl.
4
5 The license of this file is therefore the same as that of Dune, see
6 https://www.dune-project.org/about/license/
7*/
8
9#ifndef OPM_MATRIXMARKETSPECIALIZATIONS_HEADER_INCLUDED
10#define OPM_MATRIXMARKETSPECIALIZATIONS_HEADER_INCLUDED
11
12#include <dune/istl/matrixmarket.hh>
13
14namespace Opm
15{
16template<typename T, int i, int j>
18}
19
20namespace Dune
21{
22
23namespace MatrixMarketImpl
24{
25
26 template <typename T, int i, int j, typename A>
27 struct mm_header_printer<BCRSMatrix<Opm::MatrixBlock<T,i,j>, A>>
28 {
29 static void print(std::ostream& os)
30 {
31 os << "%%MatrixMarket matrix coordinate ";
32 os << mm_numeric_type<T>::str() << " general" << std::endl;
33 }
34 };
35
36 template <typename T, int i, int j, typename A>
37 struct mm_block_structure_header<BCRSMatrix<Opm::MatrixBlock<T,i,j>, A>>
38 {
39 using M = BCRSMatrix<Opm::MatrixBlock<T,i,j>, A>;
40 static void print(std::ostream& os, const M&)
41 {
42 os << "% ISTL_STRUCT blocked ";
43 os << i << " " << j << std::endl;
44 }
45 };
46} // namespace MatrixMarketImpl
47
48namespace MatrixMarketImpl
49{
50 template <typename T, int i, int j, typename A>
51 struct mm_multipliers<BCRSMatrix<Opm::MatrixBlock<T,i,j>, A>>
52 {
53 enum {
54 rows = i,
55 cols = j
56 };
57 };
58} // namespace MatrixMarketImpl
59
60} // namespace Dune
61
62#endif
Definition: MatrixMarketSpecializations.hpp:17
Definition: SupportsFaceTag.hpp:27
Definition: BlackoilPhases.hpp:27
static void print(std::ostream &os, const M &)
Definition: MatrixMarketSpecializations.hpp:40
BCRSMatrix< Opm::MatrixBlock< T, i, j >, A > M
Definition: MatrixMarketSpecializations.hpp:39
static void print(std::ostream &os)
Definition: MatrixMarketSpecializations.hpp:29