53#ifndef Foam_dimensionSet_H
54#define Foam_dimensionSet_H
135 void push(
const token& t);
139 void unpop(
const token& t);
145 explicit tokeniser(
Istream& is);
152 bool hasToken()
const;
156 void putBack(
const token&);
158 void splitWord(
const word&);
160 static bool valid(
char c);
162 static label priority(
const token& t);
168 void round(
const scalar tol);
172 const label lastPrior,
174 const HashTable<dimensionedScalar>&
188 static bool checking(
bool on)
noexcept
191 debug =
static_cast<int>(on);
198 return static_cast<bool>(
debug);
213 const scalar temperature,
215 const scalar current = 0,
216 const scalar luminousIntensity = 0
229 const word& entryName,
271 const
word& entryName,
284 const
word& entryName,
A 1D vector of objects of type <T> with a fixed length <N>.
A HashTable similar to std::unordered_map.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
readOption
Enumeration defining read preferences.
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ MUST_READ
Reading required.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
bool operator+=(const dimensionSet &) const
Addition operation, checks for identical dimensions.
bool operator==(const dimensionSet &) const
static constexpr int nDimensions
There are 7 base dimensions.
bool operator!=(const dimensionSet &) const
Istream & read(Istream &is, scalar &multiplier, const dictionary &)
Read using provided units, return scaling in multiplier. Used only in initial parsing.
dimensionSet()
Default construct (dimensionless).
static bool checking(bool on) noexcept
Turn dimension checking on/off.
static bool checking() noexcept
True if dimension checking is enabled (the usual default).
bool readIfPresent(const word &entryName, const dictionary &dict)
Update the dimensions from dictionary entry. FatalIOError if it is found and the number of tokens is ...
FixedList< scalar, 7 > list_type
The array of dimension exponents.
bool readEntry(const word &entryName, const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ)
Update the dimensions from dictionary entry. FatalIOError if it is found and the number of tokens is ...
ClassName("dimensionSet")
bool operator/=(const dimensionSet &)
Division, modifies the exponents.
bool operator-=(const dimensionSet &) const
Subtraction operation, checks for identical dimensions.
scalar operator[](const dimensionType) const
const FixedList< scalar, 7 > & values() const noexcept
Const access to the exponents as a list.
static const scalar smallExponent
Tolerance for 'small' exponents, for near-zero rounding.
bool dimensionless() const
Return true if it is dimensionless.
void clear()
Clear exponents - resets to be dimensionless.
void reset(const dimensionSet &ds)
Copy assign the exponents from the dimensionSet.
dimensionType
Enumeration for the dimension exponents.
@ LUMINOUS_INTENSITY
Candela cd.
autoPtr< dimensionSet > clone() const
Construct and return a clone.
bool operator*=(const dimensionSet &)
Multiplication, modifies the exponents.
bool operator=(const dimensionSet &) const
Assignment operation, checks for identical dimensions. Use reset() to change the dimensions.
Construction of unit sets.
A token holds an item read from Istream.
A class for handling words, derived from Foam::string.
Macro definitions for declaring ClassName(), NamespaceName(), etc.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
limits reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL))
OBJstream os(runTime.globalPath()/outputName)
Namespace for handling debugging switches.
int debug
Static debugging option.
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
bitSet operator~(const bitSet &bitset)
Bitset complement, returns a copy of the bitset with all its bits flipped.
dimensionedScalar pow6(const dimensionedScalar &ds)
dimensionSet invTransform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
dimensionedScalar pos(const dimensionedScalar &ds)
dimensionedScalar pow5(const dimensionedScalar &ds)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedScalar pos0(const dimensionedScalar &ds)
dimensionedScalar sign(const dimensionedScalar &ds)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
bitSet operator^(const bitSet &a, const bitSet &b)
Bitwise-XOR of two bitsets to form a unique bit-set.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
dimensionedScalar negPart(const dimensionedScalar &ds)
dimensionedScalar sqrt(const dimensionedScalar &ds)
tmp< GeometricField< Type, faPatchField, areaMesh > > operator&(const faMatrix< Type > &, const DimensionedField< Type, areaMesh > &)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Istream & operator>>(Istream &, directionInfo &)
dimensionedScalar hypot(const dimensionedScalar &x, const dimensionedScalar &y)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
dimensionedScalar pow4(const dimensionedScalar &ds)
dimensionSet trans(const dimensionSet &ds)
Check the argument is dimensionless (for transcendental functions).
dimensionedScalar neg(const dimensionedScalar &ds)
dimensionedScalar stabilise(const dimensionedScalar &x, const dimensionedScalar &y)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
dimensionedScalar neg0(const dimensionedScalar &ds)
dimensionedScalar cbrt(const dimensionedScalar &ds)
dimensioned< typename scalarProduct< Type1, Type2 >::type > operator&&(const dimensioned< Type1 > &, const dimensioned< Type2 > &)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensionSet pow2(const dimensionSet &ds)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensionedScalar posPart(const dimensionedScalar &ds)
dimensioned< Type > lerp(const dimensioned< Type > &a, const dimensioned< Type > &b, const scalar t)
dimensionedScalar pow025(const dimensionedScalar &ds)