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.txx
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  typedef uniformFixedValuePointPatchField<Type> this_bctype;
85  typedef fixedValuePointPatchField<Type> parent_bctype;
86 
87  // Private Data
88 
89  //- Function providing the value
91 
92  //- Function providing the value (if not on polyPatch)
93  autoPtr<Function1<Type>> refPointValueFunc_;
94 
95 
96  // Private Member Functions
97 
98  //- Find polyPatch with the same name as the pointPatch
99  static const polyPatch* getPolyPatch(const pointPatch& p);
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("uniformFixedValue");
106 
107 
108  // Constructors
109 
110  //- Construct from patch and internal field
112  (
113  const pointPatch&,
115  );
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const pointPatch&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping onto a new patch
127  (
128  const this_bctype&,
129  const pointPatch&,
131  const pointPatchFieldMapper&
132  );
133 
134  //- Copy construct with internal field reference
136  (
137  const this_bctype&,
139  );
140 
141  //- No copy without an internal field
142  [[deprecated("2026-03: soon = delete")]]
144  #ifdef Foam_pointPatchField_copyConstruct
145  : this_bctype(pfld, pfld.internalField()) {}
146  #else
147  = delete;
148  #endif
149 
150  //- Clone with an 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  (
173  const pointPatchField<Type>&,
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  // Member Operators
189 
190  //- Inherit assignment
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #ifdef NoRepository
202  #include "uniformFixedValuePointPatchField.txx"
203 #endif
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #endif
208 
209 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
Foam::pointPatchFieldMapper.
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
friend Ostream & operator(Ostream &, const Field< Type > &)
TypeName("uniformFixedValue")
Runtime type information.
tmp< Field< Type > > clone() const
Clone.
Definition: FieldI.H:140
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual void write(Ostream &) const
Write.
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 updateCoeffs()
Update the coefficients associated with the patch field.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
List< label > labelList
A List of labels.
Definition: List.H:61
volScalarField & p
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.
const DimensionedField< Type, pointMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
uniformFixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.