fieldAverageItem.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) 2011-2013 OpenFOAM Foundation
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 "fieldAverageItem.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32  const word fieldAverageItem::EXT_MEAN = "Mean";
33  const word fieldAverageItem::EXT_PRIME2MEAN = "Prime2Mean";
34 
35  template<>
36  const char* Foam::NamedEnum
37  <
39  2
40  >::names[] =
41  {
42  "iteration",
43  "time"
44  };
45 }
46 
47 
49  Foam::fieldAverageItem::baseTypeNames_;
50 
51 
52 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
53 
55 :
56  active_(false),
57  fieldName_("unknown"),
58  mean_(0),
59  meanFieldName_("unknown"),
60  prime2Mean_(0),
61  prime2MeanFieldName_("unknown"),
62  base_(ITER),
63  window_(-1.0),
64  windowName_("")
65 {}
66 
67 
69 :
70  active_(faItem.active_),
71  fieldName_(faItem.fieldName_),
72  mean_(faItem.mean_),
73  meanFieldName_(faItem.meanFieldName_),
74  prime2Mean_(faItem.prime2Mean_),
75  prime2MeanFieldName_(faItem.prime2MeanFieldName_),
76  base_(faItem.base_),
77  window_(faItem.window_),
78  windowName_(faItem.windowName_)
79 {}
80 
81 
82 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
83 
85 {}
86 
87 
88 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
89 
91 {
92  // Check for assignment to self
93  if (this == &rhs)
94  {
96  (
97  "Foam::fieldAverageItem::operator=(const Foam::fieldAverageItem&)"
98  ) << "Attempted assignment to self" << nl
99  << abort(FatalError);
100  }
101 
102  // Set updated values
103  active_ = rhs.active_;
104  fieldName_ = rhs.fieldName_;
105  mean_ = rhs.mean_;
106  meanFieldName_ = rhs.meanFieldName_;
107  prime2Mean_ = rhs.prime2Mean_;
108  prime2MeanFieldName_ = rhs.prime2MeanFieldName_;
109  base_ = rhs.base_;
110  window_ = rhs.window_;
111  windowName_ = rhs.windowName_;
112 }
113 
114 
115 // ************************************************************************* //
~fieldAverageItem()
Destructor.
baseType
Enumeration defining the averaging base type.
Namespace for OpenFOAM.
void operator=(const fieldAverageItem &)
static const char nl
Definition: Ostream.H:260
static const word EXT_PRIME2MEAN
Prime-squared average.
errorManip< error > abort(error &err)
Definition: errorManip.H:131
Initialise the NamedEnum HashTable from the static list of names.
Definition: NamedEnum.H:52
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:314
static const word EXT_MEAN
Mean average.
Helper class to describe what form of averaging to apply. A set will be applied to each base field in...
fieldAverageItem()
Construct null.
error FatalError