exprResult.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) 2012-2018 Bernhard Gschaider
9  Copyright (C) 2019-2022 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 \*---------------------------------------------------------------------------*/
28 
29 #include "exprResult.H"
30 #include "vector.H"
31 #include "tensor.H"
32 #include "symmTensor.H"
33 #include "sphericalTensor.H"
34 #include "Switch.H"
36 
37 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
38 
39 namespace Foam
40 {
41 namespace expressions
42 {
43  defineTypeNameAndDebug(exprResult,0);
44 
45  defineRunTimeSelectionTable(exprResult, dictionary);
46  defineRunTimeSelectionTable(exprResult, empty);
47 
48  addToRunTimeSelectionTable(exprResult, exprResult, dictionary);
49  addToRunTimeSelectionTable(exprResult, exprResult, empty);
50 
51 } // End namespace expressions
52 } // End namespace Foam
53 
54 
56 
57 
58 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
59 
60 bool Foam::expressions::exprResult::setAverageValueCheckedBool
61 (
62  const bool parRun
63 )
64 {
65  typedef bool Type;
66 
67  if (!isType<Type>())
68  {
69  return false;
70  }
71 
72  const Field<Type>& fld = *static_cast<const Field<Type>*>(fieldPtr_);
73  label len = fld.size();
74 
75  // The average of a bool is slightly dodgy
76 
77  label nTrue = 0;
78  for (const Type val : fld)
79  {
80  if (val)
81  {
82  ++nTrue;
83  }
84  }
85 
86  if (parRun)
87  {
88  reduce(nTrue, sumOp<label>());
89  }
90 
91  if (!nTrue)
92  {
93  isUniform_ = true;
94  single_.set(false);
95  return true;
96  }
97 
98  if (parRun)
99  {
100  reduce(len, sumOp<label>());
101  }
102 
103  if (nTrue == len)
104  {
105  isUniform_ = true;
106  single_.set(true);
107  }
108  else
109  {
110  isUniform_ = false;
111 
112  if (nTrue > len/2)
113  {
114  single_.set(true);
115  }
116  else
117  {
118  single_.set(false);
119  }
120  }
121 
122  return true;
123 }
124 
125 
126 bool Foam::expressions::exprResult::getUniformCheckedBool
127 (
128  exprResult& result,
129  const label size,
130  const bool noWarn,
131  const bool parRun
132 ) const
133 {
134  typedef bool Type;
135 
136  if (!isType<Type>())
137  {
138  return false;
139  }
140 
141  result.clear();
142 
143  const Field<Type>& fld = *static_cast<const Field<Type>*>(fieldPtr_);
144  label len = fld.size();
145 
146  // The average of a bool is slightly dodgy
147 
148  label nTrue = 0;
149  for (const Type val : fld)
150  {
151  if (val)
152  {
153  ++nTrue;
154  }
155  }
156 
157  if (parRun)
158  {
159  reduce(nTrue, sumOp<label>());
160  reduce(len, sumOp<label>());
161  }
162 
163  const Type avg = (nTrue > len/2);
164 
165  if (!noWarn)
166  {
167  // TODO?
168  }
169 
170  result.setResult<Type>(avg, size);
171 
172  return true;
173 }
174 
175 
176 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
177 
178 Foam::expressions::exprResult::singleValue::singleValue()
179 {
180  std::memset(static_cast<void*>(this), '\0', sizeof(*this));
181 }
182 
183 
184 Foam::expressions::exprResult::singleValue::singleValue
185 (
186  const singleValue& val
187 )
188 {
189  std::memcpy(static_cast<void*>(this), &val, sizeof(*this));
190 }
191 
192 
193 void Foam::expressions::exprResult::singleValue::operator=
194 (
195  const singleValue& val
196 )
197 {
198  if (this != &val)
199  {
200  // Self-assignment is a no-op
201  std::memcpy(static_cast<void*>(this), &val, sizeof(*this));
202  }
203 }
204 
205 
207 :
208  refCount(),
209  valType_(),
210  isUniform_(false),
211  isPointData_(false),
212  noReset_(false),
213  needsReset_(false),
214  size_(0),
215  single_(),
216  fieldPtr_(nullptr)
217 {
218  clear();
219 }
220 
221 
223 :
224  exprResult()
225 {
226  this->operator=(rhs);
227 }
228 
229 
231 :
233 {
234  this->operator=(std::move(rhs));
235 }
236 
237 
239 (
240  const dictionary& dict,
241  bool uniform,
242  bool needsValue
243 )
244 :
245  refCount(),
246  valType_(dict.getOrDefault<word>("valueType", "")),
247  isUniform_(dict.getOrDefault("isSingleValue", uniform)),
248  isPointData_(dict.getOrDefault("isPointValue", false)),
249  noReset_(dict.getOrDefault("noReset", false)),
250  needsReset_(false),
251  size_(0),
252  single_(),
253  fieldPtr_(nullptr)
254 {
255  DebugInFunction << nl;
256 
257  const auto* hasValue = dict.findEntry("value", keyType::LITERAL);
258 
259  if (hasValue)
260  {
261  const auto& valueEntry = *hasValue;
262  const bool uniform = isUniform_;
263 
264  const label len =
265  (
266  uniform
267  ? dict.getOrDefault<label>("fieldSize", 1)
268  : dict.get<label>("fieldSize")
269  );
270 
271  const bool ok =
272  (
273  // Just use <scalar> for <label>?
274  readChecked<scalar>(valueEntry, len, uniform)
275  || readChecked<vector>(valueEntry, len, uniform)
276  || readChecked<tensor>(valueEntry, len, uniform)
277  || readChecked<symmTensor>(valueEntry, len, uniform)
278  || readChecked<sphericalTensor>(valueEntry, len, uniform)
279  || readChecked<bool>(valueEntry, len, uniform)
280  );
281 
282  if (!ok)
283  {
284  if (valType_.empty())
285  {
286  // For error message only
287  valType_ = "none";
288  }
289 
291  << "Do not know how to read data type " << valType_
292  << (uniform ? " as a single value." : ".") << nl
293  << exit(FatalIOError);
294  }
295  }
296  else if (needsValue)
297  {
299  << "No entry 'value' defined" << nl
301  }
302 }
303 
304 
307 (
308  const dictionary& dict
309 )
310 {
311  const word resultType
312  (
313  dict.getOrDefault<word>("resultType", "exprResult")
314  );
315 
316  if (dict.getOrDefault("unsetValue", false))
317  {
318  auto* ctorPtr = emptyConstructorTable(resultType);
319 
320  if (!ctorPtr)
321  {
323  (
324  dict,
325  "resultType",
326  resultType,
327  *emptyConstructorTablePtr_
328  ) << exit(FatalIOError);
329  }
330 
331  DebugInfo
332  << "Creating unset result of type " << resultType << nl;
333 
334  return autoPtr<exprResult>(ctorPtr());
335  }
336 
337 
338  auto* ctorPtr = dictionaryConstructorTable(resultType);
339 
340  if (!ctorPtr)
341  {
343  (
344  dict,
345  "resultType",
346  resultType,
347  *dictionaryConstructorTablePtr_
348  ) << exit(FatalIOError);
349  }
350 
351  DebugInfo
352  << "Creating result of type " << resultType << nl;
354  return autoPtr<exprResult>(ctorPtr(dict));
355 }
356 
357 
360 (
361  Istream& is
362 )
363 {
365  return New(dict);
366 }
367 
368 
369 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
370 
372 {
373  DebugInFunction << nl;
375  uglyDelete();
376 }
377 
378 
379 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
382 {
383  clear();
384 }
385 
386 
388 {
389  if (force || !noReset_ || needsReset_)
390  {
391  this->resetImpl();
392  return true;
393  }
394 
395  return false;
396 }
397 
398 
400 {
401  uglyDelete();
402  valType_.clear();
403  size_ = 0;
404 }
405 
406 
407 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
408 
409 void Foam::expressions::exprResult::uglyDelete()
410 {
411  if (fieldPtr_)
412  {
413  const bool ok =
414  (
415  deleteChecked<scalar>()
416  || deleteChecked<vector>()
417  || deleteChecked<tensor>()
418  || deleteChecked<symmTensor>()
419  || deleteChecked<sphericalTensor>()
420  || deleteChecked<bool>()
421  );
422 
423  if (!ok)
424  {
426  << "Unknown type " << valType_
427  << " probable memory loss" << nl
428  << exit(FatalError);
429  }
430 
431  fieldPtr_ = nullptr;
432  size_ = 0;
433  }
434 }
435 
436 
439 (
440  const label size,
441  const bool noWarn,
442  const bool parRun
443 ) const
444 {
445  if (fieldPtr_ == nullptr)
446  {
448  << "Not set. Cannot construct uniform value" << nl
449  << exit(FatalError);
450  }
451 
452  exprResult ret;
453 
454  const bool ok =
455  (
456  getUniformChecked<scalar>(ret, size, noWarn, parRun)
457  || getUniformChecked<vector>(ret, size, noWarn, parRun)
458  || getUniformChecked<tensor>(ret, size, noWarn, parRun)
459  || getUniformChecked<symmTensor>(ret, size, noWarn, parRun)
460  || getUniformChecked<sphericalTensor>(ret, size, noWarn, parRun)
461  );
462 
463  if (!ok)
464  {
466  << "Cannot get uniform value for type " << valType_ << nl
468  }
469 
470  return ret;
471 }
472 
473 
475 {
476  if (fieldPtr_ == nullptr)
477  {
479  << "Not set - cannot determine if uniform" << nl << endl;
480  return;
481  }
482 
483  const bool ok =
484  (
485  setAverageValueChecked<scalar>(parRun)
486  || setAverageValueChecked<vector>(parRun)
487  || setAverageValueChecked<tensor>(parRun)
488  || setAverageValueChecked<symmTensor>(parRun)
489  || setAverageValueChecked<sphericalTensor>(parRun)
490  || setAverageValueCheckedBool(parRun)
491  );
492 
493  if (!ok)
494  {
496  << "Unknown type " << valType_ << nl << endl;
497  }
498 }
499 
500 
501 void Foam::expressions::exprResult::operator=(const exprResult& rhs)
502 {
503  if (this == &rhs)
504  {
505  return; // Self-assignment is a no-op
506  }
507 
508  DebugInFunction << "rhs:" << rhs << nl;
509 
510  clear();
511 
512  valType_ = rhs.valType_;
513  isUniform_ = rhs.isUniform_;
514  isPointData_ = rhs.isPointData_;
515  single_ = rhs.single_;
516 
517  if (rhs.fieldPtr_)
518  {
519  const bool ok =
520  (
521  duplicateFieldChecked<scalar>(rhs.fieldPtr_)
522  || duplicateFieldChecked<vector>(rhs.fieldPtr_)
523  || duplicateFieldChecked<tensor>(rhs.fieldPtr_)
524  || duplicateFieldChecked<symmTensor>(rhs.fieldPtr_)
525  || duplicateFieldChecked<sphericalTensor>(rhs.fieldPtr_)
526  || duplicateFieldChecked<bool>(rhs.fieldPtr_)
527  );
528 
529  if (!ok)
530  {
532  << " Type " << valType_ << " can not be copied" << nl
533  << exit(FatalError);
534  }
535  }
536 }
537 
538 
539 void Foam::expressions::exprResult::operator=(exprResult&& rhs)
540 {
541  if (this == &rhs)
542  {
543  return; // Self-assignment is a no-op
544  }
545 
546  clear();
547 
548  valType_ = rhs.valType_;
549  isUniform_ = rhs.isUniform_;
550  isPointData_ = rhs.isPointData_;
551  noReset_ = rhs.noReset_;
552  needsReset_ = rhs.needsReset_;
553  size_ = rhs.size_;
554 
555  single_ = rhs.single_;
556  fieldPtr_ = rhs.fieldPtr_;
558  rhs.fieldPtr_ = nullptr; // Took ownership of field pointer
559  rhs.clear();
560 }
561 
562 
564 (
565  const word& keyword,
566  Ostream& os
567 ) const
568 {
569  const bool ok =
570  (
571  writeEntryChecked<scalar>(keyword, os)
572  || writeEntryChecked<vector>(keyword, os)
573  || writeEntryChecked<tensor>(keyword, os)
574  || writeEntryChecked<symmTensor>(keyword, os)
575  || writeEntryChecked<sphericalTensor>(keyword, os)
576  || writeEntryChecked<bool>(keyword, os)
577  );
578 
579  if (!ok)
580  {
582  << "Unknown data type " << valType_ << endl;
583  }
584 }
585 
586 
588 (
589  Ostream& os,
590  const bool subDict
591 ) const
592 {
593  // const auto oldFmt = os.format(IOstreamOption::ASCII);
594 
596  << Foam::name(this) << nl
597  << "Format: "
598  << IOstreamOption::formatNames[os.format()] << nl;
599 
600  if (subDict)
601  {
602  os.beginBlock();
603  }
604 
605  os.writeEntry("resultType", valueType());
606  os.writeEntryIfDifferent<Switch>("noReset", false, noReset_);
607 
608  if (fieldPtr_ == nullptr)
609  {
610  os.writeEntry<Switch>("unsetValue", true);
611  }
612  else
613  {
614  os.writeEntry("valueType", valType_);
615 
616  os.writeEntryIfDifferent<Switch>("isPointValue", false, isPointData_);
617  os.writeEntry<Switch>("isSingleValue", isUniform_);
618 
619  this->writeField(os, "value");
620  }
621 
622  if (subDict)
623  {
624  os.endBlock();
625  }
626 
627  // os.format(oldFmt);
628 }
629 
630 
632 (
633  Ostream& os,
634  const word& keyword
635 ) const
636 {
637  // const auto oldFmt = os.format(IOstreamOption::ASCII);
638 
640  << Foam::name(this) << nl
641  << "Format: "
642  << IOstreamOption::formatNames[os.format()] << nl;
643 
644  const bool ok =
645  (
646  writeFieldChecked<scalar>(keyword, os)
647  || writeFieldChecked<vector>(keyword, os)
648  || writeFieldChecked<tensor>(keyword, os)
649  || writeFieldChecked<symmTensor>(keyword, os)
650  || writeFieldChecked<sphericalTensor>(keyword, os)
651  || writeFieldChecked<label>(keyword, os)
652  || writeFieldChecked<bool>(keyword, os)
653  );
654 
655  if (!ok)
656  {
658  << "Unknown data type " << valType_ << endl;
659  }
660 }
661 
662 
664 (
665  Ostream& os
666 ) const
667 {
668  // const auto oldFmt = os.format(IOstreamOption::ASCII);
669 
671  << Foam::name(this) << nl
672  << "Format: "
673  << IOstreamOption::formatNames[os.format()] << nl;
674 
675  const bool ok =
676  (
677  writeSingleValueChecked<scalar>(os)
678  || writeSingleValueChecked<vector>(os)
679  || writeSingleValueChecked<tensor>(os)
680  || writeSingleValueChecked<symmTensor>(os)
681  || writeSingleValueChecked<sphericalTensor>(os)
682  || writeSingleValueChecked<label>(os)
683  || writeSingleValueChecked<bool>(os)
684  );
685 
686  if (!ok)
687  {
689  << "Unknown data type " << valType_ << endl;
690  }
691 }
692 
693 
694 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
695 
697 Foam::expressions::exprResult::operator*=
698 (
699  const scalar& b
700 )
701 {
702  if (!fieldPtr_)
703  {
705  << "Can not multiply. Unallocated field of type" << valType_ << nl
706  << exit(FatalError);
707  }
708 
709  const bool ok =
710  (
711  multiplyEqChecked<scalar>(b)
712  || multiplyEqChecked<vector>(b)
713  || multiplyEqChecked<tensor>(b)
714  || multiplyEqChecked<symmTensor>(b)
715  || multiplyEqChecked<sphericalTensor>(b)
716  );
717 
718  if (!ok)
719  {
721  << "Can not multiply field of type "
722  << valType_ << nl
723  << exit(FatalError);
724  }
726  return *this;
727 }
728 
729 
731 Foam::expressions::exprResult::operator+=
732 (
733  const exprResult& b
734 )
735 {
736  if (!fieldPtr_)
737  {
739  << "Can not add. Unallocated field of type " << valType_ << nl
740  << exit(FatalError);
741  }
742 
743  if (this->size() != b.size())
744  {
746  << "Different sizes " << this->size() << " and " << b.size() << nl
747  << exit(FatalError);
748  }
749 
750  const bool ok =
751  (
752  plusEqChecked<scalar>(b)
753  || plusEqChecked<vector>(b)
754  || plusEqChecked<tensor>(b)
755  || plusEqChecked<symmTensor>(b)
756  || plusEqChecked<sphericalTensor>(b)
757  );
758 
759  if (!ok)
760  {
762  << "Can not add Field-type exprResult of type"
763  << valType_ << nl
764  << exit(FatalError);
765  }
766 
767  return *this;
768 }
769 
770 
771 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
772 
773 Foam::Istream& Foam::operator>>
774 (
775  Istream& is,
776  expressions::exprResult& data
777 )
778 {
779  dictionary dict(is);
780 
782 
783  return is;
784 }
785 
786 
787 Foam::Ostream& Foam::operator<<
788 (
789  Ostream& os,
790  const expressions::exprResult& data
791 )
792 {
793  data.writeDict(os);
794 
795  return os;
796 }
797 
798 
799 Foam::expressions::exprResult Foam::operator*
800 (
801  const scalar& a,
802  const expressions::exprResult& b
803 )
804 {
805  expressions::exprResult result(b);
806  return result *= a;
807 }
808 
809 
810 Foam::expressions::exprResult Foam::operator*
811 (
812  const expressions::exprResult& a,
813  const scalar& b
814 )
815 {
816  expressions::exprResult result(a);
817  result *= b;
818 
819  return result;
820 }
821 
822 
823 Foam::expressions::exprResult Foam::operator+
824 (
825  const expressions::exprResult& a,
826  const expressions::exprResult& b
827 )
828 {
830  result += b;
831 
832  return result;
833 }
834 
835 
837 {
838  #undef defineExpressionMethod
839  #define defineExpressionMethod(Type) \
840  if (isType<Type>()) \
841  { \
842  return static_cast<Field<Type>*>(fieldPtr_)->cdata(); \
843  }
844 
845  defineExpressionMethod(scalar);
850 
851  #undef defineExpressionMethod
852 
854  << "Unsupported type" << valType_ << nl
855  << exit(FatalError);
856 
857  return nullptr;
858 }
859 
860 
861 // ************************************************************************* //
bool hasValue() const
Has a value?
Definition: exprResultI.H:220
void writeValue(Ostream &os) const
Write the single value, or the first value from field.
Definition: exprResult.C:657
dictionary dict
defineTypeNameAndDebug(fvExprDriver, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
Reference counter for various OpenFOAM components.
Definition: refCount.H:44
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:120
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:578
A polymorphic field/result from evaluating an expression.
Definition: exprResult.H:120
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:49
static const Enum< streamFormat > formatNames
Stream format names (ascii, binary)
void clear()
Clear (zero) the result.
Definition: exprResult.C:392
defineRunTimeSelectionTable(fvExprDriver, dictionary)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:487
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.
virtual ~exprResult()
Destructor.
Definition: exprResult.C:364
bool writeField(ensightOutput::floatBufferType &scratch, ensightFile &os, const Field< Type > &fld, const ensightCells &part, bool parallel)
Write a field of cell values as an indirect list, using the cell ids from ensightCells.
Macros for easy insertion into run-time selection tables.
const void * dataAddress() const
The address of the field data content.
Definition: exprResult.C:829
static autoPtr< exprResult > New(const dictionary &dict)
Return a reference to the selected value driver.
Definition: exprResult.C:300
void writeField(Ostream &os, const word &keyword="") const
Write the field, optionally as an entry.
Definition: exprResult.C:625
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:52
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
A class for handling words, derived from Foam::string.
Definition: word.H:63
#define DebugInFunction
Report an information message using Foam::Info.
exprResult getUniform(const label size, const bool noWarn, const bool parRun=Pstream::parRun()) const
Construct a uniform field from the current results.
Definition: exprResult.C:432
exprResult()
Default construct.
Definition: exprResult.C:199
#define defineExpressionMethod(Type)
patchWriters clear()
String literal.
Definition: keyType.H:82
#define DebugInfo
Report an information message using Foam::Info.
void testIfSingleValue(const bool parRun=Pstream::parRun())
Test if field corresponds to a single-value and thus uniform.
Definition: exprResult.C:467
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:55
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
Database for solution data, solver performance and other reduced data.
Definition: data.H:52
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
addToRunTimeSelectionTable(exprResult, exprResult, dictionary)
#define WarningInFunction
Report a warning using Foam::Warning.
bool reset(bool force=false)
Reset at new timestep according to type.
Definition: exprResult.C:380
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:607
virtual void operator=(const exprResult &rhs)
Copy assignment.
Definition: exprResult.C:494
static const exprResult null
An empty result.
Definition: exprResult.H:391
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
void writeEntry(const word &keyword, Ostream &os) const
Forwarding to Field::writeEntry.
Definition: exprResult.C:557
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
void writeDict(Ostream &os, const bool subDict=true) const
Write entry as dictionary contents.
Definition: exprResult.C:581
Tensor of scalars, i.e. Tensor<scalar>.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:615
virtual void resetImpl()
Reset at new timestep according to the derived class type.
Definition: exprResult.C:374
Namespace for OpenFOAM.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL IO ERROR&#39; header text and ...