FreeFOAM The Cross-Platform CFD Toolkit
uniformFixedValueFvPatchField.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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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::uniformFixedValueFvPatchField
26 
27 Description
28  Foam::uniformFixedValueFvPatchField
29 
30 SourceFiles
31  uniformFixedValueFvPatchField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef uniformFixedValueFvPatchField_H
36 #define uniformFixedValueFvPatchField_H
37 
38 #include <OpenFOAM/Random.H>
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class uniformFixedValueFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class Type>
52 :
53  public fixedValueFvPatchField<Type>
54 {
55  // Private data
56 
57  Type uniformValue_;
58 
59 
60 public:
61 
62  //- Runtime type information
63  TypeName("uniformFixedValue");
64 
65 
66  // Constructors
67 
68  //- Construct from patch and internal field
70  (
71  const fvPatch&,
73  );
74 
75  //- Construct from patch, internal field and dictionary
77  (
78  const fvPatch&,
80  const dictionary&
81  );
82 
83  //- Construct by mapping given uniformFixedValueFvPatchField
84  // onto a new patch
86  (
88  const fvPatch&,
90  const fvPatchFieldMapper&
91  );
92 
93  //- Construct as copy
95  (
97  );
98 
99  //- Construct and return a clone
100  virtual tmp<fvPatchField<Type> > clone() const
101  {
102  return tmp<fvPatchField<Type> >
103  (
105  );
106  }
107 
108  //- Construct as copy setting internal field reference
110  (
113  );
114 
115  //- Construct and return a clone setting internal field reference
116  virtual tmp<fvPatchField<Type> > clone
117  (
119  ) const
120  {
121  return tmp<fvPatchField<Type> >
122  (
124  );
125  }
126 
127 
128  // Member functions
129 
130  // Access
131 
132  //- Return the fluctuation scale
133  const Type& uniformValue() const
134  {
135  return uniformValue_;
136  }
137 
138  //- Return reference to the fluctuation scale to allow adjustment
139  Type& uniformValue()
140  {
141  return uniformValue_;
142  }
143 
144 
145  // Mapping functions
146 
147  //- Map (and resize as needed) from self given a mapping object
148  virtual void autoMap
149  (
150  const fvPatchFieldMapper&
151  );
152 
153 
154  //- Write
155  virtual void write(Ostream&) const;
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #ifdef NoRepository
167 #endif
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************ vim: set sw=4 sts=4 et: ************************ //