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 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 SourceFiles
34  fixedValuePointPatchField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_fixedValuePointPatchField_H
39 #define Foam_fixedValuePointPatchField_H
40 
41 #include "valuePointPatchField.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class fixedValuePointPatchField Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class Type>
54 :
55  public valuePointPatchField<Type>
56 {
57 public:
58 
59  //- Runtime type information
60  TypeName("fixedValue");
61 
62 
63  // Constructors
64 
65  //- Construct from patch and internal field
67  (
68  const pointPatch&,
70  );
71 
72  //- Construct from patch, internal field and value
74  (
75  const pointPatch&,
77  const Type& value
78  );
79 
80  //- Construct from patch, internal field and dictionary
82  (
83  const pointPatch&,
85  const dictionary&,
87  );
88 
89  //- Compatibility. Prefer with readOption
91  (
92  const pointPatch& p,
94  const dictionary& dict,
95  const bool valueReqd
96  )
97  :
99  (
100  p, iF, dict,
101  (valueReqd? IOobjectOption::MUST_READ : IOobjectOption::NO_READ)
102  )
103  {}
104 
105  //- Construct by mapping given patch field onto a new patch
107  (
109  const pointPatch&,
111  const pointPatchFieldMapper&
112  );
113 
114  //- Construct and return a clone
115  virtual autoPtr<pointPatchField<Type>> clone() const
116  {
118  (
120  (
121  *this
122  )
123  );
124  }
125 
126  //- Construct as copy setting internal field reference
128  (
131  );
132 
133  //- Construct and return a clone setting internal field reference
135  (
137  ) const
138  {
140  (
142  (
143  *this,
144  iF
145  )
146  );
147  }
149 
150  // Member Functions
151 
152  //- True: this patch field fixes a value.
153  virtual bool fixesValue() const { return true; }
154 
155 
156  // Member Operators
157 
158  // Disable assignment operators
159 
160  virtual void operator=(const Field<Type>&){}
161  virtual void operator=(const Type&){}
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #ifdef NoRepository
172  #include "fixedValuePointPatchField.C"
173 #endif
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 #endif
178 
179 // ************************************************************************* //
dictionary dict
Foam::valuePointPatchField.
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A FixedValue boundary condition for pointField.
virtual bool fixesValue() const
True: this patch field fixes a value.
Foam::pointPatchFieldMapper.
Generic templated field type.
Definition: Field.H:62
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:61
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...
Definition: areaFieldsFwd.H:42
virtual void operator=(const Field< Type > &)
fixedValuePointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
TypeName("fixedValue")
Runtime type information.
volScalarField & p
Namespace for OpenFOAM.
readOption
Enumeration defining read preferences.