dimensionedType.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "dimensionedType.H"
27 #include "pTraits.H"
28 #include "dictionary.H"
29 #include "units.H"
30 #include "printDictionary.H"
31 
32 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
33 
34 template<class Type>
36 (
37  const word& name,
38  const unitSet& defaultUnits,
39  Istream& is
40 )
41 {
42  token nextToken(is);
43 
44  // Set the name using the argument, if specified, or read it from the
45  // stream if it is present. If neither are, then it will be set to a word
46  // representation of the value lower down.
47  if (!name.empty())
48  {
49  name_ = name;
50  }
51  else if (nextToken.isWord())
52  {
53  name_ = nextToken.wordToken();
54  }
55  else
56  {
57  name_ = word::null;
58  }
59 
60  // Put the token back if it wasn't the name
61  if (!nextToken.isWord())
62  {
63  is.putBack(nextToken);
64  }
65 
66  // Read the units if they are before the value
67  unitSet units(defaultUnits);
68  const bool haveUnits = units.readIfPresent(is);
69 
70  // Read the value
71  value_ = pTraits<Type>(is);
72 
73  // Read the units if they are after the value
74  if (!haveUnits && !is.eof())
75  {
76  units.readIfPresent(is);
77  }
78 
79  // Set the name
80  if (name_.empty())
81  {
82  name_ = Foam::name(value_);
83  }
84 
85  // Set the dimensions
86  dimensions_.reset(units.dimensions());
87 
88  // Modify the value by the unit conversion
89  units.makeStandard(value_);
90 }
91 
92 
93 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
94 
95 template<class Type>
97 :
98  name_("NaN"),
99  dimensions_(dimless),
100  value_(pTraits<Type>::nan)
101 {}
102 
103 
104 template<class Type>
106 (
107  const word& name,
108  const dimensionSet& dims,
109  const Type& t
110 )
111 :
112  name_(name),
113  dimensions_(dims),
114  value_(t)
115 {}
116 
117 
118 template<class Type>
120 :
121  name_(::Foam::name(t)),
122  dimensions_(dims),
123  value_(t)
124 {}
125 
126 
127 template<class Type>
129 :
130  name_(::Foam::name(t)),
131  dimensions_(dimless),
132  value_(t)
133 {}
134 
135 
136 template<class Type>
138 (
139  const word& name,
140  const dimensioned<Type>& dt
141 )
142 :
143  name_(name),
144  dimensions_(dt.dimensions_),
145  value_(dt.value_)
146 {}
147 
148 
149 template<class Type>
151 :
152  dimensions_(dimless)
153 {
154  initialise(word::null, units::any, is);
155 }
156 
157 
158 template<class Type>
160 :
161  name_(name),
162  dimensions_(dimless)
163 {
164  initialise(name, units::any, is);
165 }
166 
167 
168 template<class Type>
170 (
171  const word& name,
172  const dimensionSet& dims,
173  Istream& is
174 )
175 :
176  name_(name),
177  dimensions_(dims),
178  value_(Zero)
179 {
180  initialise(name, dims, is);
181 }
182 
183 
184 template<class Type>
186 (
187  const word& name,
188  const unitSet& units,
190 )
191 :
192  name_(name),
193  dimensions_(units.dimensions()),
194  value_(Zero)
195 {
196  initialise(name, units, is);
197 }
198 
199 
200 template<class Type>
202 (
203  const word& name,
204  const dimensionSet& dims,
205  const dictionary& dict
206 )
207 :
208  name_(name),
209  dimensions_(dims),
210  value_(Zero)
211 {
212  initialise(name, dims, dict.lookup(name));
213 }
214 
215 
216 template<class Type>
218 (
219  const word& name,
220  const unitSet& units,
221  const dictionary& dict
222 )
223 :
224  name_(name),
225  dimensions_(units.dimensions()),
226  value_(Zero)
227 {
228  initialise(name, units, dict.lookup(name));
229 }
230 
231 
232 template<class Type>
234 (
235  const word& name,
236  const dimensionSet& dims,
237  const dictionary& dict,
238  const Type& defaultValue
239 )
240 :
241  name_(name),
242  dimensions_(dims),
243  value_(defaultValue)
244 {
245  if (dict.found(name))
246  {
247  initialise(name, dims, dict.lookup(name));
248  }
250  {
251  printDictionary::defaults(dict).add(name, defaultValue, true);
252  }
253 }
254 
255 
256 template<class Type>
258 (
259  const word& name,
260  const dictionary& dict,
261  const Type& defaultValue
262 )
263 :
264  dimensioned(name, dimless, dict, defaultValue)
265 {}
266 
267 
268 template<class Type>
270 (
271  const word& name,
272  const unitSet& units,
273  const dictionary& dict,
274  const Type& defaultValue
275 )
276 :
277  name_(name),
278  dimensions_(units.dimensions()),
279  value_(defaultValue)
280 {
281  if (dict.found(name))
282  {
283  initialise(name, units, dict.lookup(name));
284  }
286  {
287  printDictionary::defaults(dict).add(name, defaultValue, true);
288  }
289 }
290 
291 
292 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
293 
294 template<class Type>
296 {
297  return name_;
298 }
299 
300 template<class Type>
302 {
303  return name_;
304 }
305 
306 
307 template<class Type>
309 {
310  return dimensions_;
311 }
312 
313 template<class Type>
315 {
316  return dimensions_;
317 }
318 
319 
320 template<class Type>
322 {
323  return value_;
324 }
325 
326 template<class Type>
328 {
329  return value_;
330 }
331 
332 
333 template<class Type>
336 (
337  const direction d
338 ) const
339 {
340  return dimensioned<cmptType>
341  (
342  name_ + ".component(" + Foam::name(d) + ')',
343  dimensions_,
344  value_.component(d)
345  );
346 }
347 
348 
349 template<class Type>
351 (
352  const direction d,
353  const dimensioned<typename dimensioned<Type>::cmptType>& dc
354 )
355 {
356  dimensions_ = dc.dimensions();
357  value_.replace(d, dc.value());
358 }
359 
360 
361 template<class Type>
363 (
364  const dictionary& dict,
365  const unitSet& defaultUnits
366 )
367 {
368  initialise
369  (
370  name_,
371  isNull(defaultUnits) ? dimensions_ : defaultUnits,
372  dict.lookup(name_)
373  );
374 }
375 
376 
377 template<class Type>
379 (
380  const dictionary& dict,
381  const unitSet& defaultUnits
382 )
383 {
384  const entry* entryPtr = dict.lookupEntryPtr(name_, false, true);
385 
386  if (entryPtr)
387  {
388  initialise
389  (
390  name_,
391  isNull(defaultUnits) ? dimensions_ : defaultUnits,
392  entryPtr->stream()
393  );
394  return true;
395  }
396  else
397  {
398  return false;
399  }
400 }
401 
402 
403 template<class Type>
405 (
406  const dictionary& dict,
407  const Type& defaultValue,
408  const unitSet& defaultUnits
409 )
410 {
411  const entry* entryPtr = dict.lookupEntryPtr(name_, false, true);
412 
413  if (entryPtr)
414  {
415  initialise
416  (
417  name_,
418  isNull(defaultUnits) ? dimensions_ : defaultUnits,
419  entryPtr->stream()
420  );
421  }
422  else
423  {
424  value_ = defaultValue;
425  }
426 }
427 
428 
429 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
430 
431 template<class Type>
434 {
435  return component(d);
436 }
437 
438 
439 template<class Type>
441 {
442  dimensions_ += dt.dimensions_;
443  value_ += dt.value_;
444 }
445 
446 
447 template<class Type>
449 {
450  dimensions_ -= dt.dimensions_;
451  value_ -= dt.value_;
452 }
453 
454 
455 template<class Type>
457 {
458  value_ *= s;
459 }
460 
461 
462 template<class Type>
464 {
465  value_ /= s;
466 }
467 
468 
469 // * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
470 
471 template<class Type, Foam::direction r>
474 {
476  (
477  "pow(" + dt.name() + ',' + name(r) + ')',
478  pow(dt.dimensions(), r),
479  pow(dt.value(), 2)
480  );
481 }
482 
483 
484 template<class Type>
486 Foam::sqr(const dimensioned<Type>& dt)
487 {
489  (
490  "sqr(" + dt.name() + ')',
491  sqr(dt.dimensions()),
492  sqr(dt.value())
493  );
494 }
495 
496 
497 template<class Type>
498 Foam::dimensioned<Foam::scalar> Foam::magSqr(const dimensioned<Type>& dt)
499 {
500  return dimensioned<scalar>
501  (
502  "magSqr(" + dt.name() + ')',
503  magSqr(dt.dimensions()),
504  magSqr(dt.value())
505  );
506 }
507 
508 
509 template<class Type>
510 Foam::dimensioned<Foam::scalar> Foam::mag(const dimensioned<Type>& dt)
511 {
512  return dimensioned<scalar>
513  (
514  "mag(" + dt.name() + ')',
515  dt.dimensions(),
516  mag(dt.value())
517  );
518 }
519 
520 
521 template<class Type>
523 (
524  const dimensioned<Type>& dt1,
525  const dimensioned<Type>& dt2
526 )
527 {
528  return dimensioned<Type>
529  (
530  "cmptMultiply(" + dt1.name() + ',' + dt2.name() + ')',
531  cmptMultiply(dt1.dimensions(), dt2.dimensions()),
532  cmptMultiply(dt1.value(), dt2.value())
533  );
534 }
535 
536 
537 template<class Type>
539 (
540  const dimensioned<Type>& dt1,
541  const dimensioned<Type>& dt2
542 )
543 {
544  return dimensioned<Type>
545  (
546  "cmptDivide(" + dt1.name() + ',' + dt2.name() + ')',
547  cmptDivide(dt1.dimensions(), dt2.dimensions()),
548  cmptDivide(dt1.value(), dt2.value())
549  );
550 }
551 
552 
553 template<class Type>
555 (
556  const dimensioned<Type>& dt1,
557  const dimensioned<Type>& dt2
558 )
559 {
560  if (dt1.dimensions() != dt2.dimensions())
561  {
563  << "dimensions of arguments are not equal"
564  << abort(FatalError);
565  }
566 
567  return dimensioned<Type>
568  (
569  "max(" + dt1.name() + ',' + dt2.name() + ')',
570  dt1.dimensions(),
571  max(dt1.value(), dt2.value())
572  );
573 }
574 
575 
576 template<class Type>
578 (
579  const dimensioned<Type>& dt1,
580  const dimensioned<Type>& dt2
581 )
582 {
583  if (dt1.dimensions() != dt2.dimensions())
584  {
586  << "dimensions of arguments are not equal"
587  << abort(FatalError);
588  }
589 
590  return dimensioned<Type>
591  (
592  "min(" + dt1.name() + ',' + dt2.name() + ')',
593  dt1.dimensions(),
594  min(dt1.value(), dt2.value())
595  );
596 }
597 
598 
599 // * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
600 
601 template<class Type>
603 {
604  writeKeyword(os, dt.name());
605 
606  // Write the dimensions
607  dt.dimensions().write(os);
608 
609  os << token::SPACE;
610 
611  // Write the value
612  os << dt.value();
613 
614  os << token::END_STATEMENT << endl;
615 }
616 
617 
618 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
619 
620 template<class Type>
621 Foam::Istream& Foam::operator>>(Istream& is, dimensioned<Type>& dt)
622 {
623  dt.initialise(word::null, units::any, is);
624 
625  // Check state of Istream
626  is.check("Istream& operator>>(Istream&, dimensioned<Type>&)");
627 
628  return is;
629 }
630 
631 
632 template<class Type>
633 Foam::Ostream& Foam::operator<<(Ostream& os, const dimensioned<Type>& dt)
634 {
635  // Write the name
636  os << dt.name() << token::SPACE;
637 
638  // Write the dimensions
639  dt.dimensions().write(os);
640 
641  os << token::SPACE;
642 
643  // Write the value
644  os << dt.value();
645 
646  // Check state of Ostream
647  os.check("Ostream& operator<<(Ostream&, const dimensioned<Type>&)");
648 
649  return os;
650 }
651 
652 
653 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
654 
655 template<class Type>
656 bool Foam::operator>
657 (
658  const dimensioned<Type>& dt1,
659  const dimensioned<Type>& dt2
660 )
661 {
662  return dt1.value() > dt2.value();
663 }
664 
665 
666 template<class Type>
667 bool Foam::operator<
668 (
669  const dimensioned<Type>& dt1,
670  const dimensioned<Type>& dt2
671 )
672 {
673  return dt1.value() < dt2.value();
674 }
675 
676 
677 template<class Type>
678 Foam::dimensioned<Type> Foam::operator+
679 (
680  const dimensioned<Type>& dt1,
681  const dimensioned<Type>& dt2
682 )
683 {
684  return dimensioned<Type>
685  (
686  '(' + dt1.name() + '+' + dt2.name() + ')',
687  dt1.dimensions() + dt2.dimensions(),
688  dt1.value() + dt2.value()
689  );
690 }
691 
692 
693 template<class Type>
694 Foam::dimensioned<Type> Foam::operator-(const dimensioned<Type>& dt)
695 {
696  return dimensioned<Type>
697  (
698  '-' + dt.name(),
699  dt.dimensions(),
700  -dt.value()
701  );
702 }
703 
704 
705 template<class Type>
706 Foam::dimensioned<Type> Foam::operator-
707 (
708  const dimensioned<Type>& dt1,
709  const dimensioned<Type>& dt2
710 )
711 {
712  return dimensioned<Type>
713  (
714  '(' + dt1.name() + '-' + dt2.name() + ')',
715  dt1.dimensions() - dt2.dimensions(),
716  dt1.value() - dt2.value()
717  );
718 }
719 
720 
721 template<class Type>
722 Foam::dimensioned<Type> Foam::operator*
723 (
724  const dimensioned<scalar>& ds,
725  const dimensioned<Type>& dt
726 )
727 {
728  return dimensioned<Type>
729  (
730  '(' + ds.name() + '*' + dt.name() + ')',
731  ds.dimensions() * dt.dimensions(),
732  ds.value() * dt.value()
733  );
734 }
735 
736 
737 template<class Type>
738 Foam::dimensioned<Type> Foam::operator/
739 (
740  const dimensioned<Type>& dt,
741  const dimensioned<scalar>& ds
742 )
743 {
744  return dimensioned<Type>
745  (
746  '(' + dt.name() + '|' + ds.name() + ')',
747  dt.dimensions()/ds.dimensions(),
748  dt.value()/ds.value()
749  );
750 }
751 
752 
753 #define PRODUCT_OPERATOR(product, op, opFunc) \
754  \
755 template<class Type1, class Type2> \
756 Foam::dimensioned<typename Foam::product<Type1, Type2>::type> \
757 Foam::operator op \
758 ( \
759  const dimensioned<Type1>& dt1, \
760  const dimensioned<Type2>& dt2 \
761 ) \
762 { \
763  return dimensioned<typename product<Type1, Type2>::type> \
764  ( \
765  '(' + dt1.name() + #op + dt2.name() + ')', \
766  dt1.dimensions() op dt2.dimensions(), \
767  dt1.value() op dt2.value() \
768  ); \
769 } \
770  \
771 template<class Type, class Form, class Cmpt, Foam::direction nCmpt> \
772 Foam::dimensioned<typename Foam::product<Type, Form>::type> \
773 Foam::operator op \
774 ( \
775  const dimensioned<Type>& dt1, \
776  const VectorSpace<Form,Cmpt,nCmpt>& t2 \
777 ) \
778 { \
779  return dimensioned<typename product<Type, Form>::type> \
780  ( \
781  '(' + dt1.name() + #op + name(t2) + ')', \
782  dt1.dimensions(), \
783  dt1.value() op static_cast<const Form&>(t2) \
784  ); \
785 } \
786  \
787 template<class Type, class Form, class Cmpt, Foam::direction nCmpt> \
788 Foam::dimensioned<typename Foam::product<Form, Type>::type> \
789 Foam::operator op \
790 ( \
791  const VectorSpace<Form,Cmpt,nCmpt>& t1, \
792  const dimensioned<Type>& dt2 \
793 ) \
794 { \
795  return dimensioned<typename product<Form, Type>::type> \
796  ( \
797  '(' + name(t1) + #op + dt2.name() + ')', \
798  dt2.dimensions(), \
799  static_cast<const Form&>(t1) op dt2.value() \
800  ); \
801 }
802 
803 PRODUCT_OPERATOR(outerProduct, *, outer)
804 PRODUCT_OPERATOR(crossProduct, ^, cross)
805 PRODUCT_OPERATOR(innerProduct, &, dot)
806 PRODUCT_OPERATOR(scalarProduct, &&, dotdot)
807 
808 #undef PRODUCT_OPERATOR
809 
810 
811 // ************************************************************************* //
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:108
virtual const fileName & name() const
Return the name of the stream.
Definition: IOstream.H:297
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
Definition: dictionary.C:507
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:669
bool add(entry *, bool mergeEntry=false)
Add a new entry.
Definition: dictionary.C:1019
Dimension set for the base types.
Definition: dimensionSet.H:125
Ostream & write(Ostream &os) const
Write.
Generic dimensioned Type class.
void operator+=(const dimensioned< Type > &)
dimensioned()
Null constructor.
void replace(const direction, const dimensioned< cmptType > &)
Return a component with a dimensioned<cmptType>
const dimensionSet & dimensions() const
Return const reference to dimensions.
void read(const dictionary &, const unitSet &defaultUnits=NullObjectRef< unitSet >())
Update the value of dimensioned<Type>
pTraits< Type >::cmptType cmptType
Component type.
const Type & value() const
Return const reference to value.
dimensioned< cmptType > component(const direction) const
Return a component as a dimensioned<cmptType>
void operator/=(const scalar)
void operator-=(const dimensioned< Type > &)
dimensioned< cmptType > operator[](const direction) const
Return a component as a dimensioned<cmptType>
bool readIfPresent(const dictionary &, const unitSet &defaultUnits=NullObjectRef< unitSet >())
Update the value of dimensioned<Type> if found in the dictionary.
void readOrDefault(const dictionary &, const Type &defaultValue, const unitSet &defaultUnits=NullObjectRef< unitSet >())
Update the value of dimensioned<Type> if found in the dictionary.
const word & name() const
Return const reference to name.
void operator*=(const scalar)
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:68
virtual ITstream & stream() const =0
Return token stream if this entry is a primitive entry.
Traits class for primitives.
Definition: pTraits.H:53
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
Definition: products.H:136
static bool haveDefaults(const dictionary &dict)
Return if a dictionary exists to add defaults to for a given.
static dictionary & defaults(const dictionary &dict)
Return the dictionary to add defaults to for a given dictionary.
@ END_STATEMENT
Definition: token.H:109
Unit conversion structure. Contains the associated dimensions and the multiplier with which to conver...
Definition: unitSet.H:68
bool readIfPresent(const word &keyword, const dictionary &)
Update if found in the dictionary.
Definition: unitSetIO.C:106
const dimensionSet & dimensions() const
Access the dimensions.
Definition: unitSetI.H:50
void makeStandard(T &) const
Convert a value to standard units.
A class for handling words, derived from string.
Definition: word.H:63
static const word null
An empty word.
Definition: word.H:78
#define PRODUCT_OPERATOR(product, op, opFunc)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionSet dimless
const unitSet any
Namespace for OpenFOAM.
static const zero Zero
Definition: zero.H:97
Istream & operator>>(Istream &, pointEdgeDist &)
Definition: pointEdgeDist.C:41
const dimensionSet & dimless
Definition: dimensions.C:138
void outer(GeometricField< typename outerProduct< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:288
tmp< DimensionedField< Type, GeoMesh, Field > > cmptMultiply(const DimensionedField< Type, GeoMesh, PrimitiveField1 > &df1, const DimensionedField< Type, GeoMesh, PrimitiveField2 > &df2)
errorManip< error > abort(error &err)
Definition: errorManip.H:131
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void component(GeometricField< typename GeometricField< Type, GeoMesh, PrimitiveField1 >::cmptType, GeoMesh, PrimitiveField1 > &gcf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf, const direction d)
tmp< DimensionedField< Type, GeoMesh, Field > > cmptDivide(const DimensionedField< Type, GeoMesh, PrimitiveField1 > &df1, const DimensionedField< Type, GeoMesh, PrimitiveField2 > &df2)
void dotdot(GeometricField< typename scalarProduct< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
tmp< DimensionedField< Type, GeoMesh, Field > > operator-(const DimensionedField< Type, GeoMesh, PrimitiveField > &df1)
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void cross(GeometricField< typename crossProduct< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
tmp< DimensionedField< typename powProduct< Type, r >::type, GeoMesh, Field > > pow(const DimensionedField< Type, GeoMesh, PrimitiveField > &df, typename powProduct< Type, r >::type)
bool isNull(const T &t)
Return true if t is a reference to the nullObject of type T.
Definition: nullObjectI.H:58
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
error FatalError
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
Definition: keyType.C:155
tmp< DimensionedField< scalar, GeoMesh, Field > > magSqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
uint8_t direction
Definition: direction.H:45
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
void dot(GeometricField< typename innerProduct< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
dictionary dict
Useful unit conversions.