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