Merge /u/wyldckat/foam-extend32/ branch master into master
[foam-extend-3.2.git] / src / lagrangian / molecularDynamics / molecularMeasurements / correlationFunction / correlationFunction.H
blob2ccea37337bc7a681651ea3726f1061e7eb32f6a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
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 -------------------------------------------------------------------------------
8 License
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/>.
24 Class
25     Foam::correlationFunction
27 Description
29 SourceFiles
30     correlationFunctionI.H
31     correlationFunction.C
32     correlationFunctionIO.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef correlationFunction_H
37 #define correlationFunction_H
39 #include "bufferedAccumulator.H"
40 #include "dictionary.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 template<class Type>
48 class correlationFunction;
50 template<class Type>
51 Ostream& operator<<
53     Ostream&,
54     const correlationFunction<Type>&
57 /*---------------------------------------------------------------------------*\
58                     Class correlationFunction Declaration
59 \*---------------------------------------------------------------------------*/
61 template<class Type>
62 class correlationFunction
64     public bufferedAccumulator<scalar>
66     // Private data
68         const polyMesh& mesh_;
70         Field< Field<Type> > tZeroBuffers_;
72         scalar duration_;
73         scalar sampleInterval_;
74         scalar averagingInterval_;
76         label sampleSteps_;
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>&);
90 public:
92     //- Component type
93     typedef typename pTraits<Type>::cmptType cmptType;
96     // Static data members
98         static const char* const typeName;
101     // Constructors
103         //- Construct from dictionary
104         correlationFunction
105         (
106             const polyMesh&,
107             const dictionary&,
108             const label tZeroBufferSize
109         );
111         //- Construct from components
112         correlationFunction
113         (
114             const polyMesh&,
115             const label tZeroBufferSize,
116             const scalar duration,
117             const scalar sampleInterval,
118             const scalar averagingInterval
120         );
123     // Destructor
125         ~correlationFunction();
128     // Member Functions
130         void calculateCorrelationFunction(const Field<Type>&);
132         void calculateCorrelationFunction(const Type&);
134         scalar integral() const;
136         bool writeAveraged(Ostream&) const;
139     // Access
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>
157         (
158             Ostream&,
159             const correlationFunction<Type>&
160         );
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 } // End namespace Foam
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 #include "correlationFunctionI.H"
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 #ifdef NoRepository
175 #   include "correlationFunction.C"
176 #endif
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 #endif
182 // ************************************************************************* //