1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::correlationFunction
31 correlationFunctionI.H
33 correlationFunctionIO.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef correlationFunction_H
38 #define correlationFunction_H
40 #include "bufferedAccumulator.H"
41 #include "dictionary.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 class correlationFunction;
55 const correlationFunction<Type>&
58 /*---------------------------------------------------------------------------*\
59 Class correlationFunction Declaration
60 \*---------------------------------------------------------------------------*/
63 class correlationFunction
65 public bufferedAccumulator<scalar>
69 const polyMesh& mesh_;
71 Field< Field<Type> > tZeroBuffers_;
74 scalar sampleInterval_;
75 scalar averagingInterval_;
80 // Private Member Functions
82 void setTimesAndSizes(const label);
84 //- Disallow default bitwise copy construct
85 correlationFunction(const correlationFunction<Type>&);
87 //- Disallow default bitwise assignment
88 void operator=(const correlationFunction<Type>&);
94 typedef typename pTraits<Type>::cmptType cmptType;
97 // Static data members
99 static const char* const typeName;
104 //- Construct from dictionary
109 const label tZeroBufferSize
112 //- Construct from components
116 const label tZeroBufferSize,
117 const scalar duration,
118 const scalar sampleInterval,
119 const scalar averagingInterval
126 ~correlationFunction();
131 void calculateCorrelationFunction(const Field<Type>&);
133 void calculateCorrelationFunction(const Type&);
135 scalar integral() const;
137 bool writeAveraged(Ostream&) const;
142 inline const Field< Field<Type> >& tZeroBuffers() const;
144 inline scalar duration() const;
146 inline scalar sampleInterval() const;
148 inline scalar averagingInterval() const;
150 inline label sampleSteps() const;
152 inline label measurandFieldSize() const;
155 // IOstream Operators
157 friend Ostream& operator<< <Type>
160 const correlationFunction<Type>&
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 #include "correlationFunctionI.H"
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 # include "correlationFunction.C"
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 // ************************************************************************* //