dimensionedType.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) 2016-2019 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 "dimensionedType.H"
30 #include "pTraits.H"
31 #include "dictionary.H"
32 
33 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
34 
35 template<class Type>
36 void Foam::dimensioned<Type>::initialize(Istream& is, const bool checkDims)
37 {
38  token nextToken(is);
39  is.putBack(nextToken);
40 
41  // Optional name found - use it
42  if (nextToken.isWord())
43  {
44  is >> name_;
45  is >> nextToken;
46  is.putBack(nextToken);
47  }
48 
49  scalar mult(1.0);
50 
51  if (nextToken == token::BEGIN_SQR)
52  {
53  // Optional dimensions found - use them
54  const dimensionSet curr(dimensions_);
55  dimensions_.read(is, mult);
56 
57  if (checkDims && curr != dimensions_)
58  {
60  << "The dimensions " << dimensions_
61  << " provided do not match the expected dimensions "
62  << curr << endl
63  << abort(FatalIOError);
64  }
65  }
66 
67  // Read value
68  is >> value_;
69  value_ *= mult;
70 }
71 
72 
73 template<class Type>
75 (
76  const word& key,
77  const dictionary& dict,
78  const bool mandatory,
79  const bool checkDims,
80  enum keyType::option matchOpt
81 )
82 {
83  // Largely identical to dictionary::readEntry(),
84  // but with optional handling of checkDims
85 
86  const entry* eptr = dict.findEntry(key, matchOpt);
87 
88  if (eptr)
89  {
90  ITstream& is = eptr->stream();
91 
92  initialize(is, checkDims);
93 
94  dict.checkITstream(is, key);
95 
96  return true;
97  }
98  else if (mandatory)
99  {
101  << "Entry '" << key << "' not found in dictionary "
102  << dict.name()
103  << exit(FatalIOError);
104  }
105 
106  return false;
107 }
108 
109 
110 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
111 
112 template<class Type>
114 :
115  name_("0"),
116  dimensions_(),
117  value_(Zero)
118 {}
119 
120 
121 template<class Type>
123 :
124  name_("0"),
125  dimensions_(dims),
126  value_(Zero)
127 {}
128 
129 
130 template<class Type>
132 :
133  name_("0"),
134  dimensions_(dims),
135  value_(Zero)
136 {}
137 
138 
139 template<class Type>
141 (
142  const word& name,
143  const dimensioned<Type>& dt
144 )
145 :
146  name_(name),
147  dimensions_(dt.dimensions_),
148  value_(dt.value_)
149 {}
150 
151 
152 template<class Type>
154 (
155  const word& name,
156  const dimensionSet& dims,
157  const Type& val
158 )
159 :
160  name_(name),
161  dimensions_(dims),
162  value_(val)
163 {}
164 
165 
166 template<class Type>
168 (
169  const primitiveEntry& e
170 )
171 :
172  name_(e.name()),
173  dimensions_(),
174  value_(Zero)
175 {
176  ITstream& is = e.stream();
177 
178  // no checkDims
179  initialize(is, false);
180 
181  e.checkITstream(is);
182 }
183 
184 
185 template<class Type>
187 (
188  const primitiveEntry& e,
189  const dimensionSet& dims
190 )
191 :
192  name_(e.name()),
193  dimensions_(dims),
194  value_(Zero)
195 {
196  ITstream& is = e.stream();
197 
198  // checkDims
199  initialize(is, true);
200 
201  e.checkITstream(is);
202 }
203 
204 
205 template<class Type>
207 (
208  const word& name,
209  const dictionary& dict
210 )
211 :
212  name_(name),
213  dimensions_(),
214  value_(Zero)
215 {
216  // mandatory, no checkDims
217  readEntry(name, dict, true, false);
218 }
219 
220 
221 template<class Type>
223 (
224  const word& name,
225  const dimensionSet& dims,
226  const dictionary& dict
227 )
228 :
229  name_(name),
230  dimensions_(dims),
231  value_(Zero)
232 {
233  // mandatory, checkDims
234  readEntry(name, dict);
235 }
236 
237 
238 template<class Type>
240 (
241  const word& name,
242  const dimensionSet& dims,
243  const dictionary& dict,
244  const word& entryName
245 )
246 :
247  name_(name),
248  dimensions_(dims),
249  value_(Zero)
250 {
251  // mandatory, checkDims
252  readEntry(entryName, dict);
253 }
254 
255 
256 template<class Type>
258 (
259  const word& name,
260  const dimensionSet& dims,
261  const Type& val,
262  const dictionary& dict
263 )
264 :
265  name_(name),
266  dimensions_(dims),
267  value_(val)
268 {
269  // non-mandatory, checkDims
270  readEntry(name, dict, false);
271 }
272 
273 
274 template<class Type>
276 :
277  dimensions_()
278 {
279  read(is);
280 }
281 
282 
283 template<class Type>
285 (
286  const word& name,
287  Istream& is
288 )
289 :
290  name_(name),
291  dimensions_()
292 {
293  read(is, false); // Don't read name. Read dimensionSet + multiplier only.
294 }
295 
296 
297 template<class Type>
299 (
300  const word& name,
301  const dimensionSet& dims,
302  Istream& is
303 )
304 :
305  name_(name),
306  dimensions_(dims),
307  value_(Zero)
308 {
309  // checkDims
310  initialize(is, true);
311 }
312 
313 
314 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
315 
316 template<class Type>
318 (
319  const word& name,
320  const dictionary& dict,
321  const dimensionSet& dims,
322  const Type& deflt
323 )
324 {
325  // checkDims = true
326  return dimensioned<Type>(name, dims, deflt, dict);
327 }
328 
329 
330 template<class Type>
332 (
333  const word& name,
334  const dictionary& dict,
335  const Type& deflt
336 )
337 {
338  return dimensioned<Type>(name, dimless, deflt, dict);
339 }
340 
341 
342 template<class Type>
344 (
345  const word& name,
346  dictionary& dict,
347  const dimensionSet& dims,
348  const Type& deflt
349 )
350 {
351  if (dict.found(name))
352  {
353  return dimensioned<Type>(name, dims, dict);
354  }
355 
356  (void) dict.add(name, deflt);
357  return dimensioned<Type>(name, dims, deflt);
358 }
359 
360 
361 template<class Type>
363 (
364  const word& name,
365  dictionary& dict,
366  const Type& deflt
367 )
368 {
369  return getOrAddToDict(name, dict, dimless, deflt);
370 }
371 
372 
373 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
374 
375 template<class Type>
377 {
378  return name_;
379 }
380 
381 
382 template<class Type>
384 {
385  return name_;
386 }
387 
388 
389 template<class Type>
391 {
392  return dimensions_;
393 }
394 
395 
396 template<class Type>
398 {
399  return dimensions_;
400 }
401 
402 
403 template<class Type>
405 {
406  return value_;
407 }
408 
409 
410 template<class Type>
412 {
413  return value_;
414 }
415 
416 
417 template<class Type>
420 (
421  const direction d
422 ) const
423 {
424  return dimensioned<cmptType>
425  (
426  name_ + ".component(" + Foam::name(d) + ')',
427  dimensions_,
428  value_.component(d)
429  );
430 }
431 
432 
433 template<class Type>
435 (
436  const direction d,
437  const dimensioned<typename dimensioned<Type>::cmptType>& dc
438 )
439 {
440  dimensions_ = dc.dimensions();
441  value_.replace(d, dc.value());
442 }
443 
444 
445 template<class Type>
447 {
448  return read(name_, dict);
449 }
450 
451 
452 template<class Type>
454 {
455  return readIfPresent(name_, dict);
456 }
457 
458 
459 template<class Type>
461 (
462  const word& entryName,
463  const dictionary& dict
464 )
465 {
466  // mandatory, checkDims
467  return readEntry(entryName, dict);
468 }
469 
470 
471 template<class Type>
473 (
474  const word& entryName,
475  const dictionary& dict
476 )
477 {
478  // non-mandatory, checkDims
479  return readEntry(entryName, dict, false);
480 }
481 
482 
483 template<class Type>
485 {
486  if (readName)
487  {
488  // Read name
489  is >> name_;
490  }
491 
492  // Read dimensionSet + multiplier
493  scalar mult(1.0);
494  dimensions_.read(is, mult);
495 
496  // Read value
497  is >> value_;
498  value_ *= mult;
499 
500  is.check(FUNCTION_NAME);
501  return is;
502 }
503 
504 
505 template<class Type>
508 {
509  // Read name
510  is >> name_;
511 
512  // Read dimensionSet + multiplier
513  scalar mult(1.0);
514  dimensions_.read(is, mult, readSet);
515 
516  // Read value
517  is >> value_;
518  value_ *= mult;
519 
520  is.check(FUNCTION_NAME);
521  return is;
522 }
523 
524 
525 template<class Type>
527 (
528  Istream& is,
529  const HashTable<dimensionedScalar>& readSet
530 )
531 {
532  // Read name
533  is >> name_;
534 
535  // Read dimensionSet + multiplier
536  scalar mult(1.0);
537  dimensions_.read(is, mult, readSet);
538 
539  // Read value
540  is >> value_;
541  value_ *= mult;
542 
543  is.check(FUNCTION_NAME);
544  return is;
545 }
546 
547 
548 template<class Type>
550 (
551  const word& keyword,
552  Ostream& os
553 ) const
554 {
555  os.writeKeyword(keyword);
556 
557  if (keyword != name_)
558  {
559  // The name, only if different from keyword
560  os << name_ << token::SPACE;
561  }
562 
563  // The dimensions
564  scalar mult(1.0);
565  dimensions_.write(os, mult);
566 
567  // The value
568  os << token::SPACE << value_/mult << token::END_STATEMENT << endl;
569 
570  os.check(FUNCTION_NAME);
571 }
572 
573 
574 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
575 
576 template<class Type>
579 (
580  const direction d
581 ) const
582 {
583  return component(d);
584 }
585 
586 
587 template<class Type>
589 (
590  const dimensioned<Type>& dt
591 )
592 {
593  dimensions_ += dt.dimensions_;
594  value_ += dt.value_;
595 }
596 
597 
598 template<class Type>
600 (
601  const dimensioned<Type>& dt
602 )
603 {
604  dimensions_ -= dt.dimensions_;
605  value_ -= dt.value_;
606 }
607 
608 
609 template<class Type>
611 (
612  const scalar s
613 )
614 {
615  value_ *= s;
616 }
617 
618 
619 template<class Type>
621 (
622  const scalar s
623 )
624 {
625  value_ /= s;
626 }
627 
628 
629 // * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
630 
631 template<class Type, Foam::direction r>
634 {
636  (
637  "pow(" + dt.name() + ',' + name(r) + ')',
638  pow(dt.dimensions(), r),
639  pow(dt.value(), 2)
640  );
641 }
642 
643 
644 template<class Type>
646 Foam::sqr(const dimensioned<Type>& dt)
647 {
649  (
650  "sqr(" + dt.name() + ')',
651  sqr(dt.dimensions()),
652  sqr(dt.value())
653  );
654 }
655 
656 template<class Type>
658 Foam::magSqr(const dimensioned<Type>& dt)
659 {
660  typedef typename typeOfMag<Type>::type magType;
661 
662  return dimensioned<magType>
663  (
664  "magSqr(" + dt.name() + ')',
665  magSqr(dt.dimensions()),
666  magSqr(dt.value())
667  );
668 }
669 
670 template<class Type>
672 Foam::mag(const dimensioned<Type>& dt)
673 {
674  typedef typename typeOfMag<Type>::type magType;
675 
676  return dimensioned<magType>
677  (
678  "mag(" + dt.name() + ')',
679  dt.dimensions(),
680  mag(dt.value())
681  );
682 }
683 
684 
685 template<class Type>
687 (
688  const dimensioned<Type>& dt1,
689  const dimensioned<Type>& dt2
690 )
691 {
692  return dimensioned<Type>
693  (
694  "cmptMultiply(" + dt1.name() + ',' + dt2.name() + ')',
695  cmptMultiply(dt1.dimensions(), dt2.dimensions()),
696  cmptMultiply(dt1.value(), dt2.value())
697  );
698 }
699 
700 template<class Type>
702 (
703  const dimensioned<Type>& dt1,
704  const dimensioned<Type>& dt2
705 )
706 {
707  return dimensioned<Type>
708  (
709  "cmptDivide(" + dt1.name() + ',' + dt2.name() + ')',
710  cmptDivide(dt1.dimensions(), dt2.dimensions()),
711  cmptDivide(dt1.value(), dt2.value())
712  );
713 }
714 
715 
716 template<class Type>
718 (
719  const dimensioned<Type>& dt1,
720  const dimensioned<Type>& dt2
721 )
722 {
723  if (dt1.dimensions() != dt2.dimensions())
724  {
726  << "dimensions of arguments are not equal"
727  << abort(FatalError);
728  }
729 
730  return dimensioned<Type>
731  (
732  "max(" + dt1.name() + ',' + dt2.name() + ')',
733  dt1.dimensions(),
734  max(dt1.value(), dt2.value())
735  );
736 }
737 
738 
739 template<class Type>
741 (
742  const dimensioned<Type>& dt1,
743  const dimensioned<Type>& dt2
744 )
745 {
746  if (dt1.dimensions() != dt2.dimensions())
747  {
749  << "dimensions of arguments are not equal"
750  << abort(FatalError);
751  }
752 
753  return dimensioned<Type>
754  (
755  "min(" + dt1.name() + ',' + dt2.name() + ')',
756  dt1.dimensions(),
757  min(dt1.value(), dt2.value())
758  );
759 }
760 
761 
762 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
763 
764 template<class Type>
765 Foam::Istream& Foam::operator>>(Istream& is, dimensioned<Type>& dt)
766 {
767  dt.initialize(is, false); // no checkDims
768  is.check(FUNCTION_NAME);
769  return is;
770 }
771 
772 
773 template<class Type>
774 Foam::Ostream& Foam::operator<<(Ostream& os, const dimensioned<Type>& dt)
775 {
776  // The name
777  os << dt.name() << token::SPACE;
778 
779  // The dimensions
780  scalar mult(1.0);
781  dt.dimensions().write(os, mult);
782 
783  // The value
784  os << token::SPACE << dt.value()/mult;
785 
786  os.check(FUNCTION_NAME);
787  return os;
788 }
789 
790 
791 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
792 
793 template<class Type>
794 bool Foam::operator<
795 (
796  const dimensioned<Type>& dt1,
797  const dimensioned<Type>& dt2
798 )
799 {
800  return dt1.value() < dt2.value();
801 }
802 
803 
804 template<class Type>
805 bool Foam::operator>
806 (
807  const dimensioned<Type>& dt1,
808  const dimensioned<Type>& dt2
809 )
810 {
811  return dt2.value() < dt1.value();
812 }
813 
814 
815 template<class Type>
816 Foam::dimensioned<Type> Foam::operator+
817 (
818  const dimensioned<Type>& dt1,
819  const dimensioned<Type>& dt2
820 )
821 {
822  return dimensioned<Type>
823  (
824  '(' + dt1.name() + '+' + dt2.name() + ')',
825  dt1.dimensions() + dt2.dimensions(),
826  dt1.value() + dt2.value()
827  );
828 }
829 
830 
831 template<class Type>
832 Foam::dimensioned<Type> Foam::operator-(const dimensioned<Type>& dt)
833 {
834  return dimensioned<Type>
835  (
836  '-' + dt.name(),
837  dt.dimensions(),
838  -dt.value()
839  );
840 }
841 
842 
843 template<class Type>
844 Foam::dimensioned<Type> Foam::operator-
845 (
846  const dimensioned<Type>& dt1,
847  const dimensioned<Type>& dt2
848 )
849 {
850  return dimensioned<Type>
851  (
852  '(' + dt1.name() + '-' + dt2.name() + ')',
853  dt1.dimensions() - dt2.dimensions(),
854  dt1.value() - dt2.value()
855  );
856 }
857 
858 
859 template<class Type>
860 Foam::dimensioned<Type> Foam::operator*
861 (
862  const dimensioned<scalar>& ds,
863  const dimensioned<Type>& dt
864 )
865 {
866  return dimensioned<Type>
867  (
868  '(' + ds.name() + '*' + dt.name() + ')',
869  ds.dimensions() * dt.dimensions(),
870  ds.value() * dt.value()
871  );
872 }
873 
874 
875 template<class Type>
876 Foam::dimensioned<Type> Foam::operator/
877 (
878  const dimensioned<Type>& dt,
879  const dimensioned<scalar>& ds
880 )
881 {
882  return dimensioned<Type>
883  (
884  '(' + dt.name() + '|' + ds.name() + ')',
885  dt.dimensions() / ds.dimensions(),
886  dt.value() / ds.value()
887  );
888 }
889 
890 
891 #define PRODUCT_OPERATOR(product, op, opFunc) \
892  \
893 template<class Type1, class Type2> \
894 Foam::dimensioned<typename Foam::product<Type1, Type2>::type> \
895 Foam::operator op \
896 ( \
897  const dimensioned<Type1>& dt1, \
898  const dimensioned<Type2>& dt2 \
899 ) \
900 { \
901  return dimensioned<typename product<Type1, Type2>::type> \
902  ( \
903  '(' + dt1.name() + #op + dt2.name() + ')', \
904  dt1.dimensions() op dt2.dimensions(), \
905  dt1.value() op dt2.value() \
906  ); \
907 } \
908  \
909 template<class Type, class Form, class Cmpt, Foam::direction nCmpt> \
910 Foam::dimensioned<typename Foam::product<Type, Form>::type> \
911 Foam::operator op \
912 ( \
913  const dimensioned<Type>& dt1, \
914  const VectorSpace<Form,Cmpt,nCmpt>& t2 \
915 ) \
916 { \
917  return dimensioned<typename product<Type, Form>::type> \
918  ( \
919  '(' + dt1.name() + #op + name(t2) + ')', \
920  dt1.dimensions(), \
921  dt1.value() op static_cast<const Form&>(t2) \
922  ); \
923 } \
924  \
925 template<class Type, class Form, class Cmpt, Foam::direction nCmpt> \
926 Foam::dimensioned<typename Foam::product<Form, Type>::type> \
927 Foam::operator op \
928 ( \
929  const VectorSpace<Form,Cmpt,nCmpt>& t1, \
930  const dimensioned<Type>& dt2 \
931 ) \
932 { \
933  return dimensioned<typename product<Form, Type>::type> \
934  ( \
935  '(' + name(t1) + #op + dt2.name() + ')', \
936  dt2.dimensions(), \
937  static_cast<const Form&>(t1) op dt2.value() \
938  ); \
939 }
940 
941 
942 PRODUCT_OPERATOR(outerProduct, *, outer)
943 PRODUCT_OPERATOR(crossProduct, ^, cross)
944 PRODUCT_OPERATOR(innerProduct, &, dot)
945 PRODUCT_OPERATOR(scalarProduct, &&, dotdot)
946 
947 #undef PRODUCT_OPERATOR
948 
949 
950 // ************************************************************************* //
Foam::val
label ListType::const_reference val
Definition: ListOps.H:407
Foam::component
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
Definition: FieldFieldFunctions.C:44
Foam::dimless
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
Definition: dimensionSets.H:50
Foam::primitiveEntry
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read,...
Definition: primitiveEntry.H:62
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
s
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;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputSpray.H:25
Foam::cmptMultiply
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
PRODUCT_OPERATOR
#define PRODUCT_OPERATOR(product, op, opFunc)
Definition: dimensionedType.C:891
Foam::Zero
static constexpr const zero Zero
Global zero.
Definition: zero.H:128
Foam::dimensioned::read
bool read(const dictionary &dict)
Definition: dimensionedType.C:446
Foam::operator-
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Foam::dot
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:944
Foam::dimensioned::name
const word & name() const
Return const reference to name.
Definition: dimensionedType.C:376
Foam::powProduct::type
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
Definition: products.H:170
Foam::FatalIOError
IOerror FatalIOError
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:228
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:337
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:404
Foam::dimensionSet
Dimension set for the base types.
Definition: dimensionSet.H:65
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
Foam::magSqr
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
Foam::dimensioned::readIfPresent
bool readIfPresent(const dictionary &dict)
Definition: dimensionedType.C:453
Foam::ITstream
An input stream of tokens.
Definition: ITstream.H:55
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::IOstream::name
virtual const fileName & name() const
Return the name of the stream.
Definition: IOstream.C:39
Foam::dimensioned::writeEntry
void writeEntry(const word &keyword, Ostream &os) const
Write as a dictionary entry with keyword.
Definition: dimensionedType.C:550
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:75
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
Foam::blockMeshTools::read
void read(Istream &, label &, const dictionary &)
In-place read with dictionary lookup.
Definition: blockMeshTools.C:33
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::IOstream::check
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:51
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:43
pTraits.H
Foam::Ostream::writeKeyword
virtual Ostream & writeKeyword(const keyType &kw)
Write the keyword followed by an appropriate indentation.
Definition: Ostream.C:57
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:137
Foam::dimensioned::getOrDefault
static dimensioned< Type > getOrDefault(const word &name, const dictionary &dict, const dimensionSet &dims=dimless, const Type &deflt=Type(Zero))
Definition: dimensionedType.C:318
Foam::dimensioned::getOrAddToDict
static dimensioned< Type > getOrAddToDict(const word &name, dictionary &dict, const dimensionSet &dims=dimless, const Type &deflt=Type(Zero))
Construct dimensioned from dictionary, with default value.
Definition: dimensionedType.C:344
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::HashTable
A HashTable similar to std::unordered_map.
Definition: HashTable.H:105
Foam::cmptDivide
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:355
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::dimensioned::replace
void replace(const direction d, const dimensioned< cmptType > &dc)
Return a component with a dimensioned<cmptType>
Definition: dimensionedType.C:435
Foam::dimensioned::component
dimensioned< cmptType > component(const direction d) const
Return a component as a dimensioned<cmptType>
Definition: dimensionedType.C:420
Foam::dimensioned::dimensioned
dimensioned()
A dimensionless Zero, named "0".
Definition: dimensionedType.C:113
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
dictionary.H
Foam::outer
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:942
Foam::direction
uint8_t direction
Definition: direction.H:47
FUNCTION_NAME
#define FUNCTION_NAME
Definition: messageStream.H:261
Foam::roots::type
type
Types of root.
Definition: Roots.H:54
FatalIOErrorInFunction
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:375
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::dimensioned::dimensions
const dimensionSet & dimensions() const
Return const reference to dimensions.
Definition: dimensionedType.C:390
Foam::cross
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:943
Foam::dimensioned::cmptType
pTraits< Type >::cmptType cmptType
Component type.
Definition: dimensionedType.H:120
Foam::checkDims
static bool checkDims(const char *what, const dimensionSet &a, const dimensionSet &b)
Definition: dimensionSet.C:48
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &)
Definition: boundaryPatch.C:102
dimensionedType.H
Foam::zero
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
Definition: zero.H:61
Foam::dotdot
void dotdot(FieldField< Field1, typename scalarProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:945