All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
reverseRamp.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) 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::Function1s::reverseRamp
26 
27 Description
28  A wrapper class to reverse any ramp function such that the result starts
29  from 1 decreasing to 0 from \c start over the \c duration and remaining at 0
30  thereafter.
31 
32  Usage for scaling a vector:
33  \verbatim
34  <entryName>
35  {
36  scale
37  {
38  type reverseRamp;
39 
40  ramp linearRamp;
41 
42  start 0;
43  duration 10;
44  }
45 
46  value
47  {
48  type sine;
49 
50  frequency 10;
51  amplitude 1;
52  scale (1 0.1 0);
53  level (10 1 0);
54  }
55  }
56  \endverbatim
57 
58 See also
59  Foam::Function1s::Ramp
60 
61 SourceFiles
62  reverseRamp.C
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef reverseRamp_H
67 #define reverseRamp_H
68 
69 #include "Ramp.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 namespace Function1s
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class reverseRamp Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class reverseRamp
83 :
84  public Ramp<reverseRamp>
85 {
86  //- Standard ramp function to reverse
88 
89 
90 public:
91 
92  // Runtime type information
93  TypeName("reverseRamp");
94 
95 
96  // Constructors
97 
98  //- Construct from entry name and dictionary
100  (
101  const word& entryName,
102  const dictionary& dict
103  );
104 
105  //- Copy constructor
106  reverseRamp(const reverseRamp& rr);
107 
108 
109  //- Destructor
110  virtual ~reverseRamp();
111 
112 
113  // Member Functions
114 
115  //- Return value for time t
116  virtual inline scalar value(const scalar t) const;
117 
118  //- Return the integral between times t1 and t2
119  virtual inline scalar integrate
120  (
121  const scalar t1,
122  const scalar t2
123  ) const;
124 
125  //- Write in dictionary format
126  virtual void writeData(Ostream& os) const;
127 
128 
129  // Member Operators
130 
131  //- Disallow default bitwise assignment
132  void operator=(const reverseRamp&) = delete;
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Function1s
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #include "reverseRampI.H"
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
const word const dictionary & dict
Definition: Function1.H:84
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual ~reverseRamp()
Destructor.
Definition: reverseRamp.C:64
const word & entryName
Definition: Function1.H:84
virtual void writeData(Ostream &os) const
Write in dictionary format.
Definition: reverseRamp.C:70
A class for handling words, derived from string.
Definition: word.H:59
virtual scalar value(const scalar t) const
Return value for time t.
Definition: reverseRampI.H:31
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual scalar integrate(const scalar t1, const scalar t2) const
Return the integral between times t1 and t2.
Definition: reverseRampI.H:40
void operator=(const reverseRamp &)=delete
Disallow default bitwise assignment.
reverseRamp(const word &entryName, const dictionary &dict)
Construct from entry name and dictionary.
Definition: reverseRamp.C:42
A wrapper class to reverse any ramp function such that the result starts from 1 decreasing to 0 from ...
Definition: reverseRamp.H:81
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Ramp function base class for the set of scalar functions starting from 0 and increasing monotonically...
Definition: Ramp.H:97
Namespace for OpenFOAM.