Loading...
Searching...
No Matches
zeroValueFaPatchField.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::zeroValueFaPatchField
28
29Description
30 Specifies a zero fixed value boundary condition.
31
32 Example of the boundary condition specification:
33 \verbatim
34 inlet
35 {
36 type zeroValue;
37 }
38 \endverbatim
39
40SourceFiles
41 zeroValueFaPatchField.C
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef Foam_zeroValueFaPatchField_H
46#define Foam_zeroValueFaPatchField_H
47
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55/*---------------------------------------------------------------------------*\
56 Class zeroValueFaPatchField Declaration
57\*---------------------------------------------------------------------------*/
58
59template<class Type>
61:
62 public fixedValueFaPatchField<Type>
63{
64 //- The parent boundary condition type
65 typedef fixedValueFaPatchField<Type> parent_bctype;
66
67public:
68
69 //- Runtime type information
70 TypeName("zeroValue");
71
72
73 // Constructors
74
75 //- Construct from patch and internal field
77 (
78 const faPatch& p,
80 );
81
82 //- Construct from patch, internal field and dictionary
84 (
85 const faPatch& p,
87 const dictionary& dict
88 );
89
90 //- Copy construct onto a new patch (no mapping needed)
92 (
94 const faPatch& p,
97 );
98
99 //- Copy construct with internal field reference
101 (
102 const zeroValueFaPatchField<Type>& pfld,
104 );
105
106 //- Copy construct
108 :
109 zeroValueFaPatchField<Type>(pfld, pfld.internalField())
110 {}
111
112
113 //- Construct and return a clone
114 virtual tmp<faPatchField<Type>> clone() const
115 {
117 (
119 );
120 }
121
122 //- Construct and return a clone setting internal field reference
124 (
126 ) const
127 {
129 (
130 new zeroValueFaPatchField<Type>(*this, iF)
131 );
132 }
133
134
135 // Member Functions
137 //- True: this patch field fixes a value.
138 virtual bool fixesValue() const { return true; }
139
140 //- False: this patch field is not altered by assignment.
141 virtual bool assignable() const { return false; }
142
143 //- Write (without "value" entry)
144 virtual void write(Ostream& os) const;
145
146
147 // Evaluation Functions
148
149 //- Return the matrix diagonal coefficients corresponding to the
150 //- evaluation of the value of this patchField with given weights
151 virtual tmp<Field<Type>> valueInternalCoeffs
152 (
154 ) const;
155
156 //- Return the matrix source coefficients corresponding to the
157 //- evaluation of the value of this patchField with given weights
159 (
160 const tmp<scalarField>&
161 ) const;
162
163 //- Return the matrix diagonal coefficients corresponding to the
164 //- evaluation of the gradient of this patchField
166
167 //- Return the matrix source coefficients corresponding to the
168 //- evaluation of the gradient of this patchField
170
171
172 // Member Operators
173
174 // Disable assignment operators
175 virtual void operator=(const UList<Type>&) {}
176
177 virtual void operator=(const faPatchField<Type>&) {}
178 virtual void operator+=(const faPatchField<Type>&) {}
179 virtual void operator-=(const faPatchField<Type>&) {}
180 virtual void operator*=(const faPatchField<scalar>&) {}
181 virtual void operator/=(const faPatchField<scalar>&) {}
182
183 virtual void operator+=(const Field<Type>&) {}
184 virtual void operator-=(const Field<Type>&) {}
185
186 virtual void operator*=(const Field<scalar>&) {}
187 virtual void operator/=(const Field<scalar>&) {}
188
189 virtual void operator=(const Type&) {}
190 virtual void operator+=(const Type&) {}
191 virtual void operator-=(const Type&) {}
192 virtual void operator*=(const scalar) {}
193 virtual void operator/=(const scalar) {}
194
195
196 // Disable forced assignment operators
197 virtual void operator==(const faPatchField<Type>&) {}
198 virtual void operator==(const Field<Type>&) {}
199 virtual void operator==(const Type&) {}
200
201 // Prevent automatic comparison rewriting (c++20)
202 bool operator!=(const faPatchField<Type>&) const = delete;
203 bool operator!=(const Field<Type>&) const = delete;
204 bool operator!=(const Type&) const = delete;
208// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209
210} // End namespace Foam
212// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214#ifdef NoRepository
215 #include "zeroValueFaPatchField.C"
216#endif
218// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220#endif
221
222// ************************************************************************* //
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
A FieldMapper for finite-area patch fields.
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
const DimensionedField< Type, areaMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition faPatch.H:76
fixedValueFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition tmp.H:75
zeroValueFaPatchField(const faPatch &p, const DimensionedField< Type, areaMesh > &iF)
Construct from patch and internal field.
virtual tmp< faPatchField< Type > > clone() const
Construct and return a clone.
virtual void operator/=(const Field< scalar > &)
virtual bool fixesValue() const
True: this patch field fixes a value.
virtual void operator==(const faPatchField< Type > &)
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 faPatchField< Type > &)
virtual void operator=(const Type &)
virtual void operator+=(const faPatchField< 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 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 > &)
bool operator!=(const faPatchField< Type > &) const =delete
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 Field< Type > &) const =delete
virtual tmp< faPatchField< Type > > clone(const DimensionedField< Type, areaMesh > &iF) const
Construct and return a clone setting internal field reference.
bool operator!=(const Type &) const =delete
virtual void operator=(const faPatchField< Type > &)
zeroValueFaPatchField(const zeroValueFaPatchField< Type > &pfld)
Copy construct.
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 void operator*=(const faPatchField< scalar > &)
virtual void operator/=(const faPatchField< scalar > &)
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