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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::correlationFunction
28 
29 Description
30 
31 SourceFiles
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 
46 namespace Foam
47 {
48 
49 template<class Type>
51 
52 template<class Type>
53 Ostream& operator<<
54 (
55  Ostream&,
57 );
58 
59 /*---------------------------------------------------------------------------*\
60  Class correlationFunction Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<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 
92 public:
93 
94  //- Component type
95  typedef typename pTraits<Type>::cmptType cmptType;
96 
97 
98  // Static data members
99 
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
156 
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 // ************************************************************************* //
Foam::correlationFunction::sampleSteps
label sampleSteps() const
Definition: correlationFunctionI.H:58
Foam::correlationFunction
Definition: correlationFunction.H:49
Foam::correlationFunction::typeName
static const char *const typeName
Definition: correlationFunction.H:99
Foam::correlationFunction::duration
scalar duration() const
Definition: correlationFunctionI.H:37
Foam::correlationFunction::~correlationFunction
~correlationFunction()
Destructor.
Definition: correlationFunction.C:122
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::correlationFunction::averagingInterval
scalar averagingInterval() const
Definition: correlationFunctionI.H:51
bufferedAccumulator.H
Foam::correlationFunction::writeAveraged
bool writeAveraged(Ostream &) const
Definition: correlationFunctionIO.C:32
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::correlationFunction::calculateCorrelationFunction
void calculateCorrelationFunction(const Field< Type > &)
Definition: correlationFunction.C:130
Foam::bufferedAccumulator
Definition: bufferedAccumulator.H:48
correlationFunctionI.H
Foam::correlationFunction::integral
scalar integral() const
Definition: correlationFunction.C:200
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
correlationFunction.C
Foam::correlationFunction::cmptType
pTraits< Type >::cmptType cmptType
Component type.
Definition: correlationFunction.H:94
Foam::pTraits
A traits class, which is primarily used for primitives.
Definition: pTraits.H:56
dictionary.H
Foam::correlationFunction::tZeroBuffers
const Field< Field< Type > > & tZeroBuffers() const
Definition: correlationFunctionI.H:30
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::correlationFunction::measurandFieldSize
label measurandFieldSize() const
Definition: correlationFunctionI.H:65
Foam::correlationFunction::sampleInterval
scalar sampleInterval() const
Definition: correlationFunctionI.H:44