dune-pdelab  2.4.1
eigen/descriptors.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_PDELAB_BACKEND_EIGEN_DESCRIPTORS_HH
4 #define DUNE_PDELAB_BACKEND_EIGEN_DESCRIPTORS_HH
5 
6 #include <vector>
7 
8 #if HAVE_EIGEN
9 
10 #include <Eigen/Dense>
11 #include <Eigen/Sparse>
12 
13 namespace Dune {
14  namespace PDELab {
15 
16 #ifndef DOXYGEN
17 
18  namespace EIGEN {
19 
20  template<typename GFS, typename E>
21  class VectorContainer;
22 
23  template<typename GFSV, typename GFSU, typename ET, int _Options>
24  class MatrixContainer;
25 
26  template<typename M>
27  struct MatrixPatternInserter;
28 
29  }
30 
31 #endif // DOXYGEN
32 
37  struct EigenVectorBackend
38  {
39  typedef std::size_t size_type;
40 
41  struct Traits
42  {
43  static const size_type max_blocking_depth = 0;
44  };
45 
46  template<typename GFS>
47  bool blocked(const GFS& gfs) const
48  {
49  return false;
50  }
51 
52  };
53 
54  template<int _Options = Eigen::RowMajor>
55  struct EigenMatrixBackend
56  {
57 
58  typedef std::size_t size_type;
59 
61  template<typename Matrix, typename GFSV, typename GFSU>
62  using Pattern = EIGEN::MatrixPatternInserter<typename Matrix::Container>;
63 
64  template<typename VV, typename VU, typename E>
65  struct MatrixHelper
66  {
67  typedef EIGEN::MatrixContainer<typename VV::GridFunctionSpace,typename VU::GridFunctionSpace, E, _Options> type;
68  };
69  };
70 
71  } // namespace PDELab
72 } // namespace Dune
73 
74 #elif defined HEADERCHECK
75 #warning Skipped header check due to missing Eigen.
76 #else
77 #error You need Eigen to use the Eigen backend
78 #endif // HAVE_EIGEN
79 
80 #endif // DUNE_PDELAB_BACKEND_EIGEN_DESCRIPTORS_HH
Definition: adaptivity.hh:27