Loading...
Searching...
No Matches
fixedValueFvsPatchField.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) 2024 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::fixedValueFvsPatchField
29
30Description
31 This boundary condition supplies a fixed value constraint, and is the base
32 class for a number of other boundary conditions.
33
34 The "value" entry is MUST_READ.
35
36Usage
37 \table
38 Property | Description | Required | Default
39 value | Patch face values | yes |
40 \endtable
41
42 Example of the boundary condition specification:
43 \verbatim
44 <patchName>
45 {
46 type fixedValue;
47 value uniform 0; // Example for scalar field usage
48 }
49 \endverbatim
50
51SourceFiles
52 fixedValueFvsPatchField.C
53
54\*---------------------------------------------------------------------------*/
55
56#ifndef Foam_fixedValueFvsPatchField_H
57#define Foam_fixedValueFvsPatchField_H
58
59#include "fvsPatchField.H"
60
61// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62
63namespace Foam
64{
65
66/*---------------------------------------------------------------------------*\
67 Class fixedValueFvsPatchField Declaration
68\*---------------------------------------------------------------------------*/
69
70template<class Type>
72:
73 public fvsPatchField<Type>
74{
75public:
77 //- Runtime type information
78 TypeName("fixedValue");
79
80
81 // Constructors
82
83 //- Construct from patch and internal field
85 (
86 const fvPatch&,
88 );
89
90 //- Construct from patch, internal field and value
92 (
93 const fvPatch&,
95 const Type& value
96 );
97
98 //- Construct from patch, internal field and dictionary
100 (
101 const fvPatch&,
103 const dictionary&,
105 );
106
107 //- Construct by mapping the given fixedValue patch field
108 //- onto a new patch
110 (
112 const fvPatch&,
114 const fvPatchFieldMapper&
115 );
116
117 //- Copy construct onto a new patch with internal field reference
118 //- and specified value
120 (
122 const fvPatch& p,
124 const Type& value
125 );
126
127 //- Copy construct with internal field reference
129 (
132 );
133
134 //- Copy construct
136 :
137 fixedValueFvsPatchField<Type>(pfld, pfld.internalField())
138 {}
139
140
141 //- Return clone
142 virtual tmp<fvsPatchField<Type>> clone() const
143 {
144 return fvsPatchField<Type>::Clone(*this);
145 }
146
147 //- Clone with an internal field reference
148 virtual tmp<fvsPatchField<Type>> clone
149 (
150 const DimensionedField<Type, surfaceMesh>& iF
151 ) const
152 {
153 return fvsPatchField<Type>::Clone(*this, iF);
154 }
155
157 // Member Functions
158
159 //- True: this patch field fixes a value.
160 virtual bool fixesValue() const { return true; }
161
162 //- False: this patch field is not altered by assignment.
163 virtual bool assignable() const { return false; }
164
165 //- Write includes "value" entry
166 virtual void write(Ostream&) const;
167
168
169 // Evaluation Functions
170
171 //- Return the matrix diagonal coefficients corresponding to the
172 // evaluation of the value of this patchField with given weights
174 (
175 const tmp<scalarField>&
176 ) const;
177
178 //- Return the matrix source coefficients corresponding to the
179 // evaluation of the value of this patchField with given weights
181 (
182 const tmp<scalarField>&
183 ) const;
184
185 //- Return the matrix diagonal coefficients corresponding to the
186 // evaluation of the gradient of this patchField
188
189 //- Return the matrix source coefficients corresponding to the
190 // evaluation of the gradient of this patchField
193
194 // Member Operators
195
196 virtual void operator=(const UList<Type>&) {}
197
198 virtual void operator=(const fvsPatchField<Type>&) {}
199 virtual void operator+=(const fvsPatchField<Type>&) {}
200 virtual void operator-=(const fvsPatchField<Type>&) {}
201 virtual void operator*=(const fvsPatchField<scalar>&) {}
202 virtual void operator/=(const fvsPatchField<scalar>&) {}
203
204 virtual void operator+=(const Field<Type>&) {}
205 virtual void operator-=(const Field<Type>&) {}
206
207 virtual void operator*=(const Field<scalar>&) {}
208 virtual void operator/=(const Field<scalar>&) {}
209
210 virtual void operator=(const Type&) {}
211 virtual void operator+=(const Type&) {}
212 virtual void operator-=(const Type&) {}
213 virtual void operator*=(const scalar) {}
214 virtual void operator/=(const scalar) {}
215};
216
217
218// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219
220} // End namespace Foam
221
222// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223
224#ifdef NoRepository
226#endif
227
228// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229
230#endif
231
232// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
constexpr Field() noexcept
Default construct.
Definition FieldI.H:24
readOption
Enumeration defining read preferences.
@ MUST_READ
Reading required.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
virtual void operator=(const fvsPatchField< Type > &)
virtual void operator/=(const Field< scalar > &)
virtual bool fixesValue() const
True: this patch field fixes a value.
fixedValueFvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Construct from patch and internal field.
virtual void operator-=(const fvsPatchField< Type > &)
virtual void operator*=(const fvsPatchField< scalar > &)
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< fvsPatchField< Type > > clone(const DimensionedField< Type, surfaceMesh > &iF) const
Clone with an internal field reference.
virtual void operator+=(const Field< Type > &)
virtual void operator=(const Type &)
virtual void operator*=(const Field< scalar > &)
TypeName("fixedValue")
Runtime type information.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< fvsPatchField< Type > > clone() const
Return clone.
virtual void operator/=(const scalar)
virtual void operator=(const UList< Type > &)
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual void operator+=(const fvsPatchField< Type > &)
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual void operator-=(const Type &)
fixedValueFvsPatchField(const fixedValueFvsPatchField< Type > &pfld)
Copy construct.
virtual bool assignable() const
False: this patch field is not altered by assignment.
virtual void operator/=(const fvsPatchField< scalar > &)
virtual void operator*=(const scalar)
virtual void operator-=(const Field< Type > &)
virtual void operator+=(const Type &)
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
fvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Construct from patch and internal field.
const DimensionedField< Type, surfaceMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
static tmp< fvsPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
A class for managing temporary objects.
Definition tmp.H:75
volScalarField & p
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68