correlationFunction.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::correlationFunction
26 
27 Description
28 
29 SourceFiles
30  correlationFunctionI.H
31  correlationFunction.C
32  correlationFunctionIO.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef correlationFunction_H
37 #define correlationFunction_H
38 
39 #include "bufferedAccumulator.H"
40 #include "dictionary.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 template<class Type>
49 
50 template<class Type>
51 Ostream& operator<<
52 (
53  Ostream&,
55 );
56 
57 /*---------------------------------------------------------------------------*\
58  Class correlationFunction Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template<class Type>
63 :
64  public bufferedAccumulator<scalar>
65 {
66  // Private Data
67 
68  const polyMesh& mesh_;
69 
70  Field<Field<Type>> tZeroBuffers_;
71 
72  scalar duration_;
73  scalar sampleInterval_;
74  scalar averagingInterval_;
75 
76  label sampleSteps_;
77 
78 
79  // Private Member Functions
80 
81  void setTimesAndSizes(const label);
82 
83  //- Disallow default bitwise copy construction
85 
86  //- Disallow default bitwise assignment
87  void operator=(const correlationFunction<Type>&) = delete;
88 
89 
90 public:
91 
92  //- Component type
93  typedef typename pTraits<Type>::cmptType cmptType;
94 
95 
96  // Static Data Members
97 
98  static const char* const typeName;
99 
100 
101  // Constructors
102 
103  //- Construct from dictionary
105  (
106  const polyMesh&,
107  const dictionary&,
108  const label tZeroBufferSize
109  );
110 
111  //- Construct from components
113  (
114  const polyMesh&,
115  const label tZeroBufferSize,
116  const scalar duration,
117  const scalar sampleInterval,
118  const scalar averagingInterval
119 
120  );
121 
122 
123  //- Destructor
125 
126 
127  // Member Functions
128 
130 
131  void calculateCorrelationFunction(const Type&);
132 
133  scalar integral() const;
134 
135  bool writeAveraged(Ostream&) const;
136 
137 
138  // Access
139 
140  inline const Field<Field<Type>>& tZeroBuffers() const;
141 
142  inline scalar duration() const;
143 
144  inline scalar sampleInterval() const;
145 
146  inline scalar averagingInterval() const;
147 
148  inline label sampleSteps() const;
149 
150  inline label measurandFieldSize() const;
151 
152 
153  // IOstream Operators
154 
155  friend Ostream& operator<< <Type>
156  (
157  Ostream&,
159  );
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #include "correlationFunctionI.H"
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #ifdef NoRepository
174  #include "correlationFunction.C"
175 #endif
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
pTraits< Type >::cmptType cmptType
Component type.
bool writeAveraged(Ostream &) const
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Traits class for primitives.
Definition: pTraits.H:50
void calculateCorrelationFunction(const Field< Type > &)
Pre-declare SubField and related Field type.
Definition: Field.H:56
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
static const char *const typeName
const Field< Field< Type > > & tZeroBuffers() const
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.