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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::zeroValueFvsPatchField
28 
29 Description
30  Specifies a zero fixed value boundary condition.
31 
32 Usage
33  Example of the boundary condition specification:
34  \verbatim
35  <patchName>
36  {
37  type zeroValue;
38  }
39  \endverbatim
40 
41 SourceFiles
42  zeroValueFvsPatchField.txx
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef Foam_zeroValueFvsPatchField_H
47 #define Foam_zeroValueFvsPatchField_H
48 
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class zeroValueFvsPatchField Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class Type>
62 :
63  public fixedValueFvsPatchField<Type>
64 {
67 
68 public:
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  (
94  const this_bctype& pfld,
95  const fvPatch& p,
97  const fvPatchFieldMapper&
98  );
99 
100  //- Copy construct with internal field reference
102  (
103  const this_bctype& pfld,
105  );
106 
107  //- No copy without an internal field
108  zeroValueFvsPatchField(const this_bctype&) = delete;
109 
110  //- Clone with an internal field reference
112  (
114  ) const
115  {
116  return fvsPatchField<Type>::Clone(*this, iF);
117  }
118 
119 
120  // Member Functions
122  //- True: this patch field fixes a value.
123  virtual bool fixesValue() const { return true; }
124 
125  //- False: this patch field is not altered by assignment.
126  virtual bool assignable() const { return false; }
127 
128  //- Write (without "value" entry)
129  virtual void write(Ostream& os) const;
130 
131 
132  // Evaluation Functions
133 
134  //- Return the matrix diagonal coefficients corresponding to the
135  //- evaluation of the value of this patchField with given weights
137  (
138  const tmp<scalarField>&
139  ) const;
140 
141  //- Return the matrix source coefficients corresponding to the
142  //- evaluation of the value of this patchField with given weights
144  (
145  const tmp<scalarField>&
146  ) const;
147 
148  //- Return the matrix diagonal coefficients corresponding to the
149  //- evaluation of the gradient of this patchField
150  virtual tmp<Field<Type>> gradientInternalCoeffs() const;
151 
152  //- Return the matrix source coefficients corresponding to the
153  //- evaluation of the gradient of this patchField
154  virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
155 
156 
157  // Member Operators
158 
159  // Disable assignment operators
160  virtual void operator=(const UList<Type>&) {}
161 
162  virtual void operator=(const fvsPatchField<Type>&) {}
163  virtual void operator+=(const fvsPatchField<Type>&) {}
164  virtual void operator-=(const fvsPatchField<Type>&) {}
165  virtual void operator*=(const fvsPatchField<scalar>&) {}
166  virtual void operator/=(const fvsPatchField<scalar>&) {}
167 
168  virtual void operator+=(const Field<Type>&) {}
169  virtual void operator-=(const Field<Type>&) {}
170 
171  virtual void operator*=(const Field<scalar>&) {}
172  virtual void operator/=(const Field<scalar>&) {}
173 
174  virtual void operator=(const Type&) {}
175  virtual void operator+=(const Type&) {}
176  virtual void operator-=(const Type&) {}
177  virtual void operator*=(const scalar) {}
178  virtual void operator/=(const scalar) {}
179 
180 
181  // Disable forced assignment operators
182  virtual void operator==(const fvsPatchField<Type>&) {}
183  virtual void operator==(const Field<Type>&) {}
184  virtual void operator==(const Type&) {}
186  // Prevent automatic comparison rewriting (c++20)
187  bool operator!=(const fvPatchField<Type>&) const = delete;
188  bool operator!=(const Field<Type>&) const = delete;
189  bool operator!=(const Type&) const = delete;
190 };
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 #ifdef NoRepository
200  #include "zeroValueFvsPatchField.txx"
201 #endif
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
207 // ************************************************************************* //
dictionary dict
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 bool fixesValue() const
True: this patch field fixes a value.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
static tmp< fvsPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
virtual void operator/=(const fvsPatchField< scalar > &)
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the evaluation of the value of this patchField...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
Specifies a zero fixed value boundary condition.
zeroValueFvsPatchField(const fvPatch &p, const DimensionedField< Type, surfaceMesh > &iF)
Construct from patch and internal field.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void operator==(const fvsPatchField< Type > &)
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition: Field.H:69
A FieldMapper for finite-volume patch fields.
virtual void operator+=(const fvsPatchField< Type > &)
bool operator!=(const fvPatchField< Type > &) const =delete
TypeName("zeroValue")
Runtime type information.
virtual bool assignable() const
False: this patch field is not altered by assignment.
virtual void operator=(const UList< Type > &)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the evaluation of the gradient of this patchFi...
virtual void write(Ostream &os) const
Write (without "value" entry)
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual void operator-=(const fvsPatchField< Type > &)
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
virtual tmp< fvsPatchField< Type > > clone() const
No clone without an internal field reference.
Namespace for OpenFOAM.
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 fvsPatchField< scalar > &)