OGS
ShapeMatrixPolicy.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <Eigen/Dense>
14 
16 
17 namespace detail
18 {
22 template <int N, int M>
24 {
25  using type = Eigen::Matrix<double, N, M, Eigen::RowMajor>;
26 };
27 
30 template <int N>
31 struct EigenMatrixType<N, 1>
32 {
33  using type = Eigen::Matrix<double, N, 1, Eigen::ColMajor>;
34 };
35 
39 template <int M>
40 struct EigenMatrixType<0, M>
41 {
42  using type =
43  Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
44 };
45 
46 template <>
47 struct EigenMatrixType<0, 1>
48 {
49  using type =
50  Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>;
51 };
52 
53 } // namespace detail
54 
57 template <typename ShapeFunction, int GlobalDim>
59 {
60  template <int N>
61  using VectorType = typename ::detail::EigenMatrixType<N, 1>::type;
62 
63  template <int N>
64  using RowVectorType = typename ::detail::EigenMatrixType<1, N>::type;
65 
66  template <int N, int M>
67  using MatrixType = typename ::detail::EigenMatrixType<N, M>::type;
68 
81 
82  using ShapeMatrices =
85 };
86 
89 template <typename ShapeFunction, int GlobalDim>
91 {
92  // Dynamic size local matrices are much slower in allocation than their
93  // fixed counterparts.
94 
95  template <int>
96  using VectorType = Eigen::Matrix<double, Eigen::Dynamic, 1>;
97 
98  template <int>
99  using RowVectorType = Eigen::Matrix<double, 1, Eigen::Dynamic>;
100 
101  template <int, int>
102  using MatrixType =
103  Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
104 
114 
118 };
119 
120 #ifdef OGS_EIGEN_DYNAMIC_SHAPE_MATRICES
121 template <typename ShapeFunction, int GlobalDim = ShapeFunction::DIM>
122 using ShapeMatrixPolicyType =
124 
125 const unsigned OGS_EIGEN_DYNAMIC_SHAPE_MATRICES_FLAG = 1;
126 #else
127 template <typename ShapeFunction, int GlobalDim = ShapeFunction::DIM>
130 
132 #endif
133 
134 // static_assert(std::is_class<ShapeMatrixPolicyType<>::value,
135 //"ShapeMatrixPolicyType was not defined.");
const unsigned OGS_EIGEN_DYNAMIC_SHAPE_MATRICES_FLAG
MatrixType< 0, 0 > GlobalDimNodalMatrixType
MatrixType< 0, 0 > NodalMatrixType
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorType
MatrixType< 0, 0 > GlobalDimMatrixType
RowVectorType< 0 > NodalRowVectorType
MatrixType< 0, 0 > DimNodalMatrixType
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > MatrixType
Eigen::Matrix< double, 1, Eigen::Dynamic > RowVectorType
VectorType< ShapeFunction::DIM > DimVectorType
MatrixType< ShapeFunction::NPOINTS, ShapeFunction::NPOINTS > NodalMatrixType
typename ::detail::EigenMatrixType< N, 1 >::type VectorType
typename ::detail::EigenMatrixType< 1, N >::type RowVectorType
typename ::detail::EigenMatrixType< N, M >::type MatrixType
MatrixType< ShapeFunction::DIM, ShapeFunction::NPOINTS > DimNodalMatrixType
MatrixType< ShapeFunction::DIM, ShapeFunction::DIM > DimMatrixType
MatrixType< GlobalDim, ShapeFunction::NPOINTS > GlobalDimNodalMatrixType
MatrixType< GlobalDim, GlobalDim > GlobalDimMatrixType
VectorType< GlobalDim > GlobalDimVectorType
VectorType< ShapeFunction::NPOINTS > NodalVectorType
RowVectorType< ShapeFunction::NPOINTS > NodalRowVectorType
Coordinates mapping matrices at particular location.
Definition: ShapeMatrices.h:43
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > type
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > type
Eigen::Matrix< double, N, 1, Eigen::ColMajor > type
Eigen::Matrix< double, N, M, Eigen::RowMajor > type