Loading...
Searching...
No Matches
Field.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) 2015-2025 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
27Class
28 Foam::Field
29
30Description
31 Generic templated field type that is much like a Foam::List
32 except that it is expected to hold numerical content
33 (not generic elements such as strings etc).
34
35 In addition to methods specific to numerical fields
36 (e.g., clamp, min, max, transpose, ...), it also has a reference
37 counter that is used by Foam::tmp handling.
38
39SourceFiles
40 FieldFunctions.H
41 FieldFunctionsM.H
42 FieldMapper.H
43 FieldI.H
44 FieldM.H
45 Field.C
46 FieldBase.C
47 FieldFunctions.C
48 FieldFunctionsM.C
49
50\*---------------------------------------------------------------------------*/
51
52#ifndef Foam_Field_H
53#define Foam_Field_H
54
55#include "tmp.H"
56#include "direction.H"
57#include "labelList.H"
58#include "keyType.H"
59#include "ops.H"
60#include "scalarList.H"
61#include "VectorSpace.H"
62#include "IOobjectOption.H"
63
64// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65
66namespace Foam
67{
68
69// Forward Declarations
70class FieldMapper;
71class dictionary;
72class entry;
74template<class Type> class Field;
75template<class Type> class SubField;
76
77template<class Type> Ostream& operator<<(Ostream&, const Field<Type>&);
78template<class Type> Ostream& operator<<(Ostream&, const tmp<Field<Type>>&);
79
80/*---------------------------------------------------------------------------*\
81 Class FieldBase Declaration
82\*---------------------------------------------------------------------------*/
83
84//- Template invariant parts for Field and SubField
85class FieldBase
86:
87 public refCount
88{
89public:
90
91 // Static Data Members
92
93 //- Typename for Field
94 static const char* const typeName;
95
96 //- Permit read construct from a larger size.
97 // Mostly required for things like column mesh, for example.
99
100 //- GeometricField with extra capacity for flattened boundary fields.
101 //- Uses opt-switch "unifiedGeometricField"
102 static bool unifiedGeometricField;
103
104 //- Local boundary field consistency checks.
105 //- Uses opt-switch "localBoundaryConsistency"
107
108 //- Tolerance for local boundary field consistency checks.
109 //- Uses opt-switch "localBoundaryConsistency::tolerance"
110 static scalar localBoundaryTolerance_;
111
113 // Static Member Functions
114
115 //- Warn about keyword changes for local boundary consistency checks.
116 // The supplied dictionary corresponds to the optimisationSwitches
119 //- Get flag for local boundary consistency checks.
121 {
123 }
124
125 //- Set flag for local boundary consistency checks.
126 // \return the previous value
127 static int localBoundaryConsistency(int val) noexcept
128 {
131 return old;
132 }
134
135 // Constructors
136
137 //- Default construct
138 constexpr FieldBase() noexcept
139 :
140 refCount()
141 {}
142};
144
145/*---------------------------------------------------------------------------*\
146 Class Field Declaration
147\*---------------------------------------------------------------------------*/
148
149template<class Type>
150class Field
151:
152 public FieldBase,
153 public List<Type>
154{
155public:
157 //- Component type
158 typedef typename pTraits<Type>::cmptType cmptType;
159
160 //- Declare type of subField
161 typedef SubField<Type> subField;
162
163
164 // Static Member Functions
165
166 //- Return a null Field (reference to a nullObject).
167 //- Behaves like an empty Field.
168 static const Field<Type>& null() noexcept
169 {
171 }
172
173
174 // Constructors
175
176 //- Default construct
177 // For temporary fields that are initialised after construction
178 inline constexpr Field() noexcept;
179
180 //- Construct given size
181 // For temporary fields that are initialised after construction
182 inline explicit Field(const label len);
184 //- Construct given size and initial value
185 inline Field(const label len, const Type& val);
186
187 //- Construct given size and initial values of zero
188 inline Field(const label len, Foam::zero);
189
190 //- Construct with length=1, copying the value as the only content
191 inline Field(Foam::one, const Type& val);
193 //- Construct with length=1, moving the value as the only content
194 inline Field(Foam::one, Type&& val);
195
196 //- Construct with length=1, initializing content to zero
197 inline Field(Foam::one, Foam::zero);
198
199 //- Copy construct
200 inline Field(const Field<Type>& fld);
201
202 //- Copy construct from UList<Type>
203 inline explicit Field(const UList<Type>& list);
204
205 //- Copy construct from IndirectList
206 template<class Addr>
207 inline explicit Field(const IndirectListBase<Type, Addr>& list);
208
209 //- Move construct from Field
210 inline Field(Field<Type>&& fld) noexcept;
211
212 //- Move construct from List
213 inline Field(List<Type>&& list) noexcept;
214
215 //- Move construct from DynamicList
216 template<int SizeMin>
217 inline Field(DynamicList<Type, SizeMin>&& list);
218
219 //- Construct by 1 to 1 mapping from the given field
220 Field
221 (
222 const UList<Type>& mapF,
223 const labelUList& mapAddressing
224 );
225
226 //- Construct by 1 to 1 mapping from the given tmp field
228 (
229 const tmp<Field<Type>>& tmapF,
230 const labelUList& mapAddressing
231 );
233 //- Construct by interpolative mapping from the given field
234 Field
235 (
236 const UList<Type>& mapF,
237 const labelListList& mapAddressing,
238 const scalarListList& weights
239 );
240
241 //- Construct by interpolative mapping from the given tmp field
243 (
244 const tmp<Field<Type>>& tmapF,
245 const labelListList& mapAddressing,
246 const scalarListList& weights
247 );
248
249 //- Construct by mapping from the given field
250 Field
251 (
252 const UList<Type>& mapF,
254 const bool applyFlip = true
255 );
256
257 //- Construct by mapping from the given field
259 (
260 const UList<Type>& mapF,
261 const FieldMapper& map,
262 const Type& defaultValue,
263 const bool applyFlip = true
264 );
265
266 //- Construct by mapping from the given field
267 Field
268 (
269 const UList<Type>& mapF,
270 const FieldMapper& map,
271 const UList<Type>& defaultValues,
272 const bool applyFlip = true
273 );
275 //- Construct by mapping from the given tmp field
276 Field
277 (
278 const tmp<Field<Type>>& tmapF,
279 const FieldMapper& map,
280 const bool applyFlip = true
281 );
282
283 //- Construct by mapping from the given tmp field.
284 //- Uses supplied uniform value for unmapped items
285 Field
286 (
287 const tmp<Field<Type>>& tmapF,
288 const FieldMapper& map,
289 const Type& defaultValue,
290 const bool applyFlip = true
291 );
293 //- Construct by mapping from the given tmp field.
294 //- Uses supplied values for unmapped items
295 Field
296 (
297 const tmp<Field<Type>>& tmapF,
298 const FieldMapper& map,
299 const UList<Type>& defaultValues,
300 const bool applyFlip = true
301 );
303 //- Copy construct or re-use as specified.
304 inline Field(Field<Type>& fld, bool reuse);
305
306 //- Copy or move construct from tmp
307 inline Field(const tmp<Field<Type>>& tfld);
308
309 //- Construct from Istream
310 inline Field(Istream& is);
311
312 //- Construct from a dictionary (primitive) entry.
313 Field(const entry& e, const label len);
314
315 //- Lookup of a primitive dictionary entry by (literal) name
316 //- and assign its contents to this. The behaviour largely as
317 //- described in assign():
318 // - For MUST_READ and key not found: FatalIOError.
319 // - For LAZY_READ and key not found: initialise field with zero.
320 // - For NO_READ and key not found: simply size the field.
321 // .
323 (
324 const word& key,
325 const dictionary& dict,
326 const label len,
327 IOobjectOption::readOption readOpt = IOobjectOption::MUST_READ
328 );
329
330 //- Clone
331 inline tmp<Field<Type>> clone() const;
332
333 //- Return a pointer to a new Field created on freestore
334 static autoPtr<Field<Type>> New(Istream& is)
335 {
336 return autoPtr<Field<Type>>(new Field<Type>(is));
337 }
338
339 //- Return a pointer to a new calculatedFvPatchFieldField created on
340 //- freestore without setting patchField values
341 template<class Type2>
343 {
344 return tmp<Field<Type>>::New(f.size());
345 }
346
347
348 // Member Functions
349
350 //- Assign from a primitive dictionary entry with the following
351 //- behaviour:
352 // - If len == 0 : a no-op
353 // - If len < 0 : no size checking
354 // - If len > 0 : resize \em uniform entries to this size
355 // before assigning. Use as length check for \em nonuniform
356 // entries. A mismatch is possibly Fatal, except when
357 // allowConstructFromLargerSize is true (eg, for column mesh).
358 // .
359 void assign(const entry& e, const label len);
360
361 //- Lookup a primitive dictionary entry by (literal) name
362 //- and assign its contents to this (behaviour as described above).
363 // - If len == 0 : a no-op and return True.
364 // - For NO_READ : a no-op and return False.
365 // - For LAZY_READ and key not found : a no-op and return False.
366 // - For MUST_READ and key not found : FatalIOError
367 // .
368 // \returns True if an assignment occurred or for zero-length.
369 bool assign
370 (
371 const word& key,
372 const dictionary& dict,
373 const label len,
375 );
376
377 //- 1 to 1 map from the given field
378 void map
379 (
380 const UList<Type>& mapF,
381 const labelUList& mapAddressing
382 );
384 //- 1 to 1 map from the given tmp field
385 void map
386 (
387 const tmp<Field<Type>>& tmapF,
388 const labelUList& mapAddressing
389 );
390
391 //- Interpolative map from the given field
392 void map
394 const UList<Type>& mapF,
395 const labelListList& mapAddressing,
396 const scalarListList& weights
397 );
398
399 //- Interpolative map from the given tmp field
400 void map
401 (
402 const tmp<Field<Type>>& tmapF,
403 const labelListList& mapAddressing,
404 const scalarListList& weights
405 );
406
407 //- Map from the given field
408 void map
409 (
410 const UList<Type>& mapF,
411 const FieldMapper& map,
412 const bool applyFlip = true
413 );
414
415 //- Map from the given tmp field
416 void map
417 (
418 const tmp<Field<Type>>& tmapF,
419 const FieldMapper& map,
420 const bool applyFlip = true
421 );
422
423 //- Map from self
424 void autoMap
425 (
426 const FieldMapper& map,
427 const bool applyFlip = true
428 );
429
430 //- 1 to 1 reverse-map from the given field
431 void rmap
432 (
433 const UList<Type>& mapF,
434 const labelUList& mapAddressing
435 );
436
437 //- 1 to 1 reverse-map from the given tmp field
438 void rmap
439 (
440 const tmp<Field<Type>>& tmapF,
441 const labelUList& mapAddressing
442 );
443
444 //- Interpolative reverse map from the given field
445 void rmap
446 (
447 const UList<Type>& mapF,
448 const labelUList& mapAddressing,
449 const UList<scalar>& weights
450 );
452 //- Interpolative reverse map from the given tmp field
453 void rmap
454 (
455 const tmp<Field<Type>>& tmapF,
456 const labelUList& mapAddressing,
457 const UList<scalar>& weights
458 );
459
460 //- Inplace negate this field (negative).
461 // Inverts the state for a bool field.
462 void negate();
463
464 //- Inplace normalise this field.
465 //- Generally a no-op except for vector fields.
466 // Vector fields are normalised by their magnitude.
467 // Small vectors (mag less than ROOTVSMALL) are set to zero.
468 void normalise();
469
470 //- Return a component field of the field
472
473 //- Replace a component field of the field
474 void replace(const direction, const UList<cmptType>&);
476 //- Replace a component field of the field
477 void replace(const direction, const tmp<Field<cmptType>>&);
478
479 //- Replace a component field of the field
480 void replace(const direction, const cmptType&);
481
482 //- Impose lower (floor) clamp on the field values (in-place)
483 void clamp_min(const Type& lower);
485 //- Impose lower (floor) clamp on the field values (in-place)
486 void clamp_min(const UList<Type>& lower);
487
488 //- Impose upper (ceiling) clamp on the field values (in-place)
489 void clamp_max(const Type& upper);
490
491 //- Impose upper (ceiling) clamp on the field values (in-place)
492 void clamp_max(const UList<Type>& upper);
494 //- Clamp field values (in-place) to the specified range.
495 // Does not check if range is valid or not.
496 void clamp_range(const Type& lower, const Type& upper);
497
498 //- Clamp field values (in-place) to the specified range.
499 // Does not check if range is valid or not.
500 void clamp_range(const MinMax<Type>& range);
501
502 template<class VSForm>
503 VSForm block(const label start) const;
504
505 //- Return the field transpose (only defined for second rank tensors)
506 tmp<Field<Type>> T() const;
507
508 //- Write the field as a dictionary entry
509 void writeEntry(const word& keyword, Ostream& os) const;
510
511
512 // Other Access
514 //- Return SubField slice (non-const access) - no range checking
515 SubField<Type> slice(const label pos, label len = -1);
516
517 //- Return SubField slice (const access) - no range checking
518 const SubField<Type> slice(const label pos, label len = -1) const;
519
520 //- Return SubField slice (non-const access) - with range checking
522
523 //- Return SubField slice (const access) - with range checking
524 const SubField<Type> slice(const labelRange& range) const;
525
526
527 // Assignment
528
529 //- Copy assignment
530 void operator=(const Field<Type>&);
531 void operator=(const tmp<Field<Type>>&);
532
533 inline void operator=(const UList<Type>& rhs);
534 inline void operator=(const SubField<Type>& rhs);
535
536 //- Copy assign from IndirectList
537 template<class Addr>
538 inline void operator=(const IndirectListBase<Type, Addr>& rhs);
539
540 //- Move assignment
541 inline void operator=(Field<Type>&& rhs);
542 inline void operator=(List<Type>&& rhs);
543
544 template<int SizeMin>
546
547 //- Assign entries to the given value
548 inline void operator=(const Type& val);
549
550 //- Assign entries to zero
551 inline void operator=(Foam::zero);
552
553 template<class Form, class Cmpt, direction nCmpt>
555
556
557 // Member Operators
558
559 void operator+=(const UList<Type>&);
561
562 void operator-=(const UList<Type>&);
563 void operator-=(const tmp<Field<Type>>&);
564
565 void operator*=(const UList<scalar>&);
566 void operator*=(const tmp<Field<scalar>>&);
567
568 void operator/=(const UList<scalar>&);
569 void operator/=(const tmp<Field<scalar>>&);
571 void operator+=(const Type&);
572 void operator-=(const Type&);
573
574 void operator*=(const scalar&);
575 void operator/=(const scalar&);
576
577
578 // IOstream Operators
579
580 friend Ostream& operator<< <Type>
581 (Ostream&, const Field<Type>&);
583 friend Ostream& operator<< <Type>
584 (Ostream&, const tmp<Field<Type>>&);
585
586
587 // Expression templates
588
589 //- Construct from value expression
590 template<typename E>
592 {
593 expr.evaluate(*this);
594 }
595
596 //- Assign values from expression
597 template<typename E>
599 {
600 expr.evaluate(*this);
602};
603
604
605// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
607} // End namespace Foam
608
609// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
610
611#include "FieldI.H"
612#include "FieldFunctions.H"
613
614#ifdef NoRepository
615 #include "Field.C"
616#endif
617
618// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
619
620#endif
622// ************************************************************************* //
scalar range
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
Expression templates for List.
static bool unifiedGeometricField
GeometricField with extra capacity for flattened boundary fields. Uses opt-switch "unifiedGeometricFi...
Definition Field.H:106
static bool allowConstructFromLargerSize
Permit read construct from a larger size.
Definition Field.H:100
static int localBoundaryConsistency() noexcept
Get flag for local boundary consistency checks.
Definition Field.H:133
static void warnLocalBoundaryConsistencyCompat(const dictionary &)
Warn about keyword changes for local boundary consistency checks.
Definition FieldBase.C:77
constexpr FieldBase() noexcept
Default construct.
Definition Field.H:156
static scalar localBoundaryTolerance_
Tolerance for local boundary field consistency checks. Uses opt-switch "localBoundaryConsistency::tol...
Definition Field.H:118
static int localBoundaryConsistency(int val) noexcept
Set flag for local boundary consistency checks.
Definition Field.H:143
static int localBoundaryConsistency_
Local boundary field consistency checks. Uses opt-switch "localBoundaryConsistency".
Definition Field.H:112
static const char *const typeName
Typename for Field.
Definition Field.H:93
Abstract base class to hold the Field mapping addressing and weights.
Definition FieldMapper.H:44
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
void clamp_range(const MinMax< Type > &range)
Clamp field values (in-place) to the specified range.
Definition Field.C:725
void operator=(Foam::zero)
Assign entries to zero.
Definition FieldI.H:203
static tmp< Field< Type > > NewCalculatedType(const Field< Type2 > &f)
Return a pointer to a new calculatedFvPatchFieldField created on freestore without setting patchField...
Definition Field.H:431
void map(const tmp< Field< Type > > &tmapF, const FieldMapper &map, const bool applyFlip=true)
Map from the given tmp field.
Definition Field.C:452
void operator+=(const tmp< Field< Type > > &)
Definition Field.C:833
void operator-=(const Type &)
Definition Field.C:834
static autoPtr< Field< T > > New(Istream &is)
Definition Field.H:421
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors).
Definition Field.C:745
void map(const UList< Type > &mapF, const FieldMapper &map, const bool applyFlip=true)
Map from the given field.
Definition Field.C:393
void operator/=(const scalar &)
Definition Field.C:836
void map(const tmp< Field< Type > > &tmapF, const labelListList &mapAddressing, const scalarListList &weights)
Interpolative map from the given tmp field.
Definition Field.C:380
void operator=(const Field< Type > &)
Copy assignment.
Definition Field.C:781
void operator/=(const tmp< Field< scalar > > &)
Definition Field.C:836
void operator=(Field< Type > &&rhs)
Move assignment.
Definition FieldI.H:174
void clamp_range(const Type &lower, const Type &upper)
Clamp field values (in-place) to the specified range.
Definition Field.C:712
void autoMap(const FieldMapper &map, const bool applyFlip=true)
Map from self.
Definition Field.C:465
void operator=(const SubField< Type > &rhs)
Definition FieldI.H:156
void operator*=(const scalar &)
Definition Field.C:835
void operator+=(const Type &)
Definition Field.C:833
void operator=(const UList< Type > &rhs)
Definition FieldI.H:149
void operator+=(const UList< Type > &)
Definition Field.C:833
void operator-=(const UList< Type > &)
Definition Field.C:834
void operator=(DynamicList< Type, SizeMin > &&rhs)
Definition FieldI.H:189
void clamp_min(const Type &lower)
Impose lower (floor) clamp on the field values (in-place).
Definition Field.C:654
void operator=(const tmp< Field< Type > > &)
SubField< T > subField
Definition Field.H:183
SubField< Type > slice(const labelRange &range)
Return SubField slice (non-const access) - with range checking.
Definition SubField.H:254
void operator*=(const tmp< Field< scalar > > &)
Definition Field.C:835
pTraits< T >::cmptType cmptType
Definition Field.H:178
void clamp_max(const UList< Type > &upper)
Impose upper (ceiling) clamp on the field values (in-place).
Definition Field.C:695
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
Definition Field.C:754
static const Field< Type > & null() noexcept
Return a null Field (reference to a nullObject). Behaves like an empty Field.
Definition Field.H:192
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
Definition Field.C:619
void clamp_min(const UList< Type > &lower)
Impose lower (floor) clamp on the field values (in-place).
Definition Field.C:678
constexpr Field() noexcept
Default construct.
Definition FieldI.H:24
void operator=(const Expression::ListExpression< E > &expr)
Assign values from expression.
Definition Field.H:769
void operator=(List< Type > &&rhs)
Definition FieldI.H:181
void map(const UList< Type > &mapF, const labelListList &mapAddressing, const scalarListList &weights)
Interpolative map from the given field.
Definition Field.C:343
void operator=(const VectorSpace< Form, Cmpt, nCmpt > &)
Definition Field.C:806
void rmap(const tmp< Field< Type > > &tmapF, const labelUList &mapAddressing, const UList< scalar > &weights)
Interpolative reverse map from the given tmp field.
Definition Field.C:580
void operator*=(const UList< scalar > &)
Definition Field.C:835
void replace(const direction, const cmptType &)
Replace a component field of the field.
Definition Field.C:643
void assign(const entry &e, const label len)
Assign from a primitive dictionary entry with the following behaviour:
Definition Field.C:206
void replace(const direction, const tmp< Field< cmptType > > &)
Replace a component field of the field.
Definition Field.C:631
tmp< Field< T > > clone() const
bool assign(const word &key, const dictionary &dict, const label len, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ)
Lookup a primitive dictionary entry by (literal) name and assign its contents to this (behaviour as d...
Definition Field.C:265
void operator/=(const UList< scalar > &)
Definition Field.C:836
void operator-=(const tmp< Field< Type > > &)
Definition Field.C:834
void negate()
Inplace negate this field (negative).
Definition Field.C:592
void map(const tmp< Field< Type > > &tmapF, const labelUList &mapAddressing)
1 to 1 map from the given tmp field
Definition Field.C:331
void clamp_max(const Type &upper)
Impose upper (ceiling) clamp on the field values (in-place).
Definition Field.C:666
void map(const UList< T > &mapF, const labelUList &mapAddressing)
void operator=(const Type &val)
Assign entries to the given value.
Definition FieldI.H:196
void operator=(const IndirectListBase< Type, Addr > &rhs)
Copy assign from IndirectList.
Definition FieldI.H:165
void normalise()
Inplace normalise this field. Generally a no-op except for vector fields.
Definition Field.C:600
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing, const UList< scalar > &weights)
Interpolative reverse map from the given field.
Definition Field.C:561
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given field
Definition Field.C:528
const SubField< Type > slice(const labelRange &range) const
Return SubField slice (const access) - with range checking.
Definition SubField.H:262
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
Definition Field.C:607
void rmap(const tmp< Field< Type > > &tmapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given tmp field
Definition Field.C:549
VSForm block(const label start) const
Definition Field.C:733
SubField< Type > slice(const label pos, label len=-1)
Return SubField slice (non-const access) - no range checking.
Definition SubField.H:230
const SubField< Type > slice(const label pos, label len=-1) const
Return SubField slice (const access) - no range checking.
Definition SubField.H:242
Field(const Expression::ListExpression< E > &expr)
Construct from value expression.
Definition Field.H:760
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
readOption
Enumeration defining read preferences.
@ MUST_READ
Reading required.
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
A min/max value pair with additional methods. In addition to conveniently storing values,...
Definition MinMax.H:106
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
SubField is a Field obtained as a section of another Field, without its own allocation....
Definition SubField.H:58
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
auto expr() const
Wrap value as expression.
Definition UList.H:999
Templated vector space.
Definition VectorSpace.H:75
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A keyword and a list of tokens is an 'entry'.
Definition entry.H:66
A range or interval of labels defined by a start and a size.
Definition labelRange.H:66
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Definition one.H:57
A traits class, which is primarily used for primitives and vector-space.
Definition pTraits.H:64
constexpr refCount() noexcept
Default construct, initializing count to 0.
Definition refCount.H:63
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition zero.H:58
Direction is an 8-bit unsigned integer type used to represent Cartesian directions,...
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
List< scalarList > scalarListList
List of scalarList.
Definition scalarList.H:35
dimensionedScalar pos(const dimensionedScalar &ds)
const T & NullObjectRef() noexcept
Const reference (of type T) to the nullObject.
Definition nullObject.H:228
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
uint8_t direction
Definition direction.H:49
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
const direction noexcept
Definition scalarImpl.H:265
UList< label > labelUList
A UList of labels.
Definition UList.H:75
Various functors for unary and binary operations. Can be used for parallel combine-reduce operations ...
labelList f(nPoints)
dictionary dict
volScalarField & e
A non-counting (dummy) refCount.
Definition refCount.H:55