FreeFOAM The Cross-Platform CFD Toolkit
errorEstimate.H
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 Class
25  Foam::errorEstimate
26 
27 Description
28  Residual error estimation
29 
30 SourceFiles
31  errorEstimate.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef errorEstimate_H
36 #define errorEstimate_H
37 
38 #include <finiteVolume/volFields.H>
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class errorEstimate Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class Type>
52 :
53  public refCount
54 {
55  // Private data
56 
57  // Reference to GeometricField<Type, fvPatchField, volMesh>
59 
60  //- Dimension set
61  dimensionSet dimensions_;
62 
63  //- Cell residual pointer
64  Field<Type> residual_;
65 
66  //- Normalisation factor
67  scalarField normFactor_;
68 
69 
70  // Private Member Functions
71 
72  //- Return boundary condition types for the error field
73  wordList errorBCTypes() const;
74 
75 public:
76 
77  // Static data members
78 
79  ClassName("errorEstimate");
80 
81 
82  // Constructors
83 
84  //- Construct from components
86  (
88  const dimensionSet& ds,
89  const Field<Type>& res,
90  const scalarField& norm
91  );
92 
93  //- Construct as copy
95 
96 
97  // Destructor
98 
100 
101 
102  // Member Functions
103 
104  // Access
105 
106  //- Return field
108  {
109  return psi_;
110  }
111 
112  //- Return residual dimensions
113  const dimensionSet& dimensions() const
114  {
115  return dimensions_;
116  }
117 
118  // Raw residual (for calculus)
119 
121  {
122  return residual_;
123  }
124 
125  const Field<Type>& res() const
126  {
127  return residual_;
128  }
129 
130 
131  // Error Estimate
132 
133  //- Cell residual (volume intensive)
135 
136  //- Normalisation factor
138 
139  //- Error estimate
141 
142 
143  // Member Operators
144 
145  void operator=(const errorEstimate<Type>&);
146  void operator=(const tmp<errorEstimate<Type> >&);
147 
148  void negate();
149 
150  void operator+=(const errorEstimate<Type>&);
151  void operator+=(const tmp<errorEstimate<Type> >&);
152 
153  void operator-=(const errorEstimate<Type>&);
154  void operator-=(const tmp<errorEstimate<Type> >&);
155 
158 
161 
162  void operator+=(const dimensioned<Type>&);
163  void operator-=(const dimensioned<Type>&);
164 
165  void operator*=(const volScalarField&);
166  void operator*=(const tmp<volScalarField>&);
167 
168  void operator*=(const dimensioned<scalar>&);
169 
170 
171  // Friend Functions
172 
173  // Friend Operators
174 };
175 
176 
177 // * * * * * * * * * * * * * * * Global functions * * * * * * * * * * * * * //
178 
179 template<class Type>
180 void checkMethod
181 (
182  const errorEstimate<Type>&,
183  const errorEstimate<Type>&,
184  const char*
185 );
186 
187 template<class Type>
188 void checkMethod
189 (
190  const errorEstimate<Type>&,
191  const GeometricField<Type, fvPatchField, volMesh>&,
192  const char*
193 );
194 
195 template<class Type>
196 void checkMethod
197 (
198  const errorEstimate<Type>&,
199  const dimensioned<Type>&,
200  const char*
201 );
202 
203 
204 // * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * //
205 
206 template<class Type>
207 tmp<errorEstimate<Type> > operator-
208 (
209  const errorEstimate<Type>&
210 );
211 
212 template<class Type>
213 tmp<errorEstimate<Type> > operator-
214 (
215  const tmp<errorEstimate<Type> >&
216 );
217 
218 template<class Type>
219 tmp<errorEstimate<Type> > operator+
220 (
221  const errorEstimate<Type>&,
222  const errorEstimate<Type>&
223 );
224 
225 template<class Type>
226 tmp<errorEstimate<Type> > operator+
227 (
228  const tmp<errorEstimate<Type> >&,
229  const errorEstimate<Type>&
230 );
231 
232 template<class Type>
233 tmp<errorEstimate<Type> > operator+
234 (
235  const errorEstimate<Type>&,
236  const tmp<errorEstimate<Type> >&
237 );
238 
239 template<class Type>
240 tmp<errorEstimate<Type> > operator+
241 (
242  const tmp<errorEstimate<Type> >&,
243  const tmp<errorEstimate<Type> >&
244 );
245 
246 template<class Type>
247 tmp<errorEstimate<Type> > operator-
248 (
249  const errorEstimate<Type>&,
250  const errorEstimate<Type>&
251 );
252 
253 template<class Type>
254 tmp<errorEstimate<Type> > operator-
255 (
256  const tmp<errorEstimate<Type> >&,
257  const errorEstimate<Type>&
258 );
259 
260 template<class Type>
261 tmp<errorEstimate<Type> > operator-
262 (
263  const errorEstimate<Type>&,
264  const tmp<errorEstimate<Type> >&
265 );
266 
267 template<class Type>
268 tmp<errorEstimate<Type> > operator-
269 (
270  const tmp<errorEstimate<Type> >&,
271  const tmp<errorEstimate<Type> >&
272 );
273 
274 template<class Type>
275 tmp<errorEstimate<Type> > operator==
276 (
277  const errorEstimate<Type>&,
278  const errorEstimate<Type>&
279 );
280 
281 template<class Type>
282 tmp<errorEstimate<Type> > operator==
283 (
284  const tmp<errorEstimate<Type> >&,
285  const errorEstimate<Type>&
286 );
287 
288 template<class Type>
289 tmp<errorEstimate<Type> > operator==
290 (
291  const errorEstimate<Type>&,
292  const tmp<errorEstimate<Type> >&
293 );
294 
295 template<class Type>
296 tmp<errorEstimate<Type> > operator==
297 (
298  const tmp<errorEstimate<Type> >&,
299  const tmp<errorEstimate<Type> >&
300 );
301 
302 template<class Type>
303 tmp<errorEstimate<Type> > operator+
304 (
305  const errorEstimate<Type>&,
306  const GeometricField<Type, fvPatchField, volMesh>&
307 );
308 
309 template<class Type>
310 tmp<errorEstimate<Type> > operator+
311 (
312  const tmp<errorEstimate<Type> >&,
313  const GeometricField<Type, fvPatchField, volMesh>&
314 );
315 
316 template<class Type>
317 tmp<errorEstimate<Type> > operator+
318 (
319  const errorEstimate<Type>&,
320  const tmp<GeometricField<Type, fvPatchField, volMesh> >&
321 );
322 
323 template<class Type>
324 tmp<errorEstimate<Type> > operator+
325 (
326  const tmp<errorEstimate<Type> >&,
327  const tmp<GeometricField<Type, fvPatchField, volMesh> >&
328 );
329 
330 template<class Type>
331 tmp<errorEstimate<Type> > operator+
332 (
333  const GeometricField<Type, fvPatchField, volMesh>&,
334  const errorEstimate<Type>&
335 );
336 
337 template<class Type>
338 tmp<errorEstimate<Type> > operator+
339 (
340  const GeometricField<Type, fvPatchField, volMesh>&,
341  const tmp<errorEstimate<Type> >&
342 );
343 
344 template<class Type>
345 tmp<errorEstimate<Type> > operator+
346 (
347  const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
348  const errorEstimate<Type>&
349 );
350 
351 template<class Type>
352 tmp<errorEstimate<Type> > operator+
353 (
354  const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
355  const tmp<errorEstimate<Type> >&
356 );
357 
358 template<class Type>
359 tmp<errorEstimate<Type> > operator-
360 (
361  const errorEstimate<Type>&,
362  const GeometricField<Type, fvPatchField, volMesh>&
363 );
364 
365 template<class Type>
366 tmp<errorEstimate<Type> > operator-
367 (
368  const tmp<errorEstimate<Type> >&,
369  const GeometricField<Type, fvPatchField, volMesh>&
370 );
371 
372 template<class Type>
373 tmp<errorEstimate<Type> > operator-
374 (
375  const errorEstimate<Type>&,
376  const tmp<GeometricField<Type, fvPatchField, volMesh> >&
377 );
378 
379 template<class Type>
380 tmp<errorEstimate<Type> > operator-
381 (
382  const tmp<errorEstimate<Type> >&,
383  const tmp<GeometricField<Type, fvPatchField, volMesh> >&
384 );
385 
386 template<class Type>
387 tmp<errorEstimate<Type> > operator-
388 (
389  const GeometricField<Type, fvPatchField, volMesh>&,
390  const errorEstimate<Type>&
391 );
392 
393 template<class Type>
394 tmp<errorEstimate<Type> > operator-
395 (
396  const GeometricField<Type, fvPatchField, volMesh>&,
397  const tmp<errorEstimate<Type> >&
398 );
399 
400 template<class Type>
401 tmp<errorEstimate<Type> > operator-
402 (
403  const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
404  const errorEstimate<Type>&
405 );
406 
407 template<class Type>
408 tmp<errorEstimate<Type> > operator-
409 (
410  const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
411  const tmp<errorEstimate<Type> >&
412 );
413 
414 template<class Type>
415 tmp<errorEstimate<Type> > operator+
416 (
417  const tmp<errorEstimate<Type> >&,
418  const dimensioned<Type>&
419 );
420 
421 template<class Type>
422 tmp<errorEstimate<Type> > operator+
423 (
424  const dimensioned<Type>&,
425  const tmp<errorEstimate<Type> >&
426 );
427 
428 template<class Type>
429 tmp<errorEstimate<Type> > operator-
430 (
431  const tmp<errorEstimate<Type> >&,
432  const dimensioned<Type>&
433 );
434 
435 template<class Type>
436 tmp<errorEstimate<Type> > operator-
437 (
438  const dimensioned<Type>&,
439  const tmp<errorEstimate<Type> >&
440 );
441 
442 template<class Type>
443 tmp<errorEstimate<Type> > operator==
444 (
445  const errorEstimate<Type>&,
446  const GeometricField<Type, fvPatchField, volMesh>&
447 );
448 
449 template<class Type>
450 tmp<errorEstimate<Type> > operator==
451 (
452  const tmp<errorEstimate<Type> >&,
453  const GeometricField<Type, fvPatchField, volMesh>&
454 );
455 
456 template<class Type>
457 tmp<errorEstimate<Type> > operator==
458 (
459  const errorEstimate<Type>&,
460  const tmp<GeometricField<Type, fvPatchField, volMesh> >&
461 );
462 
463 template<class Type>
464 tmp<errorEstimate<Type> > operator==
465 (
466  const tmp<errorEstimate<Type> >&,
467  const tmp<GeometricField<Type, fvPatchField, volMesh> >&
468 );
469 
470 template<class Type>
471 tmp<errorEstimate<Type> > operator==
472 (
473  const errorEstimate<Type>&,
474  const dimensioned<Type>&
475 );
476 
477 template<class Type>
478 tmp<errorEstimate<Type> > operator==
479 (
480  const tmp<errorEstimate<Type> >&,
481  const dimensioned<Type>&
482 );
483 
484 
485 template<class Type>
486 tmp<errorEstimate<Type> > operator*
487 (
488  const volScalarField&,
489  const errorEstimate<Type>&
490 );
491 
492 template<class Type>
493 tmp<errorEstimate<Type> > operator*
494 (
495  const volScalarField&,
496  const tmp<errorEstimate<Type> >&
497 );
498 
499 template<class Type>
500 tmp<errorEstimate<Type> > operator*
501 (
502  const tmp<volScalarField>&,
503  const errorEstimate<Type>&
504 );
505 
506 template<class Type>
507 tmp<errorEstimate<Type> > operator*
508 (
509  const tmp<volScalarField>&,
510  const tmp<errorEstimate<Type> >&
511 );
512 
513 
514 template<class Type>
515 tmp<errorEstimate<Type> > operator*
516 (
517  const dimensioned<scalar>&,
518  const errorEstimate<Type>&
519 );
520 
521 template<class Type>
522 tmp<errorEstimate<Type> > operator*
523 (
524  const dimensioned<scalar>&,
525  const tmp<errorEstimate<Type> >&
526 );
527 
528 
529 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
530 
531 } // End namespace Foam
532 
533 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
534 
535 #ifdef NoRepository
537 #endif
538 
539 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
540 
541 #endif
542 
543 // ************************ vim: set sw=4 sts=4 et: ************************ //