FreeFOAM The Cross-Platform CFD Toolkit
valuePointPatchField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "valuePointPatchField.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 
34 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
35 
36 template<class Type>
37 void valuePointPatchField<Type>::checkFieldSize() const
38 {
39  if (size() != this->patch().size())
40  {
42  (
43  "void valuePointPatchField<Type>::checkField() const"
44  ) << "field does not correspond to patch. " << endl
45  << "Field size: " << size() << " patch size: "
46  << this->patch().size()
47  << abort(FatalError);
48  }
49 }
50 
51 
52 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
53 
54 template<class Type>
56 (
57  const pointPatch& p,
59 )
60 :
62  Field<Type>(p.size())
63 {}
64 
65 
66 template<class Type>
68 (
69  const pointPatch& p,
71  const dictionary& dict,
72  const bool valueRequired
73 )
74 :
75  pointPatchField<Type>(p, iF, dict),
76  Field<Type>(p.size())
77 {
78  if (dict.found("value"))
79  {
81  (
82  Field<Type>("value", dict, p.size())
83  );
84  }
85  else if (!valueRequired)
86  {
88  }
89  else
90  {
92  (
93  "pointPatchField<Type>::pointPatchField"
94  "("
95  "const fvPatch& p,"
96  "const DimensionedField<Type, pointMesh>& iF,"
97  "const dictionary& dict,"
98  "const bool valueRequired"
99  ")",
100  dict
101  ) << "Essential entry 'value' missing"
102  << exit(FatalIOError);
103  }
104 }
105 
106 
107 template<class Type>
109 (
110  const valuePointPatchField<Type>& ptf,
111  const pointPatch& p,
113  const pointPatchFieldMapper& mapper
114 )
115 :
117  Field<Type>(ptf, mapper)
118 {}
119 
120 
121 template<class Type>
123 (
124  const valuePointPatchField<Type>& ptf,
126 )
127 :
128  pointPatchField<Type>(ptf, iF),
129  Field<Type>(ptf)
130 {}
131 
132 
133 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
134 
135 template<class Type>
137 (
138  const pointPatchFieldMapper& m
139 )
140 {
142 }
143 
144 
145 template<class Type>
147 (
148  const pointPatchField<Type>& ptf,
149  const labelList& addr
150 )
151 {
153  (
155  (
156  ptf
157  ),
158  addr
159  );
160 }
161 
162 
163 template<class Type>
165 {
166  if (this->updated())
167  {
168  return;
169  }
170 
171  // Get internal field to insert values into
172  Field<Type>& iF = const_cast<Field<Type>&>(this->internalField());
173 
174  setInInternalField(iF, *this);
175 
177 }
178 
179 
180 template<class Type>
182 {
183  // Get internal field to insert values into
184  Field<Type>& iF = const_cast<Field<Type>&>(this->internalField());
185 
186  setInInternalField(iF, *this);
187 
189 }
190 
191 
192 template<class Type>
194 {
196  this->writeEntry("value", os);
197 }
198 
199 
200 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
201 
202 template<class Type>
204 (
205  const valuePointPatchField<Type>& ptf
206 )
207 {
209 }
210 
211 
212 template<class Type>
214 (
215  const pointPatchField<Type>& ptf
216 )
217 {
219 }
220 
221 
222 template<class Type>
224 (
225  const Field<Type>& tf
226 )
227 {
229 }
230 
231 
232 template<class Type>
234 (
235  const Type& t
236 )
237 {
239 }
240 
241 
242 // Force an assignment
243 template<class Type>
245 (
246  const valuePointPatchField<Type>& ptf
247 )
248 {
250 }
251 
252 
253 template<class Type>
255 (
256  const pointPatchField<Type>& ptf
257 )
258 {
260 }
261 
262 
263 template<class Type>
265 (
266  const Field<Type>& tf
267 )
268 {
270 }
271 
272 
273 template<class Type>
275 (
276  const Type& t
277 )
278 {
280 }
281 
282 
283 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
284 
285 } // End namespace Foam
286 
287 // ************************ vim: set sw=4 sts=4 et: ************************ //