Hanning.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) 2016 OpenCFD Ltd.
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::windowModels::Hanning
28
29Description
30 Hanning window
31
32 The window is described by the function
33 \f[
34 wf = (1 - \alpha) - \alpha cos(2 \pi t/m);
35 \f]
36
37 Where:
38 \vartable
39 \alpha | Coefficient with a default value of 0.5
40 t | time
41 m | window width
42 \endvartable
43
44 The window can be further manipulated by the controls:
45 - \c symmetric: force the window to be symmetric
46 - \c extended: extend the window by 1 element at start and end to produce
47 non-zero values at the start and end positions. Note: window is
48 normalised to preserve energy content
49
50SourceFiles
51 Hanning.C
52
53\*---------------------------------------------------------------------------*/
54
55#ifndef Hanning_H
56#define Hanning_H
57
58#include "autoPtr.H"
60#include "windowModel.H"
61
62// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63
64namespace Foam
65{
66namespace windowModels
67{
68
69/*---------------------------------------------------------------------------*\
70 Class Hanning Declaration
71\*---------------------------------------------------------------------------*/
72
73class Hanning
74:
75 public windowModel
76{
77
78protected:
79
80 // Protected Member Data
81
82 //- Symmetric switch
83 bool symmetric_;
85 //- Extended switch
86 bool extended_;
87
88 //- Window coefficient, default = 0.5
89 scalar alpha_;
90
91
92public:
93
94 //- Runtime type information
95 TypeName("Hanning");
96
98 //- Construct from dictionary
99 Hanning(const dictionary& dict, const label nSamples);
101 //- Destructor
102 virtual ~Hanning() = default;
103
104
105 // Public Member Functions
107 //- Return the symmetric flag
108 bool symmetric() const;
109
110 //- Return the extended flag
111 bool extended() const;
112
113 //- Return the window coefficient
114 scalar alpha() const;
115};
116
117
118// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119
120} // End namespace windowModels
121} // End namespace Foam
122
123// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124
125#endif
126
127// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Base class for windowing models.
Definition: windowModel.H:55
label nSamples() const
Return the number of samples in the window.
Definition: windowModel.C:56
Hanning window.
Definition: Hanning.H:87
bool symmetric() const
Return the symmetric flag.
Definition: Hanning.C:95
bool extended_
Extended switch.
Definition: Hanning.H:97
virtual ~Hanning()=default
Destructor.
TypeName("Hanning")
Runtime type information.
bool extended() const
Return the extended flag.
Definition: Hanning.C:101
bool symmetric_
Symmetric switch.
Definition: Hanning.H:94
scalar alpha_
Window coefficient, default = 0.5.
Definition: Hanning.H:100
scalar alpha() const
Return the window coefficient.
Definition: Hanning.C:107
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73