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-2020 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  <name>
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  // Private Data
87 
88  //- Standard ramp function to reverse
90 
91 
92 public:
93 
94  // Runtime type information
95  TypeName("reverseRamp");
96 
97 
98  // Constructors
99 
100  //- Construct from name and dictionary
102  (
103  const word& name,
104  const dictionary& dict
105  );
106 
107  //- Copy constructor
108  reverseRamp(const reverseRamp& rr);
109 
110 
111  //- Destructor
112  virtual ~reverseRamp();
113 
114 
115  // Member Functions
116 
117  //- Return value for time t
118  virtual inline scalar value(const scalar t) const;
119 
120  //- Return the integral between times t1 and t2
121  virtual inline scalar integral
122  (
123  const scalar t1,
124  const scalar t2
125  ) const;
126 
127  //- Write data to dictionary stream
128  virtual void write(Ostream& os) const;
129 
130 
131  // Member Operators
132 
133  //- Disallow default bitwise assignment
134  void operator=(const reverseRamp&) = delete;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Function1s
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #include "reverseRampI.H"
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
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:156
const word & name() const
Return the name of the entry.
virtual ~reverseRamp()
Destructor.
Definition: reverseRamp.C:64
virtual void write(Ostream &os) const
Write data to dictionary stream.
Definition: reverseRamp.C:70
reverseRamp(const word &name, const dictionary &dict)
Construct from name and dictionary.
Definition: reverseRamp.C:42
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
virtual scalar integral(const scalar t1, const scalar t2) const
Return the integral between times t1 and t2.
Definition: reverseRampI.H:40
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
void operator=(const reverseRamp &)=delete
Disallow default bitwise assignment.
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.