DUNE PDELab (2.8)

constraintsparameters.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3
4#ifndef DUNE_PDELAB_CONSTRAINTS_COMMON_CONSTRAINTSPARAMETERS_HH
5#define DUNE_PDELAB_CONSTRAINTS_COMMON_CONSTRAINTSPARAMETERS_HH
6
8#include <dune/typetree/typetree.hh>
9
10namespace Dune {
11 namespace PDELab {
12
16
26 {
27
37 template<typename I>
38 bool isDirichlet(const I & intersection, const FieldVector<typename I::ctype, I::mydimension> & coord) const
39 {
40 return true;
41 }
42
55 template<typename I>
56 bool isNeumann(const I & intersection, const FieldVector<typename I::ctype, I::mydimension> & coord) const
57 {
58 return false;
59 }
60
61
67 template<typename T>
68 void setTime(const T& time)
69 {}
70
71 };
72
81 {
82
86 template<typename I>
87 bool isDirichlet(const I & intersection, const FieldVector<typename I::ctype, I::mydimension> & coord) const
88 {
89 return false;
90 }
91
95 template<typename I>
96 bool isNeumann(const I & intersection, const FieldVector<typename I::ctype, I::mydimension> & coord) const
97 {
98 return true;
99 }
100
106 template<typename T>
107 void setTime(const T& time)
108 {}
109
110 };
111
112
121 public TypeTree::LeafNode
122 {
123
133 template<typename I>
134 bool isNeumann(const I & intersection, const FieldVector<typename I::ctype, I::mydimension> & coord) const
135 {
136 return true;
137 }
138
144 template<typename T>
145 void setTime(const T& time)
146 {}
147
148 };
149
157 public TypeTree::LeafNode
158 {
159
163 template<typename I>
164 bool isNeumann(const I & intersection, const FieldVector<typename I::ctype, I::mydimension> & coord) const
165 {
166 return false;
167 }
168
174 template<typename T>
175 void setTime(const T& time)
176 {}
177
178 };
179
190 template<typename DirichletConstraintsParameters>
192 public TypeTree::LeafNode
193 {
194
198 template<typename I>
199 bool isDirichlet(const I & intersection, const FieldVector<typename I::ctype, I::mydimension> & coord) const
200 {
201 return _dirichletConstraintsParameters.isDirichlet(intersection,coord);
202 }
203
207 template<typename I>
208 bool isNeumann(const I & intersection, const FieldVector<typename I::ctype, I::mydimension> & coord) const
209 {
210 return !_dirichletConstraintsParameters.isDirichlet(intersection,coord);
211 }
212
216 template<typename T>
217 void setTime(const T& time)
218 {
219 _dirichletConstraintsParameters.setTime(time);
220 }
221
223 : _dirichletConstraintsParameters(dirichletConstraintsParameters)
224 {}
225
226 private:
227
228 DirichletConstraintsParameters& _dirichletConstraintsParameters;
229
230 };
231
242 template<typename FluxConstraintsParameters>
244 public TypeTree::LeafNode
245 {
246
250 template<typename I>
251 bool isDirichlet(const I & intersection, const FieldVector<typename I::ctype, I::mydimension> & coord) const
252 {
253 return !_fluxConstraintsParameters.isNeumann(intersection,coord);
254 }
255
259 template<typename I>
260 bool isNeumann(const I & intersection, const FieldVector<typename I::ctype, I::mydimension> & coord) const
261 {
262 return _fluxConstraintsParameters.isNeumann(intersection,coord);
263 }
264
268 template<typename T>
269 void setTime(const T& time)
270 {
271 _fluxConstraintsParameters.setTime(time);
272 }
273
275 : _fluxConstraintsParameters(fluxConstraintsParameters)
276 {}
277
278 private:
279
280 FluxConstraintsParameters& _fluxConstraintsParameters;
281
282 };
283
294
296
297 }
298}
299
300#endif // DUNE_PDELAB_CONSTRAINTS_COMMON_CONSTRAINTSPARAMETERS_HH
vector space out of a tensor product of fields.
Definition: fvector.hh:95
Definition: constraintsparameters.hh:293
Base class for leaf nodes in a dune-typetree.
Definition: leafnode.hh:26
Implements a vector constructed from a given type representing a field and a compile-time given size.
Dune namespace.
Definition: alignedallocator.hh:11
Definition: constraintsparameters.hh:26
bool isDirichlet(const I &intersection, const FieldVector< typename I::ctype, I::mydimension > &coord) const
Definition: constraintsparameters.hh:38
bool isNeumann(const I &intersection, const FieldVector< typename I::ctype, I::mydimension > &coord) const
Definition: constraintsparameters.hh:56
void setTime(const T &time)
Definition: constraintsparameters.hh:68
Definition: constraintsparameters.hh:245
bool isDirichlet(const I &intersection, const FieldVector< typename I::ctype, I::mydimension > &coord) const
Definition: constraintsparameters.hh:251
void setTime(const T &time)
Definition: constraintsparameters.hh:269
bool isNeumann(const I &intersection, const FieldVector< typename I::ctype, I::mydimension > &coord) const
Definition: constraintsparameters.hh:260
Definition: constraintsparameters.hh:122
bool isNeumann(const I &intersection, const FieldVector< typename I::ctype, I::mydimension > &coord) const
Definition: constraintsparameters.hh:134
void setTime(const T &time)
Definition: constraintsparameters.hh:145
Definition: constraintsparameters.hh:193
void setTime(const T &time)
Definition: constraintsparameters.hh:217
bool isNeumann(const I &intersection, const FieldVector< typename I::ctype, I::mydimension > &coord) const
Definition: constraintsparameters.hh:208
bool isDirichlet(const I &intersection, const FieldVector< typename I::ctype, I::mydimension > &coord) const
Definition: constraintsparameters.hh:199
Definition: constraintsparameters.hh:81
bool isNeumann(const I &intersection, const FieldVector< typename I::ctype, I::mydimension > &coord) const
Definition: constraintsparameters.hh:96
void setTime(const T &time)
Definition: constraintsparameters.hh:107
bool isDirichlet(const I &intersection, const FieldVector< typename I::ctype, I::mydimension > &coord) const
Definition: constraintsparameters.hh:87
Definition: constraintsparameters.hh:158
bool isNeumann(const I &intersection, const FieldVector< typename I::ctype, I::mydimension > &coord) const
Definition: constraintsparameters.hh:164
void setTime(const T &time)
Definition: constraintsparameters.hh:175
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)