BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / lagrangian / molecularDynamics / molecularMeasurements / correlationFunction / correlationFunction.H
blob0c02e412df859d307e452e02b8ee85cda17e93d2
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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
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
19     for more details.
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/>.
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
124     ~correlationFunction();
127     // Member Functions
129         void calculateCorrelationFunction(const Field<Type>&);
131         void calculateCorrelationFunction(const Type&);
133         scalar integral() const;
135         bool writeAveraged(Ostream&) const;
138     // Access
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>
156         (
157             Ostream&,
158             const correlationFunction<Type>&
159         );
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 #include "correlationFunctionI.H"
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 #ifdef NoRepository
174 #   include "correlationFunction.C"
175 #endif
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 #endif
181 // ************************************************************************* //