My Project
MatrixMarketSpecializations.hpp
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/common/version.hh>
13 #include <dune/istl/matrixmarket.hh>
14 
15 namespace Opm
16 {
17 template<typename T, int i, int j>
19 }
20 
21 namespace Dune
22 {
23 
24 namespace MatrixMarketImpl
25 {
26 
27  template <typename T, int i, int j, typename A>
28  struct mm_header_printer<BCRSMatrix<Opm::MatrixBlock<T,i,j>, A>>
29  {
30  static void print(std::ostream& os)
31  {
32  os << "%%MatrixMarket matrix coordinate ";
33  os << mm_numeric_type<T>::str() << " general" << std::endl;
34  }
35  };
36 
37  template <typename T, int i, int j, typename A>
38  struct mm_block_structure_header<BCRSMatrix<Opm::MatrixBlock<T,i,j>, A>>
39  {
40  using M = BCRSMatrix<Opm::MatrixBlock<T,i,j>, A>;
41  static void print(std::ostream& os, const M&)
42  {
43  os << "% ISTL_STRUCT blocked ";
44  os << i << " " << j << std::endl;
45  }
46  };
47 } // namespace MatrixMarketImpl
48 
49 #if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 7)
50 namespace MatrixMarketImpl
51 {
52 #endif
53  template <typename T, int i, int j, typename A>
54  struct mm_multipliers<BCRSMatrix<Opm::MatrixBlock<T,i,j>, A>>
55  {
56  enum {
57  rows = i,
58  cols = j
59  };
60  };
61 #if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 7)
62 } // namespace MatrixMarketImpl
63 #endif
64 
65 } // namespace Dune
66 
67 #endif
Definition: MatrixMarketSpecializations.hpp:18
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27