1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
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
124 ~correlationFunction();
129 void calculateCorrelationFunction(const Field<Type>&);
131 void calculateCorrelationFunction(const Type&);
133 scalar integral() const;
135 bool writeAveraged(Ostream&) const;
140 inline const Field< Field<Type> >& tZeroBuffers() const;
142 inline scalar duration() const;
144 inline scalar sampleInterval() const;
146 inline scalar averagingInterval() const;
148 inline label sampleSteps() const;
150 inline label measurandFieldSize() const;
153 // IOstream Operators
155 friend Ostream& operator<< <Type>
158 const correlationFunction<Type>&
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 #include "correlationFunctionI.H"
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 # include "correlationFunction.C"
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 // ************************************************************************* //