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>
410 const Type& deflt = Type(
Zero)
422 const Type& deflt = Type(
Zero)
434 const dimensionSet& dims =
dimless,
435 const Type& deflt = Type(
Zero)
447 const Type& deflt = Type(
Zero)
459 Ostream& operator<<(Ostream& os, const dimensioned<Type>& dt);
461 template<
class Type, direction r>
465 const dimensioned<Type>&,
472 sqr(
const dimensioned<Type>&);
476 magSqr(
const dimensioned<Type>& dt);
480 mag(
const dimensioned<Type>& dt);
485 const dimensioned<Type>&,
486 const dimensioned<Type>&
492 const dimensioned<Type>&,
493 const dimensioned<Type>&
497 dimensioned<Type>
max(
const dimensioned<Type>&,
const dimensioned<Type>&);
500 dimensioned<Type>
min(
const dimensioned<Type>&,
const dimensioned<Type>&);
503 dimensioned<Type>
lerp 505 const dimensioned<Type>& a,
506 const dimensioned<Type>&
b,
511 bool operator<(const dimensioned<Type>&,
const dimensioned<Type>&);
514 bool operator>(
const dimensioned<Type>&,
const dimensioned<Type>&);
540 #define PRODUCT_OPERATOR(product, op, opFunc) \ 542 template<class Type1, class Type2> \ 543 dimensioned<typename product<Type1, Type2>::type> \ 544 operator op(const dimensioned<Type1>&, const dimensioned<Type2>&); \ 546 template<class Type, class Form, class Cmpt, direction nCmpt> \ 547 dimensioned<typename product<Type, Form>::type> \ 550 const dimensioned<Type>&, \ 551 const VectorSpace<Form,Cmpt,nCmpt>& \ 554 template<class Type, class Form, class Cmpt, direction nCmpt> \ 555 dimensioned<typename product<Form, Type>::type> \ 558 const VectorSpace<Form,Cmpt,nCmpt>&, \ 559 const dimensioned<Type>& \ 567 #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 > &)
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
#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))
Same as getOrDefault()
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.
#define FOAM_DEPRECATED_STRICT(since, replacement)
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)
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))
Same as getOrAddToDict()
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
A keyword and a list of tokens is an 'entry'.
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.