Go to the documentation of this file.
42 #ifndef dimensionSet_H
43 #define dimensionSet_H
123 void push(
const token& t);
127 void unpop(
const token& t);
143 bool hasToken()
const;
147 void putBack(
const token&);
149 void splitWord(
const word&);
151 static bool valid(
char c);
153 static label priority(
const token& t);
159 void round(
const scalar tol);
163 const label lastPrior,
185 const scalar temperature,
187 const scalar current = 0,
188 const scalar luminousIntensity = 0
292 Istream&
operator>>(Istream& is, dimensionSet& ds);
293 Ostream&
operator<<(Ostream& os,
const dimensionSet& ds);
298 dimensionSet
min(
const dimensionSet& ds1,
const dimensionSet& ds2);
299 dimensionSet
max(
const dimensionSet& ds1,
const dimensionSet& ds2);
300 dimensionSet
clip(
const dimensionSet& ds1,
const dimensionSet& ds2);
302 dimensionSet
cmptMultiply(
const dimensionSet& ds1,
const dimensionSet& ds2);
303 dimensionSet
cmptDivide(
const dimensionSet& ds1,
const dimensionSet& ds2);
306 dimensionSet
pow(
const dimensionSet& ds,
const scalar
p);
310 dimensionSet
sqr(
const dimensionSet& ds);
311 dimensionSet
pow2(
const dimensionSet& ds);
312 dimensionSet
pow3(
const dimensionSet& ds);
313 dimensionSet
pow4(
const dimensionSet& ds);
314 dimensionSet
pow5(
const dimensionSet& ds);
315 dimensionSet
pow6(
const dimensionSet& ds);
316 dimensionSet
pow025(
const dimensionSet& ds);
318 dimensionSet
sqrt(
const dimensionSet& ds);
319 dimensionSet
cbrt(
const dimensionSet& ds);
321 dimensionSet
magSqr(
const dimensionSet& ds);
322 dimensionSet
mag(
const dimensionSet& ds);
323 dimensionSet
sign(
const dimensionSet&);
324 dimensionSet
pos(
const dimensionSet&);
325 dimensionSet
pos0(
const dimensionSet&);
326 dimensionSet
neg(
const dimensionSet&);
327 dimensionSet
neg0(
const dimensionSet&);
328 dimensionSet
posPart(
const dimensionSet&);
329 dimensionSet
negPart(
const dimensionSet&);
332 dimensionSet
inv(
const dimensionSet& ds);
335 dimensionSet
trans(
const dimensionSet& ds);
338 dimensionSet
atan2(
const dimensionSet& ds1,
const dimensionSet& ds2);
341 dimensionSet
hypot(
const dimensionSet& ds1,
const dimensionSet& ds2);
344 dimensionSet
transform(
const dimensionSet& ds);
353 dimensionSet
operator~(
const dimensionSet& ds);
356 dimensionSet
operator-(
const dimensionSet& ds);
358 dimensionSet
operator+(
const dimensionSet& ds1,
const dimensionSet& ds2);
359 dimensionSet
operator-(
const dimensionSet& ds1,
const dimensionSet& ds2);
360 dimensionSet
operator*(
const dimensionSet& ds1,
const dimensionSet& ds2);
361 dimensionSet
operator/(
const dimensionSet& ds1,
const dimensionSet& ds2);
362 dimensionSet
operator&(
const dimensionSet& ds1,
const dimensionSet& ds2);
363 dimensionSet
operator^(
const dimensionSet& ds1,
const dimensionSet& ds2);
364 dimensionSet
operator&&(
const dimensionSet& ds1,
const dimensionSet& ds2);
static constexpr int nDimensions
There are 7 base dimensions.
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
dimensionSet trans(const dimensionSet &ds)
Check the argument is dimensionless (for transcendental functions)
ClassName("dimensionSet")
autoPtr< dimensionSet > clone() const
Construct and return a clone.
bool operator+=(const dimensionSet &) const
A class for handling words, derived from Foam::string.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
bool operator/=(const dimensionSet &)
tmp< GeometricField< Type, fvPatchField, volMesh > > operator&(const fvMatrix< Type > &, const DimensionedField< Type, volMesh > &)
dimensionSet pow2(const dimensionSet &ds)
static const scalar smallExponent
Tolerance for 'small' exponents, for near-zero rounding.
dimensionedScalar posPart(const dimensionedScalar &ds)
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
dimensionedScalar neg0(const dimensionedScalar &ds)
bool operator*=(const dimensionSet &)
Istream & operator>>(Istream &, directionInfo &)
A token holds an item read from Istream.
dimensionedScalar pos0(const dimensionedScalar &ds)
Dimension set for the base types.
dimensionedScalar sign(const dimensionedScalar &ds)
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
dimensionSet()
Default construct (dimensionless).
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensionedScalar pow025(const dimensionedScalar &ds)
dimensionedScalar hypot(const dimensionedScalar &x, const dimensionedScalar &y)
dimensionType
Enumeration for the dimension exponents.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
dimensionedScalar pow4(const dimensionedScalar &ds)
bool dimensionless() const
Return true if it is dimensionless.
dimensionedScalar pow6(const dimensionedScalar &ds)
Istream & read(Istream &is, scalar &multiplier, const dictionary &)
Read using provided units. Used only in initial parsing.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
Macro definitions for declaring ClassName(), NamespaceName(), etc.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
bool operator==(const dimensionSet &) const
FixedList< scalar, 7 > list_type
The array of dimension exponents.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
void clear()
Reset exponents to be dimensionless.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
bool operator!=(const dimensionSet &) const
bool operator-=(const dimensionSet &) const
dimensioned< typename scalarProduct< Type1, Type2 >::type > operator&&(const dimensioned< Type1 > &, const dimensioned< Type2 > &)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
dimensionedScalar pow5(const dimensionedScalar &ds)
Generic dimensioned Type class.
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
A HashTable similar to std::unordered_map.
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Ostream & write(Ostream &os, scalar &multiplier, const dimensionSets &) const
Write using provided units.
bitSet operator~(const bitSet &bitset)
Bitset complement, returns a copy of the bitset with all its bits flipped.
const FixedList< scalar, 7 > & values() const
Return const access to the exponents as a list.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar negPart(const dimensionedScalar &ds)
dimensionSet clip(const dimensionSet &ds1, const dimensionSet &ds2)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar sqrt(const dimensionedScalar &ds)
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
scalar operator[](const dimensionType) const
tmp< faMatrix< Type > > operator*(const areaScalarField &, const faMatrix< Type > &)
dimensionSet invTransform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
const dimensionedScalar c
Speed of light in a vacuum.
bool operator=(const dimensionSet &) const
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bitSet operator^(const bitSet &a, const bitSet &b)
Bitwise-XOR of two bitsets to form a unique bit-set.
dimensionedScalar cbrt(const dimensionedScalar &ds)
dimensionedScalar neg(const dimensionedScalar &ds)
Construction of unit sets.
void reset(const dimensionSet &ds)
Copy assign the exponents from the dimensionSet.
dimensionedScalar pos(const dimensionedScalar &ds)