zeroValuePointPatchField.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) 2014 OpenFOAM Foundation
9  Copyright (C) 2023-2025 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::zeroValuePointPatchField
29 
30 Description
31  Specifies a zero fixed value boundary condition
32 
33  Example of the boundary condition specification:
34  \verbatim
35  inlet
36  {
37  type zeroValue;
38  }
39  \endverbatim
40 
41 SourceFiles
42  zeroValuePointPatchField.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef Foam_zeroValuePointPatchField_H
47 #define Foam_zeroValuePointPatchField_H
48 
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class zeroValuePointPatchField Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class Type>
62 :
63  public fixedValuePointPatchField<Type>
64 {
65  //- The parent boundary condition type
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 pointPatch&,
81  );
82 
83  //- Construct from patch, internal field and dictionary
85  (
86  const pointPatch&,
88  const dictionary&
89  );
90 
91  //- Copy construct onto a new patch
93  (
95  const pointPatch& p,
98  );
99 
100  //- Copy construct with internal field reference
102  (
103  const zeroValuePointPatchField<Type>& pfld,
105  );
106 
107  //- Copy construct
109  :
111  {}
112 
113 
114  //- Return a clone
115  virtual autoPtr<pointPatchField<Type>> clone() const
116  {
118  }
119 
120  //- Construct and return a clone setting internal field reference
122  (
124  ) const
125  {
126  return pointPatchField<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; }
134 
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  // Member Operators
143 
144  // Disable assignment operators
145  virtual void operator=(const valuePointPatchField<Type>&) {}
146  virtual void operator=(const pointPatchField<Type>&) {}
147  virtual void operator=(const Field<Type>&) {}
148  virtual void operator=(const Type&) {}
149 
150  // Disable forced assignment operators
151  virtual void operator==(const valuePointPatchField<Type>&) {}
152  virtual void operator==(const pointPatchField<Type>&) {}
153  virtual void operator==(const Field<Type>&) {}
154  virtual void operator==(const Type&) {}
155 
156  // Prevent automatic comparison rewriting (c++20)
157  bool operator!=(const valuePointPatchField<Type>&) const = delete;
158  bool operator!=(const pointPatchField<Type>&) const = delete;
159  bool operator!=(const Field<Type>&) const = delete;
160  bool operator!=(const Type&) const = delete;
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 } // End namespace Foam
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #ifdef NoRepository
172 #endif
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
Foam::valuePointPatchField.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
virtual void operator==(const valuePointPatchField< Type > &)
A FixedValue boundary condition for pointField.
Foam::pointPatchFieldMapper.
virtual bool assignable() const
False: this patch field is not altered by assignment.
virtual void operator=(const valuePointPatchField< Type > &)
bool operator!=(const valuePointPatchField< Type > &) const =delete
zeroValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition: Field.H:69
virtual bool fixesValue() const
True: this patch field fixes a value.
virtual autoPtr< pointPatchField< Type > > clone() const
Return a clone.
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
TypeName("zeroValue")
Runtime type information.
virtual void write(Ostream &os) const
Write (without "value" entry)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
OBJstream os(runTime.globalPath()/outputName)
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:64
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
volScalarField & p
const DimensionedField< Type, pointMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
Namespace for OpenFOAM.
Specifies a zero fixed value boundary condition.