Loading...
Searching...
No Matches
fixedValueFvPatchField.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) 2023-2025 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::fixedValueFvPatchField
29
30Group
31 grpGenericBoundaryConditions
32
33Description
34 This boundary condition supplies a fixed value constraint, and is the base
35 class for a number of other boundary conditions.
36
37Usage
38 \table
39 Property | Description | Required | Default value
40 value | Patch face values | yes |
41 \endtable
42
43 Example of the boundary condition specification:
44 \verbatim
45 <patchName>
46 {
47 type fixedValue;
48 value uniform 0; // Example for scalar field usage
49 }
50 \endverbatim
51
52SourceFiles
53 fixedValueFvPatchField.C
54
55\*---------------------------------------------------------------------------*/
56
57#ifndef Foam_fixedValueFvPatchField_H
58#define Foam_fixedValueFvPatchField_H
59
60#include "fvPatchField.H"
61
62// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63
64namespace Foam
65{
66
67/*---------------------------------------------------------------------------*\
68 Class fixedValueFvPatchField Declaration
69\*---------------------------------------------------------------------------*/
70
71template<class Type>
73:
74 public fvPatchField<Type>
75{
76public:
78 //- Runtime type information
79 TypeName("fixedValue");
80
81
82 // Constructors
83
84 //- Construct from patch and internal field
86 (
87 const fvPatch&,
89 );
90
91 //- Construct from patch, internal field and value
93 (
94 const fvPatch&,
96 const Type& value
97 );
98
99 //- Construct from patch, internal field and dictionary
101 (
102 const fvPatch&,
104 const dictionary&,
106 );
107
108 //- Compatibility (prefer with readOption)
110 (
111 const fvPatch& p,
114 const bool needValue
115 )
116 :
118 (
119 p, iF, dict,
120 (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ)
121 )
122 {}
123
124 //- Construct by mapping the given fixedValue patch field
125 //- onto a new patch
127 (
129 const fvPatch&,
131 const fvPatchFieldMapper&
132 );
133
134 //- Construct onto a new patch with internal field reference
135 //- and specified value
137 (
139 const fvPatch& p,
141 const Type& value
142 );
144 //- Copy construct with internal field reference
146 (
149 );
150
151 //- Copy construct
153 :
154 fixedValueFvPatchField<Type>(pfld, pfld.internalField())
155 {}
156
157
158 //- Return a clone
159 virtual tmp<fvPatchField<Type>> clone() const
160 {
161 return fvPatchField<Type>::Clone(*this);
162 }
163
164 //- Clone with an internal field reference
165 virtual tmp<fvPatchField<Type>> clone
168 ) const
169 {
170 return fvPatchField<Type>::Clone(*this, iF);
171 }
172
173
174 // Member Functions
176 //- True: this patch field fixes a value.
177 virtual bool fixesValue() const { return true; }
178
179 //- False: this patch field is not altered by assignment.
180 virtual bool assignable() const { return false; }
181
182 //- Write includes "value" entry
183 virtual void write(Ostream&) const;
185
186 // Evaluation functions
187
188 //- Return the matrix diagonal coefficients corresponding to the
189 // evaluation of the value of this patchField with given weights
191 (
193 ) const;
194
195 //- Return the matrix source coefficients corresponding to the
196 // evaluation of the value of this patchField with given weights
198 (
199 const tmp<scalarField>&
200 ) const;
201
202 //- Return the matrix diagonal coefficients corresponding to the
203 // evaluation of the gradient of this patchField
205
206 //- Return the matrix source coefficients corresponding to the
207 // evaluation of the gradient of this patchField
209
210
211 // Member Operators
212
213 // Disable assignment operators
214 virtual void operator=(const UList<Type>&) {}
215
216 virtual void operator=(const fvPatchField<Type>&) {}
217 virtual void operator+=(const fvPatchField<Type>&) {}
218 virtual void operator-=(const fvPatchField<Type>&) {}
219 virtual void operator*=(const fvPatchField<scalar>&) {}
220 virtual void operator/=(const fvPatchField<scalar>&) {}
221
222 virtual void operator+=(const Field<Type>&) {}
223 virtual void operator-=(const Field<Type>&) {}
224
225 virtual void operator*=(const Field<scalar>&) {}
226 virtual void operator/=(const Field<scalar>&) {}
227
228 virtual void operator=(const Type&) {}
229 virtual void operator+=(const Type&) {}
230 virtual void operator-=(const Type&) {}
231 virtual void operator*=(const scalar) {}
232 virtual void operator/=(const scalar) {}
233};
234
235
236// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237
238} // End namespace Foam
239
240// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241
242#ifdef NoRepository
243 #include "fixedValueFvPatchField.C"
244#endif
245
246// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
247
248#endif
249
250// ************************************************************************* //
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
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
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 Field< scalar > &)
virtual bool fixesValue() const
True: this patch field fixes a value.
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void write(Ostream &) const
Write includes "value" entry.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual void operator+=(const Field< Type > &)
virtual void operator=(const Type &)
virtual void operator*=(const Field< scalar > &)
virtual void operator+=(const fvPatchField< Type > &)
TypeName("fixedValue")
Runtime type information.
fixedValueFvPatchField(const fixedValueFvPatchField< Type > &, const fvPatch &, const DimensionedField< Type, volMesh > &, const fvPatchFieldMapper &)
Construct by mapping the given fixedValue patch field onto a new patch.
virtual void operator/=(const fvPatchField< scalar > &)
fixedValueFvPatchField(const fixedValueFvPatchField< Type > &pfld)
Copy construct.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &, IOobjectOption::readOption requireValue=IOobjectOption::MUST_READ)
Construct from patch, internal field and dictionary.
virtual void operator=(const fvPatchField< Type > &)
virtual void operator*=(const fvPatchField< scalar > &)
virtual void operator/=(const scalar)
virtual void operator-=(const fvPatchField< Type > &)
virtual void operator=(const UList< Type > &)
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const Type &value)
Construct from patch, internal field and value.
virtual void operator-=(const Type &)
fixedValueFvPatchField(const fvPatch &p, const DimensionedField< Type, volMesh > &iF, const dictionary &dict, const bool needValue)
Compatibility (prefer with readOption).
fixedValueFvPatchField(const fixedValueFvPatchField< Type > &pfld, const fvPatch &p, const DimensionedField< Type, volMesh > &iF, const Type &value)
Construct onto a new patch with internal field reference and specified value.
fixedValueFvPatchField(const fixedValueFvPatchField< Type > &pfld, const DimensionedField< Type, volMesh > &iF)
Copy construct with internal field reference.
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
virtual bool assignable() const
False: this patch field is not altered by assignment.
virtual void operator*=(const scalar)
virtual void operator-=(const Field< Type > &)
virtual void operator+=(const Type &)
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Clone with an internal field reference.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
const DimensionedField< scalar, volMesh > & internalField() const noexcept
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
A class for managing temporary objects.
Definition tmp.H:75
volScalarField & p
Namespace for OpenFOAM.
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68