Loading...
Searching...
No Matches
Field.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) 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
27\*---------------------------------------------------------------------------*/
28
29#include "FieldMapper.H"
30#include "FieldM.H"
31#include "dictionary.H"
32#include "mapDistributeBase.H"
33
34// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35
36template<class Type>
38(
39 const UList<Type>& mapF,
40 const labelUList& mapAddressing
41)
42:
43 List<Type>(mapAddressing.size())
44{
45 map(mapF, mapAddressing);
46}
47
48
49template<class Type>
51(
52 const tmp<Field<Type>>& tmapF,
53 const labelUList& mapAddressing
54)
55:
56 List<Type>(mapAddressing.size())
57{
58 map(tmapF, mapAddressing);
59}
60
61
62template<class Type>
64(
65 const UList<Type>& mapF,
66 const labelListList& mapAddressing,
67 const scalarListList& mapWeights
68)
69:
70 List<Type>(mapAddressing.size())
71{
72 map(mapF, mapAddressing, mapWeights);
73}
74
75
76template<class Type>
78(
79 const tmp<Field<Type>>& tmapF,
80 const labelListList& mapAddressing,
81 const scalarListList& mapWeights
82)
83:
84 List<Type>(mapAddressing.size())
85{
86 map(tmapF, mapAddressing, mapWeights);
87}
88
89
90template<class Type>
92(
93 const UList<Type>& mapF,
94 const FieldMapper& mapper,
95 const bool applyFlip
96)
97:
98 List<Type>(mapper.size())
99{
100 map(mapF, mapper, applyFlip);
101}
102
103
104template<class Type>
106(
107 const UList<Type>& mapF,
108 const FieldMapper& mapper,
109 const Type& defaultValue,
110 const bool applyFlip
111)
112:
113 List<Type>(mapper.size(), defaultValue)
114{
115 map(mapF, mapper, applyFlip);
116}
117
118
119template<class Type>
121(
122 const UList<Type>& mapF,
123 const FieldMapper& mapper,
124 const UList<Type>& defaultValues,
125 const bool applyFlip
126)
127:
128 List<Type>(defaultValues)
129{
130 map(mapF, mapper, applyFlip);
131}
132
133
134template<class Type>
136(
137 const tmp<Field<Type>>& tmapF,
138 const FieldMapper& mapper,
139 const bool applyFlip
140)
141:
142 List<Type>(mapper.size())
143{
144 map(tmapF, mapper, applyFlip);
145}
146
147
148template<class Type>
150(
151 const tmp<Field<Type>>& tmapF,
152 const FieldMapper& mapper,
153 const Type& defaultValue,
154 const bool applyFlip
155)
156:
157 List<Type>(mapper.size(), defaultValue)
158{
159 map(tmapF, mapper, applyFlip);
160}
161
162
163template<class Type>
165(
166 const tmp<Field<Type>>& tmapF,
167 const FieldMapper& mapper,
168 const UList<Type>& defaultValues,
169 const bool applyFlip
170)
171:
172 List<Type>(defaultValues)
173{
174 map(tmapF, mapper, applyFlip);
175}
176
177
178template<class Type>
179Foam::Field<Type>::Field(const entry& e, const label len)
180{
182}
183
184
185template<class Type>
187(
188 const word& key,
189 const dictionary& dict,
190 const label len,
192)
193{
194 if (!Field<Type>::assign(key, dict, len, readOpt))
195 {
197 {
198 // Lazy read: init with zero value
199 if (len > 0) this->resize(len, Zero);
200 }
201 else
202 {
203 // No read: set length only
204 if (len > 0) this->resize(len);
205 }
207}
208
209
210// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
211
212template<class Type>
213void Foam::Field<Type>::assign(const entry& e, const label len)
214{
215 if (len)
216 {
217 ITstream& is = e.stream();
218
219 // Read first token
220 token firstToken(is);
221
222 if (firstToken.isWord("uniform"))
223 {
224 // Resize to expected length (or -1 : retain current length)
225 if (len >= 0)
226 {
227 this->resize_nocopy(len);
228 }
229 operator=(pTraits<Type>(is));
230 }
231 else if (firstToken.isWord("nonuniform"))
232 {
233 is >> static_cast<List<Type>&>(*this);
234 const label lenRead = this->size();
235
236 // Check lengths
237 if (len >= 0 && len != lenRead)
238 {
239 if (len < lenRead && FieldBase::allowConstructFromLargerSize)
240 {
241 // Truncate the data
242 this->resize(len);
243
244 #ifdef FULLDEBUG
246 << "Sizes do not match. Truncating " << lenRead
247 << " entries to " << len << endl;
248 #endif
249 }
250 else
251 {
253 << "Size " << lenRead
254 << " is not equal to the expected length " << len
255 << exit(FatalIOError);
256 }
257 }
258 }
259 else
260 {
262 << "Expected keyword 'uniform' or 'nonuniform', found "
263 << firstToken.info() << nl
265 }
266 }
267}
268
269
270template<class Type>
272(
273 const word& key,
274 const dictionary& dict,
275 const label len,
276 IOobjectOption::readOption readOpt
277)
278{
279 if (!len)
280 {
281 return true;
282 }
283 else if (readOpt != IOobjectOption::NO_READ)
284 {
285 const entry* eptr = dict.findEntry(key, keyType::LITERAL);
286
287 if (eptr)
288 {
289 Field<Type>::assign(*eptr, len);
290 return true;
291 }
292
293 // Missing (mandatory or optional)
294 if (IOobjectOption::isReadRequired(readOpt))
295 {
297 << "Required entry '" << key << "' missing in dictionary "
298 << dict.relativeName() << nl
299 << exit(FatalIOError);
300 }
302
303 return false;
304}
305
306
307template<class Type>
309(
310 const UList<Type>& mapF,
311 const labelUList& mapAddressing
312)
313{
314 Field<Type>& f = *this;
315
316 if (f.size() != mapAddressing.size())
317 {
318 f.resize(mapAddressing.size());
319 }
320
321 if (mapF.size() > 0)
322 {
323 forAll(f, i)
324 {
325 const label mapI = mapAddressing[i];
326
327 if (mapI >= 0)
328 {
329 f[i] = mapF[mapI];
331 }
332 }
333}
334
335
336template<class Type>
338(
339 const tmp<Field<Type>>& tmapF,
340 const labelUList& mapAddressing
341)
343 map(tmapF(), mapAddressing);
344 tmapF.clear();
345}
346
347
348template<class Type>
350(
351 const UList<Type>& mapF,
352 const labelListList& mapAddressing,
353 const scalarListList& mapWeights
354)
355{
356 Field<Type>& f = *this;
357
358 if (f.size() != mapAddressing.size())
359 {
360 f.resize(mapAddressing.size());
361 }
362
363 if (mapWeights.size() != mapAddressing.size())
364 {
366 << mapWeights.size() << " map size: " << mapAddressing.size()
367 << abort(FatalError);
368 }
369
370 forAll(f, i)
371 {
372 const labelList& localAddrs = mapAddressing[i];
373 const scalarList& localWeights = mapWeights[i];
374
375 f[i] = Zero;
376
377 forAll(localAddrs, j)
378 {
379 f[i] += localWeights[j]*mapF[localAddrs[j]];
380 }
381 }
382}
383
384
385template<class Type>
387(
388 const tmp<Field<Type>>& tmapF,
389 const labelListList& mapAddressing,
390 const scalarListList& mapWeights
391)
393 map(tmapF(), mapAddressing, mapWeights);
394 tmapF.clear();
395}
396
397
398template<class Type>
400(
401 const UList<Type>& mapF,
402 const FieldMapper& mapper,
403 const bool applyFlip
404)
405{
406 if (mapper.distributed())
407 {
408 // Fetch remote parts of mapF
409 const mapDistributeBase& distMap = mapper.distributeMap();
410 Field<Type> newMapF(mapF);
411
412 if (applyFlip)
413 {
414 distMap.distribute(newMapF);
415 }
416 else
417 {
418 distMap.distribute(newMapF, identityOp());
419 }
420
421 if (mapper.direct() && notNull(mapper.directAddressing()))
422 {
423 map(newMapF, mapper.directAddressing());
424 }
425 else if (!mapper.direct())
426 {
427 map(newMapF, mapper.addressing(), mapper.weights());
428 }
429 else if (mapper.direct() && isNull(mapper.directAddressing()))
430 {
431 // Special case, no local mapper. Assume ordering already correct
432 // from distribution. Note: this behaviour is different compared
433 // to local mapper.
434 this->transfer(newMapF);
435 this->resize(mapper.size());
436 }
437 }
438 else
439 {
440 if
441 (
442 mapper.direct()
443 && notNull(mapper.directAddressing())
444 && mapper.directAddressing().size()
445 )
446 {
447 map(mapF, mapper.directAddressing());
448 }
449 else if (!mapper.direct() && mapper.addressing().size())
450 {
451 map(mapF, mapper.addressing(), mapper.weights());
452 }
453 }
454}
455
456
457template<class Type>
459(
460 const tmp<Field<Type>>& tmapF,
461 const FieldMapper& mapper,
462 const bool applyFlip
463)
465 map(tmapF(), mapper, applyFlip);
466 tmapF.clear();
467}
468
469
470template<class Type>
472(
473 const FieldMapper& mapper,
474 const bool applyFlip
476{
477 if (mapper.distributed())
478 {
479 // Fetch remote parts of *this
480 const mapDistributeBase& distMap = mapper.distributeMap();
481 Field<Type> fCpy(*this);
482
483 if (applyFlip)
484 {
485 distMap.distribute(fCpy);
486 }
487 else
488 {
489 distMap.distribute(fCpy, identityOp());
490 }
491
492 if
493 (
494 (mapper.direct()
495 && notNull(mapper.directAddressing()))
496 || !mapper.direct()
497 )
498 {
499 this->map(fCpy, mapper);
500 }
501 else if (mapper.direct() && isNull(mapper.directAddressing()))
502 {
503 // Special case, no local mapper. Assume ordering already correct
504 // from distribution. Note: this behaviour is different compared
505 // to local mapper.
506 this->transfer(fCpy);
507 this->resize(mapper.size());
508 }
509 }
510 else
511 {
512 if
513 (
514 (
515 mapper.direct()
516 && notNull(mapper.directAddressing())
517 && mapper.directAddressing().size()
518 )
519 || (!mapper.direct() && mapper.addressing().size())
520 )
521 {
522 Field<Type> fCpy(*this);
523 map(fCpy, mapper);
524 }
525 else
526 {
527 this->resize(mapper.size());
528 }
529 }
530}
531
532
533template<class Type>
535(
536 const UList<Type>& mapF,
537 const labelUList& mapAddressing
538)
539{
540 Field<Type>& f = *this;
541
542 forAll(mapF, i)
543 {
544 label mapI = mapAddressing[i];
545
546 if (mapI >= 0)
547 {
548 f[mapI] = mapF[i];
549 }
550 }
551}
552
553
554template<class Type>
556(
557 const tmp<Field<Type>>& tmapF,
558 const labelUList& mapAddressing
559)
561 rmap(tmapF(), mapAddressing);
562 tmapF.clear();
563}
564
565
566template<class Type>
568(
569 const UList<Type>& mapF,
570 const labelUList& mapAddressing,
571 const UList<scalar>& mapWeights
572)
573{
574 Field<Type>& f = *this;
575
576 f = Zero;
577
578 forAll(mapF, i)
580 f[mapAddressing[i]] += mapF[i]*mapWeights[i];
581 }
583
584
585template<class Type>
587(
588 const tmp<Field<Type>>& tmapF,
589 const labelUList& mapAddressing,
590 const UList<scalar>& mapWeights
591)
593 rmap(tmapF(), mapAddressing, mapWeights);
594 tmapF.clear();
595}
597
598template<class Type>
601 TFOR_ALL_F_OP_OP_F(Type, *this, =, -, Type, *this)
602}
603
604
605// A no-op except for vector specialization
606template<class Type>
608{}
609
610
611template<class Type>
614(
615 const direction d
616) const
617{
618 auto tres = tmp<Field<cmptType>>::New(this->size());
619 ::Foam::component(tres.ref(), *this, d);
620 return tres;
621}
622
623
624template<class Type>
627 const direction d,
628 const UList<cmptType>& sf
629)
631 TFOR_ALL_F_OP_FUNC_S_F(Type, *this, ., replace, const direction, d,
632 cmptType, sf)
633}
634
635
636template<class Type>
639 const direction d,
640 const tmp<Field<cmptType>>& tsf
641)
643 replace(d, tsf());
644 tsf.clear();
645}
646
647
648template<class Type>
650(
651 const direction d,
652 const cmptType& c
655 TFOR_ALL_F_OP_FUNC_S_S(Type, *this, ., replace, const direction, d,
656 cmptType, c)
657}
659
660template<class Type>
661void Foam::Field<Type>::clamp_min(const Type& lower)
662{
663 // Use free function max() [sic] to impose component-wise clamp_min
664 // std::for_each
665 for (auto& val : *this)
667 val = max(val, lower);
668 }
669}
670
671
672template<class Type>
673void Foam::Field<Type>::clamp_max(const Type& upper)
674{
675 // Use free function min() [sic] to impose component-wise clamp_max
676 // std::for_each
677 for (auto& val : *this)
679 val = min(val, upper);
680 }
681}
682
683
684template<class Type>
685void Foam::Field<Type>::clamp_min(const UList<Type>& lower)
686{
687 // Use free function max() [sic] to impose component-wise clamp_min
688 std::transform
689 (
690 // Can use (std::execution::par_unseq | std::execution::unseq)
691 this->begin(),
692 // this->end() but with some extra range safety
693 this->begin(lower.size()),
694 lower.begin(),
695 this->begin(),
697 );
698}
699
700
701template<class Type>
703{
704 // Use free function min() [sic] to impose component-wise clamp_max
705 std::transform
706 (
707 // Can use (std::execution::par_unseq | std::execution::unseq)
708 this->begin(),
709 // this->end() but with some extra range safety
710 this->begin(upper.size()),
711 upper.begin(),
712 this->begin(),
714 );
715}
716
717
718template<class Type>
719void Foam::Field<Type>::clamp_range(const Type& lower, const Type& upper)
720{
721 // Note: no checks for bad/invalid clamping ranges
722
723 // Use free functions min(), max() to impose component-wise clamping
724 // std::for_each
725 for (auto& val : *this)
727 val = min(max(val, lower), upper);
728 }
730
731template<class Type>
736
737
738template<class Type>
739template<class VSForm>
740VSForm Foam::Field<Type>::block(const label start) const
741{
742 VSForm vs;
743 for (direction i=0; i<VSForm::nComponents; i++)
744 {
745 vs[i] = this->operator[](start + i);
746 }
747 return vs;
748}
749
750
751template<class Type>
753{
754 auto tres = tmp<Field<Type>>::New(this->size());
755 ::Foam::T(tres.ref(), *this);
756 return tres;
757}
758
759
760template<class Type>
761void Foam::Field<Type>::writeEntry(const word& keyword, Ostream& os) const
762{
763 if (keyword.size())
764 {
765 os.writeKeyword(keyword);
766 }
767
768 // The contents are 'uniform' if the list is non-empty
769 // and all entries have identical values.
770
771 if (is_contiguous_v<Type> && List<Type>::uniform())
772 {
773 os << word("uniform") << token::SPACE << List<Type>::front();
774 }
775 else
776 {
777 os << word("nonuniform") << token::SPACE;
778 List<Type>::writeEntry(os);
779 }
780
781 os.endEntry();
782}
783
784
785// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
786
787template<class Type>
789{
790 if (this == &rhs)
791 {
792 return; // Self-assignment is a no-op
794
796}
797
798
799template<class Type>
800void Foam::Field<Type>::operator=(const tmp<Field>& rhs)
801{
802 if (this == &(rhs()))
803 {
804 return; // Self-assignment is a no-op
805 }
808}
809
810
811template<class Type>
812template<class Form, class Cmpt, Foam::direction nCmpt>
813void Foam::Field<Type>::operator=(const VectorSpace<Form,Cmpt,nCmpt>& vs)
814{
815 TFOR_ALL_F_OP_S(Type, *this, =, VSType, vs)
816}
817
818
819#define COMPUTED_ASSIGNMENT(TYPE, op) \
820 \
821template<class Type> \
822void Foam::Field<Type>::operator op(const UList<TYPE>& f) \
823{ \
824 TFOR_ALL_F_OP_F(Type, *this, op, TYPE, f) \
825} \
826 \
827template<class Type> \
828void Foam::Field<Type>::operator op(const tmp<Field<TYPE>>& tf) \
829{ \
830 operator op(tf()); \
831 tf.clear(); \
832} \
834template<class Type> \
835void Foam::Field<Type>::operator op(const TYPE& t) \
836{ \
837 TFOR_ALL_F_OP_S(Type, *this, op, TYPE, t) \
838}
839
840COMPUTED_ASSIGNMENT(Type, +=)
841COMPUTED_ASSIGNMENT(Type, -=)
842COMPUTED_ASSIGNMENT(scalar, *=)
843COMPUTED_ASSIGNMENT(scalar, /=)
844
845#undef COMPUTED_ASSIGNMENT
846
847
848// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
849
850template<class Type>
852{
854 return os;
855}
856
857
858template<class Type>
860{
861 os << tf();
862 tf.clear();
863 return os;
864}
865
866
867// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
868
869#include "FieldFunctions.C"
870
871// ************************************************************************* //
#define COMPUTED_ASSIGNMENT(TYPE, op)
Declaration macros for Field<Type> algebra.
#define TFOR_ALL_F_OP_OP_F(typeF1, f1, OP1, OP2, typeF2, f2)
Definition FieldM.H:480
#define TFOR_ALL_F_OP_S(typeF, f, OP, typeS, s)
Definition FieldM.H:502
#define TFOR_ALL_F_OP_FUNC_S_S(typeF1, f1, OP, FUNC, typeS1, s1, typeS2, s2)
Definition FieldM.H:299
#define TFOR_ALL_F_OP_FUNC_S_F(typeF1, f1, OP, FUNC, typeS, s, typeF2, f2)
Definition FieldM.H:277
#define COMPUTED_ASSIGNMENT(TYPE, op)
Definition Field.C:812
scalar range
static bool allowConstructFromLargerSize
Permit read construct from a larger size.
Definition Field.H:100
Abstract base class to hold the Field mapping addressing and weights.
Definition FieldMapper.H:44
virtual bool direct() const =0
Is it a direct (non-interpolating) mapper?
virtual const labelUList & directAddressing() const
Return the direct addressing values.
Definition FieldMapper.H:91
virtual const scalarListList & weights() const
Return the interpolation weights.
virtual label size() const =0
The size of the mapper.
virtual bool distributed() const
Does the mapper have remote contributions?
Definition FieldMapper.H:76
virtual const labelListList & addressing() const
Return the interpolation addressing.
virtual const mapDistributeBase & distributeMap() const
Return the distribution map.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
static autoPtr< Field< Type > > New(Istream &is)
Return a pointer to a new Field created on freestore.
Definition Field.H:421
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors).
Definition Field.C:745
void operator=(const Field< Type > &)
Copy assignment.
Definition Field.C:781
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 clamp_min(const Type &lower)
Impose lower (floor) clamp on the field values (in-place).
Definition Field.C:654
pTraits< Type >::cmptType cmptType
Component type.
Definition Field.H:178
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
Definition Field.C:754
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
Definition Field.C:619
constexpr Field() noexcept
Default construct.
Definition FieldI.H:24
void assign(const entry &e, const label len)
Assign from a primitive dictionary entry with the following behaviour:
Definition Field.C:206
void negate()
Inplace negate this field (negative).
Definition Field.C:592
void clamp_max(const Type &upper)
Impose upper (ceiling) clamp on the field values (in-place).
Definition Field.C:666
void map(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 map from the given field
Definition Field.C:302
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)
1 to 1 reverse-map from the given field
Definition Field.C:528
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
Definition Field.C:607
VSForm block(const label start) const
Definition Field.C:733
static bool isReadOptional(readOption opt) noexcept
True if (LAZY_READ) bits are set [same as READ_IF_PRESENT].
static bool isReadRequired(readOption opt) noexcept
True if (MUST_READ | READ_MODIFIED) bits are set.
readOption
Enumeration defining read preferences.
@ NO_READ
Nothing to be read.
An input stream of tokens.
Definition ITstream.H:56
void transfer(List< Type > &list)
void resize_nocopy(const label len)
void operator=(const UList< T > &list)
Assignment to UList operator. Takes linear time.
Definition List.C:381
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
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
iterator begin() noexcept
Definition UListI.H:410
bool uniform() const
True if all entries have identical values, and list is non-empty.
Definition UListI.H:217
void writeEntry(Ostream &os) const
Write the UList with its compound type.
Definition UListIO.C:29
void size(const label n)
Definition UList.H:118
TypeGrad & operator[](const label i)
Definition UListI.H:363
Templated vector space.
Definition VectorSpace.H:75
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
@ LITERAL
String literal.
Definition keyType.H:82
Class containing processor-to-processor mapping information.
static void distribute(const UPstream::commsTypes commsType, const UList< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &field, const T &nullValue, const CombineOp &cop, const NegateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Distribute combine data with specified combine operation and negate operator (for flips).
A traits class, which is primarily used for primitives and vector-space.
Definition pTraits.H:64
A class for managing temporary objects.
Definition tmp.H:75
A token holds an item read from Istream.
Definition token.H:70
@ SPACE
Space [isspace].
Definition token.H:144
bool isWord() const noexcept
Token is word-variant (WORD, DIRECTIVE).
Definition tokenI.H:1004
InfoProxy< token > info() const noexcept
Return info proxy, for printing token information to a stream.
Definition token.H:1253
A class for handling words, derived from Foam::string.
Definition word.H:66
patchWriters resize(patchIds.size())
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition error.H:629
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition error.H:600
OBJstream os(runTime.globalPath()/outputName)
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
constexpr auto key(const Type &t) noexcept
Helper function to return the enum value.
List< scalarList > scalarListList
List of scalarList.
Definition scalarList.H:35
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition hashSets.C:40
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< label > labelList
A List of labels.
Definition List.H:62
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition hashSets.C:26
errorManip< error > abort(error &err)
Definition errorManip.H:139
uint8_t direction
Definition direction.H:49
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
constexpr bool is_contiguous_v
The is_contiguous value of Type (after stripping of qualifiers).
Definition contiguous.H:77
bool notNull(const T *ptr) noexcept
True if ptr is not a pointer (of type T) to the nullObject.
Definition nullObject.H:267
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition errorManip.H:125
UList< label > labelUList
A UList of labels.
Definition UList.H:75
List< scalar > scalarList
List of scalar.
Definition scalarList.H:32
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
bool isNull(const T *ptr) noexcept
True if ptr is a pointer (of type T) to the nullObject.
Definition nullObject.H:248
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
labelList f(nPoints)
dictionary dict
volScalarField & e
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299
A functor that returns its argument unchanged (cf. C++20 std::identity) Should never be specialized.
Definition stdFoam.H:108