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 boundary condition.
32 
33  Example of the boundary condition specification:
34  \verbatim
35  inlet
36  {
37  type uniformFixedValue;
38  uniformValue constant 0.2;
39  }
40  \endverbatim
41 
42  The uniformValue entry is a Function1 type, able to describe time
43  varying functions. The example above gives the usage for supplying a
44  constant value.
45 
46 SourceFiles
47  uniformFixedValuePointPatchField.C
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef uniformFixedValuePointPatchField_H
52 #define uniformFixedValuePointPatchField_H
53 
55 #include "PatchFunction1.H"
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 
62 class polyPatch;
63 
64 /*---------------------------------------------------------------------------*\
65  Class uniformFixedValuePointPatchField Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 template<class Type>
70 :
71  public fixedValuePointPatchField<Type>
72 {
73  // Private Member Functions
74 
75  static const polyPatch& getPatch(const pointPatch&);
76 
77 
78  // Private data
79 
80  autoPtr<PatchFunction1<Type>> uniformValue_;
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("uniformFixedValue");
87 
88 
89  // Constructors
90 
91  //- Construct from patch and internal field
93  (
94  const pointPatch&,
96  );
97 
98  //- Construct from patch, internal field and dictionary
100  (
101  const pointPatch&,
103  const dictionary&
104  );
105 
106  //- Construct by mapping given patchField<Type> onto a new patch
108  (
110  const pointPatch&,
112  const pointPatchFieldMapper&
113  );
114 
115  //- Construct as copy
117  (
119  );
120 
121  //- Construct and return a clone
122  virtual autoPtr<pointPatchField<Type>> clone() const
123  {
125  (
127  (
128  *this
129  )
130  );
131  }
132 
133  //- Construct as copy setting internal field reference
135  (
138  );
139 
140 
141  //- Construct and return a clone setting internal field reference
143  (
145  ) const
146  {
148  (
150  (
151  *this,
152  iF
153  )
154  );
155  }
156 
157 
158  // Member functions
159 
160  // Access
161 
162  //- Return the uniform value
163  const Function1<Type>& uniformValue() const
164  {
165  return uniformValue_;
166  }
167 
168 
169  // Mapping functions
170 
171  //- Map (and resize as needed) from self given a mapping object
172  virtual void autoMap
173  (
174  const pointPatchFieldMapper&
175  );
176 
177  //- Reverse map the given fvPatchField onto this fvPatchField
178  virtual void rmap
179  (
180  const pointPatchField<Type>&,
181  const labelList&
182  );
183 
184 
185  // Evaluation functions
186 
187  //- Update the coefficients associated with the patch field
188  virtual void updateCoeffs();
189 
190 
191  //- Write
192  virtual void write(Ostream&) const;
193 };
194 
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 } // End namespace Foam
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #ifdef NoRepository
204 #endif
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
Foam::uniformFixedValuePointPatchField::uniformValue
const Function1< Type > & uniformValue() const
Return the uniform value.
Definition: uniformFixedValuePointPatchField.H:162
PatchFunction1.H
uniformFixedValuePointPatchField.C
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:58
Foam::pointPatchField
Abstract base class for point-mesh patch fields.
Definition: pointMVCWeight.H:60
Foam::Function1
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Definition: propellerInfo.H:291
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:48
Foam::fixedValuePointPatchField
A FixedValue boundary condition for pointField.
Definition: fixedValuePointPatchField.H:51
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::uniformFixedValuePointPatchField::uniformFixedValuePointPatchField
uniformFixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Definition: uniformFixedValuePointPatchField.C:57
Foam::uniformFixedValuePointPatchField::rmap
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: uniformFixedValuePointPatchField.C:174
fixedValuePointPatchField.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::uniformFixedValuePointPatchField
Enables the specification of a uniform fixed value boundary condition.
Definition: uniformFixedValuePointPatchField.H:68
Foam::uniformFixedValuePointPatchField::write
virtual void write(Ostream &) const
Write.
Definition: uniformFixedValuePointPatchField.C:203
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::uniformFixedValuePointPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: uniformFixedValuePointPatchField.C:189
Foam::List< label >
Foam::uniformFixedValuePointPatchField::TypeName
TypeName("uniformFixedValue")
Runtime type information.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::uniformFixedValuePointPatchField::clone
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
Definition: uniformFixedValuePointPatchField.H:121
Foam::uniformFixedValuePointPatchField::autoMap
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: uniformFixedValuePointPatchField.C:157
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54