reverseRamp.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) 2007-2019 PCOpt/NTUA
9  Copyright (C) 2013-2019 FOSS GP
10  Copyright (C) 2019 OpenCFD Ltd.
11 -------------------------------------------------------------------------------
12 License
13  This file is part of OpenFOAM.
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 Class
29  Foam::Function1Types::reverseRamp
30 
31 Description
32  Reverse ramp function starting from 1 and decreasing stepRamply to a min.
33  user-specified value from \c start over the \c duration and remaining
34  constant thereafter.
35 
36 See also
37  Foam::Function1Types::ramp
38 
39 SourceFiles
40  reverseRamp.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef reverseRamp_H
45 #define reverseRamp_H
46 
47 #include "ramp.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 namespace Function1Types
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class reverseRamp Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class reverseRamp
62 :
63  public ramp
64 {
65 protected:
66 
67  // Protected Data Members
68 
69  //- The min value
70  scalar minValue_;
71 
72  //- Interval for reducing the base value
73  scalar interval_;
74 
75  //- Steps to reach the min. value
76  scalar steps_;
77 
78 
79 private:
80 
81  // Private Data Members
82 
83  //- No copy assignment
84  void operator=(const reverseRamp&) = delete;
85 
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("reverseRamp");
91 
92 
93  // Constructors
94 
95  //- Construct from entry and dictionary
97  (
98  const word& entryName,
99  const dictionary& dict,
100  const objectRegistry* obrPtr = nullptr
101  );
102 
103 
104  //- Destructor
105  virtual ~reverseRamp() = default;
106 
107 
108  // Member Functions
109 
110  //- Return value for time t
111  inline virtual scalar value(const scalar t) const;
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace Function1Types
118 } // End namespace Foam
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #include "reverseRampI.H"
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
TypeName("reverseRamp")
Runtime type information.
const word const dictionary & dict
Definition: Function1.H:140
reverseRamp(const word &entryName, const dictionary &dict, const objectRegistry *obrPtr=nullptr)
Construct from entry and dictionary.
Definition: reverseRamp.C:40
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
scalar minValue_
The min value.
Definition: reverseRamp.H:67
Reverse ramp function starting from 1 and decreasing stepRamply to a min. user-specified value from s...
Definition: reverseRamp.H:56
Ramp function base class for the set of scalar functions starting from 0 and increasing monotonically...
Definition: ramp.H:95
const word & entryName
Definition: Function1.H:140
A class for handling words, derived from Foam::string.
Definition: word.H:63
scalar interval_
Interval for reducing the base value.
Definition: reverseRamp.H:72
const word const dictionary const objectRegistry * obrPtr
Definition: Function1.H:140
virtual ~reverseRamp()=default
Destructor.
virtual scalar value(const scalar t) const
Return value for time t.
Definition: reverseRampI.H:26
Registry of regIOobjects.
Namespace for OpenFOAM.
scalar steps_
Steps to reach the min. value.
Definition: reverseRamp.H:77