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  The "value" entry is normally MUST_READ.
34 
35 SourceFiles
36  fixedValuePointPatchField.C
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 {
59 public:
60 
61  //- Runtime type information
62  TypeName("fixedValue");
63 
64 
65  // Constructors
66 
67  //- Construct from patch and internal field
69  (
70  const pointPatch&,
72  );
73 
74  //- Construct from patch, internal field and value
76  (
77  const pointPatch&,
79  const Type& value
80  );
81 
82  //- Construct from patch, internal field and dictionary
84  (
85  const pointPatch&,
87  const dictionary&,
89  );
90 
91  //- Compatibility. Prefer with readOption
93  (
94  const pointPatch& p,
96  const dictionary& dict,
97  const bool needValue
98  )
99  :
101  (
102  p, iF, dict,
103  (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ)
104  )
105  {}
106 
107  //- Construct by mapping given patch field onto a new patch
109  (
111  const pointPatch&,
113  const pointPatchFieldMapper&
114  );
115 
116  //- Construct as copy setting internal field reference
118  (
121  );
122 
123  //- Return a clone
124  virtual autoPtr<pointPatchField<Type>> clone() const
125  {
126  return pointPatchField<Type>::Clone(*this);
127  }
128 
129  //- Construct and return a clone setting internal field reference
130  virtual autoPtr<pointPatchField<Type>> clone
131  (
132  const DimensionedField<Type, pointMesh>& iF
133  ) const
134  {
135  return pointPatchField<Type>::Clone(*this, iF);
136  }
137 
138 
139  // Member Functions
140 
141  //- True: this patch field fixes a value.
142  virtual bool fixesValue() const { return true; }
143 
145  // Member Operators
146 
147  // Disable assignment operators
148 
149  virtual void operator=(const Field<Type>&){}
150  virtual void operator=(const Type&){}
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #ifdef NoRepository
161  #include "fixedValuePointPatchField.C"
162 #endif
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 #endif
167 
168 // ************************************************************************* //
dictionary dict
Foam::valuePointPatchField.
virtual autoPtr< pointPatchField< Type > > clone() const
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
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
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...
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.