Loading...
Searching...
No Matches
zeroValueFvPatchField.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) 2023-2025 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::zeroValueFvPatchField
28
29Group
30 grpGenericBoundaryConditions
31
32Description
33 Specifies a zero fixed value boundary condition.
34
35Usage
36 Example of the boundary condition specification:
37 \verbatim
38 <patchName>
39 {
40 type zeroValue;
41 }
42 \endverbatim
43
44SourceFiles
45 zeroValueFvPatchField.C
46
47\*---------------------------------------------------------------------------*/
48
49#ifndef Foam_zeroValueFvPatchField_H
50#define Foam_zeroValueFvPatchField_H
51
53
54// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55
56namespace Foam
57{
58
59/*---------------------------------------------------------------------------*\
60 Class zeroValueFvPatchField Declaration
61\*---------------------------------------------------------------------------*/
62
63template<class Type>
65:
66 public fixedValueFvPatchField<Type>
67{
68 //- The parent boundary condition type
69 typedef fixedValueFvPatchField<Type> parent_bctype;
70
71public:
72
73 //- Runtime type information
74 TypeName("zeroValue");
75
76
77 // Constructors
78
79 //- Construct from patch and internal field
81 (
82 const fvPatch& p,
84 );
85
86 //- Construct from patch, internal field and dictionary
88 (
89 const fvPatch& p,
91 const dictionary& dict
92 );
93
94 //- Copy construct onto a new patch (no mapping needed)
96 (
98 const fvPatch& p,
100 const fvPatchFieldMapper&
101 );
102
103 //- Copy construct with internal field reference
105 (
106 const zeroValueFvPatchField<Type>& pfld,
108 );
109
110 //- Copy construct
112 :
113 zeroValueFvPatchField<Type>(pfld, pfld.internalField())
114 {}
115
116
117 //- Construct and return a clone
118 virtual tmp<fvPatchField<Type>> clone() const
119 {
121 (
123 );
124 }
125
126 //- Construct and return a clone setting internal field reference
128 (
130 ) const
131 {
133 (
134 new zeroValueFvPatchField<Type>(*this, iF)
135 );
136 }
137
138
139 // Member Functions
141 //- True: this patch field fixes a value.
142 virtual bool fixesValue() const { return true; }
143
144 //- False: this patch field is not altered by assignment.
145 virtual bool assignable() const { return false; }
146
147 //- Write (without "value" entry)
148 virtual void write(Ostream& os) const;
149
150
151 // Evaluation Functions
152
153 //- Return the matrix diagonal coefficients corresponding to the
154 //- evaluation of the value of this patchField with given weights
155 virtual tmp<Field<Type>> valueInternalCoeffs
156 (
158 ) const;
159
160 //- Return the matrix source coefficients corresponding to the
161 //- evaluation of the value of this patchField with given weights
163 (
164 const tmp<scalarField>&
165 ) const;
166
167 //- Return the matrix diagonal coefficients corresponding to the
168 //- evaluation of the gradient of this patchField
170
171 //- Return the matrix source coefficients corresponding to the
172 //- evaluation of the gradient of this patchField
174
175
176 // Member Operators
177
178 // Disable assignment operators
179 virtual void operator=(const UList<Type>&) {}
180
181 virtual void operator=(const fvPatchField<Type>&) {}
182 virtual void operator+=(const fvPatchField<Type>&) {}
183 virtual void operator-=(const fvPatchField<Type>&) {}
184 virtual void operator*=(const fvPatchField<scalar>&) {}
185 virtual void operator/=(const fvPatchField<scalar>&) {}
186
187 virtual void operator+=(const Field<Type>&) {}
188 virtual void operator-=(const Field<Type>&) {}
189
190 virtual void operator*=(const Field<scalar>&) {}
191 virtual void operator/=(const Field<scalar>&) {}
192
193 virtual void operator=(const Type&) {}
194 virtual void operator+=(const Type&) {}
195 virtual void operator-=(const Type&) {}
196 virtual void operator*=(const scalar) {}
197 virtual void operator/=(const scalar) {}
198
199
200 // Disable forced assignment operators
201 virtual void operator==(const fvPatchField<Type>&) {}
202 virtual void operator==(const Field<Type>&) {}
203 virtual void operator==(const Type&) {}
204
205 // Prevent automatic comparison rewriting (c++20)
206 bool operator!=(const fvPatchField<Type>&) const = delete;
207 bool operator!=(const Field<Type>&) const = delete;
208 bool operator!=(const Type&) const = delete;
212// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213
214} // End namespace Foam
216// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218#ifdef NoRepository
219 #include "zeroValueFvPatchField.C"
220#endif
222// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224#endif
225
226// ************************************************************************* //
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
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
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
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< Type, volMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
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
virtual void operator/=(const Field< scalar > &)
virtual bool fixesValue() const
True: this patch field fixes a value.
TypeName("zeroValue")
Runtime type information.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the evaluation of the gradient of this patch...
virtual void operator==(const Type &)
virtual void operator+=(const Field< Type > &)
virtual void operator=(const Type &)
virtual void operator*=(const Field< scalar > &)
virtual void operator+=(const fvPatchField< Type > &)
virtual void operator/=(const fvPatchField< scalar > &)
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the evaluation of the value of this patchFie...
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 evaluation of the gradient of this patchFi...
virtual void operator==(const Field< Type > &)
virtual void operator==(const fvPatchField< Type > &)
zeroValueFvPatchField(const zeroValueFvPatchField< Type > &pfld)
Copy construct.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the evaluation of the value of this patchField...
virtual void operator-=(const Type &)
bool operator!=(const fvPatchField< Type > &) const =delete
bool operator!=(const Field< Type > &) const =delete
bool operator!=(const Type &) const =delete
zeroValueFvPatchField(const fvPatch &p, const DimensionedField< Type, volMesh > &iF)
Construct from patch and internal field.
virtual tmp< fvPatchField< Type > > clone() const
Construct and 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
Construct and return a clone setting internal field reference.
volScalarField & p
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68