FreeFOAM The Cross-Platform CFD Toolkit
correlationFunction.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) 2008-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::correlationFunction
26 
27 Description
28 
29 SourceFiles
30  correlationFunctionI.H
31  correlationFunction.C
32  correlationFunctionIO.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef correlationFunction_H
37 #define correlationFunction_H
38 
40 #include <OpenFOAM/dictionary.H>
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 template<class Type>
48 class correlationFunction;
49 
50 template<class Type>
51 Ostream& operator<<
52 (
53  Ostream&,
54  const correlationFunction<Type>&
55 );
56 
57 /*---------------------------------------------------------------------------*\
58  Class correlationFunction Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template<class Type>
63 :
64  public bufferedAccumulator<scalar>
65 {
66  // Private data
67 
68  const polyMesh& mesh_;
69 
70  Field< Field<Type> > tZeroBuffers_;
71 
72  scalar duration_;
73  scalar sampleInterval_;
74  scalar averagingInterval_;
75 
76  label sampleSteps_;
77 
78 
79  // Private Member Functions
80 
81  void setTimesAndSizes(const label);
82 
83  //- Disallow default bitwise copy construct
85 
86  //- Disallow default bitwise assignment
87  void operator=(const correlationFunction<Type>&);
88 
89 
90 public:
91 
92  //- Component type
94 
95 
96  // Static data members
97 
98  static const char* const typeName;
99 
100 
101  // Constructors
102 
103  //- Construct from dictionary
105  (
106  const polyMesh&,
107  const dictionary&,
108  const label tZeroBufferSize
109  );
110 
111  //- Construct from components
113  (
114  const polyMesh&,
115  const label tZeroBufferSize,
116  const scalar duration,
117  const scalar sampleInterval,
118  const scalar averagingInterval
119 
120  );
121 
122 
123  // Destructor
124 
126 
127 
128  // Member Functions
129 
131 
132  void calculateCorrelationFunction(const Type&);
133 
134  scalar integral() const;
135 
136  bool writeAveraged(Ostream&) const;
137 
138 
139  // Access
140 
141  inline const Field< Field<Type> >& tZeroBuffers() const;
142 
143  inline scalar duration() const;
144 
145  inline scalar sampleInterval() const;
146 
147  inline scalar averagingInterval() const;
148 
149  inline label sampleSteps() const;
150 
151  inline label measurandFieldSize() const;
152 
153 
154  // IOstream Operators
155 
156  friend Ostream& operator<< <Type>
157  (
158  Ostream&,
160  );
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #include "correlationFunctionI.H"
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #ifdef NoRepository
175 # include "correlationFunction.C"
176 #endif
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************ vim: set sw=4 sts=4 et: ************************ //