DUNE PDELab (git)

tags.hh
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=8 sw=2 sts=2:
3#ifndef DUNE_PDELAB_BACKEND_ISTL_TAGS_HH
4#define DUNE_PDELAB_BACKEND_ISTL_TAGS_HH
5
7#include <dune/pdelab/backend/istl/forwarddeclarations.hh>
8#include <cstddef>
9
10namespace Dune {
11
12 namespace PDELab {
13
14 namespace ISTL {
15
16 // ********************************************************************************
17 // tag definitions
18 // ********************************************************************************
19
20 namespace tags {
21
24 {
25 typedef block_vector base_tag;
26 };
27
30 {
32 };
33
35
44 {
47 };
48
51 : public field_vector
52 {};
53
56 : public field_vector
57 {};
58
61 {
62 typedef bcrs_matrix base_tag;
63 };
64
67 {
69 };
70
72
81 {
84 };
85
88 {};
89
92 {};
93
96 {};
97
100 {};
101
104 : public field_matrix
105 , public field_matrix_1_any
106 , public field_matrix_any_1
107 {};
108
111 : public field_matrix
112 , public field_matrix_n_any
113 , public field_matrix_any_1
114 {};
115
118 : public field_matrix
119 , public field_matrix_1_any
120 , public field_matrix_any_m
121 {};
122
125 : public field_matrix
126 , public field_matrix_n_any
127 , public field_matrix_any_m
128 {};
129
130
131 // ********************************************************************************
132 // Tag extraction
133 // ********************************************************************************
134
135#ifdef DOXYGEN
136
138
141 template<typename T>
143 {
146 };
147
148#else // DOXYGEN
149
150 // There is no standard implementation.
151 template<typename T>
152 struct container;
153
154
155 template<typename Block, typename Alloc>
156 struct container<Dune::BlockVector<Block,Alloc> >
157 {
158 typedef block_vector type;
159 };
160
161
162 // DynamicVector grew allocator support some time after the 2.3 release,
163 // so we have to adjust the forward declaration accordingly
164
165 template<typename F, typename Allocator>
166 struct container<DynamicVector<F,Allocator> >
167 {
168 typedef dynamic_vector type;
169 };
170
171 template<typename F, int n>
172 struct container<FieldVector<F,n> >
173 {
174 typedef field_vector_n type;
175 };
176
177 template<typename F>
178 struct container<FieldVector<F,1> >
179 {
180 typedef field_vector_1 type;
181 };
182
183
184 template<typename Block, typename Alloc>
185 struct container<Dune::BCRSMatrix<Block,Alloc> >
186 {
187 typedef bcrs_matrix type;
188 };
189
190 template<typename F>
191 struct container<DynamicMatrix<F> >
192 {
193 typedef dynamic_matrix type;
194 };
195
196 template<typename F, int n, int m>
197 struct container<FieldMatrix<F,n,m> >
198 {
199 typedef field_matrix_n_m type;
200 };
201
202 template<typename F, int n>
203 struct container<FieldMatrix<F,n,1> >
204 {
205 typedef field_matrix_n_1 type;
206 };
207
208 template<typename F, int m>
209 struct container<FieldMatrix<F,1,m> >
210 {
211 typedef field_matrix_1_m type;
212 };
213
214 template<typename F>
215 struct container<FieldMatrix<F,1,1> >
216 {
217 typedef field_matrix_1_1 type;
218 };
219
220#endif // DOXYGEN
221
222 } // namespace tags
223
225
233 template<typename T>
234 typename tags::container<T>::type container_tag(const T&)
235 {
236 return typename tags::container<T>::type();
237 }
238
239 } // namespace ISTL
240
241 } // namespace PDELab
242} // namespace Dune
243
244
245
246#endif // DUNE_PDELAB_BACKEND_ISTL_TAGS_HH
Construct a vector with a dynamic size.
Definition: dynvector.hh:59
vector space out of a tensor product of fields.
Definition: fvector.hh:95
Documentation related stuff.
Dune namespace.
Definition: alignedallocator.hh:13
Dummy struct used for documentation purposes.
Definition: documentation.hh:42
Tag describing a BCRSMatrix.
Definition: tags.hh:61
Tag describing a BlockVector.
Definition: tags.hh:24
Extracts the container tag from T.
Definition: tags.hh:143
ImplementationDefined type
The container tag associated with T.
Definition: tags.hh:145
Tag describing a DynamicMatrix.
Definition: tags.hh:67
Tag describing a DynamicVector.
Definition: tags.hh:30
Tag describing a FieldMatrix with row block size 1 and column block size 1.
Definition: tags.hh:107
Tag describing a FieldMatrix with row block size 1 and arbitrary column block size.
Definition: tags.hh:88
Tag describing a FieldMatrix with row block size 1 and column block size > 1.
Definition: tags.hh:121
Tag describing a FieldMatrix with arbitrary row block size and column block size 1.
Definition: tags.hh:96
Tag describing a FieldMatrix with arbitrary row block size and column block size > 1.
Definition: tags.hh:100
Tag describing a FieldMatrix with row block size > 1 and column block size 1.
Definition: tags.hh:114
Tag describing a FieldMatrix with row block size > 1 and arbitrary column block size.
Definition: tags.hh:92
Tag describing a FieldMatrix with row block size > 1 and column block size > 1.
Definition: tags.hh:128
Tag describing an arbitrary FieldMatrix.
Definition: tags.hh:81
field_matrix base_tag
Base tag for this tag category.
Definition: tags.hh:83
Tag describing a field vector with block size 1.
Definition: tags.hh:52
Tag describing a field vector with block size > 1.
Definition: tags.hh:57
Tag describing an arbitrary FieldVector.
Definition: tags.hh:44
field_vector base_tag
Base tag for this tag category.
Definition: tags.hh:46
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)