valuePointPatchField.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-2017 OpenFOAM Foundation
9  Copyright (C) 2020 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::valuePointPatchField
29 
30 Description
31  Foam::valuePointPatchField
32 
33 SourceFiles
34  valuePointPatchField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef valuePointPatchField_H
39 #define valuePointPatchField_H
40 
41 #include "pointPatchField.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class valuePointPatchField Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class Type>
54 :
55  public pointPatchField<Type>,
56  public Field<Type>
57 {
58 public:
59 
60  //- Declare type-name, virtual type (with debug switch)
61  TypeName("value");
62 
63 
64  // Generated Methods
65 
66  //- Copy construct
68 
69 
70  // Constructors
71 
72  //- Construct from patch and internal field
74  (
75  const pointPatch&,
77  );
78 
79  //- Construct from patch, internal field and dictionary
81  (
82  const pointPatch&,
84  const dictionary&,
85  const bool valueRequired=true
86  );
87 
88  //- Construct by mapping given patchField<Type> onto a new patch
90  (
92  const pointPatch&,
95  );
96 
97  //- Construct and return a clone
98  virtual autoPtr<pointPatchField<Type>> clone() const
99  {
101  (
103  (
104  *this
105  )
106  );
107  }
108 
109  //- Construct as copy setting internal field reference
111  (
114  );
115 
116  //- Construct and return a clone setting internal field reference
118  (
120  ) const
121  {
123  (
125  (
126  *this,
127  iF
128  )
129  );
130  }
131 
132 
133  // Member Functions
134 
135  // Access
136 
137  //- Return size
138  label size() const
139  {
140  return Field<Type>::size();
141  }
142 
143 
144  // Mapping functions
145 
146  //- Map (and resize as needed) from self given a mapping object
147  virtual void autoMap
148  (
149  const pointPatchFieldMapper&
150  );
151 
152  //- Reverse map the given PointPatchField onto
153  // this PointPatchField
154  virtual void rmap
155  (
156  const pointPatchField<Type>&,
157  const labelList&
158  );
159 
160 
161  // Evaluation functions
162 
163  //- Update the coefficients associated with the patch field
164  virtual void updateCoeffs();
165 
166  //- Evaluate the patch field
167  virtual void evaluate
168  (
169  const Pstream::commsTypes commsType =
171  );
172 
173 
174  //- Write
175  virtual void write(Ostream&) const;
176 
177 
178  // Member Operators
179 
180  // Assignment operators
181 
182  virtual void operator=
183  (
185  );
186 
187  virtual void operator=
188  (
189  const pointPatchField<Type>&
190  );
191 
192  virtual void operator=(const Field<Type>&);
193  virtual void operator=(const Type&);
194 
195 
196  // Force an assignment irrespective of form of patch
197 
198  virtual void operator==
199  (
201  );
202 
203  virtual void operator==
204  (
205  const pointPatchField<Type>&
206  );
207 
208  virtual void operator==(const Field<Type>&);
209  virtual void operator==(const Type&);
210 };
211 
212 
213 // This function is added to override the hack in pointPatchField.H
214 // which enables simple backward compatibility with versions using
215 // referenceLevel in GeometricField
216 template<class Type>
217 tmp<Field<Type>> operator+
218 (
219  const valuePointPatchField<Type>& vsppf,
220  const Type& t
221 )
222 {
223  return static_cast<const Field<Type>&>(vsppf) + t;
224 }
225 
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 } // End namespace Foam
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 #ifdef NoRepository
234  #include "valuePointPatchField.C"
235 #endif
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #endif
240 
241 // ************************************************************************* //
Foam::valuePointPatchField::size
label size() const
Return size.
Definition: valuePointPatchField.H:137
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::valuePointPatchField::operator=
virtual void operator=(const valuePointPatchField< Type > &)
Definition: valuePointPatchField.C:175
pointPatchField.H
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:58
Foam::pointPatchField
Abstract base class for point-mesh patch fields.
Definition: pointMVCWeight.H:60
valuePointPatchField.C
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:48
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::valuePointPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: valuePointPatchField.C:135
Foam::valuePointPatchField::write
virtual void write(Ostream &) const
Write.
Definition: valuePointPatchField.C:164
Foam::valuePointPatchField::operator==
virtual void operator==(const valuePointPatchField< Type > &)
Definition: valuePointPatchField.C:215
Foam::valuePointPatchField::TypeName
TypeName("value")
Declare type-name, virtual type (with debug switch)
Foam::valuePointPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Definition: valuePointPatchField.C:152
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::valuePointPatchField::autoMap
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: valuePointPatchField.C:108
Foam::valuePointPatchField::valuePointPatchField
valuePointPatchField(const valuePointPatchField &)=default
Copy construct.
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::valuePointPatchField
Foam::valuePointPatchField.
Definition: valuePointPatchField.H:52
Foam::List< label >
Foam::valuePointPatchField::rmap
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given PointPatchField onto.
Definition: valuePointPatchField.C:118
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::valuePointPatchField::clone
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
Definition: valuePointPatchField.H:97
Foam::UPstream::commsTypes::blocking