correlationFunction.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::correlationFunction
28
29Description
30
31SourceFiles
32 correlationFunctionI.H
33 correlationFunction.C
34 correlationFunctionIO.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef correlationFunction_H
39#define correlationFunction_H
40
41#include "bufferedAccumulator.H"
42#include "dictionary.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49template<class Type>
50class correlationFunction;
51
52template<class Type>
53Ostream& operator<<
54(
55 Ostream&,
57);
58
59/*---------------------------------------------------------------------------*\
60 Class correlationFunction Declaration
61\*---------------------------------------------------------------------------*/
62
63template<class Type>
65:
66 public bufferedAccumulator<scalar>
67{
68 // Private data
69
70 const polyMesh& mesh_;
71
72 Field<Field<Type>> tZeroBuffers_;
73
74 scalar duration_;
75 scalar sampleInterval_;
76 scalar averagingInterval_;
77
78 label sampleSteps_;
79
80
81 // Private Member Functions
82
83 void setTimesAndSizes(const label);
84
85 //- No copy construct
87
88 //- No copy assignment
89 void operator=(const correlationFunction<Type>&) = delete;
90
91
92public:
93
94 //- Component type
95 typedef typename pTraits<Type>::cmptType cmptType;
96
97
98 // Static data members
100 static const char* const typeName;
101
102
103 // Constructors
104
105 //- Construct from dictionary
107 (
108 const polyMesh&,
109 const dictionary&,
110 const label tZeroBufferSize
111 );
112
113 //- Construct from components
115 (
116 const polyMesh&,
117 const label tZeroBufferSize,
118 const scalar duration,
119 const scalar sampleInterval,
120 const scalar averagingInterval
121
122 );
123
124
125 //- Destructor
127
128
129 // Member Functions
130
132
133 void calculateCorrelationFunction(const Type&);
134
135 scalar integral() const;
136
137 bool writeAveraged(Ostream&) const;
138
139
140 // Access
141
142 inline const Field<Field<Type>>& tZeroBuffers() const;
143
144 inline scalar duration() const;
145
146 inline scalar sampleInterval() const;
147
148 inline scalar averagingInterval() const;
149
150 inline label sampleSteps() const;
151
152 inline label measurandFieldSize() const;
153
154
155 // IOstream Operators
157 friend Ostream& operator<< <Type>
158 (
159 Ostream&,
161 );
162};
163
164
165// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166
167} // End namespace Foam
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171#include "correlationFunctionI.H"
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#ifdef NoRepository
176 #include "correlationFunction.C"
177#endif
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181#endif
182
183// ************************************************************************* //
Generic templated field type.
Definition: Field.H:82
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
bool writeAveraged(Ostream &) const
void calculateCorrelationFunction(const Field< Type > &)
pTraits< Type >::cmptType cmptType
Component type.
const Field< Field< Type > > & tZeroBuffers() const
static const char *const typeName
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:66
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Namespace for OpenFOAM.