1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 Foam::correlationFunction
30 correlationFunctionI.H
32 correlationFunctionIO.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef correlationFunction_H
37 #define correlationFunction_H
39 #include "bufferedAccumulator.H"
40 #include "dictionary.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 class correlationFunction;
54 const correlationFunction<Type>&
57 /*---------------------------------------------------------------------------*\
58 Class correlationFunction Declaration
59 \*---------------------------------------------------------------------------*/
62 class correlationFunction
64 public bufferedAccumulator<scalar>
68 const polyMesh& mesh_;
70 Field< Field<Type> > tZeroBuffers_;
73 scalar sampleInterval_;
74 scalar averagingInterval_;
79 // Private Member Functions
81 void setTimesAndSizes(const label);
83 //- Disallow default bitwise copy construct
84 correlationFunction(const correlationFunction<Type>&);
86 //- Disallow default bitwise assignment
87 void operator=(const correlationFunction<Type>&);
93 typedef typename pTraits<Type>::cmptType cmptType;
96 // Static data members
98 static const char* const typeName;
103 //- Construct from dictionary
108 const label tZeroBufferSize
111 //- Construct from components
115 const label tZeroBufferSize,
116 const scalar duration,
117 const scalar sampleInterval,
118 const scalar averagingInterval
125 ~correlationFunction();
130 void calculateCorrelationFunction(const Field<Type>&);
132 void calculateCorrelationFunction(const Type&);
134 scalar integral() const;
136 bool writeAveraged(Ostream&) const;
141 inline const Field< Field<Type> >& tZeroBuffers() const;
143 inline scalar duration() const;
145 inline scalar sampleInterval() const;
147 inline scalar averagingInterval() const;
149 inline label sampleSteps() const;
151 inline label measurandFieldSize() const;
154 // IOstream Operators
156 friend Ostream& operator<< <Type>
159 const correlationFunction<Type>&
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 } // End namespace Foam
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 #include "correlationFunctionI.H"
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 # include "correlationFunction.C"
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 // ************************************************************************* //