All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Scale2.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) 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::Function2s::Scale
26 
27 Description
28  Function2 which scales a given 'value' function by a 'scale' scalar function
29  and scales the 'x' and 'y' arguments of the 'value' and 'scale' functions
30  by the optional 'xScale' and 'yScale' scalar functions.
31 
32 See also
33  Foam::Function2s::ramp
34  Foam::Function2s::reverseRamp
35 
36 SourceFiles
37  Scale.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef Scale2_H
42 #define Scale2_H
43 
44 #include "Function2.H"
45 #include "Function1.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 namespace Function2s
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class Scale Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 template<class Type>
59 class Scale
60 :
61  public FieldFunction2<Type, Scale<Type>>
62 {
63  // Private Data
64 
65  //- Scalar scaling function
67 
68  //- Argument scaling function
70 
71  //- Argument scaling function
73 
74  //- Value function
76 
77 
78  // Private Member Functions
79 
80  //- Read the coefficients from the given dictionary
81  void read(const dictionary& dict);
82 
83 
84 public:
85 
86  // Runtime type information
87  TypeName("scale");
88 
89 
90  // Constructors
91 
92  //- Construct from name and dictionary
93  Scale
94  (
95  const word& name,
96  const dictionary& dict
97  );
98 
99  //- Copy constructor
100  Scale(const Scale<Type>& se);
101 
102 
103  //- Destructor
104  virtual ~Scale();
105 
106 
107  // Member Functions
108 
109  //- Return value
110  virtual inline Type value(const scalar x, const scalar y) const;
111 
112  //- Write data to dictionary stream
113  virtual void write(Ostream& os) const;
114 
115 
116  // Member Operators
117 
118  //- Disallow default bitwise assignment
119  void operator=(const Scale<Type>&) = delete;
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Function2s
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #include "Scale2I.H"
131 
132 #ifdef NoRepository
133  #include "Scale2.C"
134 #endif
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
virtual ~Scale()
Destructor.
Definition: Scale2.C:81
Scale(const word &name, const dictionary &dict)
Construct from name and dictionary.
Definition: Scale2.C:56
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const word const dictionary & dict
Definition: Function2.H:84
const word & name() const
Return the name of the entry.
scalar y
A class for handling words, derived from string.
Definition: word.H:59
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual Type value(const scalar x, const scalar y) const
Return value.
Definition: Scale2I.H:32
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Function2 which scales a given &#39;value&#39; function by a &#39;scale&#39; scalar function and scales the &#39;x&#39; and &#39;...
Definition: Scale2.H:58
virtual void write(Ostream &os) const
Write data to dictionary stream.
Definition: Scale2.C:88
void operator=(const Scale< Type > &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.