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 -------------------------------------------------------------------------------
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::zeroValueFaPatchField
28 
29 Description
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 
40 SourceFiles
41  zeroValueFaPatchField.txx
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef Foam_zeroValueFaPatchField_H
46 #define Foam_zeroValueFaPatchField_H
47 
48 #include "fixedValueFaPatchField.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class zeroValueFaPatchField Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class Type>
61 :
62  public fixedValueFaPatchField<Type>
63 {
66 
67 public:
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  (
93  const zeroValueFaPatchField<Type>& pfld,
94  const faPatch& p,
96  const faPatchFieldMapper&
97  );
98 
99  //- Copy construct with internal field reference
101  (
102  const zeroValueFaPatchField<Type>& pfld,
104  );
105 
106  //- No copy without an internal field
107  zeroValueFaPatchField(const this_bctype&) = delete;
108 
109  //- Clone with an internal field reference
111  (
113  ) const
114  {
115  return faPatchField<Type>::Clone(*this, iF);
116  }
117 
118 
119  // Member Functions
121  //- True: this patch field fixes a value.
122  virtual bool fixesValue() const { return true; }
123 
124  //- False: this patch field is not altered by assignment.
125  virtual bool assignable() const { return false; }
126 
127  //- Write (without "value" entry)
128  virtual void write(Ostream& os) const;
129 
130 
131  // Evaluation Functions
132 
133  //- Return the matrix diagonal coefficients corresponding to the
134  //- evaluation of the value of this patchField with given weights
136  (
137  const tmp<scalarField>&
138  ) const;
139 
140  //- Return the matrix source coefficients corresponding to the
141  //- evaluation of the value of this patchField with given weights
143  (
144  const tmp<scalarField>&
145  ) const;
146 
147  //- Return the matrix diagonal coefficients corresponding to the
148  //- evaluation of the gradient of this patchField
149  virtual tmp<Field<Type>> gradientInternalCoeffs() const;
150 
151  //- Return the matrix source coefficients corresponding to the
152  //- evaluation of the gradient of this patchField
153  virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
154 
155 
156  // Member Operators
157 
158  // Disable assignment operators
159  virtual void operator=(const UList<Type>&) {}
160 
161  virtual void operator=(const faPatchField<Type>&) {}
162  virtual void operator+=(const faPatchField<Type>&) {}
163  virtual void operator-=(const faPatchField<Type>&) {}
164  virtual void operator*=(const faPatchField<scalar>&) {}
165  virtual void operator/=(const faPatchField<scalar>&) {}
166 
167  virtual void operator+=(const Field<Type>&) {}
168  virtual void operator-=(const Field<Type>&) {}
169 
170  virtual void operator*=(const Field<scalar>&) {}
171  virtual void operator/=(const Field<scalar>&) {}
172 
173  virtual void operator=(const Type&) {}
174  virtual void operator+=(const Type&) {}
175  virtual void operator-=(const Type&) {}
176  virtual void operator*=(const scalar) {}
177  virtual void operator/=(const scalar) {}
178 
179 
180  // Disable forced assignment operators
181  virtual void operator==(const faPatchField<Type>&) {}
182  virtual void operator==(const Field<Type>&) {}
183  virtual void operator==(const Type&) {}
185  // Prevent automatic comparison rewriting (c++20)
186  bool operator!=(const faPatchField<Type>&) const = delete;
187  bool operator!=(const Field<Type>&) const = delete;
188  bool operator!=(const Type&) const = delete;
189 };
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 } // End namespace Foam
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 #ifdef NoRepository
199  #include "zeroValueFaPatchField.txx"
200 #endif
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
206 // ************************************************************************* //
dictionary dict
virtual void operator==(const faPatchField< Type > &)
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
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 > &)
virtual tmp< faPatchField< Type > > clone() const
No clone without an internal field reference.
Definition: faPatchField.H:534
Specifies a zero fixed value boundary condition.
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
Definition: areaFieldsFwd.H:41
virtual void operator*=(const faPatchField< scalar > &)
TypeName("zeroValue")
Runtime type information.
virtual bool fixesValue() const
True: this patch field fixes a value.
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 faPatchField< scalar > &)
virtual void write(Ostream &os) const
Write (without "value" entry)
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition: Field.H:69
zeroValueFaPatchField(const faPatch &p, const DimensionedField< Type, areaMesh > &iF)
Construct from patch and internal field.
virtual void operator-=(const faPatchField< Type > &)
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the evaluation of the gradient of this patch...
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:73
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the evaluation of the value of this patchField...
static tmp< faPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: faPatchField.H:559
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.
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A FieldMapper for finite-area patch fields.
virtual void operator+=(const faPatchField< Type > &)
bool operator!=(const faPatchField< Type > &) const =delete
Namespace for OpenFOAM.