fixedValuePointPatchField.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2023-2026 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::fixedValuePointPatchField
29 
30 Description
31  A FixedValue boundary condition for pointField.
32 
33  The "value" entry is normally MUST_READ.
34 
35 SourceFiles
36  fixedValuePointPatchField.txx
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef Foam_fixedValuePointPatchField_H
41 #define Foam_fixedValuePointPatchField_H
42 
43 #include "valuePointPatchField.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class fixedValuePointPatchField Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class Type>
56 :
57  public valuePointPatchField<Type>
58 {
61 
62 public:
63 
64  //- Runtime type information
65  TypeName("fixedValue");
66 
67 
68  // Constructors
69 
70  //- Construct from patch and internal field
72  (
73  const pointPatch&,
75  );
76 
77  //- Construct from patch, internal field and value
79  (
80  const pointPatch&,
82  const Type& value
83  );
84 
85  //- Construct from patch, internal field and dictionary
87  (
88  const pointPatch&,
90  const dictionary&,
92  );
93 
94  //- Compatibility. Prefer with readOption
96  (
97  const pointPatch& p,
99  const dictionary& dict,
100  const bool needValue
101  )
102  :
104  (
105  p, iF, dict,
106  (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ)
107  )
108  {}
109 
110  //- Construct by mapping onto a new patch
112  (
113  const this_bctype&,
114  const pointPatch&,
116  const pointPatchFieldMapper&
117  );
118 
119  //- Copy construct onto patch with internal field reference
120  //- and specified value
122  (
123  const this_bctype&,
124  const pointPatch& p,
126  const Type& value
127  );
128 
129  //- Copy construct with internal field reference
131  (
132  const this_bctype& pfld,
134  );
135 
136  //- No copy without an internal field
137  [[deprecated("2026-03: soon = delete")]]
138  fixedValuePointPatchField(const this_bctype& pfld)
139  #ifdef Foam_pointPatchField_copyConstruct
140  : this_bctype(pfld, pfld.internalField()) {}
141  #else
142  = delete;
143  #endif
144 
145  //- Clone with an internal field reference
146  virtual autoPtr<pointPatchField<Type>> clone
147  (
148  const DimensionedField<Type, pointMesh>& iF
149  ) const
150  {
151  return pointPatchField<Type>::Clone(*this, iF);
152  }
153 
154 
155  // Member Functions
156 
157  //- True: this patch field fixes a value.
158  virtual bool fixesValue() const { return true; }
159 
160  //- False: this patch field is not altered by assignment.
161  virtual bool assignable() const { return false; }
163 
164  // Member Operators
165 
166  // No assignment operations
167  virtual void operator=(const valuePointPatchField<Type>&) {}
168  virtual void operator=(const pointPatchField<Type>&) {}
169  virtual void operator=(const Field<Type>&) {}
170  virtual void operator=(const Type&) {}
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 } // End namespace Foam
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #ifdef NoRepository
181  #include "fixedValuePointPatchField.txx"
182 #endif
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
188 // ************************************************************************* //
dictionary dict
Foam::valuePointPatchField.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
A FixedValue boundary condition for pointField.
virtual bool fixesValue() const
True: this patch field fixes a value.
Foam::pointPatchFieldMapper.
Abstract base class for point-mesh patch fields.
tmp< Field< Type > > clone() const
Clone.
Definition: FieldI.H:140
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
virtual void operator=(const valuePointPatchField< Type > &)
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:64
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
fixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
virtual bool assignable() const
False: this patch field is not altered by assignment.
TypeName("fixedValue")
Runtime type information.
volScalarField & p
Namespace for OpenFOAM.
readOption
Enumeration defining read preferences.