Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::uniformFixedValuePointPatchField
29
30Description
31 Enables the specification of a uniform fixed value condition.
32
33Usage
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
49Note
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
59SourceFiles
60 uniformFixedValuePointPatchField.C
61
62\*---------------------------------------------------------------------------*/
63
64#ifndef Foam_uniformFixedValuePointPatchField_H
65#define Foam_uniformFixedValuePointPatchField_H
66
68#include "PatchFunction1.H"
69
70// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71
72namespace Foam
73{
74
75/*---------------------------------------------------------------------------*\
76 Class uniformFixedValuePointPatchField Declaration
77\*---------------------------------------------------------------------------*/
78
79template<class Type>
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 //- Find polyPatch with the same name as the pointPatch
96 static const polyPatch* getPolyPatch(const pointPatch& p);
97
98
99public:
100
101 //- Runtime type information
102 TypeName("uniformFixedValue");
103
104
105 // Constructors
106
107 //- Construct from patch and internal field
109 (
110 const pointPatch&,
112 );
113
114 //- Construct from patch, internal field and dictionary
116 (
117 const pointPatch&,
119 const dictionary&
120 );
121
122 //- Construct by mapping given patch field onto a new patch
124 (
126 const pointPatch&,
129 );
130
131 //- Copy construct with internal field reference
133 (
136 );
137
138 //- Copy construct
140 (
142 )
143 :
145 {}
146
147
148 //- Return a clone
149 virtual autoPtr<pointPatchField<Type>> clone() const
150 {
151 return pointPatchField<Type>::Clone(*this);
152 }
153
154 //- Construct and return a clone setting internal field reference
155 virtual autoPtr<pointPatchField<Type>> clone
156 (
157 const DimensionedField<Type, pointMesh>& iF
158 ) const
159 {
160 return pointPatchField<Type>::Clone(*this, iF);
161 }
162
163
164 // Member Functions
165
166 // Mapping functions
168 //- Map (and resize as needed) from self given a mapping object
169 virtual void autoMap
170 (
172 );
173
174 //- Reverse map the given fvPatchField onto this fvPatchField
175 virtual void rmap
176 (
178 const labelList&
179 );
180
181
182 // Evaluation functions
183
184 //- Update the coefficients associated with the patch field
185 virtual void updateCoeffs();
186
188 //- Write
189 virtual void write(Ostream&) const;
190};
191
192
193// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194
195} // End namespace Foam
196
197// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198
199#ifdef NoRepository
201#endif
202
203// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204
205#endif
206
207// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FixedValue boundary condition for pointField.
fixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Foam::pointPatchFieldMapper.
Abstract base class for point-mesh patch fields.
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
const DimensionedField< Type, pointMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
Basic pointPatch represents a set of points from the mesh.
Definition pointPatch.H:67
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
Enables the specification of a uniform fixed value condition.
uniformFixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
uniformFixedValuePointPatchField(const uniformFixedValuePointPatchField< Type > &pfld)
Copy construct.
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
TypeName("uniformFixedValue")
Runtime type information.
virtual autoPtr< pointPatchField< Type > > clone(const DimensionedField< Type, pointMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual autoPtr< pointPatchField< Type > > clone() const
Return a clone.
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
volScalarField & p
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68