valuePointPatchField.C
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) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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\*---------------------------------------------------------------------------*/
28
31
32// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
33
34template<class Type>
36(
37 const pointPatch& p,
39)
40:
41 pointPatchField<Type>(p, iF),
42 Field<Type>(p.size())
43{}
44
45
46template<class Type>
48(
49 const pointPatch& p,
51 const dictionary& dict,
52 const bool valueRequired
53)
54:
55 pointPatchField<Type>(p, iF, dict),
56 Field<Type>(p.size())
57{
58 if (dict.found("value"))
59 {
61 (
62 Field<Type>("value", dict, p.size())
63 );
64 }
65 else if (!valueRequired)
66 {
68 }
69 else
70 {
72 << "Essential entry 'value' missing on patch "
73 << p.name() << endl
75 }
76}
77
78
79template<class Type>
81(
83 const pointPatch& p,
85 const pointPatchFieldMapper& mapper
86)
87:
88 pointPatchField<Type>(ptf, p, iF, mapper),
89 Field<Type>(ptf, mapper)
90{}
91
92
93template<class Type>
95(
98)
99:
100 pointPatchField<Type>(ptf, iF),
101 Field<Type>(ptf)
102{}
103
104
105// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
106
107template<class Type>
110 const pointPatchFieldMapper& m
111)
112{
114}
115
116
117template<class Type>
119(
120 const pointPatchField<Type>& ptf,
121 const labelList& addr
122)
123{
125 (
127 (
128 ptf
129 ),
130 addr
131 );
132}
133
134
135template<class Type>
137{
138 if (this->updated())
139 {
140 return;
141 }
142
143 // Get internal field to insert values into
144 Field<Type>& iF = const_cast<Field<Type>&>(this->primitiveField());
145
146 this->setInInternalField(iF, *this);
147
149}
150
151
152template<class Type>
154{
155 // Get internal field to insert values into
156 Field<Type>& iF = const_cast<Field<Type>&>(this->primitiveField());
157
158 this->setInInternalField(iF, *this);
159
161}
162
164template<class Type>
168 this->writeEntry("value", os);
169}
170
171
172// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
173
174template<class Type>
176(
178)
179{
182
183
184template<class Type>
187 const pointPatchField<Type>& ptf
188)
189{
190 Field<Type>::operator=(this->patchInternalField());
193
194template<class Type>
196(
197 const Field<Type>& tf
198)
199{
201}
203
204template<class Type>
206(
207 const Type& t
209{
211}
212
213
214template<class Type>
216(
218)
219{
221}
222
223
224template<class Type>
226(
227 const pointPatchField<Type>& ptf
228)
229{
230 Field<Type>::operator=(this->patchInternalField());
231}
232
233
234template<class Type>
236(
237 const Field<Type>& tf
238)
239{
241}
242
243
244template<class Type>
246(
247 const Type& t
248)
249{
251}
252
253
254// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type.
Definition: Field.H:82
void operator=(const Field< Type > &)
Copy assignment.
Definition: Field.C:641
void autoMap(const FieldMapper &map, const bool applyFlip=true)
Map from self.
Definition: Field.C:403
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given field
Definition: Field.C:466
void evaluate()
Evaluate boundary conditions.
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
commsTypes
Types of communications.
Definition: UPstream.H:67
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
Definition: dictionaryI.H:87
virtual bool write()
Write the output fields.
Foam::pointPatchFieldMapper.
Abstract base class for point-mesh patch fields.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:64
Foam::valuePointPatchField.
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given PointPatchField onto.
volScalarField & p
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:473
OBJstream os(runTime.globalPath()/outputName)
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
IOerror FatalIOError
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
dictionary dict