uniformFixedValuePointPatchField.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::uniformFixedValuePointPatchField
29 
30 Description
31  Enables the specification of a uniform fixed value condition.
32 
33 Usage
34  \table
35  Property | Description | Required | Default
36  uniformValue | uniform value | yes |
37  value | initial field value | optional |
38  \endtable
39 
40  Example of the boundary condition specification:
41  \verbatim
42  inlet
43  {
44  type uniformFixedValue;
45  uniformValue constant 0.2;
46  }
47  \endverbatim
48 
49 Note
50  The uniformValue entry is a PatchFunction1 type,
51  able to describe time and spatial varying functions.
52  The example above gives the usage for supplying a constant value.
53 
54  The \c value entry (optional) is used for the initial values.
55  Otherwise the \c uniformValue is evaluated.
56  In some cases (eg, coded or expression entries with references to other
57  fields) this can be problematic and the \c value entry will be needed.
58 
59 SourceFiles
60  uniformFixedValuePointPatchField.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef Foam_uniformFixedValuePointPatchField_H
65 #define Foam_uniformFixedValuePointPatchField_H
66 
68 #include "PatchFunction1.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class uniformFixedValuePointPatchField Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 template<class Type>
80 class uniformFixedValuePointPatchField
81 :
82  public fixedValuePointPatchField<Type>
83 {
84  // Private Data
85 
86  //- Function providing the value
87  autoPtr<PatchFunction1<Type>> refValueFunc_;
88 
89 
90  // Private Member Functions
91 
92  static const polyPatch& getPatch(const pointPatch&);
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("uniformFixedValue");
99 
100 
101  // Constructors
102 
103  //- Construct from patch and internal field
105  (
106  const pointPatch&,
108  );
109 
110  //- Construct from patch, internal field and dictionary
112  (
113  const pointPatch&,
115  const dictionary&
116  );
117 
118  //- Construct by mapping given patch field onto a new patch
120  (
122  const pointPatch&,
124  const pointPatchFieldMapper&
125  );
126 
127  //- Construct as copy
129  (
131  );
132 
133  //- Construct and return a clone
134  virtual autoPtr<pointPatchField<Type>> clone() const
135  {
137  (
139  (
140  *this
141  )
142  );
143  }
144 
145  //- Construct as copy setting internal field reference
147  (
150  );
151 
152 
153  //- Construct and return a clone setting internal field reference
155  (
157  ) const
158  {
160  (
162  (
163  *this,
164  iF
165  )
166  );
167  }
168 
169 
170  // Member Functions
171 
172  // Mapping functions
173 
174  //- Map (and resize as needed) from self given a mapping object
175  virtual void autoMap
176  (
177  const pointPatchFieldMapper&
178  );
179 
180  //- Reverse map the given fvPatchField onto this fvPatchField
181  virtual void rmap
182  (
184  const labelList&
185  );
186 
187 
188  // Evaluation functions
189 
190  //- Update the coefficients associated with the patch field
191  virtual void updateCoeffs();
192 
193 
194  //- Write
195  virtual void write(Ostream&) const;
196 };
197 
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #ifdef NoRepository
207 #endif
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Foam::pointPatchFieldMapper.
Abstract base class for point-mesh patch fields.
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
TypeName("uniformFixedValue")
Runtime type information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:61
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
Enables the specification of a uniform fixed value condition.
uniformFixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.