Loading...
Searching...
No Matches
zeroValueFvsPatchField.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::zeroValueFvsPatchField
28
29Description
30 Specifies a zero fixed value boundary condition.
31
32Usage
33 Example of the boundary condition specification:
34 \verbatim
35 <patchName>
36 {
37 type zeroValue;
38 }
39 \endverbatim
40
41SourceFiles
42 zeroValueFvsPatchField.C
43
44\*---------------------------------------------------------------------------*/
45
46#ifndef Foam_zeroValueFvsPatchField_H
47#define Foam_zeroValueFvsPatchField_H
48
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56/*---------------------------------------------------------------------------*\
57 Class zeroValueFvsPatchField Declaration
58\*---------------------------------------------------------------------------*/
59
60template<class Type>
62:
63 public fixedValueFvsPatchField<Type>
64{
65 //- The parent boundary condition type
66 typedef fixedValueFvsPatchField<Type> parent_bctype;
67
68public:
69
70 //- Runtime type information
71 TypeName("zeroValue");
72
73
74 // Constructors
75
76 //- Construct from patch and internal field
78 (
79 const fvPatch& p,
81 );
82
83 //- Construct from patch, internal field and dictionary
85 (
86 const fvPatch& p,
88 const dictionary& dict
89 );
90
91 //- Copy construct onto a new patch (no mapping needed)
93 (
95 const fvPatch& p,
98 );
99
100 //- Copy construct with internal field reference
102 (
105 );
106
107 //- Copy construct
109 :
110 zeroValueFvsPatchField<Type>(pfld, pfld.internalField())
111 {}
112
113
114 //- Return clone
115 virtual tmp<fvsPatchField<Type>> clone() const
116 {
118 }
119
120 //- Clone with an internal field reference
122 (
124 ) const
125 {
126 return fvsPatchField<Type>::Clone(*this, iF);
127 }
128
129
130 // Member Functions
131
132 //- True: this patch field fixes a value.
133 virtual bool fixesValue() const { return true; }
135 //- False: this patch field is not altered by assignment.
136 virtual bool assignable() const { return false; }
137
138 //- Write (without "value" entry)
139 virtual void write(Ostream& os) const;
140
141
142 // Evaluation Functions
143
144 //- Return the matrix diagonal coefficients corresponding to the
145 //- evaluation of the value of this patchField with given weights
147 (
149 ) const;
150
151 //- Return the matrix source coefficients corresponding to the
152 //- evaluation of the value of this patchField with given weights
154 (
155 const tmp<scalarField>&
156 ) const;
157
158 //- Return the matrix diagonal coefficients corresponding to the
159 //- evaluation of the gradient of this patchField
161
162 //- Return the matrix source coefficients corresponding to the
163 //- evaluation of the gradient of this patchField
165
166
167 // Member Operators
168
169 // Disable assignment operators
170 virtual void operator=(const UList<Type>&) {}
171
172 virtual void operator=(const fvsPatchField<Type>&) {}
173 virtual void operator+=(const fvsPatchField<Type>&) {}
174 virtual void operator-=(const fvsPatchField<Type>&) {}
175 virtual void operator*=(const fvsPatchField<scalar>&) {}
176 virtual void operator/=(const fvsPatchField<scalar>&) {}
177
178 virtual void operator+=(const Field<Type>&) {}
179 virtual void operator-=(const Field<Type>&) {}
180
181 virtual void operator*=(const Field<scalar>&) {}
182 virtual void operator/=(const Field<scalar>&) {}
183
184 virtual void operator=(const Type&) {}
185 virtual void operator+=(const Type&) {}
186 virtual void operator-=(const Type&) {}
187 virtual void operator*=(const scalar) {}
188 virtual void operator/=(const scalar) {}
189
190
191 // Disable forced assignment operators
192 virtual void operator==(const fvsPatchField<Type>&) {}
193 virtual void operator==(const Field<Type>&) {}
194 virtual void operator==(const Type&) {}
195
196 // Prevent automatic comparison rewriting (c++20)
197 bool operator!=(const fvPatchField<Type>&) const = delete;
198 bool operator!=(const Field<Type>&) const = delete;
199 bool operator!=(const Type&) const = delete;
203// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204
205} // End namespace Foam
207// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209#ifdef NoRepository
210 #include "zeroValueFvsPatchField.C"
211#endif
213// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215#endif
216
217// ************************************************************************* //
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
fixedValueFvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
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...
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
virtual void operator=(const fvsPatchField< Type > &)
virtual void operator/=(const Field< scalar > &)
virtual bool fixesValue() const
True: this patch field fixes a value.
virtual void operator-=(const fvsPatchField< Type > &)
TypeName("zeroValue")
Runtime type information.
virtual void operator*=(const fvsPatchField< scalar > &)
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the evaluation of the gradient of this patch...
virtual tmp< fvsPatchField< Type > > clone(const DimensionedField< Type, surfaceMesh > &iF) const
Clone with an internal field reference.
virtual void operator==(const Type &)
virtual void operator+=(const Field< Type > &)
virtual void operator=(const Type &)
virtual void operator*=(const Field< 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 fvsPatchField< Type > &)
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 evaluation of the gradient of this patchFi...
virtual void operator==(const Field< Type > &)
virtual void operator+=(const fvsPatchField< Type > &)
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the evaluation of the value of this patchField...
zeroValueFvsPatchField(const zeroValueFvsPatchField< Type > &pfld)
Copy construct.
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
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 &)
zeroValueFvsPatchField(const fvPatch &p, const DimensionedField< Type, surfaceMesh > &iF)
Construct from patch and internal field.
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