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 as copy setting internal field reference
135  (
138  );
139 
140 
141  //- Return a clone
142  virtual autoPtr<pointPatchField<Type>> clone() const
143  {
144  return pointPatchField<Type>::Clone(*this);
145  }
146 
147  //- Construct and return a clone setting internal field reference
149  (
151  ) const
152  {
153  return pointPatchField<Type>::Clone(*this, iF);
154  }
155 
156 
157  // Member Functions
158 
159  // Mapping functions
160 
161  //- Map (and resize as needed) from self given a mapping object
162  virtual void autoMap
163  (
164  const pointPatchFieldMapper&
165  );
166 
167  //- Reverse map the given fvPatchField onto this fvPatchField
168  virtual void rmap
169  (
170  const pointPatchField<Type>&,
171  const labelList&
172  );
173 
174 
175  // Evaluation functions
176 
177  //- Update the coefficients associated with the patch field
178  virtual void updateCoeffs();
179 
180 
181  //- Write
182  virtual void write(Ostream&) const;
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #ifdef NoRepository
194 #endif
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
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:61
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.