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  //- Function providing the value (if not on polyPatch)
90  autoPtr<Function1<Type>> refPointValueFunc_;
91 
92 
93  // Private Member Functions
94 
95  static const polyPatch* getPatch(const pointPatch&);
96 
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("uniformFixedValue");
102 
103 
104  // Constructors
105 
106  //- Construct from patch and internal field
108  (
109  const pointPatch&,
111  );
112 
113  //- Construct from patch, internal field and dictionary
115  (
116  const pointPatch&,
118  const dictionary&
119  );
120 
121  //- Construct by mapping given patch field onto a new patch
123  (
125  const pointPatch&,
127  const pointPatchFieldMapper&
128  );
129 
130  //- Construct as copy
132  (
134  );
135 
136  //- Construct as copy setting internal field reference
138  (
141  );
142 
143 
144  //- Return a clone
145  virtual autoPtr<pointPatchField<Type>> clone() const
146  {
147  return pointPatchField<Type>::Clone(*this);
148  }
149 
150  //- Construct and return a clone setting internal field reference
152  (
154  ) const
155  {
156  return pointPatchField<Type>::Clone(*this, iF);
157  }
158 
159 
160  // Member Functions
161 
162  // Mapping functions
163 
164  //- Map (and resize as needed) from self given a mapping object
165  virtual void autoMap
166  (
167  const pointPatchFieldMapper&
168  );
169 
170  //- Reverse map the given fvPatchField onto this fvPatchField
171  virtual void rmap
172  (
174  const labelList&
175  );
176 
177 
178  // Evaluation functions
179 
180  //- Update the coefficients associated with the patch field
181  virtual void updateCoeffs();
183 
184  //- Write
185  virtual void write(Ostream&) const;
186 };
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 } // End namespace Foam
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #ifdef NoRepository
197 #endif
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************************************************************* //
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
Return a clone.
TypeName("uniformFixedValue")
Runtime type information.
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
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:64
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
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.