38 #ifndef Foam_dimensionedType_H 39 #define Foam_dimensionedType_H 58 template<
class Type>
class dimensioned;
61 Istream&
operator>>(Istream& is, dimensioned<Type>& dt);
76 dimensionSet dimensions_;
93 void initialize(Istream& is,
const bool checkDims);
110 const dictionary&
dict,
122 typedef typename pTraits<Type>::cmptType
cmptType;
223 const word& entryName
250 const Type& deflt = Type(
Zero)
259 const Type& deflt = Type(
Zero)
270 const Type& deflt = Type(
Zero)
280 const Type& deflt = Type(
Zero)
311 dimensioned<Type>
T()
const;
323 bool read(
const word& entryName,
const dictionary&
dict);
335 Istream&
read(Istream& is,
const bool readName =
true);
339 Istream&
read(Istream& is,
const dictionary& readSet);
343 Istream&
read(Istream& is,
const HashTable<dimensionedScalar>& readSet);
367 friend Istream&
operator>> <Type>
411 const Type& deflt = Type(
Zero)
423 const Type& deflt = Type(
Zero)
436 const dimensionSet& dims =
dimless,
437 const Type& deflt = Type(
Zero)
450 const Type& deflt = Type(
Zero)
462 Ostream& operator<<(Ostream& os, const dimensioned<Type>& dt);
464 template<
class Type, direction r>
468 const dimensioned<Type>&,
475 sqr(
const dimensioned<Type>&);
479 magSqr(
const dimensioned<Type>& dt);
483 mag(
const dimensioned<Type>& dt);
488 const dimensioned<Type>&,
489 const dimensioned<Type>&
495 const dimensioned<Type>&,
496 const dimensioned<Type>&
500 dimensioned<Type>
max(
const dimensioned<Type>&,
const dimensioned<Type>&);
503 dimensioned<Type>
min(
const dimensioned<Type>&,
const dimensioned<Type>&);
506 dimensioned<Type>
lerp 508 const dimensioned<Type>& a,
509 const dimensioned<Type>&
b,
514 bool operator<(const dimensioned<Type>&,
const dimensioned<Type>&);
543 #define PRODUCT_OPERATOR(product, op, opFunc) \ 545 template<class Type1, class Type2> \ 546 dimensioned<typename product<Type1, Type2>::type> \ 547 operator op(const dimensioned<Type1>&, const dimensioned<Type2>&); \ 549 template<class Type, class Form, class Cmpt, direction nCmpt> \ 550 dimensioned<typename product<Type, Form>::type> \ 553 const dimensioned<Type>&, \ 554 const VectorSpace<Form,Cmpt,nCmpt>& \ 557 template<class Type, class Form, class Cmpt, direction nCmpt> \ 558 dimensioned<typename product<Form, Type>::type> \ 561 const VectorSpace<Form,Cmpt,nCmpt>&, \ 562 const dimensioned<Type>& \ 570 #undef PRODUCT_OPERATOR dimensioned< cmptType > component(const direction d) const
Return a component as a dimensioned<cmptType>
const Type & value() const noexcept
Return const reference to value.
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.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool readIfPresent(const dictionary &dict)
Update the value of dimensioned<Type> if found in the dictionary, lookup in dictionary with the name(...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
bool operator>(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A newer than B.
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Generic dimensioned Type class.
const dimensionSet dimless
Dimensionless.
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
void dotdot(FieldField< Field1, typename scalarProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void operator-=(const dimensioned< Type > &dt)
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
#define PRODUCT_OPERATOR(product, op, opFunc)
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read...
static dimensioned< Type > lookupOrDefault(const word &name, const dictionary &dict, const dimensionSet &dims=dimless, const Type &deflt=Type(Zero))
Construct dimensioned from dictionary, with default value. FatalIOError if there are excess tokens...
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
const dimensionedScalar e
Elementary charge.
pTraits< Type >::cmptType cmptType
Component type.
void writeEntry(const word &keyword, Ostream &os) const
Write as a dictionary entry with keyword.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
A class for handling words, derived from Foam::string.
Istream & operator>>(Istream &, directionInfo &)
Type value_type
The underlying data type.
const dimensionSet & dimensions() const noexcept
Return const reference to dimensions.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
bool read(const dictionary &dict)
Update the value of dimensioned<Type>, lookup in dictionary with the name().
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensioned()
A dimensionless Zero, named "0".
OBJstream os(runTime.globalPath()/outputName)
dimensioned< Type > T() const
Return transpose.
void operator*=(const scalar s)
dimensioned< Type > lerp(const dimensioned< Type > &a, const dimensioned< Type > &b, const scalar t)
#define FOAM_DEPRECATED(since)
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.
const word & name() const noexcept
Return const reference to name.
void operator+=(const dimensioned< Type > &dt)
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
dimensioned< cmptType > operator[](const direction d) const
Return a component as a dimensioned<cmptType>
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Direction is an 8-bit unsigned integer type used to represent Cartesian directions, components etc.
void operator/=(const scalar s)
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
static bool checkDims(const char *what, const dimensionSet &a, const dimensionSet &b)
option
Enumeration for the data type and search/match modes (bitmask)
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
void replace(const direction d, const dimensioned< cmptType > &dc)
Return a component with a dimensioned<cmptType>
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))
static dimensioned< Type > lookupOrAddToDict(const word &name, dictionary &dict, const dimensionSet &dims=dimless, const Type &deflt=Type(Zero))
Construct dimensioned from dictionary, with default value.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
static constexpr const zero Zero
Global zero (0)
readOption
Enumeration defining read preferences.