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