initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / molecularDynamics / molecularMeasurements / correlationFunction / correlationFunction.H
blobfe2071aff372af8f680c640fd4559afb74dcba3b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2008-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::correlationFunction
28 Description
30 SourceFiles
31     correlationFunctionI.H
32     correlationFunction.C
33     correlationFunctionIO.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef correlationFunction_H
38 #define correlationFunction_H
40 #include "bufferedAccumulator.H"
41 #include "dictionary.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 template<class Type>
49 class correlationFunction;
51 template<class Type>
52 Ostream& operator<<
54     Ostream&,
55     const correlationFunction<Type>&
58 /*---------------------------------------------------------------------------*\
59                     Class correlationFunction Declaration
60 \*---------------------------------------------------------------------------*/
62 template<class Type>
63 class correlationFunction
65     public bufferedAccumulator<scalar>
67     // Private data
69         const polyMesh& mesh_;
71         Field< Field<Type> > tZeroBuffers_;
73         scalar duration_;
74         scalar sampleInterval_;
75         scalar averagingInterval_;
77         label sampleSteps_;
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>&);
91 public:
93     //- Component type
94     typedef typename pTraits<Type>::cmptType cmptType;
97     // Static data members
99         static const char* const typeName;
102     // Constructors
104         //- Construct from dictionary
105         correlationFunction
106         (
107             const polyMesh&,
108             const dictionary&,
109             const label tZeroBufferSize
110         );
112         //- Construct from components
113         correlationFunction
114         (
115             const polyMesh&,
116             const label tZeroBufferSize,
117             const scalar duration,
118             const scalar sampleInterval,
119             const scalar averagingInterval
121         );
124     // Destructor
126         ~correlationFunction();
129     // Member Functions
131         void calculateCorrelationFunction(const Field<Type>&);
133         void calculateCorrelationFunction(const Type&);
135         scalar integral() const;
137         bool writeAveraged(Ostream&) const;
140     // Access
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>
158         (
159             Ostream&,
160             const correlationFunction<Type>&
161         );
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 #include "correlationFunctionI.H"
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 #ifdef NoRepository
176 #   include "correlationFunction.C"
177 #endif
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 #endif
183 // ************************************************************************* //